summaryrefslogtreecommitdiffstats
path: root/Wrappers
diff options
context:
space:
mode:
Diffstat (limited to 'Wrappers')
-rw-r--r--Wrappers/Python/ccpi/astra/astra_processors.py36
1 files changed, 20 insertions, 16 deletions
diff --git a/Wrappers/Python/ccpi/astra/astra_processors.py b/Wrappers/Python/ccpi/astra/astra_processors.py
index 650e11b..8cc0df4 100644
--- a/Wrappers/Python/ccpi/astra/astra_processors.py
+++ b/Wrappers/Python/ccpi/astra/astra_processors.py
@@ -190,16 +190,18 @@ class AstraForwardProjectorMC(DataSetProcessor):
def process(self):
IM = self.getInput()
- DATA = numpy.zeros((self.sinogram_geometry.angles.size,
- self.sinogram_geometry.pixel_num_h,
- 1,
- self.sinogram_geometry.channels),
- 'float32')
- for k in range(self.sinogram_geometry.channels):
- sinogram_id, DATA[:,:,0,k] = astra.create_sino(IM.as_array()[:,:,0,k],
+ #create the output Sinogram
+ DATA = SinogramData(geometry=self.sinogram_geometry)
+ #DATA = numpy.zeros((self.sinogram_geometry.angles.size,
+ # self.sinogram_geometry.pixel_num_h,
+ # 1,
+ # self.sinogram_geometry.channels),
+ # 'float32')
+ for k in range(DATA.geometry.channels):
+ sinogram_id, DATA.as_array()[k] = astra.create_sino(IM.as_array()[k],
self.proj_id)
astra.data2d.delete(sinogram_id)
- return SinogramData(DATA,geometry=self.sinogram_geometry)
+ return DATA
class AstraBackProjectorMC(DataSetProcessor):
'''AstraBackProjector
@@ -261,13 +263,15 @@ class AstraBackProjectorMC(DataSetProcessor):
def process(self):
DATA = self.getInput()
- IM = numpy.zeros((self.volume_geometry.voxel_num_x,
- self.volume_geometry.voxel_num_y,
- 1,
- self.volume_geometry.channels),
- 'float32')
- for k in range(self.volume_geometry.channels):
- rec_id, IM[:,:,0,k] = astra.create_backprojection(DATA.as_array()[:,:,0,k],
+ #IM = numpy.zeros((self.volume_geometry.voxel_num_x,
+ # self.volume_geometry.voxel_num_y,
+ # 1,
+ # self.volume_geometry.channels),
+ # 'float32')
+ IM = VolumeData(geometry=self.volume_geometry)
+
+ for k in range(IM.geometry.channels):
+ rec_id, IM.as_array()[k] = astra.create_backprojection(DATA.as_array()[k],
self.proj_id)
astra.data2d.delete(rec_id)
- return VolumeData(IM,geometry=self.volume_geometry) \ No newline at end of file
+ return IM \ No newline at end of file