diff options
author | jakobsj <jakobsj@users.noreply.github.com> | 2018-03-07 16:05:32 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-07 16:05:32 +0000 |
commit | 83dd0330d20a57f52956d8a08b01072807e24daf (patch) | |
tree | add85f33450a02a8c45d44d73988f0633fc8a48f /Wrappers | |
parent | 6a1dbd9a1fb74cce7dfebbbcc9f1e17ffe1438d0 (diff) | |
download | framework-83dd0330d20a57f52956d8a08b01072807e24daf.tar.gz framework-83dd0330d20a57f52956d8a08b01072807e24daf.tar.bz2 framework-83dd0330d20a57f52956d8a08b01072807e24daf.tar.xz framework-83dd0330d20a57f52956d8a08b01072807e24daf.zip |
fix simple_demo for cpu fanbeam (#44)
Diffstat (limited to 'Wrappers')
-rw-r--r-- | Wrappers/Python/ccpi/astra/astra_processors.py | 18 | ||||
-rw-r--r-- | Wrappers/Python/test/simple_demo.py | 2 |
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, |