summaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/astra/PyAlgorithmFactory.pxd6
-rw-r--r--python/astra/PyAlgorithmManager.pxd6
-rw-r--r--python/astra/PyData2DManager.pxd6
-rw-r--r--python/astra/PyData3DManager.pxd6
-rw-r--r--python/astra/PyIncludes.pxd10
-rw-r--r--python/astra/PyIndexManager.pxd6
-rw-r--r--python/astra/PyMatrixManager.pxd6
-rw-r--r--python/astra/PyProjector2DFactory.pxd6
-rw-r--r--python/astra/PyProjector2DManager.pxd6
-rw-r--r--python/astra/PyProjector3DFactory.pxd6
-rw-r--r--python/astra/PyProjector3DManager.pxd6
-rw-r--r--python/astra/PyXMLDocument.pxd6
-rw-r--r--python/astra/__init__.py12
-rw-r--r--python/astra/algorithm.py6
-rw-r--r--python/astra/algorithm_c.pyx6
-rw-r--r--python/astra/astra.py6
-rw-r--r--python/astra/astra_c.pyx9
-rw-r--r--python/astra/creators.py19
-rw-r--r--python/astra/data2d.py6
-rw-r--r--python/astra/data2d_c.pyx10
-rw-r--r--python/astra/data3d.py6
-rw-r--r--python/astra/data3d_c.pyx6
-rw-r--r--python/astra/experimental.pyx6
-rw-r--r--python/astra/extrautils.pyx6
-rw-r--r--python/astra/functions.py63
-rw-r--r--python/astra/log.py6
-rw-r--r--python/astra/log_c.pyx6
-rw-r--r--python/astra/matlab.py6
-rw-r--r--python/astra/matrix.py6
-rw-r--r--python/astra/matrix_c.pyx6
-rw-r--r--python/astra/optomo.py6
-rw-r--r--python/astra/plugin.py6
-rw-r--r--python/astra/plugin_c.pyx6
-rw-r--r--python/astra/plugins/__init__.py6
-rw-r--r--python/astra/plugins/cgls.py6
-rw-r--r--python/astra/plugins/sirt.py6
-rw-r--r--python/astra/projector.py6
-rw-r--r--python/astra/projector3d.py6
-rw-r--r--python/astra/projector3d_c.pyx6
-rw-r--r--python/astra/projector_c.pyx6
-rw-r--r--python/astra/pythonutils.py8
-rw-r--r--python/astra/src/PythonPluginAlgorithm.cpp6
-rw-r--r--python/astra/src/PythonPluginAlgorithm.h6
-rw-r--r--python/astra/tests.py16
-rw-r--r--python/astra/utils.pxd6
-rw-r--r--python/astra/utils.pyx6
-rw-r--r--python/builder.py6
47 files changed, 234 insertions, 147 deletions
diff --git a/python/astra/PyAlgorithmFactory.pxd b/python/astra/PyAlgorithmFactory.pxd
index 5e335e4..5913697 100644
--- a/python/astra/PyAlgorithmFactory.pxd
+++ b/python/astra/PyAlgorithmFactory.pxd
@@ -1,8 +1,8 @@
# -----------------------------------------------------------------------
-# Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp
-# 2013-2016, CWI, Amsterdam
+# Copyright: 2010-2018, imec Vision Lab, University of Antwerp
+# 2013-2018, CWI, Amsterdam
#
-# Contact: astra@uantwerpen.be
+# Contact: astra@astra-toolbox.com
# Website: http://www.astra-toolbox.com/
#
# This file is part of the ASTRA Toolbox.
diff --git a/python/astra/PyAlgorithmManager.pxd b/python/astra/PyAlgorithmManager.pxd
index dfc7961..7f2cbb8 100644
--- a/python/astra/PyAlgorithmManager.pxd
+++ b/python/astra/PyAlgorithmManager.pxd
@@ -1,8 +1,8 @@
# -----------------------------------------------------------------------
-# Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp
-# 2013-2016, CWI, Amsterdam
+# Copyright: 2010-2018, imec Vision Lab, University of Antwerp
+# 2013-2018, CWI, Amsterdam
#
-# Contact: astra@uantwerpen.be
+# Contact: astra@astra-toolbox.com
# Website: http://www.astra-toolbox.com/
#
# This file is part of the ASTRA Toolbox.
diff --git a/python/astra/PyData2DManager.pxd b/python/astra/PyData2DManager.pxd
index 7cf60c7..167f840 100644
--- a/python/astra/PyData2DManager.pxd
+++ b/python/astra/PyData2DManager.pxd
@@ -1,8 +1,8 @@
# -----------------------------------------------------------------------
-# Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp
-# 2013-2016, CWI, Amsterdam
+# Copyright: 2010-2018, imec Vision Lab, University of Antwerp
+# 2013-2018, CWI, Amsterdam
#
-# Contact: astra@uantwerpen.be
+# Contact: astra@astra-toolbox.com
# Website: http://www.astra-toolbox.com/
#
# This file is part of the ASTRA Toolbox.
diff --git a/python/astra/PyData3DManager.pxd b/python/astra/PyData3DManager.pxd
index 250147e..cc9afad 100644
--- a/python/astra/PyData3DManager.pxd
+++ b/python/astra/PyData3DManager.pxd
@@ -1,8 +1,8 @@
# -----------------------------------------------------------------------
-# Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp
-# 2013-2016, CWI, Amsterdam
+# Copyright: 2010-2018, imec Vision Lab, University of Antwerp
+# 2013-2018, CWI, Amsterdam
#
-# Contact: astra@uantwerpen.be
+# Contact: astra@astra-toolbox.com
# Website: http://www.astra-toolbox.com/
#
# This file is part of the ASTRA Toolbox.
diff --git a/python/astra/PyIncludes.pxd b/python/astra/PyIncludes.pxd
index ec37d0a..b9a61a9 100644
--- a/python/astra/PyIncludes.pxd
+++ b/python/astra/PyIncludes.pxd
@@ -1,8 +1,8 @@
# -----------------------------------------------------------------------
-# Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp
-# 2013-2016, CWI, Amsterdam
+# Copyright: 2010-2018, imec Vision Lab, University of Antwerp
+# 2013-2018, CWI, Amsterdam
#
-# Contact: astra@uantwerpen.be
+# Contact: astra@astra-toolbox.com
# Website: http://www.astra-toolbox.com/
#
# This file is part of the ASTRA Toolbox.
@@ -128,6 +128,10 @@ cdef extern from "astra/FanFlatVecProjectionGeometry2D.h" namespace "astra":
cdef cppclass CFanFlatVecProjectionGeometry2D:
CFanFlatVecProjectionGeometry2D()
+cdef extern from "astra/ParallelVecProjectionGeometry2D.h" namespace "astra":
+ cdef cppclass CParallelVecProjectionGeometry2D:
+ CParallelVecProjectionGeometry2D()
+
cdef extern from "astra/ParallelProjectionGeometry2D.h" namespace "astra":
cdef cppclass CParallelProjectionGeometry2D:
CParallelProjectionGeometry2D()
diff --git a/python/astra/PyIndexManager.pxd b/python/astra/PyIndexManager.pxd
index 5eeff02..9d4dff7 100644
--- a/python/astra/PyIndexManager.pxd
+++ b/python/astra/PyIndexManager.pxd
@@ -1,8 +1,8 @@
# -----------------------------------------------------------------------
-# Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp
-# 2013-2016, CWI, Amsterdam
+# Copyright: 2010-2018, imec Vision Lab, University of Antwerp
+# 2013-2018, CWI, Amsterdam
#
-# Contact: astra@uantwerpen.be
+# Contact: astra@astra-toolbox.com
# Website: http://www.astra-toolbox.com/
#
# This file is part of the ASTRA Toolbox.
diff --git a/python/astra/PyMatrixManager.pxd b/python/astra/PyMatrixManager.pxd
index 38ad7f1..5f6fb58 100644
--- a/python/astra/PyMatrixManager.pxd
+++ b/python/astra/PyMatrixManager.pxd
@@ -1,8 +1,8 @@
# -----------------------------------------------------------------------
-# Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp
-# 2013-2016, CWI, Amsterdam
+# Copyright: 2010-2018, imec Vision Lab, University of Antwerp
+# 2013-2018, CWI, Amsterdam
#
-# Contact: astra@uantwerpen.be
+# Contact: astra@astra-toolbox.com
# Website: http://www.astra-toolbox.com/
#
# This file is part of the ASTRA Toolbox.
diff --git a/python/astra/PyProjector2DFactory.pxd b/python/astra/PyProjector2DFactory.pxd
index b70bf79..e21c73d 100644
--- a/python/astra/PyProjector2DFactory.pxd
+++ b/python/astra/PyProjector2DFactory.pxd
@@ -1,8 +1,8 @@
# -----------------------------------------------------------------------
-# Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp
-# 2013-2016, CWI, Amsterdam
+# Copyright: 2010-2018, imec Vision Lab, University of Antwerp
+# 2013-2018, CWI, Amsterdam
#
-# Contact: astra@uantwerpen.be
+# Contact: astra@astra-toolbox.com
# Website: http://www.astra-toolbox.com/
#
# This file is part of the ASTRA Toolbox.
diff --git a/python/astra/PyProjector2DManager.pxd b/python/astra/PyProjector2DManager.pxd
index 86bd3cf..cfadb2d 100644
--- a/python/astra/PyProjector2DManager.pxd
+++ b/python/astra/PyProjector2DManager.pxd
@@ -1,8 +1,8 @@
# -----------------------------------------------------------------------
-# Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp
-# 2013-2016, CWI, Amsterdam
+# Copyright: 2010-2018, imec Vision Lab, University of Antwerp
+# 2013-2018, CWI, Amsterdam
#
-# Contact: astra@uantwerpen.be
+# Contact: astra@astra-toolbox.com
# Website: http://www.astra-toolbox.com/
#
# This file is part of the ASTRA Toolbox.
diff --git a/python/astra/PyProjector3DFactory.pxd b/python/astra/PyProjector3DFactory.pxd
index ae0cc1d..191c965 100644
--- a/python/astra/PyProjector3DFactory.pxd
+++ b/python/astra/PyProjector3DFactory.pxd
@@ -1,8 +1,8 @@
# -----------------------------------------------------------------------
-# Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp
-# 2013-2016, CWI, Amsterdam
+# Copyright: 2010-2018, imec Vision Lab, University of Antwerp
+# 2013-2018, CWI, Amsterdam
#
-# Contact: astra@uantwerpen.be
+# Contact: astra@astra-toolbox.com
# Website: http://www.astra-toolbox.com/
#
# This file is part of the ASTRA Toolbox.
diff --git a/python/astra/PyProjector3DManager.pxd b/python/astra/PyProjector3DManager.pxd
index cdd739a..56b714c 100644
--- a/python/astra/PyProjector3DManager.pxd
+++ b/python/astra/PyProjector3DManager.pxd
@@ -1,8 +1,8 @@
# -----------------------------------------------------------------------
-# Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp
-# 2013-2016, CWI, Amsterdam
+# Copyright: 2010-2018, imec Vision Lab, University of Antwerp
+# 2013-2018, CWI, Amsterdam
#
-# Contact: astra@uantwerpen.be
+# Contact: astra@astra-toolbox.com
# Website: http://www.astra-toolbox.com/
#
# This file is part of the ASTRA Toolbox.
diff --git a/python/astra/PyXMLDocument.pxd b/python/astra/PyXMLDocument.pxd
index dbd84d5..e1d606b 100644
--- a/python/astra/PyXMLDocument.pxd
+++ b/python/astra/PyXMLDocument.pxd
@@ -1,8 +1,8 @@
# -----------------------------------------------------------------------
-# Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp
-# 2013-2016, CWI, Amsterdam
+# Copyright: 2010-2018, imec Vision Lab, University of Antwerp
+# 2013-2018, CWI, Amsterdam
#
-# Contact: astra@uantwerpen.be
+# Contact: astra@astra-toolbox.com
# Website: http://www.astra-toolbox.com/
#
# This file is part of the ASTRA Toolbox.
diff --git a/python/astra/__init__.py b/python/astra/__init__.py
index 4675229..1a7f444 100644
--- a/python/astra/__init__.py
+++ b/python/astra/__init__.py
@@ -1,8 +1,8 @@
# -----------------------------------------------------------------------
-# Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp
-# 2013-2016, CWI, Amsterdam
+# Copyright: 2010-2018, imec Vision Lab, University of Antwerp
+# 2013-2018, CWI, Amsterdam
#
-# Contact: astra@uantwerpen.be
+# Contact: astra@astra-toolbox.com
# Website: http://www.astra-toolbox.com/
#
# This file is part of the ASTRA Toolbox.
@@ -25,9 +25,9 @@
from . import matlab as m
from .creators import astra_dict,create_vol_geom, create_proj_geom, create_backprojection, create_sino, create_reconstruction, create_projector,create_sino3d_gpu, create_backprojection3d_gpu
-from .functions import data_op, add_noise_to_sino, clear, move_vol_geom
+from .functions import data_op, add_noise_to_sino, clear, move_vol_geom, geom_size, geom_2vec, geom_postalignment
from .extrautils import clipCircle
-from .astra import set_gpu_index, get_gpu_info
+from .astra import set_gpu_index, get_gpu_info, use_cuda
from . import data2d
from . import astra
from . import data3d
@@ -39,7 +39,7 @@ from . import plugin
from . import plugins
from . import log
from .optomo import OpTomo
-from .tests import test_noCUDA, test_CUDA
+from .tests import test, test_noCUDA, test_CUDA
__version__ = '1.9.0dev'
diff --git a/python/astra/algorithm.py b/python/astra/algorithm.py
index b6dfb95..33cca85 100644
--- a/python/astra/algorithm.py
+++ b/python/astra/algorithm.py
@@ -1,8 +1,8 @@
# -----------------------------------------------------------------------
-# Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp
-# 2013-2016, CWI, Amsterdam
+# Copyright: 2010-2018, imec Vision Lab, University of Antwerp
+# 2013-2018, CWI, Amsterdam
#
-# Contact: astra@uantwerpen.be
+# Contact: astra@astra-toolbox.com
# Website: http://www.astra-toolbox.com/
#
# This file is part of the ASTRA Toolbox.
diff --git a/python/astra/algorithm_c.pyx b/python/astra/algorithm_c.pyx
index 161fe98..a190ee1 100644
--- a/python/astra/algorithm_c.pyx
+++ b/python/astra/algorithm_c.pyx
@@ -1,8 +1,8 @@
# -----------------------------------------------------------------------
-# Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp
-# 2013-2016, CWI, Amsterdam
+# Copyright: 2010-2018, imec Vision Lab, University of Antwerp
+# 2013-2018, CWI, Amsterdam
#
-# Contact: astra@uantwerpen.be
+# Contact: astra@astra-toolbox.com
# Website: http://www.astra-toolbox.com/
#
# This file is part of the ASTRA Toolbox.
diff --git a/python/astra/astra.py b/python/astra/astra.py
index 434ccb9..ef46db1 100644
--- a/python/astra/astra.py
+++ b/python/astra/astra.py
@@ -1,8 +1,8 @@
# -----------------------------------------------------------------------
-# Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp
-# 2013-2016, CWI, Amsterdam
+# Copyright: 2010-2018, imec Vision Lab, University of Antwerp
+# 2013-2018, CWI, Amsterdam
#
-# Contact: astra@uantwerpen.be
+# Contact: astra@astra-toolbox.com
# Website: http://www.astra-toolbox.com/
#
# This file is part of the ASTRA Toolbox.
diff --git a/python/astra/astra_c.pyx b/python/astra/astra_c.pyx
index f25fc2a..e7c5a6d 100644
--- a/python/astra/astra_c.pyx
+++ b/python/astra/astra_c.pyx
@@ -1,8 +1,8 @@
# -----------------------------------------------------------------------
-# Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp
-# 2013-2016, CWI, Amsterdam
+# Copyright: 2010-2018, imec Vision Lab, University of Antwerp
+# 2013-2018, CWI, Amsterdam
#
-# Contact: astra@uantwerpen.be
+# Contact: astra@astra-toolbox.com
# Website: http://www.astra-toolbox.com/
#
# This file is part of the ASTRA Toolbox.
@@ -38,6 +38,7 @@ from .PyIndexManager cimport CAstraObjectManagerBase
cdef extern from "astra/Globals.h" namespace "astra":
bool cudaEnabled()
+ bool cudaAvailable()
IF HAVE_CUDA==True:
cdef extern from "../cuda/2d/astra.h" namespace "astraCUDA":
@@ -74,7 +75,7 @@ def credits():
def use_cuda():
- return cudaEnabled()
+ return cudaAvailable()
IF HAVE_CUDA==True:
def set_gpu_index(idx, memory=0):
diff --git a/python/astra/creators.py b/python/astra/creators.py
index 1e4d937..ca4916d 100644
--- a/python/astra/creators.py
+++ b/python/astra/creators.py
@@ -1,8 +1,8 @@
# -----------------------------------------------------------------------
-# Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp
-# 2013-2016, CWI, Amsterdam
+# Copyright: 2010-2018, imec Vision Lab, University of Antwerp
+# 2013-2018, CWI, Amsterdam
#
-# Contact: astra@uantwerpen.be
+# Contact: astra@astra-toolbox.com
# Website: http://www.astra-toolbox.com/
#
# This file is part of the ASTRA Toolbox.
@@ -147,6 +147,13 @@ This method can be called in a number of ways:
:type angles: :class:`numpy.ndarray`
:returns: A parallel projection geometry.
+``create_proj_geom('parallel_vec', det_count, V)``:
+
+:param det_count: Number of detector pixels.
+:type det_count: :class:`int`
+:param V: Vector array.
+:type V: :class:`numpy.ndarray`
+:returns: A parallel-beam projection geometry.
``create_proj_geom('fanflat', det_width, det_count, angles, source_origin, origin_det)``:
@@ -234,6 +241,12 @@ This method can be called in a number of ways:
raise Exception(
'not enough variables: astra_create_proj_geom(parallel, detector_spacing, det_count, angles)')
return {'type': 'parallel', 'DetectorWidth': args[0], 'DetectorCount': args[1], 'ProjectionAngles': args[2]}
+ elif intype == 'parallel_vec':
+ if len(args) < 2:
+ raise Exception('not enough variables: astra_create_proj_geom(parallel_vec, det_count, V)')
+ if not args[1].shape[1] == 6:
+ raise Exception('V should be a Nx6 matrix, with N the number of projections')
+ return {'type':'parallel_vec', 'DetectorCount':args[0], 'Vectors':args[1]}
elif intype == 'fanflat':
if len(args) < 5:
raise Exception('not enough variables: astra_create_proj_geom(fanflat, det_width, det_count, angles, source_origin, origin_det)')
diff --git a/python/astra/data2d.py b/python/astra/data2d.py
index 674161d..188ff69 100644
--- a/python/astra/data2d.py
+++ b/python/astra/data2d.py
@@ -1,8 +1,8 @@
# -----------------------------------------------------------------------
-# Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp
-# 2013-2016, CWI, Amsterdam
+# Copyright: 2010-2018, imec Vision Lab, University of Antwerp
+# 2013-2018, CWI, Amsterdam
#
-# Contact: astra@uantwerpen.be
+# Contact: astra@astra-toolbox.com
# Website: http://www.astra-toolbox.com/
#
# This file is part of the ASTRA Toolbox.
diff --git a/python/astra/data2d_c.pyx b/python/astra/data2d_c.pyx
index 9c88073..d33581a 100644
--- a/python/astra/data2d_c.pyx
+++ b/python/astra/data2d_c.pyx
@@ -1,8 +1,8 @@
# -----------------------------------------------------------------------
-# Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp
-# 2013-2016, CWI, Amsterdam
+# Copyright: 2010-2018, imec Vision Lab, University of Antwerp
+# 2013-2018, CWI, Amsterdam
#
-# Contact: astra@uantwerpen.be
+# Contact: astra@astra-toolbox.com
# Website: http://www.astra-toolbox.com/
#
# This file is part of the ASTRA Toolbox.
@@ -111,6 +111,8 @@ def create(datatype, geometry, data=None, link=False):
ppGeometry = <CProjectionGeometry2D * >new CFanFlatProjectionGeometry2D()
elif (tpe == 'fanflat_vec'):
ppGeometry = <CProjectionGeometry2D * >new CFanFlatVecProjectionGeometry2D()
+ elif (tpe == 'parallel_vec'):
+ ppGeometry = <CProjectionGeometry2D * >new CParallelVecProjectionGeometry2D()
else:
ppGeometry = <CProjectionGeometry2D * >new CParallelProjectionGeometry2D()
if not ppGeometry.initialize(cfg[0]):
@@ -225,6 +227,8 @@ def change_geometry(i, geom):
ppGeometry = <CProjectionGeometry2D * >new CFanFlatProjectionGeometry2D()
elif (tpe == 'fanflat_vec'):
ppGeometry = <CProjectionGeometry2D * >new CFanFlatVecProjectionGeometry2D()
+ elif (tpe == 'parallel_vec'):
+ ppGeometry = <CProjectionGeometry2D * >new CParallelVecProjectionGeometry2D()
else:
ppGeometry = <CProjectionGeometry2D * >new CParallelProjectionGeometry2D()
if not ppGeometry.initialize(cfg[0]):
diff --git a/python/astra/data3d.py b/python/astra/data3d.py
index ecb99d0..b0d54b2 100644
--- a/python/astra/data3d.py
+++ b/python/astra/data3d.py
@@ -1,8 +1,8 @@
# -----------------------------------------------------------------------
-# Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp
-# 2013-2016, CWI, Amsterdam
+# Copyright: 2010-2018, imec Vision Lab, University of Antwerp
+# 2013-2018, CWI, Amsterdam
#
-# Contact: astra@uantwerpen.be
+# Contact: astra@astra-toolbox.com
# Website: http://www.astra-toolbox.com/
#
# This file is part of the ASTRA Toolbox.
diff --git a/python/astra/data3d_c.pyx b/python/astra/data3d_c.pyx
index 897634b..d4073ea 100644
--- a/python/astra/data3d_c.pyx
+++ b/python/astra/data3d_c.pyx
@@ -1,8 +1,8 @@
# -----------------------------------------------------------------------
-# Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp
-# 2013-2016, CWI, Amsterdam
+# Copyright: 2010-2018, imec Vision Lab, University of Antwerp
+# 2013-2018, CWI, Amsterdam
#
-# Contact: astra@uantwerpen.be
+# Contact: astra@astra-toolbox.com
# Website: http://www.astra-toolbox.com/
#
# This file is part of the ASTRA Toolbox.
diff --git a/python/astra/experimental.pyx b/python/astra/experimental.pyx
index 80dae9a..b1e3567 100644
--- a/python/astra/experimental.pyx
+++ b/python/astra/experimental.pyx
@@ -1,8 +1,8 @@
# -----------------------------------------------------------------------
-# Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp
-# 2013-2016, CWI, Amsterdam
+# Copyright: 2010-2018, imec Vision Lab, University of Antwerp
+# 2013-2018, CWI, Amsterdam
#
-# Contact: astra@uantwerpen.be
+# Contact: astra@astra-toolbox.com
# Website: http://www.astra-toolbox.com/
#
# This file is part of the ASTRA Toolbox.
diff --git a/python/astra/extrautils.pyx b/python/astra/extrautils.pyx
index 248c6ee..2508865 100644
--- a/python/astra/extrautils.pyx
+++ b/python/astra/extrautils.pyx
@@ -1,8 +1,8 @@
# -----------------------------------------------------------------------
-# Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp
-# 2013-2016, CWI, Amsterdam
+# Copyright: 2010-2018, imec Vision Lab, University of Antwerp
+# 2013-2018, CWI, Amsterdam
#
-# Contact: astra@uantwerpen.be
+# Contact: astra@astra-toolbox.com
# Website: http://www.astra-toolbox.com/
#
# This file is part of the ASTRA Toolbox.
diff --git a/python/astra/functions.py b/python/astra/functions.py
index 7277de5..853c0b9 100644
--- a/python/astra/functions.py
+++ b/python/astra/functions.py
@@ -1,8 +1,8 @@
# -----------------------------------------------------------------------
-# Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp
-# 2013-2016, CWI, Amsterdam
+# Copyright: 2010-2018, imec Vision Lab, University of Antwerp
+# 2013-2018, CWI, Amsterdam
#
-# Contact: astra@uantwerpen.be
+# Contact: astra@astra-toolbox.com
# Website: http://www.astra-toolbox.com/
#
# This file is part of the ASTRA Toolbox.
@@ -172,7 +172,27 @@ def geom_2vec(proj_geom):
:param proj_geom: Projection geometry to convert
:type proj_geom: :class:`dict`
"""
- if proj_geom['type'] == 'fanflat':
+
+ if proj_geom['type'] == 'parallel':
+ angles = proj_geom['ProjectionAngles']
+ vectors = np.zeros((len(angles), 6))
+ for i in range(len(angles)):
+
+ # source
+ vectors[i, 0] = np.sin(angles[i])
+ vectors[i, 1] = -np.cos(angles[i])
+
+ # center of detector
+ vectors[i, 2] = 0
+ vectors[i, 3] = 0
+
+ # vector from detector pixel 0 to 1
+ vectors[i, 4] = np.cos(angles[i]) * proj_geom['DetectorWidth']
+ vectors[i, 5] = np.sin(angles[i]) * proj_geom['DetectorWidth']
+ proj_geom_out = ac.create_proj_geom(
+ 'parallel_vec', proj_geom['DetectorCount'], vectors)
+
+ elif proj_geom['type'] == 'fanflat':
angles = proj_geom['ProjectionAngles']
vectors = np.zeros((len(angles), 6))
for i in range(len(angles)):
@@ -251,3 +271,38 @@ def geom_2vec(proj_geom):
raise ValueError(
'No suitable vector geometry found for type: ' + proj_geom['type'])
return proj_geom_out
+
+
+def geom_postalignment(proj_geom, factor):
+ """Apply a postalignment to a vector-based projection geometry.
+ Can be used to model the rotation axis offset.
+
+ For 2D geometries, the argument factor is a single float specifying the
+ distance to shift the detector (measured in detector pixels).
+
+ For 3D geometries, factor can be a pair of floats specifying the horizontal
+ resp. vertical distances to shift the detector. If only a single float
+ is specified, this is treated as a horizontal shift.
+
+ :param proj_geom: input projection geometry
+ :type proj_geom: :class:`dict`
+ :param factor: number of pixels to shift the detector
+ :type factor: :class:`float`
+ """
+
+ proj_geom = geom_2vec(proj_geom)
+
+ if proj_geom['type'] == 'parallel_vec' or proj_geom['type'] == 'fanflat_vec':
+ V = proj_geom['Vectors']
+ V[:,2:4] = V[:,2:4] + factor * V[:,4:6]
+
+ elif proj_geom['type'] == 'parallel3d_vec' or proj_geom['type'] == 'cone_vec':
+ V = proj_geom['Vectors']
+ V[:,3:6] = V[:,3:6] + factor[0] * V[:,6:9]
+ if len(factor) > 1:
+ V[:,3:6] = V[:,3:6] + factor[1] * V[:,9:12]
+ else:
+ raise RuntimeError('No suitable geometry for postalignment: ' + proj_geom['type'])
+
+ return proj_geom
+
diff --git a/python/astra/log.py b/python/astra/log.py
index a54ed08..28e9bad 100644
--- a/python/astra/log.py
+++ b/python/astra/log.py
@@ -1,8 +1,8 @@
# -----------------------------------------------------------------------
-# Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp
-# 2013-2016, CWI, Amsterdam
+# Copyright: 2010-2018, imec Vision Lab, University of Antwerp
+# 2013-2018, CWI, Amsterdam
#
-# Contact: astra@uantwerpen.be
+# Contact: astra@astra-toolbox.com
# Website: http://www.astra-toolbox.com/
#
# This file is part of the ASTRA Toolbox.
diff --git a/python/astra/log_c.pyx b/python/astra/log_c.pyx
index 0757d0c..7701667 100644
--- a/python/astra/log_c.pyx
+++ b/python/astra/log_c.pyx
@@ -1,8 +1,8 @@
# -----------------------------------------------------------------------
-# Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp
-# 2013-2016, CWI, Amsterdam
+# Copyright: 2010-2018, imec Vision Lab, University of Antwerp
+# 2013-2018, CWI, Amsterdam
#
-# Contact: astra@uantwerpen.be
+# Contact: astra@astra-toolbox.com
# Website: http://www.astra-toolbox.com/
#
# This file is part of the ASTRA Toolbox.
diff --git a/python/astra/matlab.py b/python/astra/matlab.py
index c96931e..df1135c 100644
--- a/python/astra/matlab.py
+++ b/python/astra/matlab.py
@@ -1,8 +1,8 @@
# -----------------------------------------------------------------------
-# Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp
-# 2013-2016, CWI, Amsterdam
+# Copyright: 2010-2018, imec Vision Lab, University of Antwerp
+# 2013-2018, CWI, Amsterdam
#
-# Contact: astra@uantwerpen.be
+# Contact: astra@astra-toolbox.com
# Website: http://www.astra-toolbox.com/
#
# This file is part of the ASTRA Toolbox.
diff --git a/python/astra/matrix.py b/python/astra/matrix.py
index eeb873c..a097142 100644
--- a/python/astra/matrix.py
+++ b/python/astra/matrix.py
@@ -1,8 +1,8 @@
# -----------------------------------------------------------------------
-# Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp
-# 2013-2016, CWI, Amsterdam
+# Copyright: 2010-2018, imec Vision Lab, University of Antwerp
+# 2013-2018, CWI, Amsterdam
#
-# Contact: astra@uantwerpen.be
+# Contact: astra@astra-toolbox.com
# Website: http://www.astra-toolbox.com/
#
# This file is part of the ASTRA Toolbox.
diff --git a/python/astra/matrix_c.pyx b/python/astra/matrix_c.pyx
index ba20b10..5c56233 100644
--- a/python/astra/matrix_c.pyx
+++ b/python/astra/matrix_c.pyx
@@ -1,8 +1,8 @@
# -----------------------------------------------------------------------
-# Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp
-# 2013-2016, CWI, Amsterdam
+# Copyright: 2010-2018, imec Vision Lab, University of Antwerp
+# 2013-2018, CWI, Amsterdam
#
-# Contact: astra@uantwerpen.be
+# Contact: astra@astra-toolbox.com
# Website: http://www.astra-toolbox.com/
#
# This file is part of the ASTRA Toolbox.
diff --git a/python/astra/optomo.py b/python/astra/optomo.py
index 74f34e5..ff67791 100644
--- a/python/astra/optomo.py
+++ b/python/astra/optomo.py
@@ -1,8 +1,8 @@
# -----------------------------------------------------------------------
-# Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp
-# 2013-2016, CWI, Amsterdam
+# Copyright: 2010-2018, imec Vision Lab, University of Antwerp
+# 2013-2018, CWI, Amsterdam
#
-# Contact: astra@uantwerpen.be
+# Contact: astra@astra-toolbox.com
# Website: http://www.astra-toolbox.com/
#
# This file is part of the ASTRA Toolbox.
diff --git a/python/astra/plugin.py b/python/astra/plugin.py
index 56c2761..0ef701e 100644
--- a/python/astra/plugin.py
+++ b/python/astra/plugin.py
@@ -1,8 +1,8 @@
# -----------------------------------------------------------------------
-# Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp
-# 2013-2016, CWI, Amsterdam
+# Copyright: 2010-2018, imec Vision Lab, University of Antwerp
+# 2013-2018, CWI, Amsterdam
#
-# Contact: astra@uantwerpen.be
+# Contact: astra@astra-toolbox.com
# Website: http://www.astra-toolbox.com/
#
# This file is part of the ASTRA Toolbox.
diff --git a/python/astra/plugin_c.pyx b/python/astra/plugin_c.pyx
index 3853cec..dcc22e9 100644
--- a/python/astra/plugin_c.pyx
+++ b/python/astra/plugin_c.pyx
@@ -1,8 +1,8 @@
# -----------------------------------------------------------------------
-# Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp
-# 2013-2016, CWI, Amsterdam
+# Copyright: 2010-2018, imec Vision Lab, University of Antwerp
+# 2013-2018, CWI, Amsterdam
#
-# Contact: astra@uantwerpen.be
+# Contact: astra@astra-toolbox.com
# Website: http://www.astra-toolbox.com/
#
# This file is part of the ASTRA Toolbox.
diff --git a/python/astra/plugins/__init__.py b/python/astra/plugins/__init__.py
index 88a68cb..0f66907 100644
--- a/python/astra/plugins/__init__.py
+++ b/python/astra/plugins/__init__.py
@@ -1,8 +1,8 @@
# -----------------------------------------------------------------------
-# Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp
-# 2013-2016, CWI, Amsterdam
+# Copyright: 2010-2018, imec Vision Lab, University of Antwerp
+# 2013-2018, CWI, Amsterdam
#
-# Contact: astra@uantwerpen.be
+# Contact: astra@astra-toolbox.com
# Website: http://www.astra-toolbox.com/
#
# This file is part of the ASTRA Toolbox.
diff --git a/python/astra/plugins/cgls.py b/python/astra/plugins/cgls.py
index 5268f51..30fe8e6 100644
--- a/python/astra/plugins/cgls.py
+++ b/python/astra/plugins/cgls.py
@@ -1,8 +1,8 @@
# -----------------------------------------------------------------------
-# Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp
-# 2013-2016, CWI, Amsterdam
+# Copyright: 2010-2018, imec Vision Lab, University of Antwerp
+# 2013-2018, CWI, Amsterdam
#
-# Contact: astra@uantwerpen.be
+# Contact: astra@astra-toolbox.com
# Website: http://www.astra-toolbox.com/
#
# This file is part of the ASTRA Toolbox.
diff --git a/python/astra/plugins/sirt.py b/python/astra/plugins/sirt.py
index 5238399..c5a8d90 100644
--- a/python/astra/plugins/sirt.py
+++ b/python/astra/plugins/sirt.py
@@ -1,8 +1,8 @@
# -----------------------------------------------------------------------
-# Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp
-# 2013-2016, CWI, Amsterdam
+# Copyright: 2010-2018, imec Vision Lab, University of Antwerp
+# 2013-2018, CWI, Amsterdam
#
-# Contact: astra@uantwerpen.be
+# Contact: astra@astra-toolbox.com
# Website: http://www.astra-toolbox.com/
#
# This file is part of the ASTRA Toolbox.
diff --git a/python/astra/projector.py b/python/astra/projector.py
index 878e011..2fcb889 100644
--- a/python/astra/projector.py
+++ b/python/astra/projector.py
@@ -1,8 +1,8 @@
# -----------------------------------------------------------------------
-# Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp
-# 2013-2016, CWI, Amsterdam
+# Copyright: 2010-2018, imec Vision Lab, University of Antwerp
+# 2013-2018, CWI, Amsterdam
#
-# Contact: astra@uantwerpen.be
+# Contact: astra@astra-toolbox.com
# Website: http://www.astra-toolbox.com/
#
# This file is part of the ASTRA Toolbox.
diff --git a/python/astra/projector3d.py b/python/astra/projector3d.py
index 9befa3f..4d474c3 100644
--- a/python/astra/projector3d.py
+++ b/python/astra/projector3d.py
@@ -1,8 +1,8 @@
# -----------------------------------------------------------------------
-# Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp
-# 2013-2016, CWI, Amsterdam
+# Copyright: 2010-2018, imec Vision Lab, University of Antwerp
+# 2013-2018, CWI, Amsterdam
#
-# Contact: astra@uantwerpen.be
+# Contact: astra@astra-toolbox.com
# Website: http://www.astra-toolbox.com/
#
# This file is part of the ASTRA Toolbox.
diff --git a/python/astra/projector3d_c.pyx b/python/astra/projector3d_c.pyx
index 7184535..53d7113 100644
--- a/python/astra/projector3d_c.pyx
+++ b/python/astra/projector3d_c.pyx
@@ -1,8 +1,8 @@
# -----------------------------------------------------------------------
-# Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp
-# 2013-2016, CWI, Amsterdam
+# Copyright: 2010-2018, imec Vision Lab, University of Antwerp
+# 2013-2018, CWI, Amsterdam
#
-# Contact: astra@uantwerpen.be
+# Contact: astra@astra-toolbox.com
# Website: http://www.astra-toolbox.com/
#
# This file is part of the ASTRA Toolbox.
diff --git a/python/astra/projector_c.pyx b/python/astra/projector_c.pyx
index ddd59a5..62225dc 100644
--- a/python/astra/projector_c.pyx
+++ b/python/astra/projector_c.pyx
@@ -1,8 +1,8 @@
# -----------------------------------------------------------------------
-# Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp
-# 2013-2016, CWI, Amsterdam
+# Copyright: 2010-2018, imec Vision Lab, University of Antwerp
+# 2013-2018, CWI, Amsterdam
#
-# Contact: astra@uantwerpen.be
+# Contact: astra@astra-toolbox.com
# Website: http://www.astra-toolbox.com/
#
# This file is part of the ASTRA Toolbox.
diff --git a/python/astra/pythonutils.py b/python/astra/pythonutils.py
index 27fa8fd..715df30 100644
--- a/python/astra/pythonutils.py
+++ b/python/astra/pythonutils.py
@@ -1,8 +1,8 @@
# -----------------------------------------------------------------------
-# Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp
-# 2013-2016, CWI, Amsterdam
+# Copyright: 2010-2018, imec Vision Lab, University of Antwerp
+# 2013-2018, CWI, Amsterdam
#
-# Contact: astra@uantwerpen.be
+# Contact: astra@astra-toolbox.com
# Website: http://www.astra-toolbox.com/
#
# This file is part of the ASTRA Toolbox.
@@ -51,7 +51,7 @@ def geom_size(geom, dim=None):
elif geom['type'] == 'parallel3d' or geom['type'] == 'cone':
s = (geom['DetectorRowCount'], len(
geom['ProjectionAngles']), geom['DetectorColCount'])
- elif geom['type'] == 'fanflat_vec':
+ elif geom['type'] == 'fanflat_vec' or geom['type'] == 'parallel_vec':
s = (geom['Vectors'].shape[0], geom['DetectorCount'])
elif geom['type'] == 'parallel3d_vec' or geom['type'] == 'cone_vec':
s = (geom['DetectorRowCount'], geom[
diff --git a/python/astra/src/PythonPluginAlgorithm.cpp b/python/astra/src/PythonPluginAlgorithm.cpp
index 69b3d06..d461f06 100644
--- a/python/astra/src/PythonPluginAlgorithm.cpp
+++ b/python/astra/src/PythonPluginAlgorithm.cpp
@@ -1,9 +1,9 @@
/*
-----------------------------------------------------------------------
-Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp
- 2014-2016, CWI, Amsterdam
+Copyright: 2010-2016, imec Vision Lab, University of Antwerp
+ 2014-2018, CWI, Amsterdam
-Contact: astra@uantwerpen.be
+Contact: astra@astra-toolbox.com
Website: http://www.astra-toolbox.com/
This file is part of the ASTRA Toolbox.
diff --git a/python/astra/src/PythonPluginAlgorithm.h b/python/astra/src/PythonPluginAlgorithm.h
index dacd0e4..947e30d 100644
--- a/python/astra/src/PythonPluginAlgorithm.h
+++ b/python/astra/src/PythonPluginAlgorithm.h
@@ -1,9 +1,9 @@
/*
-----------------------------------------------------------------------
-Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp
- 2014-2016, CWI, Amsterdam
+Copyright: 2010-2018, imec Vision Lab, University of Antwerp
+ 2014-2018, CWI, Amsterdam
-Contact: astra@uantwerpen.be
+Contact: astra@astra-toolbox.com
Website: http://www.astra-toolbox.com/
This file is part of the ASTRA Toolbox.
diff --git a/python/astra/tests.py b/python/astra/tests.py
index 32afd36..0d67521 100644
--- a/python/astra/tests.py
+++ b/python/astra/tests.py
@@ -1,8 +1,8 @@
# -----------------------------------------------------------------------
-# Copyright: 2010-2017, iMinds-Vision Lab, University of Antwerp
-# 2013-2017, CWI, Amsterdam
+# Copyright: 2010-2018, imec Vision Lab, University of Antwerp
+# 2013-2018, CWI, Amsterdam
#
-# Contact: astra@uantwerpen.be
+# Contact: astra@astra-toolbox.com
# Website: http://www.astra-toolbox.com/
#
# This file is part of the ASTRA Toolbox.
@@ -95,3 +95,13 @@ def test_CUDA():
ok3 = _basic_par3d_cuda()
if not (ok1 and ok2 and ok3):
raise RuntimeError("Test failed")
+
+def test():
+ """Perform a very basic functionality test"""
+
+ import astra
+ if astra.use_cuda():
+ test_CUDA()
+ else:
+ print("No GPU support available")
+ test_noCUDA()
diff --git a/python/astra/utils.pxd b/python/astra/utils.pxd
index 695081f..e91ed98 100644
--- a/python/astra/utils.pxd
+++ b/python/astra/utils.pxd
@@ -1,8 +1,8 @@
# -----------------------------------------------------------------------
-# Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp
-# 2013-2016, CWI, Amsterdam
+# Copyright: 2010-2018, imec Vision Lab, University of Antwerp
+# 2013-2018, CWI, Amsterdam
#
-# Contact: astra@uantwerpen.be
+# Contact: astra@astra-toolbox.com
# Website: http://www.astra-toolbox.com/
#
# This file is part of the ASTRA Toolbox.
diff --git a/python/astra/utils.pyx b/python/astra/utils.pyx
index bcff6c3..46be462 100644
--- a/python/astra/utils.pyx
+++ b/python/astra/utils.pyx
@@ -1,8 +1,8 @@
# -----------------------------------------------------------------------
-# Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp
-# 2013-2016, CWI, Amsterdam
+# Copyright: 2010-2018, imec Vision Lab, University of Antwerp
+# 2013-2018, CWI, Amsterdam
#
-# Contact: astra@uantwerpen.be
+# Contact: astra@astra-toolbox.com
# Website: http://www.astra-toolbox.com/
#
# This file is part of the ASTRA Toolbox.
diff --git a/python/builder.py b/python/builder.py
index 310f3c3..dd99633 100644
--- a/python/builder.py
+++ b/python/builder.py
@@ -1,8 +1,8 @@
# -----------------------------------------------------------------------
-# Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp
-# 2013-2016, CWI, Amsterdam
+# Copyright: 2010-2018, imec Vision Lab, University of Antwerp
+# 2013-2018, CWI, Amsterdam
#
-# Contact: astra@uantwerpen.be
+# Contact: astra@astra-toolbox.com
# Website: http://www.astra-toolbox.com/
#
# This file is part of the ASTRA Toolbox.