diff options
author | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2015-09-16 12:01:02 +0200 |
---|---|---|
committer | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2015-09-16 12:01:02 +0200 |
commit | 55cbaa5df6f91594b7cd69754e04c186c7c88c97 (patch) | |
tree | b1456253660a7762df6868d1452a6d9480e25b19 /python/astra/data2d_c.pyx | |
parent | 7584ffbd6748bcca8c3f7ed2dc961be01f2fcfdc (diff) | |
parent | 026aa46c5db24ddd687cec0fa6e056a2ee3790c5 (diff) | |
download | astra-55cbaa5df6f91594b7cd69754e04c186c7c88c97.tar.gz astra-55cbaa5df6f91594b7cd69754e04c186c7c88c97.tar.bz2 astra-55cbaa5df6f91594b7cd69754e04c186c7c88c97.tar.xz astra-55cbaa5df6f91594b7cd69754e04c186c7c88c97.zip |
Merge branch 'master' into volgeom3d
Conflicts:
src/CudaBackProjectionAlgorithm3D.cpp
Diffstat (limited to 'python/astra/data2d_c.pyx')
-rw-r--r-- | python/astra/data2d_c.pyx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/python/astra/data2d_c.pyx b/python/astra/data2d_c.pyx index ac54898..4919bf2 100644 --- a/python/astra/data2d_c.pyx +++ b/python/astra/data2d_c.pyx @@ -47,6 +47,12 @@ from .PyIncludes cimport * cimport utils from .utils import wrap_from_bytes +from .pythonutils import geom_size + +import operator + +from six.moves import reduce + cdef CData2DManager * man2d = <CData2DManager * >PyData2DManager.getSingletonPtr() cdef extern from "CFloat32CustomPython.h": @@ -71,6 +77,10 @@ def create(datatype, geometry, data=None, link=False): cdef CProjectionGeometry2D * ppGeometry cdef CFloat32Data2D * pDataObject2D cdef CFloat32CustomMemory * pCustom + + if link and data.shape!=geom_size(geometry): + raise Exception("The dimensions of the data do not match those specified in the geometry.") + if datatype == '-vol': cfg = utils.dictToConfig(six.b('VolumeGeometry'), geometry) pGeometry = new CVolumeGeometry2D() |