From 69ab4daf439164eb37203b69b0cca3efe4c2232e Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Thu, 2 Jul 2020 15:55:14 +0200 Subject: Add error check --- python/astra/experimental.pyx | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'python/astra') diff --git a/python/astra/experimental.pyx b/python/astra/experimental.pyx index 0c40a82..08d907d 100644 --- a/python/astra/experimental.pyx +++ b/python/astra/experimental.pyx @@ -65,6 +65,8 @@ IF HAVE_CUDA==True: cdef CData3DManager * man3d = PyData3DManager.getSingletonPtr() def do_composite(projector_id, vol_ids, proj_ids, mode, t): + if mode != MODE_ADD and mode != MODE_SET: + raise RuntimeError("internal error: wrong composite mode") cdef vector[CFloat32VolumeData3D *] vol cdef CFloat32VolumeData3D * pVolObject cdef CFloat32ProjectionData3D * pProjObject @@ -126,6 +128,8 @@ IF HAVE_CUDA==True: from .utils cimport linkVolFromGeometry, linkProjFromGeometry def direct_FPBP3D(projector_id, vol, proj, mode, t): + if mode != MODE_ADD and mode != MODE_SET: + raise RuntimeError("internal error: wrong composite mode") cdef CProjector3D * projector = manProj.get(projector_id) if projector == NULL: raise Exception("Projector not found") -- cgit v1.2.3