diff options
author | Vaggelis Papoutsellis <22398586+epapoutsellis@users.noreply.github.com> | 2019-03-22 15:47:52 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-22 15:47:52 +0000 |
commit | 1f037b3244e6df88d69d2542c6e09e67b94e949f (patch) | |
tree | b98eebe2aa6e000f7307458b6449b04eab70115e /Wrappers/Python/ccpi | |
parent | 5062caff495bfa8657135dc663080f0f7c2fdd12 (diff) | |
download | astra-wrapper-1f037b3244e6df88d69d2542c6e09e67b94e949f.tar.gz astra-wrapper-1f037b3244e6df88d69d2542c6e09e67b94e949f.tar.bz2 astra-wrapper-1f037b3244e6df88d69d2542c6e09e67b94e949f.tar.xz astra-wrapper-1f037b3244e6df88d69d2542c6e09e67b94e949f.zip |
Update ops.py
Diffstat (limited to 'Wrappers/Python/ccpi')
-rwxr-xr-x | Wrappers/Python/ccpi/astra/ops.py | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/Wrappers/Python/ccpi/astra/ops.py b/Wrappers/Python/ccpi/astra/ops.py index 6f3bb1b..ead97d6 100755 --- a/Wrappers/Python/ccpi/astra/ops.py +++ b/Wrappers/Python/ccpi/astra/ops.py @@ -15,7 +15,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -from ccpi.optimisation.ops import Operator +from ccpi.optimisation.operators import Operator, LinearOperator +from ccpi.optimisation.operators import LinearOperator import numpy from ccpi.framework import AcquisitionData, ImageData, DataContainer from ccpi.optimisation.ops import PowerMethodNonsquare @@ -23,7 +24,7 @@ from ccpi.astra.processors import AstraForwardProjector, AstraBackProjector, \ AstraForwardProjectorMC, AstraBackProjectorMC, AstraForwardProjector3D, \ AstraBackProjector3D -class AstraProjectorSimple(Operator): +class AstraProjectorSimple(LinearOperator): """ASTRA projector modified to use DataSet and geometry.""" def __init__(self, geomv, geomp, device): super(AstraProjectorSimple, self).__init__() @@ -58,8 +59,20 @@ class AstraProjectorSimple(Operator): #def delete(self): # astra.data2d.delete(self.proj_id) - def get_max_sing_val(self): - self.s1, sall, svec = PowerMethodNonsquare(self,10) + #def get_max_sing_val(self): + # self.s1, sall, svec = PowerMethodNonsquare(self,10) + # return self.s1 + + def domain_geometry(self): + return self.volume_geometry + + def range_geometry(self): + return self.sinogram_geometry + + def norm(self): + + x0 = self.volume_geometry.allocate('random') + self.s1, sall, svec = PowerMethodNonsquare(self, 50, x0) return self.s1 def size(self): @@ -69,10 +82,10 @@ class AstraProjectorSimple(Operator): (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(inputsize[0], - inputsize[1])) + #def create_image_data(self): + # inputsize = self.size()[1] + # return DataContainer(numpy.random.randn(inputsize[0], + # inputsize[1])) class AstraProjector3DSimple(Operator): """ASTRA projector modified to use DataSet and geometry.""" |