diff options
author | Allard Hendriksen <allard@allardhendriksen.nl> | 2020-06-23 15:54:56 +0200 |
---|---|---|
committer | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2020-07-02 15:54:13 +0200 |
commit | 7213c6ae82c0e447ccec804f74226e6ceb8d45f8 (patch) | |
tree | 6f8fe04c5b32531a85ac7aad3d51f6e5488961ff /python | |
parent | 492c0211608fa756ba6642ff7ae3b479765a955b (diff) | |
download | astra-7213c6ae82c0e447ccec804f74226e6ceb8d45f8.tar.gz astra-7213c6ae82c0e447ccec804f74226e6ceb8d45f8.tar.bz2 astra-7213c6ae82c0e447ccec804f74226e6ceb8d45f8.tar.xz astra-7213c6ae82c0e447ccec804f74226e6ceb8d45f8.zip |
Add mode parameter to direct_FPBP3D
This change allows additive forward and backprojections.
Diffstat (limited to 'python')
-rw-r--r-- | python/astra/experimental.pyx | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/python/astra/experimental.pyx b/python/astra/experimental.pyx index c76fcbe..0c40a82 100644 --- a/python/astra/experimental.pyx +++ b/python/astra/experimental.pyx @@ -125,7 +125,7 @@ IF HAVE_CUDA==True: cimport utils from .utils cimport linkVolFromGeometry, linkProjFromGeometry - def direct_FPBP3D(projector_id, vol, proj, t): + def direct_FPBP3D(projector_id, vol, proj, mode, t): cdef CProjector3D * projector = manProj.get(projector_id) if projector == NULL: raise Exception("Projector not found") @@ -140,10 +140,10 @@ IF HAVE_CUDA==True: cdef CCompositeGeometryManager m try: if t == "FP": - if not m.doFP(projector, vols, projs, MODE_SET): + if not m.doFP(projector, vols, projs, mode): raise Exception("Failed to perform FP") elif t == "BP": - if not m.doBP(projector, vols, projs, MODE_SET): + if not m.doBP(projector, vols, projs, mode): raise Exception("Failed to perform BP") else: raise RuntimeError("internal error: wrong op type") @@ -161,7 +161,7 @@ IF HAVE_CUDA==True: :param proj: The pre-allocated output data, either numpy array or GPULink :type datatype: :class:`numpy.ndarray` or :class:`astra.data3d.GPULink` """ - direct_FPBP3D(projector_id, vol, proj, "FP") + direct_FPBP3D(projector_id, vol, proj, MODE_SET, "FP") def direct_BP3D(projector_id, vol, proj): """Perform a 3D back projection with pre-allocated input/output. @@ -173,5 +173,4 @@ IF HAVE_CUDA==True: :param proj: The input data, either numpy array or GPULink :type datatype: :class:`numpy.ndarray` or :class:`astra.data3d.GPULink` """ - direct_FPBP3D(projector_id, vol, proj, "BP") - + direct_FPBP3D(projector_id, vol, proj, MODE_SET, "BP") |