summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <wjp@usecode.org>2021-12-01 11:56:08 +0100
committerWillem Jan Palenstijn <wjp@usecode.org>2021-12-01 11:56:08 +0100
commitc686f9ac537f7ebf66ea7d1fff7df19498c09525 (patch)
tree85f4d881f9ce4d4c21d809528afd150bb5d36960
parent628e1da0b73140bd73501de3805b27b78ec8a19c (diff)
downloadastra-c686f9ac537f7ebf66ea7d1fff7df19498c09525.tar.gz
astra-c686f9ac537f7ebf66ea7d1fff7df19498c09525.tar.bz2
astra-c686f9ac537f7ebf66ea7d1fff7df19498c09525.tar.xz
astra-c686f9ac537f7ebf66ea7d1fff7df19498c09525.zip
Add test for FDK shortscan scaling
-rw-r--r--tests/python/test_rec_scaling.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/python/test_rec_scaling.py b/tests/python/test_rec_scaling.py
index ee27efc..a20aacb 100644
--- a/tests/python/test_rec_scaling.py
+++ b/tests/python/test_rec_scaling.py
@@ -20,7 +20,7 @@ def VolumeGeometries(is3D,noncube):
yield astra.create_vol_geom(64, 64, 64, -32*s, 32*s, -32*s, 32*s, -32*s, 32*s)
-def ProjectionGeometries(type):
+def ProjectionGeometries(type,shortscan):
if type == 'parallel':
for dU in [0.8, 1.0, 1.25]:
yield astra.create_proj_geom('parallel', dU, 256, np.linspace(0,np.pi,180,False))
@@ -51,11 +51,13 @@ def ProjectionGeometries(type):
pg = astra.create_proj_geom('parallel3d_vec', 128, 128, Vectors)
yield pg
elif type == 'cone':
+ A = [1.5, 2] if shortscan else [ 2 ]
for dU in [0.8, 1.0]:
for dV in [0.8, 1.0]:
for src in [500, 1000]:
for det in [0, 250]:
- yield astra.create_proj_geom('cone', dU, dV, 128, 128, np.linspace(0,2*np.pi,180,False), src, det)
+ for a in A:
+ yield astra.create_proj_geom('cone', dU, dV, 128, 128, np.linspace(0,a*np.pi,180,False), src, det)
elif type == 'cone_vec':
for j in range(10):
Vectors = np.zeros([180,12])
@@ -81,7 +83,7 @@ class TestRecScale(unittest.TestCase):
self.skipTest('CPU FBP is parallel-beam only')
is3D = (geom_type in ['parallel3d', 'cone'])
for vg in VolumeGeometries(is3D, 'FDK' not in alg):
- for pg in ProjectionGeometries(geom_type):
+ for pg in ProjectionGeometries(geom_type, 'FDK' in alg):
if not is3D:
vol = np.zeros((128,128),dtype=np.float32)
vol[50:70,50:70] = 1
@@ -109,6 +111,8 @@ class TestRecScale(unittest.TestCase):
cfg['ReconstructionDataId'] = rec_id
cfg['ProjectionDataId'] = sino_id
cfg['ProjectorId'] = proj_id
+ if 'FDK' in alg and geom_type == "cone" and pg["ProjectionAngles"][-1] < 1.8*np.pi:
+ cfg['option'] = { 'ShortScan': True }
alg_id = astra.algorithm.create(cfg)
for i in range(iters):