summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdoardo Pasca <edo.paskino@gmail.com>2019-03-11 12:18:53 -0400
committerEdoardo Pasca <edo.paskino@gmail.com>2019-03-11 12:18:53 -0400
commitb19a37714dcf8288a55bcd41a2a78dd6f8164e7f (patch)
tree64d170ee120b0cb97e14357f0a8371fb5c76e474
parent740d0d23407ce16706b66a5faa1a51c7829a3a0f (diff)
downloadframework-plugins-b19a37714dcf8288a55bcd41a2a78dd6f8164e7f.tar.gz
framework-plugins-b19a37714dcf8288a55bcd41a2a78dd6f8164e7f.tar.bz2
framework-plugins-b19a37714dcf8288a55bcd41a2a78dd6f8164e7f.tar.xz
framework-plugins-b19a37714dcf8288a55bcd41a2a78dd6f8164e7f.zip
added missing methods
-rwxr-xr-xWrappers/Python/ccpi/plugins/ops.py56
1 files changed, 47 insertions, 9 deletions
diff --git a/Wrappers/Python/ccpi/plugins/ops.py b/Wrappers/Python/ccpi/plugins/ops.py
index 75c5db9..f2e0dd3 100755
--- a/Wrappers/Python/ccpi/plugins/ops.py
+++ b/Wrappers/Python/ccpi/plugins/ops.py
@@ -78,16 +78,27 @@ class CCPiProjectorSimple(Operator):
# Initialise empty for singular value.
self.s1 = None
-
- def direct(self, image_data):
+ self.ag = pg
+ self.vg = vg
+
+ def is_linear(self):
+ return True
+
+ def direct(self, image_data, out=None):
self.fp.set_input(image_data)
- out = self.fp.get_output()
- return out
-
- def adjoint(self, acquisition_data):
+ if out is None:
+ out = self.fp.get_output()
+ return out
+ else:
+ out.fill(self.fp.get_output())
+
+ def adjoint(self, acquisition_data, out=None):
self.bp.set_input(acquisition_data)
- out = self.bp.get_output()
- return out
+ if out is None:
+ out = self.bp.get_output()
+ return out
+ else:
+ out.fill(self.bp.get_output())
#def delete(self):
# astra.data2d.delete(self.proj_id)
@@ -110,4 +121,31 @@ class CCPiProjectorSimple(Operator):
dimension_labels=self.bp.output_axes_order)#\
#.subset(['horizontal_x','horizontal_y','vertical'])
x0.fill(numpy.random.randn(*x0.shape))
- return x0 \ No newline at end of file
+ return x0
+ def domain_geometry(self):
+ return ImageGeometry(
+ self.vg.voxel_num_x,
+ self.vg.voxel_num_y,
+ self.vg.voxel_num_z,
+ self.vg.voxel_size_x,
+ self.vg.voxel_size_y,
+ self.vg.voxel_size_z,
+ self.vg.center_x,
+ self.vg.center_y,
+ self.vg.center_z,
+ self.vg.channels,
+ ['horizontal_x','horizontal_y','vertical'] )
+
+ def range_geometry(self):
+ return AcquisitionGeometry(self.ag.geom_type,
+ self.ag.dimension,
+ self.ag.angles,
+ self.ag.pixel_num_h,
+ self.ag.pixel_size_h,
+ self.ag.pixel_num_v,
+ self.ag.pixel_size_v,
+ self.ag.dist_source_center,
+ self.ag.dist_center_detector,
+ self.ag.channels,
+ ['angle','vertical','horizontal'])
+