diff options
-rw-r--r-- | Wrappers/Python/ccpi/astra/operators/AstraProjector3DSimple.py | 22 | ||||
-rw-r--r-- | Wrappers/Python/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 |