summaryrefslogtreecommitdiffstats
path: root/Wrappers/Python
diff options
context:
space:
mode:
Diffstat (limited to 'Wrappers/Python')
-rw-r--r--Wrappers/Python/ccpi/astra/astra_processors.py18
-rw-r--r--Wrappers/Python/test/simple_demo.py2
2 files changed, 15 insertions, 5 deletions
diff --git a/Wrappers/Python/ccpi/astra/astra_processors.py b/Wrappers/Python/ccpi/astra/astra_processors.py
index 91612b1..c3127eb 100644
--- a/Wrappers/Python/ccpi/astra/astra_processors.py
+++ b/Wrappers/Python/ccpi/astra/astra_processors.py
@@ -37,8 +37,13 @@ class AstraForwardProjector(DataSetProcessor):
# ASTRA projector, to be stored
if device == 'cpu':
- # Note that 'line' is only for parallel (2D) and only one option
- self.setProjector(astra.create_projector('line', proj_geom, vol_geom) )
+ # Note that 'line' only one option
+ if self.sinogram_geometry.geom_type == 'parallel':
+ self.setProjector(astra.create_projector('line', proj_geom, vol_geom) )
+ elif self.sinogram_geometry.geom_type == 'cone':
+ self.setProjector(astra.create_projector('line_fanflat', proj_geom, vol_geom) )
+ else:
+ NotImplemented
elif device == 'gpu':
self.setProjector(astra.create_projector('cuda', proj_geom, vol_geom) )
else:
@@ -100,8 +105,13 @@ class AstraBackProjector(DataSetProcessor):
# ASTRA projector, to be stored
if device == 'cpu':
- # Note that 'line' is only for parallel (2D) and only one option
- self.setProjector(astra.create_projector('line', proj_geom, vol_geom) )
+ # Note that 'line' only one option
+ if self.sinogram_geometry.geom_type == 'parallel':
+ self.setProjector(astra.create_projector('line', proj_geom, vol_geom) )
+ elif self.sinogram_geometry.geom_type == 'cone':
+ self.setProjector(astra.create_projector('line_fanflat', proj_geom, vol_geom) )
+ else:
+ NotImplemented
elif device == 'gpu':
self.setProjector(astra.create_projector('cuda', proj_geom, vol_geom) )
else:
diff --git a/Wrappers/Python/test/simple_demo.py b/Wrappers/Python/test/simple_demo.py
index 1046e7b..0bbb687 100644
--- a/Wrappers/Python/test/simple_demo.py
+++ b/Wrappers/Python/test/simple_demo.py
@@ -60,7 +60,7 @@ elif test_case==2:
dist_center_detector=OrigDetec)
# ASTRA operator using volume and sinogram geometries
-Aop = AstraProjectorSimple(vg, pg, 'gpu')
+Aop = AstraProjectorSimple(vg, pg, 'cpu')
# Unused old astra projector without geometry
# Aop_old = AstraProjector(det_w, det_num, SourceOrig,