summaryrefslogtreecommitdiffstats
path: root/Wrappers/Python
diff options
context:
space:
mode:
authorEdoardo Pasca <edo.paskino@gmail.com>2019-10-28 10:37:53 +0000
committerGitHub <noreply@github.com>2019-10-28 10:37:53 +0000
commit4a76f6b9a024016112811106e48af7720fdb9798 (patch)
treec32675ce75eda0aa79b3bc31c6c8f312c405be8d /Wrappers/Python
parent650356e61d157da1d7656f4b3b1e7a409fe05786 (diff)
downloadframework-4a76f6b9a024016112811106e48af7720fdb9798.tar.gz
framework-4a76f6b9a024016112811106e48af7720fdb9798.tar.bz2
framework-4a76f6b9a024016112811106e48af7720fdb9798.tar.xz
framework-4a76f6b9a024016112811106e48af7720fdb9798.zip
override the dimension parameter, set angles to None by default (#412)
Diffstat (limited to 'Wrappers/Python')
-rwxr-xr-xWrappers/Python/ccpi/framework/framework.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/Wrappers/Python/ccpi/framework/framework.py b/Wrappers/Python/ccpi/framework/framework.py
index c58088a..627e6d2 100755
--- a/Wrappers/Python/ccpi/framework/framework.py
+++ b/Wrappers/Python/ccpi/framework/framework.py
@@ -217,8 +217,8 @@ class AcquisitionGeometry(object):
HORIZONTAL = 'horizontal'
def __init__(self,
geom_type,
- dimension,
- angles,
+ dimension=None,
+ angles=None,
pixel_num_h=0,
pixel_size_h=1,
pixel_num_v=0,
@@ -255,6 +255,15 @@ class AcquisitionGeometry(object):
angles_format radians or degrees
"""
self.geom_type = geom_type # 'parallel' or 'cone'
+ # Override the parameter passed as dimension
+ # determine if the geometry is 2D or 3D
+ if pixel_num_v >= 1:
+ dimension = '3D'
+ elif pixel_num_v == 0:
+ dimension = '2D'
+ else:
+ raise ValueError('Number of pixels at detector on the vertical axis must be >= 0. Got {}'.format(vert))
+
self.dimension = dimension # 2D or 3D
if isinstance(angles, numpy.ndarray):
self.angles = angles