summaryrefslogtreecommitdiffstats
path: root/python/astra/functions.py
diff options
context:
space:
mode:
authorWim van Aarle <wimvanaarle@gmail.com>2015-05-26 15:43:08 +0200
committerWim van Aarle <wimvanaarle@gmail.com>2015-05-26 15:43:08 +0200
commit3117c7a61a83ca28ba00211d1eb65eaf13a7307a (patch)
tree4851ae878cf499deb2ae2f77575b3c48ecaf5d04 /python/astra/functions.py
parent9e884e760b71be354c08892f6bce2efe723917b3 (diff)
parent57668bcdd086145eb14598e32fd5d0dca711865c (diff)
downloadastra-3117c7a61a83ca28ba00211d1eb65eaf13a7307a.tar.gz
astra-3117c7a61a83ca28ba00211d1eb65eaf13a7307a.tar.bz2
astra-3117c7a61a83ca28ba00211d1eb65eaf13a7307a.tar.xz
astra-3117c7a61a83ca28ba00211d1eb65eaf13a7307a.zip
Merge remote-tracking branch 'upstream/master' into parallel_vec
Conflicts: astra_vc11.vcxproj.filters python/astra/functions.py src/ParallelBeamBlobKernelProjector2D.cpp src/ProjectionGeometry2D.cpp
Diffstat (limited to 'python/astra/functions.py')
-rw-r--r--python/astra/functions.py31
1 files changed, 7 insertions, 24 deletions
diff --git a/python/astra/functions.py b/python/astra/functions.py
index bbbb355..13ca911 100644
--- a/python/astra/functions.py
+++ b/python/astra/functions.py
@@ -32,12 +32,17 @@
from . import creators as ac
import numpy as np
-from six.moves import range
+try:
+ from six.moves import range
+except ImportError:
+ # six 1.3.0
+ from six.moves import xrange as range
from . import data2d
from . import data3d
from . import projector
from . import algorithm
+from . import pythonutils
@@ -158,29 +163,7 @@ def geom_size(geom, dim=None):
:param dim: Optional axis index to return
:type dim: :class:`int`
"""
-
- if 'GridSliceCount' in geom:
- # 3D Volume geometry?
- s = (geom['GridSliceCount'], geom[
- 'GridRowCount'], geom['GridColCount'])
- elif 'GridColCount' in geom:
- # 2D Volume geometry?
- s = (geom['GridRowCount'], geom['GridColCount'])
- elif geom['type'] == 'parallel' or geom['type'] == 'fanflat':
- s = (len(geom['ProjectionAngles']), geom['DetectorCount'])
- elif geom['type'] == 'parallel3d' or geom['type'] == 'cone':
- s = (geom['DetectorRowCount'], len(
- geom['ProjectionAngles']), geom['DetectorColCount'])
- elif geom['type'] == 'parallel_vec' or geom['type'] == 'fanflat_vec':
- s = (geom['Vectors'].shape[0], geom['DetectorCount'])
- elif geom['type'] == 'parallel3d_vec' or geom['type'] == 'cone_vec':
- s = (geom['DetectorRowCount'], geom[
- 'Vectors'].shape[0], geom['DetectorColCount'])
-
- if dim != None:
- s = s[dim]
-
- return s
+ return pythonutils.geom_size(geom,dim)
def geom_2vec(proj_geom):