diff options
author | Jakob Jorgensen, WS at HMXIF <jakob.jorgensen@manchester.ac.uk> | 2019-04-26 17:12:11 +0100 |
---|---|---|
committer | Jakob Jorgensen, WS at HMXIF <jakob.jorgensen@manchester.ac.uk> | 2019-04-26 17:12:11 +0100 |
commit | 590a1178f8eaef600541e9a8a6a863b07afca806 (patch) | |
tree | 8ba022de2c25234d6f3d7f9a5a4810d182194468 | |
parent | 3dd7810b24962999c1a80c72e1dfa411543e4c52 (diff) | |
download | astra-wrapper-590a1178f8eaef600541e9a8a6a863b07afca806.tar.gz astra-wrapper-590a1178f8eaef600541e9a8a6a863b07afca806.tar.bz2 astra-wrapper-590a1178f8eaef600541e9a8a6a863b07afca806.tar.xz astra-wrapper-590a1178f8eaef600541e9a8a6a863b07afca806.zip |
Add out in 3D projector
-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 |