diff options
author | Jakob Jorgensen, WS at HMXIF <jakob.jorgensen@manchester.ac.uk> | 2019-04-26 16:50:39 +0100 |
---|---|---|
committer | Jakob Jorgensen, WS at HMXIF <jakob.jorgensen@manchester.ac.uk> | 2019-04-26 16:50:39 +0100 |
commit | 493d4fe58d74c8027213ec1f409bc853d90a3282 (patch) | |
tree | c855e3455f6384dca96d2422a4d66bc98ee45e92 | |
parent | 6f094f37fd2503e104a0477ac01d7a5b825d351a (diff) | |
download | astra-wrapper-493d4fe58d74c8027213ec1f409bc853d90a3282.tar.gz astra-wrapper-493d4fe58d74c8027213ec1f409bc853d90a3282.tar.bz2 astra-wrapper-493d4fe58d74c8027213ec1f409bc853d90a3282.tar.xz astra-wrapper-493d4fe58d74c8027213ec1f409bc853d90a3282.zip |
Add/remove new/old methods in operators
3 files changed, 10 insertions, 58 deletions
diff --git a/Wrappers/Python/ccpi/astra/operators/AstraProjector3DSimple.py b/Wrappers/Python/ccpi/astra/operators/AstraProjector3DSimple.py index 3240ee4..606bce6 100644 --- a/Wrappers/Python/ccpi/astra/operators/AstraProjector3DSimple.py +++ b/Wrappers/Python/ccpi/astra/operators/AstraProjector3DSimple.py @@ -16,7 +16,6 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. from ccpi.optimisation.operators import Operator, LinearOperator -import numpy from ccpi.framework import AcquisitionData, ImageData, DataContainer from ccpi.optimisation.ops import PowerMethodNonsquare from ccpi.astra.processors import AstraForwardProjector, AstraBackProjector, \ @@ -52,24 +51,17 @@ class AstraProjector3DSimple(LinearOperator): out = self.bp.get_output() return out - #def delete(self): - # astra.data2d.delete(self.proj_id) - def get_max_sing_val(self): self.s1, sall, svec = PowerMethodNonsquare(self,10) return self.s1 - def size(self): - # Only implemented for 2D - return ( (self.sinogram_geometry.angles.size, \ - self.sinogram_geometry.pixel_num_h, \ - self.sinogram_geometry.pixel_num_v,), \ - (self.volume_geometry.voxel_num_x, \ - self.volume_geometry.voxel_num_y, \ - self.volume_geometry.voxel_num_z) ) + def domain_geometry(self): + return self.volume_geometry + + def range_geometry(self): + return self.sinogram_geometry - def create_image_data(self): - inputsize = self.size()[1] - return DataContainer(numpy.random.randn(inputsize[2], - inputsize[1], - inputsize[0]))
\ No newline at end of file + def norm(self): + x0 = self.volume_geometry.allocate('random') + self.s1, sall, svec = PowerMethodNonsquare(self, 50, x0) + return self.s1
\ No newline at end of file diff --git a/Wrappers/Python/ccpi/astra/operators/AstraProjectorMC.py b/Wrappers/Python/ccpi/astra/operators/AstraProjectorMC.py index 51f51ca..a6993ba 100644 --- a/Wrappers/Python/ccpi/astra/operators/AstraProjectorMC.py +++ b/Wrappers/Python/ccpi/astra/operators/AstraProjectorMC.py @@ -42,18 +42,7 @@ class AstraProjectorMC(LinearOperator): device=device) # Initialise empty for singular value. - self.s1 = None - -# def direct(self, IM): -# self.fp.set_input(IM) -# out = self.fp.get_output() -# return out -# -# def adjoint(self, DATA): -# self.bp.set_input(DATA) -# out = self.bp.get_output() -# return out - + self.s1 = None def direct(self, IM, out=None): self.fp.set_input(IM) @@ -71,33 +60,6 @@ class AstraProjectorMC(LinearOperator): else: out.fill(self.bp.get_output()) - #def delete(self): - # astra.data2d.delete(self.proj_id) - -# def get_max_sing_val(self): -# if self.s1 is None: -# self.s1, sall, svec = PowerMethodNonsquare(self,10) -# return self.s1 -# else: -# return self.s1 -# -# def size(self): -# # Only implemented for 2D -# return ( (self.sinogram_geometry.angles.size, \ -# self.sinogram_geometry.pixel_num_h), \ -# (self.volume_geometry.voxel_num_x, \ -# self.volume_geometry.voxel_num_y) ) -# -# def create_image_data(self): -# inputsize = self.size()[1] -# return DataContainer(numpy.random.randn(self.volume_geometry.channels, -# inputsize[0], -# inputsize[1])) - -# def allocate_direct(self): -# return self.create_image_data()def domain_geometry(self): -# return self.volume_geometry - def domain_geometry(self): return self.volume_geometry @@ -105,7 +67,6 @@ class AstraProjectorMC(LinearOperator): return self.sinogram_geometry def norm(self): - x0 = self.volume_geometry.allocate('random') self.s1, sall, svec = PowerMethodNonsquare(self, 50, x0) return self.s1 diff --git a/Wrappers/Python/ccpi/astra/operators/AstraProjectorSimple.py b/Wrappers/Python/ccpi/astra/operators/AstraProjectorSimple.py index b459e82..71bc3c6 100644 --- a/Wrappers/Python/ccpi/astra/operators/AstraProjectorSimple.py +++ b/Wrappers/Python/ccpi/astra/operators/AstraProjectorSimple.py @@ -65,7 +65,6 @@ class AstraProjectorSimple(LinearOperator): return self.sinogram_geometry def norm(self): - x0 = self.volume_geometry.allocate('random') self.s1, sall, svec = PowerMethodNonsquare(self, 50, x0) return self.s1
\ No newline at end of file |