diff options
Diffstat (limited to 'python/astra/pythonutils.py')
-rw-r--r-- | python/astra/pythonutils.py | 42 |
1 files changed, 30 insertions, 12 deletions
diff --git a/python/astra/pythonutils.py b/python/astra/pythonutils.py index 8ea4af5..27fa8fd 100644 --- a/python/astra/pythonutils.py +++ b/python/astra/pythonutils.py @@ -1,28 +1,28 @@ -#----------------------------------------------------------------------- -# Copyright 2013 Centrum Wiskunde & Informatica, Amsterdam +# ----------------------------------------------------------------------- +# Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp +# 2013-2016, CWI, Amsterdam # -# Author: Daniel M. Pelt -# Contact: D.M.Pelt@cwi.nl -# Website: http://dmpelt.github.io/pyastratoolbox/ +# Contact: astra@uantwerpen.be +# Website: http://www.astra-toolbox.com/ # +# This file is part of the ASTRA Toolbox. # -# This file is part of the Python interface to the -# All Scale Tomographic Reconstruction Antwerp Toolbox ("ASTRA Toolbox"). # -# The Python interface to the ASTRA Toolbox is free software: you can redistribute it and/or modify +# The ASTRA Toolbox is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or -#(at your option) any later version. +# (at your option) any later version. # -# The Python interface to the ASTRA Toolbox is distributed in the hope that it will be useful, +# The ASTRA Toolbox is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with the Python interface to the ASTRA Toolbox. If not, see <http://www.gnu.org/licenses/>. +# along with the ASTRA Toolbox. If not, see <http://www.gnu.org/licenses/>. # -#----------------------------------------------------------------------- +# ----------------------------------------------------------------------- + """Additional purely Python functions for PyAstraToolbox. .. moduleauthor:: Daniel M. Pelt <D.M.Pelt@cwi.nl> @@ -61,3 +61,21 @@ def geom_size(geom, dim=None): s = s[dim] return s + +class GPULink(object): + """Utility class for astra.data3d.link with a CUDA pointer + + The CUDA pointer ptr must point to an array of floats. + + x is the fastest-changing coordinate, z the slowest-changing. + + pitch is the width in bytes of the memory block. For a contiguous + memory block, pitch is equal to sizeof(float) * x. For a memory block + allocated by cudaMalloc3D, pitch is the pitch as returned by cudaMalloc3D. + """ + def __init__(self, ptr, x, y, z, pitch): + self.ptr = ptr + self.x = x + self.y = y + self.z = z + self.pitch = pitch |