summaryrefslogtreecommitdiffstats
path: root/python/astra/data3d_c.pyx
diff options
context:
space:
mode:
authorDaniel M. Pelt <D.M.Pelt@cwi.nl>2015-05-07 11:34:37 +0200
committerDaniel M. Pelt <D.M.Pelt@cwi.nl>2015-05-07 11:34:37 +0200
commitf730efe78367e8fe8e589c2b43fb0886d384f5c8 (patch)
tree7609d9e24baad50d5d405b02560c44a13ffe0f79 /python/astra/data3d_c.pyx
parentf69d9f6bc1704560518da3c30c46e495c0228aac (diff)
downloadastra-f730efe78367e8fe8e589c2b43fb0886d384f5c8.tar.gz
astra-f730efe78367e8fe8e589c2b43fb0886d384f5c8.tar.bz2
astra-f730efe78367e8fe8e589c2b43fb0886d384f5c8.tar.xz
astra-f730efe78367e8fe8e589c2b43fb0886d384f5c8.zip
Do not allow 1D input in Python link method
Diffstat (limited to 'python/astra/data3d_c.pyx')
-rw-r--r--python/astra/data3d_c.pyx10
1 files changed, 2 insertions, 8 deletions
diff --git a/python/astra/data3d_c.pyx b/python/astra/data3d_c.pyx
index 30745b4..3b27ab7 100644
--- a/python/astra/data3d_c.pyx
+++ b/python/astra/data3d_c.pyx
@@ -69,14 +69,8 @@ def create(datatype,geometry,data=None, link=False):
cdef CConeProjectionGeometry3D* pppGeometry
cdef CFloat32CustomMemory * pCustom
- if link:
- geomSize = geom_size(geometry)
- if len(data.shape)==1:
- if data.size!=reduce(operator.mul,geomSize):
- raise Exception("The dimensions of the data do not match those specified in the geometry.")
- else:
- if data.shape!=geomSize:
- raise Exception("The dimensions of the data do not match those specified in the geometry.")
+ 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)