From ec373635a4b3e095cfcc87ae03bd52b05389e5d1 Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Mon, 30 Oct 2017 11:09:53 +0000 Subject: bugfixes for AstraDevice use --- src/Python/test/test_reconstructor.py | 39 ++++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) (limited to 'src/Python/test') diff --git a/src/Python/test/test_reconstructor.py b/src/Python/test/test_reconstructor.py index 343b9bb..f4627d7 100644 --- a/src/Python/test/test_reconstructor.py +++ b/src/Python/test/test_reconstructor.py @@ -30,10 +30,10 @@ def createAstraDevice(projector_geometry, output_geometry): '''TODO remove''' device = AstraDevice(DeviceModel.DeviceType.PARALLEL3D.value, - [projector_geometry['DetectorSpacingX'] , - projector_geometry['DetectorSpacingY'] , + [projector_geometry['DetectorRowCount'] , projector_geometry['DetectorColCount'] , - projector_geometry['DetectorRowCount'] , + projector_geometry['DetectorSpacingX'] , + projector_geometry['DetectorSpacingY'] , projector_geometry['ProjectionAngles'] ], [ @@ -332,5 +332,34 @@ else: fistaRecon.prepareForIteration() - X = fistaRecon.iterate(numpy.load("X.npy")) - numpy.save("X_out.npy", X) + X = numpy.load("X.npy") +## rd = astradevice.createReducedDevice() +## print ("rd proj_geom" , rd.proj_geom) +## +## +## rd.doForwardProject(X[0:1]) +## proj_geomT = proj_geom.copy() +## for ekey in rd.proj_geom.keys(): +## if ekey == 'ProjectionAngles': +## valrd = numpy.shape(rd.proj_geom[ekey]) +## valg = numpy.shape(proj_geomT[ekey]) +## else: +## valrd = rd.proj_geom[ekey] +## valg = proj_geomT[ekey] +## +## print ("key {0}: RD {1} geomT {2}".format(ekey, valrd, valg)) +## +## +## proj_geomT['DetectorRowCount'] = 1 +## vol_geomT = vol_geom.copy() +## vol_geomT['GridSliceCount'] = 1; +## rd.proj_geom = proj_geomT.copy() +## rd.vol_geom = vol_geomT.copy() +## +## +## +## sino_id, y = astra.creators.create_sino3d_gpu( +## X[0:1], rd.proj_geom, rd.vol_geom) + + X = fistaRecon.iterate(X) + #numpy.save("X_out.npy", X) -- cgit v1.2.3