From 4a76f6b9a024016112811106e48af7720fdb9798 Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Mon, 28 Oct 2019 10:37:53 +0000 Subject: override the dimension parameter, set angles to None by default (#412) --- Wrappers/Python/ccpi/framework/framework.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'Wrappers/Python') 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 -- cgit v1.2.3