summaryrefslogtreecommitdiffstats
path: root/Wrappers/Python
diff options
context:
space:
mode:
authorEdoardo Pasca <edo.paskino@gmail.com>2019-03-11 13:31:11 -0400
committerEdoardo Pasca <edo.paskino@gmail.com>2019-03-11 13:31:11 -0400
commitcbb6e2ce2baa3a9c18f1d8ad537f1498348f827d (patch)
treee8d9b258e7136bc4a640cdda078a21dce0c41303 /Wrappers/Python
parent8c248538a839dd34fb5599bcb126fe8d2f395fa5 (diff)
downloadframework-cbb6e2ce2baa3a9c18f1d8ad537f1498348f827d.tar.gz
framework-cbb6e2ce2baa3a9c18f1d8ad537f1498348f827d.tar.bz2
framework-cbb6e2ce2baa3a9c18f1d8ad537f1498348f827d.tar.xz
framework-cbb6e2ce2baa3a9c18f1d8ad537f1498348f827d.zip
add dimension_labels to geometries to allocate on specific axis order
Diffstat (limited to 'Wrappers/Python')
-rwxr-xr-xWrappers/Python/ccpi/framework/framework.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/Wrappers/Python/ccpi/framework/framework.py b/Wrappers/Python/ccpi/framework/framework.py
index 1413e21..029a80d 100755
--- a/Wrappers/Python/ccpi/framework/framework.py
+++ b/Wrappers/Python/ccpi/framework/framework.py
@@ -54,7 +54,8 @@ class ImageGeometry(object):
center_x=0,
center_y=0,
center_z=0,
- channels=1):
+ channels=1,
+ dimension_labels=None):
self.voxel_num_x = voxel_num_x
self.voxel_num_y = voxel_num_y
@@ -66,6 +67,7 @@ class ImageGeometry(object):
self.center_y = center_y
self.center_z = center_z
self.channels = channels
+ self.dimension_labels = dimension_labels
def get_min_x(self):
return self.center_x - 0.5*self.voxel_num_x*self.voxel_size_x
@@ -113,6 +115,8 @@ class ImageGeometry(object):
return repres
def allocate(self, value=0, dimension_labels=None):
'''allocates an ImageData according to the size expressed in the instance'''
+ if dimension_labels is None:
+ dimension_labels = self.dimension_labels
out = ImageData(geometry=self, dimension_labels=dimension_labels)
if value != 0:
out += value
@@ -130,7 +134,8 @@ class AcquisitionGeometry(object):
dist_source_center=None,
dist_center_detector=None,
channels=1,
- angle_unit='degree'
+ angle_unit='degree',
+ dimension_labels=None
):
"""
General inputs for standard type projection geometries
@@ -171,6 +176,7 @@ class AcquisitionGeometry(object):
self.pixel_size_v = pixel_size_v
self.channels = channels
+ self.dimension_labels = dimension_labels
def clone(self):
'''returns a copy of the AcquisitionGeometry'''
@@ -198,6 +204,8 @@ class AcquisitionGeometry(object):
return repres
def allocate(self, value=0, dimension_labels=None):
'''allocates an AcquisitionData according to the size expressed in the instance'''
+ if dimension_labels is None:
+ dimension_labels = self.dimension_labels
out = AcquisitionData(geometry=self, dimension_labels=dimension_labels)
if value != 0:
out += value