From 590a1178f8eaef600541e9a8a6a863b07afca806 Mon Sep 17 00:00:00 2001 From: "Jakob Jorgensen, WS at HMXIF" Date: Fri, 26 Apr 2019 17:12:11 +0100 Subject: Add out in 3D projector --- .../ccpi/astra/operators/AstraProjector3DSimple.py | 22 ++++++++++++---------- .../ccpi/astra/operators/AstraProjectorMC.py | 3 +-- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/Wrappers/Python/ccpi/astra/operators/AstraProjector3DSimple.py b/Wrappers/Python/ccpi/astra/operators/AstraProjector3DSimple.py index 606bce6..8058cdc 100644 --- a/Wrappers/Python/ccpi/astra/operators/AstraProjector3DSimple.py +++ b/Wrappers/Python/ccpi/astra/operators/AstraProjector3DSimple.py @@ -41,19 +41,21 @@ class AstraProjector3DSimple(LinearOperator): # Initialise empty for singular value. self.s1 = None - def direct(self, IM): + def direct(self, IM, out=None): self.fp.set_input(IM) - out = self.fp.get_output() - return out + + if out is None: + return self.fp.get_output() + else: + out.fill(self.fp.get_output()) - def adjoint(self, DATA): + def adjoint(self, DATA, out=None): self.bp.set_input(DATA) - out = self.bp.get_output() - return out - - def get_max_sing_val(self): - self.s1, sall, svec = PowerMethodNonsquare(self,10) - return self.s1 + + if out is None: + return self.bp.get_output() + else: + out.fill(self.bp.get_output()) def domain_geometry(self): return self.volume_geometry diff --git a/Wrappers/Python/ccpi/astra/operators/AstraProjectorMC.py b/Wrappers/Python/ccpi/astra/operators/AstraProjectorMC.py index a6993ba..f796a63 100644 --- a/Wrappers/Python/ccpi/astra/operators/AstraProjectorMC.py +++ b/Wrappers/Python/ccpi/astra/operators/AstraProjectorMC.py @@ -69,5 +69,4 @@ class AstraProjectorMC(LinearOperator): 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 + return self.s1 \ No newline at end of file -- cgit v1.2.1