From 20f329a7a38cd02586ef305d551d288ebcf39501 Mon Sep 17 00:00:00 2001 From: "Daniel M. Pelt" Date: Wed, 4 Mar 2015 13:44:03 +0100 Subject: Also clean up generated Cython files during `make clean` --- build/linux/Makefile.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build/linux/Makefile.in b/build/linux/Makefile.in index cd5e74b..92697b2 100644 --- a/build/linux/Makefile.in +++ b/build/linux/Makefile.in @@ -303,6 +303,8 @@ clean: rm -f $(TEST_OBJECTS) test.bin rm -fr ../../python/finalbuild/ rm -fr ../../python/build/ + rm -f ../../python/astra/*.cpp + rm -f ../../python/astra/*.c distclean: clean rm -f config.guess config.sub ltmain.sh libtool install-sh -- cgit v1.2.3 From 8a1001f236cc0d31d24c250e6eb1f0cd1c419ebc Mon Sep 17 00:00:00 2001 From: "Daniel M. Pelt" Date: Thu, 5 Mar 2015 12:22:52 +0100 Subject: Force clang to use libstdc++ on OSX (fixes Cython compilation) --- build/linux/Makefile.in | 2 ++ build/linux/configure.ac | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/build/linux/Makefile.in b/build/linux/Makefile.in index 92697b2..2d62a17 100644 --- a/build/linux/Makefile.in +++ b/build/linux/Makefile.in @@ -32,6 +32,8 @@ CXXFLAGS+=-g -O3 -Wall -Wshadow LIBS+=-lpthread LDFLAGS+=-g +CPPFLAGS+=@CPPFLAGS_OS@ + ifeq ($(cuda),yes) CPPFLAGS += @CPPFLAGS_CUDA@ -DASTRA_CUDA NVCCFLAGS = @NVCCFLAGS@ @CPPFLAGS_CUDA@ -I../.. -I../../include -DASTRA_CUDA diff --git a/build/linux/configure.ac b/build/linux/configure.ac index b97a7a0..129079c 100644 --- a/build/linux/configure.ac +++ b/build/linux/configure.ac @@ -208,6 +208,19 @@ fi AC_SUBST(HAVEPYTHON) +#OS specific setup +AC_CANONICAL_HOST +case $host_os in + darwin* ) + CPPFLAGS_OS="-stdlib=libstdc++ -mmacosx-version-min=10.6" + ;; + *) + CPPFLAGS_OS="" + ;; +esac + +AC_SUBST(CPPFLAGS_OS) + # TODO: -- cgit v1.2.3 From 495512324b84a75782f9fbc11921668ad9c170a9 Mon Sep 17 00:00:00 2001 From: "Daniel M. Pelt" Date: Thu, 5 Mar 2015 15:19:43 +0100 Subject: Added Python support for CUDA projectors --- python/astra/ASTRAProjector.py | 9 +-- python/astra/PyIncludes.pxd | 16 +++++ python/astra/PyProjector3DFactory.pxd | 35 ++++++++++ python/astra/PyProjector3DManager.pxd | 39 +++++++++++ python/astra/__init__.py | 1 + python/astra/creators.py | 66 +++++++------------ python/astra/projector.py | 30 ++++++--- python/astra/projector3d.py | 100 ++++++++++++++++++++++++++++ python/astra/projector3d_c.pyx | 119 ++++++++++++++++++++++++++++++++++ python/astra/projector_c.pyx | 17 +++++ 10 files changed, 375 insertions(+), 57 deletions(-) create mode 100644 python/astra/PyProjector3DFactory.pxd create mode 100644 python/astra/PyProjector3DManager.pxd create mode 100644 python/astra/projector3d.py create mode 100644 python/astra/projector3d_c.pyx diff --git a/python/astra/ASTRAProjector.py b/python/astra/ASTRAProjector.py index 96acb10..f282618 100644 --- a/python/astra/ASTRAProjector.py +++ b/python/astra/ASTRAProjector.py @@ -70,11 +70,9 @@ class ASTRAProjector2D(object): :type vol_geom: :class:`dict` :param proj_type: Projector type, such as ``'line'``, ``'linear'``, ... :type proj_type: :class:`string` - :param useCUDA: If ``True``, use CUDA for calculations, when possible. - :type useCUDA: :class:`bool` """ - def __init__(self, proj_geom, vol_geom, proj_type, useCUDA=False): + def __init__(self, proj_geom, vol_geom, proj_type): self.vol_geom = vol_geom self.recSize = vol_geom['GridColCount'] self.angles = proj_geom['ProjectionAngles'] @@ -84,7 +82,6 @@ class ASTRAProjector2D(object): self.nProj = self.angles.shape[0] self.proj_geom = proj_geom self.proj_id = ac.create_projector(proj_type, proj_geom, vol_geom) - self.useCUDA = useCUDA self.T = ASTRAProjector2DTranspose(self) def backProject(self, data): @@ -96,7 +93,7 @@ class ASTRAProjector2D(object): """ vol_id, vol = ac.create_backprojection( - data, self.proj_id, useCUDA=self.useCUDA, returnData=True) + data, self.proj_id, returnData=True) data2d.delete(vol_id) return vol @@ -108,7 +105,7 @@ class ASTRAProjector2D(object): :returns: :class:`numpy.ndarray` -- The forward projection. """ - sin_id, sino = ac.create_sino(data, self.proj_id, useCUDA=self.useCUDA, returnData=True) + sin_id, sino = ac.create_sino(data, self.proj_id, returnData=True) data2d.delete(sin_id) return sino diff --git a/python/astra/PyIncludes.pxd b/python/astra/PyIncludes.pxd index 434546a..7df02c5 100644 --- a/python/astra/PyIncludes.pxd +++ b/python/astra/PyIncludes.pxd @@ -27,6 +27,8 @@ from libcpp cimport bool from libcpp.string cimport string from .PyXMLDocument cimport XMLNode +include "config.pxi" + cdef extern from "astra/Globals.h" namespace "astra": ctypedef float float32 ctypedef double float64 @@ -150,6 +152,20 @@ cdef extern from "astra/Projector2D.h" namespace "astra": CVolumeGeometry2D* getVolumeGeometry() CSparseMatrix* getMatrix() +cdef extern from "astra/Projector3D.h" namespace "astra": + cdef cppclass CProjector3D: + bool isInitialized() + CProjectionGeometry3D* getProjectionGeometry() + CVolumeGeometry3D* getVolumeGeometry() + +IF HAVE_CUDA==True: + cdef extern from "astra/CudaProjector3D.h" namespace "astra": + cdef cppclass CCudaProjector3D + + cdef extern from "astra/CudaProjector2D.h" namespace "astra": + cdef cppclass CCudaProjector2D + + cdef extern from "astra/SparseMatrix.h" namespace "astra": cdef cppclass CSparseMatrix: CSparseMatrix(unsigned int,unsigned int,unsigned long) diff --git a/python/astra/PyProjector3DFactory.pxd b/python/astra/PyProjector3DFactory.pxd new file mode 100644 index 0000000..bcbce94 --- /dev/null +++ b/python/astra/PyProjector3DFactory.pxd @@ -0,0 +1,35 @@ +#----------------------------------------------------------------------- +#Copyright 2013 Centrum Wiskunde & Informatica, Amsterdam +# +#Author: Daniel M. Pelt +#Contact: D.M.Pelt@cwi.nl +#Website: http://dmpelt.github.io/pyastratoolbox/ +# +# +#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 +#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. +# +#The Python interface to 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 . +# +#----------------------------------------------------------------------- +from libcpp.string cimport string +from libcpp cimport bool +from .PyIncludes cimport * + +cdef extern from "astra/AstraObjectFactory.h" namespace "astra": + cdef cppclass CProjector3DFactory: + CProjector3D *create(Config) + +cdef extern from "astra/AstraObjectFactory.h" namespace "astra::CProjector3DFactory": + cdef CProjector3DFactory* getSingletonPtr() diff --git a/python/astra/PyProjector3DManager.pxd b/python/astra/PyProjector3DManager.pxd new file mode 100644 index 0000000..b1eac6b --- /dev/null +++ b/python/astra/PyProjector3DManager.pxd @@ -0,0 +1,39 @@ +#----------------------------------------------------------------------- +#Copyright 2013 Centrum Wiskunde & Informatica, Amsterdam +# +#Author: Daniel M. Pelt +#Contact: D.M.Pelt@cwi.nl +#Website: http://dmpelt.github.io/pyastratoolbox/ +# +# +#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 +#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. +# +#The Python interface to 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 . +# +#----------------------------------------------------------------------- +from libcpp.string cimport string + +from .PyIncludes cimport * + +cdef extern from "astra/AstraObjectManager.h" namespace "astra": + cdef cppclass CProjector3DManager: + string info() + void clear() + void remove(int i) + int store(CProjector3D *) + CProjector3D * get(int i) + +cdef extern from "astra/AstraObjectManager.h" namespace "astra::CProjector3DManager": + cdef CProjector3DManager* getSingletonPtr() diff --git a/python/astra/__init__.py b/python/astra/__init__.py index a61aafc..c249c01 100644 --- a/python/astra/__init__.py +++ b/python/astra/__init__.py @@ -33,6 +33,7 @@ from . import astra from . import data3d from . import algorithm from . import projector +from . import projector3d from . import matrix import os diff --git a/python/astra/creators.py b/python/astra/creators.py index 9aba464..2e2dc71 100644 --- a/python/astra/creators.py +++ b/python/astra/creators.py @@ -30,15 +30,16 @@ import math from . import data2d from . import data3d from . import projector +from . import projector3d from . import algorithm def astra_dict(intype): """Creates a dict to use with the ASTRA Toolbox. - + :param intype: Type of the ASTRA object. :type intype: :class:`string` :returns: :class:`dict` -- An ASTRA dict of type ``intype``. - + """ if intype == 'SIRT_CUDA2': intype = 'SIRT_CUDA' @@ -255,25 +256,23 @@ This method can be called in a number of ways: raise Exception('not enough variables: astra_create_proj_geom(parallel3d_vec, det_row_count, det_col_count, V)') if not args[2].shape[1] == 12: raise Exception('V should be a Nx12 matrix, with N the number of projections') - return {'type': 'parallel3d_vec','DetectorRowCount':args[0],'DetectorColCount':args[1],'Vectors':args[2]} + return {'type': 'parallel3d_vec','DetectorRowCount':args[0],'DetectorColCount':args[1],'Vectors':args[2]} elif intype == 'sparse_matrix': if len(args) < 4: raise Exception( 'not enough variables: astra_create_proj_geom(sparse_matrix, det_width, det_count, angles, matrix_id)') return {'type': 'sparse_matrix', 'DetectorWidth': args[0], 'DetectorCount': args[1], 'ProjectionAngles': args[2], 'MatrixID': args[3]} else: - raise Exception('Error: unknown type ' + intype) + raise Exception('Error: unknown type ' + intype) -def create_backprojection(data, proj_id, useCUDA=False, returnData=True): +def create_backprojection(data, proj_id, returnData=True): """Create a backprojection of a sinogram (2D). :param data: Sinogram data or ID. :type data: :class:`numpy.ndarray` or :class:`int` :param proj_id: ID of the projector to use. :type proj_id: :class:`int` -:param useCUDA: If ``True``, use CUDA for the calculation. -:type useCUDA: :class:`bool` :param returnData: If False, only return the ID of the backprojection. :type returnData: :class:`bool` :returns: :class:`int` or (:class:`int`, :class:`numpy.ndarray`) -- If ``returnData=False``, returns the ID of the backprojection. Otherwise, returns a tuple containing the ID of the backprojection and the backprojection itself, in that order. @@ -287,13 +286,13 @@ def create_backprojection(data, proj_id, useCUDA=False, returnData=True): sino_id = data vol_id = data2d.create('-vol', vol_geom, 0) - algString = 'BP' - if useCUDA: - algString = algString + '_CUDA' + if projector.is_cuda(proj_id): + algString = 'BP_CUDA' + else: + algString = 'BP' cfg = astra_dict(algString) - if not useCUDA: - cfg['ProjectorId'] = proj_id + cfg['ProjectorId'] = proj_id cfg['ProjectionDataId'] = sino_id cfg['ReconstructionDataId'] = vol_id alg_id = algorithm.create(cfg) @@ -345,20 +344,13 @@ def create_backprojection3d_gpu(data, proj_geom, vol_geom, returnData=True): return vol_id -def create_sino(data, proj_id=None, proj_geom=None, vol_geom=None, - useCUDA=False, returnData=True, gpuIndex=None): +def create_sino(data, proj_id, returnData=True, gpuIndex=None): """Create a forward projection of an image (2D). :param data: Image data or ID. :type data: :class:`numpy.ndarray` or :class:`int` :param proj_id: ID of the projector to use. :type proj_id: :class:`int` - :param proj_geom: Projection geometry. - :type proj_geom: :class:`dict` - :param vol_geom: Volume geometry. - :type vol_geom: :class:`dict` - :param useCUDA: If ``True``, use CUDA for the calculation. - :type useCUDA: :class:`bool` :param returnData: If False, only return the ID of the forward projection. :type returnData: :class:`bool` :param gpuIndex: Optional GPU index. @@ -374,31 +366,20 @@ def create_sino(data, proj_id=None, proj_geom=None, vol_geom=None, ``proj_geom`` and ``vol_geom``. If ``proj_id`` is given, then ``proj_geom`` and ``vol_geom`` must be None and vice versa. """ - if proj_id is not None: - proj_geom = projector.projection_geometry(proj_id) - vol_geom = projector.volume_geometry(proj_id) - elif proj_geom is not None and vol_geom is not None: - if not useCUDA: - # We need more parameters to create projector. - raise ValueError( - """A ``proj_id`` is needed when CUDA is not used.""") - else: - raise Exception("""The geometry setup is not defined. - The geometry of setup is defined by ``proj_id`` or with - ``proj_geom`` and ``vol_geom``. If ``proj_id`` is given, then - ``proj_geom`` and ``vol_geom`` must be None and vice versa.""") + proj_geom = projector.projection_geometry(proj_id) + vol_geom = projector.volume_geometry(proj_id) if isinstance(data, np.ndarray): volume_id = data2d.create('-vol', vol_geom, data) else: volume_id = data sino_id = data2d.create('-sino', proj_geom, 0) - algString = 'FP' - if useCUDA: - algString = algString + '_CUDA' + if projector.is_cuda(proj_id): + algString = 'FP_CUDA' + else: + algString = 'FP' cfg = astra_dict(algString) - if not useCUDA: - cfg['ProjectorId'] = proj_id + cfg['ProjectorId'] = proj_id if gpuIndex is not None: cfg['option'] = {'GPUindex': gpuIndex} cfg['ProjectionDataId'] = sino_id @@ -496,8 +477,7 @@ def create_reconstruction(rec_type, proj_id, sinogram, iterations=1, use_mask='n vol_geom = projector.volume_geometry(proj_id) recon_id = data2d.create('-vol', vol_geom, 0) cfg = astra_dict(rec_type) - if not 'CUDA' in rec_type: - cfg['ProjectorId'] = proj_id + cfg['ProjectorId'] = proj_id cfg['ProjectionDataId'] = sino_id cfg['ReconstructionDataId'] = recon_id cfg['options'] = {} @@ -560,4 +540,8 @@ def create_projector(proj_type, proj_geom, vol_geom): cfg = astra_dict(proj_type) cfg['ProjectionGeometry'] = proj_geom cfg['VolumeGeometry'] = vol_geom - return projector.create(cfg) + types3d = ['linear3d', 'linearcone', 'cuda3d'] + if proj_type in types3d: + return projector3d.create(cfg) + else: + return projector.create(cfg) diff --git a/python/astra/projector.py b/python/astra/projector.py index c916c52..e370e5a 100644 --- a/python/astra/projector.py +++ b/python/astra/projector.py @@ -27,21 +27,21 @@ from . import projector_c as p def create(config): """Create projector object. - + :param config: Projector options. :type config: :class:`dict` :returns: :class:`int` -- the ID of the constructed object. - + """ return p.create(config) def delete(ids): """Delete a projector object. - + :param ids: ID or list of ID's to delete. :type ids: :class:`int` or :class:`list` - + """ return p.delete(ids) @@ -57,22 +57,22 @@ def info(): def projection_geometry(i): """Get projection geometry of a projector. - + :param i: ID of projector. :type i: :class:`int` :returns: :class:`dict` -- projection geometry - + """ return p.projection_geometry(i) def volume_geometry(i): """Get volume geometry of a projector. - + :param i: ID of projector. :type i: :class:`int` :returns: :class:`dict` -- volume geometry - + """ return p.volume_geometry(i) @@ -88,13 +88,23 @@ def weights_projection(i, projection_index): def splat(i, row, col): return p.splat(i, row, col) +def is_cuda(i): + """Check whether a projector is a CUDA projector. + + :param i: ID of projector. + :type i: :class:`int` + :returns: :class:`bool` -- True if the projector is a CUDA projector. + + """ + return p.is_cuda(i) + def matrix(i): """Get sparse matrix of a projector. - + :param i: ID of projector. :type i: :class:`int` :returns: :class:`int` -- ID of sparse matrix. - + """ return p.matrix(i) diff --git a/python/astra/projector3d.py b/python/astra/projector3d.py new file mode 100644 index 0000000..d1086b9 --- /dev/null +++ b/python/astra/projector3d.py @@ -0,0 +1,100 @@ +#----------------------------------------------------------------------- +#Copyright 2013 Centrum Wiskunde & Informatica, Amsterdam +# +#Author: Daniel M. Pelt +#Contact: D.M.Pelt@cwi.nl +#Website: http://dmpelt.github.io/pyastratoolbox/ +# +# +#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 +#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. +# +#The Python interface to 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 . +# +#----------------------------------------------------------------------- +from . import projector3d_c as p + +def create(config): + """Create projector object. + + :param config: Projector options. + :type config: :class:`dict` + :returns: :class:`int` -- the ID of the constructed object. + + """ + return p.create(config) + + +def delete(ids): + """Delete a projector object. + + :param ids: ID or list of ID's to delete. + :type ids: :class:`int` or :class:`list` + + """ + return p.delete(ids) + + +def clear(): + """Clear all projector objects.""" + return p.clear() + + +def info(): + """Print info on projector objects in memory.""" + return p.info() + +def projection_geometry(i): + """Get projection geometry of a projector. + + :param i: ID of projector. + :type i: :class:`int` + :returns: :class:`dict` -- projection geometry + + """ + return p.projection_geometry(i) + + +def volume_geometry(i): + """Get volume geometry of a projector. + + :param i: ID of projector. + :type i: :class:`int` + :returns: :class:`dict` -- volume geometry + + """ + return p.volume_geometry(i) + + +def weights_single_ray(i, projection_index, detector_index): + return p.weights_single_ray(i, projection_index, detector_index) + + +def weights_projection(i, projection_index): + return p.weights_projection(i, projection_index) + + +def splat(i, row, col): + return p.splat(i, row, col) + + +def is_cuda(i): + """Check whether a projector is a CUDA projector. + + :param i: ID of projector. + :type i: :class:`int` + :returns: :class:`bool` -- True if the projector is a CUDA projector. + + """ + return p.is_cuda(i) diff --git a/python/astra/projector3d_c.pyx b/python/astra/projector3d_c.pyx new file mode 100644 index 0000000..8b978d7 --- /dev/null +++ b/python/astra/projector3d_c.pyx @@ -0,0 +1,119 @@ +#----------------------------------------------------------------------- +#Copyright 2013 Centrum Wiskunde & Informatica, Amsterdam +# +#Author: Daniel M. Pelt +#Contact: D.M.Pelt@cwi.nl +#Website: http://dmpelt.github.io/pyastratoolbox/ +# +# +#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 +#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. +# +#The Python interface to 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 . +# +#----------------------------------------------------------------------- +# distutils: language = c++ +# distutils: libraries = astra + +import six +from .PyIncludes cimport * + +cimport utils +from .utils import wrap_from_bytes + +cimport PyProjector3DFactory +from .PyProjector3DFactory cimport CProjector3DFactory + +cimport PyProjector3DManager +from .PyProjector3DManager cimport CProjector3DManager + +cimport PyXMLDocument +from .PyXMLDocument cimport XMLDocument + +cdef CProjector3DManager * manProj = PyProjector3DManager.getSingletonPtr() + +include "config.pxi" + +IF HAVE_CUDA: + cdef extern from *: + CCudaProjector3D* dynamic_cast_cuda_projector "dynamic_cast" (CProjector3D*) + + +def create(config): + cdef Config * cfg = utils.dictToConfig(six.b('Projector3D'), config) + cdef CProjector3D * proj + proj = PyProjector3DFactory.getSingletonPtr().create(cfg[0]) + if proj == NULL: + del cfg + raise Exception("Error creating Projector3D.") + del cfg + return manProj.store(proj) + + +def delete(ids): + try: + for i in ids: + manProj.remove(i) + except TypeError: + manProj.remove(ids) + + +def clear(): + manProj.clear() + + +def info(): + six.print_(wrap_from_bytes(manProj.info())) + +cdef CProjector3D * getObject(i) except NULL: + cdef CProjector3D * proj = manProj.get(i) + if proj == NULL: + raise Exception("Projector not initialized.") + if not proj.isInitialized(): + raise Exception("Projector not initialized.") + return proj + + +def projection_geometry(i): + cdef CProjector3D * proj = getObject(i) + return utils.configToDict(proj.getProjectionGeometry().getConfiguration()) + + +def volume_geometry(i): + cdef CProjector3D * proj = getObject(i) + return utils.configToDict(proj.getVolumeGeometry().getConfiguration()) + + +def weights_single_ray(i, projection_index, detector_index): + raise Exception("Not yet implemented") + + +def weights_projection(i, projection_index): + raise Exception("Not yet implemented") + + +def splat(i, row, col): + raise Exception("Not yet implemented") + +def is_cuda(i): + cdef CProjector3D * proj = getObject(i) + IF HAVE_CUDA==True: + cdef CCudaProjector3D * cudaproj = NULL + cudaproj = dynamic_cast_cuda_projector(proj) + if cudaproj==NULL: + return False + else: + return True + ELSE: + return False diff --git a/python/astra/projector_c.pyx b/python/astra/projector_c.pyx index f91a8dd..9aa868e 100644 --- a/python/astra/projector_c.pyx +++ b/python/astra/projector_c.pyx @@ -47,6 +47,12 @@ from .PyMatrixManager cimport CMatrixManager cdef CProjector2DManager * manProj = PyProjector2DManager.getSingletonPtr() cdef CMatrixManager * manM = PyMatrixManager.getSingletonPtr() +include "config.pxi" + +IF HAVE_CUDA: + cdef extern from *: + CCudaProjector2D* dynamic_cast_cuda_projector "dynamic_cast" (CProjector2D*) + def create(config): cdef Config * cfg = utils.dictToConfig(six.b('Projector2D'), config) @@ -104,6 +110,17 @@ def weights_projection(i, projection_index): def splat(i, row, col): raise Exception("Not yet implemented") +def is_cuda(i): + cdef CProjector2D * proj = getObject(i) + IF HAVE_CUDA==True: + cdef CCudaProjector2D * cudaproj = NULL + cudaproj = dynamic_cast_cuda_projector(proj) + if cudaproj==NULL: + return False + else: + return True + ELSE: + return False def matrix(i): cdef CProjector2D * proj = getObject(i) -- cgit v1.2.3 From 1c247ef5576afe401be02e08b974824263f3d61b Mon Sep 17 00:00:00 2001 From: "Daniel M. Pelt" Date: Thu, 5 Mar 2015 15:40:23 +0100 Subject: Avoid Python recompilation during installation --- python/builder.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/python/builder.py b/python/builder.py index ddca795..cfdb7d1 100644 --- a/python/builder.py +++ b/python/builder.py @@ -41,9 +41,22 @@ try: usecuda=True except KeyError: pass -cfg = open('astra/config.pxi','w') -cfg.write('DEF HAVE_CUDA=' + str(usecuda) + "\n") -cfg.close() + +cfgToWrite = 'DEF HAVE_CUDA=' + str(usecuda) + "\n" +cfgHasToBeUpdated = True +try: + cfg = open('astra/config.pxi','r') + cfgIn = cfg.read() + cfg.close() + if cfgIn==cfgToWrite: + cfgHasToBeUpdated = False +except IOError: + pass + +if cfgHasToBeUpdated: + cfg = open('astra/config.pxi','w') + cfg.write(cfgToWrite) + cfg.close() cmdclass = { } ext_modules = [ ] -- cgit v1.2.3 From f603045f5bb41de6bc1ffa93badd932b891f5f1d Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Fri, 6 Mar 2015 10:58:50 +0100 Subject: Adjust docstring and samples to new python create_sino function --- python/astra/creators.py | 4 ---- samples/python/s001_sinogram_par2d.py | 4 ++-- samples/python/s003_gpu_reconstruction.py | 4 ++-- samples/python/s008_gpu_selection.py | 4 ++-- samples/python/s012_masks.py | 4 ++-- samples/python/s013_constraints.py | 4 ++-- samples/python/s014_FBP.py | 4 ++-- samples/python/s015_fp_bp.py | 14 +++++++------- 8 files changed, 19 insertions(+), 23 deletions(-) diff --git a/python/astra/creators.py b/python/astra/creators.py index 2e2dc71..68bc8a2 100644 --- a/python/astra/creators.py +++ b/python/astra/creators.py @@ -361,10 +361,6 @@ def create_sino(data, proj_id, returnData=True, gpuIndex=None): projection. Otherwise, returns a tuple containing the ID of the forward projection and the forward projection itself, in that order. - - The geometry of setup is defined by ``proj_id`` or with - ``proj_geom`` and ``vol_geom``. If ``proj_id`` is given, then - ``proj_geom`` and ``vol_geom`` must be None and vice versa. """ proj_geom = projector.projection_geometry(proj_id) vol_geom = projector.volume_geometry(proj_id) diff --git a/samples/python/s001_sinogram_par2d.py b/samples/python/s001_sinogram_par2d.py index 009d9b3..1d1b912 100644 --- a/samples/python/s001_sinogram_par2d.py +++ b/samples/python/s001_sinogram_par2d.py @@ -43,8 +43,8 @@ P = scipy.io.loadmat('phantom.mat')['phantom256'] # Create a sinogram using the GPU. # Note that the first time the GPU is accessed, there may be a delay # of up to 10 seconds for initialization. -proj_id = astra.create_projector('line',proj_geom,vol_geom) -sinogram_id, sinogram = astra.create_sino(P, proj_id,useCUDA=True) +proj_id = astra.create_projector('cuda',proj_geom,vol_geom) +sinogram_id, sinogram = astra.create_sino(P, proj_id) import pylab pylab.gray() diff --git a/samples/python/s003_gpu_reconstruction.py b/samples/python/s003_gpu_reconstruction.py index 4f6ec1f..07b38ef 100644 --- a/samples/python/s003_gpu_reconstruction.py +++ b/samples/python/s003_gpu_reconstruction.py @@ -33,8 +33,8 @@ proj_geom = astra.create_proj_geom('parallel', 1.0, 384, np.linspace(0,np.pi,180 # As before, create a sinogram from a phantom import scipy.io P = scipy.io.loadmat('phantom.mat')['phantom256'] -proj_id = astra.create_projector('line',proj_geom,vol_geom) -sinogram_id, sinogram = astra.create_sino(P, proj_id,useCUDA=True) +proj_id = astra.create_projector('cuda',proj_geom,vol_geom) +sinogram_id, sinogram = astra.create_sino(P, proj_id) import pylab pylab.gray() diff --git a/samples/python/s008_gpu_selection.py b/samples/python/s008_gpu_selection.py index c42e53b..a180802 100644 --- a/samples/python/s008_gpu_selection.py +++ b/samples/python/s008_gpu_selection.py @@ -32,10 +32,10 @@ proj_geom = astra.create_proj_geom('parallel', 1.0, 384, np.linspace(0,np.pi,180 import scipy.io P = scipy.io.loadmat('phantom.mat')['phantom256'] -proj_id = astra.create_projector('line',proj_geom,vol_geom) +proj_id = astra.create_projector('cuda',proj_geom,vol_geom) # Create a sinogram from a phantom, using GPU #1. (The default is #0) -sinogram_id, sinogram = astra.create_sino(P, proj_id, useCUDA=True, gpuIndex=1) +sinogram_id, sinogram = astra.create_sino(P, proj_id, gpuIndex=1) # Set up the parameters for a reconstruction algorithm using the GPU diff --git a/samples/python/s012_masks.py b/samples/python/s012_masks.py index 441d11b..0f667b0 100644 --- a/samples/python/s012_masks.py +++ b/samples/python/s012_masks.py @@ -48,8 +48,8 @@ proj_geom = astra.create_proj_geom('parallel', 1.0, 384, np.linspace(0,np.pi,50, # As before, create a sinogram from a phantom import scipy.io P = scipy.io.loadmat('phantom.mat')['phantom256'] -proj_id = astra.create_projector('line',proj_geom,vol_geom) -sinogram_id, sinogram = astra.create_sino(P, proj_id,useCUDA=True) +proj_id = astra.create_projector('cuda',proj_geom,vol_geom) +sinogram_id, sinogram = astra.create_sino(P, proj_id) pylab.figure(2) pylab.imshow(P) diff --git a/samples/python/s013_constraints.py b/samples/python/s013_constraints.py index 009360e..8b63d5e 100644 --- a/samples/python/s013_constraints.py +++ b/samples/python/s013_constraints.py @@ -36,8 +36,8 @@ proj_geom = astra.create_proj_geom('parallel', 1.0, 384, np.linspace(0,np.pi,50, # As before, create a sinogram from a phantom import scipy.io P = scipy.io.loadmat('phantom.mat')['phantom256'] -proj_id = astra.create_projector('line',proj_geom,vol_geom) -sinogram_id, sinogram = astra.create_sino(P, proj_id,useCUDA=True) +proj_id = astra.create_projector('cuda',proj_geom,vol_geom) +sinogram_id, sinogram = astra.create_sino(P, proj_id) import pylab pylab.gray() diff --git a/samples/python/s014_FBP.py b/samples/python/s014_FBP.py index ef4afc2..2f8e388 100644 --- a/samples/python/s014_FBP.py +++ b/samples/python/s014_FBP.py @@ -33,8 +33,8 @@ proj_geom = astra.create_proj_geom('parallel', 1.0, 384, np.linspace(0,np.pi,180 # As before, create a sinogram from a phantom import scipy.io P = scipy.io.loadmat('phantom.mat')['phantom256'] -proj_id = astra.create_projector('line',proj_geom,vol_geom) -sinogram_id, sinogram = astra.create_sino(P, proj_id,useCUDA=True) +proj_id = astra.create_projector('cuda',proj_geom,vol_geom) +sinogram_id, sinogram = astra.create_sino(P, proj_id) import pylab pylab.gray() diff --git a/samples/python/s015_fp_bp.py b/samples/python/s015_fp_bp.py index 10c238d..fa0bf86 100644 --- a/samples/python/s015_fp_bp.py +++ b/samples/python/s015_fp_bp.py @@ -26,8 +26,8 @@ # This example demonstrates using the FP and BP primitives with Matlab's lsqr -# solver. Calls to FP (astra_create_sino_cuda) and -# BP (astra_create_backprojection_cuda) are wrapped in a function astra_wrap, +# solver. Calls to FP (astra.create_sino) and +# BP (astra.create_backprojection) are wrapped in a function astra_wrap, # and a handle to this function is passed to lsqr. # Because in this case the inputs/outputs of FP and BP have to be vectors @@ -39,17 +39,17 @@ import numpy as np # FP/BP wrapper class class astra_wrap(object): def __init__(self,proj_geom,vol_geom): - self.proj_id = astra.create_projector('line',proj_geom,vol_geom) + self.proj_id = astra.create_projector('cuda',proj_geom,vol_geom) self.shape = (proj_geom['DetectorCount']*len(proj_geom['ProjectionAngles']),vol_geom['GridColCount']*vol_geom['GridRowCount']) self.dtype = np.float def matvec(self,v): - sid, s = astra.create_sino(np.reshape(v,(vol_geom['GridRowCount'],vol_geom['GridColCount'])),self.proj_id,useCUDA=True) + sid, s = astra.create_sino(np.reshape(v,(vol_geom['GridRowCount'],vol_geom['GridColCount'])),self.proj_id) astra.data2d.delete(sid) return s.flatten() def rmatvec(self,v): - bid, b = astra.create_backprojection(np.reshape(v,(len(proj_geom['ProjectionAngles']),proj_geom['DetectorCount'],)),self.proj_id,useCUDA=True) + bid, b = astra.create_backprojection(np.reshape(v,(len(proj_geom['ProjectionAngles']),proj_geom['DetectorCount'],)),self.proj_id) astra.data2d.delete(bid) return b.flatten() @@ -61,8 +61,8 @@ import scipy.io P = scipy.io.loadmat('phantom.mat')['phantom256'] # Create a sinogram using the GPU. -proj_id = astra.create_projector('line',proj_geom,vol_geom) -sinogram_id, sinogram = astra.create_sino(P, proj_id,useCUDA=True) +proj_id = astra.create_projector('cuda',proj_geom,vol_geom) +sinogram_id, sinogram = astra.create_sino(P, proj_id) # Reshape the sinogram into a vector b = sinogram.flatten() -- cgit v1.2.3 From c58a0f821cf494741e039d4b56aabb7a9ffe85bf Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Fri, 6 Mar 2015 21:23:19 +0100 Subject: Make boost-unit-test-framework optional in configure --- build/linux/Makefile.in | 10 +++++++++- build/linux/configure.ac | 7 ++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/build/linux/Makefile.in b/build/linux/Makefile.in index 2d62a17..f647299 100644 --- a/build/linux/Makefile.in +++ b/build/linux/Makefile.in @@ -1,6 +1,7 @@ cuda=@HAVECUDA@ matlab=@HAVEMATLAB@ python=@HAVEPYTHON@ +boostutf=@HAVEBOOSTUTF@ MATLAB_ROOT=@MATLAB_ROOT@ @@ -59,6 +60,8 @@ endif BOOST_CPPFLAGS= BOOST_LDFLAGS= +BOOSTUTF_LIBS=@LIBS_BOOSTUTF@ + CPPFLAGS+=$(BOOST_CPPFLAGS) LDFLAGS+=$(BOOST_LDFLAGS) @@ -290,11 +293,16 @@ ifeq ($(cuda),yes) @rm -f $(*F).linkinfo endif +ifeq ($(boostutf),yes) test.bin: $(ALL_OBJECTS) $(TEST_OBJECTS) - ./libtool --mode=link $(LD) -o $@ $(LDFLAGS) $(LIBS) $+ -lboost_unit_test_framework + ./libtool --mode=link $(LD) -o $@ $(LDFLAGS) $+ $(LIBS) $(BOOSTUTF_LIBS) test: test.bin ./test.bin +else +test: + @echo "Tests have been disabled by configure" +endif clean: rm -f $(MATLAB_MEX) libastra.la diff --git a/build/linux/configure.ac b/build/linux/configure.ac index 129079c..6558445 100644 --- a/build/linux/configure.ac +++ b/build/linux/configure.ac @@ -53,20 +53,25 @@ AC_CHECK_HEADER(iostream, , AC_MSG_ERROR([No working c++ compiler found])) AC_MSG_CHECKING([for boost-unit-test-framework]) ASTRA_CHECK_BOOST_UNIT_TEST_FRAMEWORK(-lboost_unit_test_framework-mt, BOOSTUTF=yes_mt, BOOSTUTF=no) +HAVEBOOSTUTF=no if test x$BOOSTUTF = xno; then ASTRA_CHECK_BOOST_UNIT_TEST_FRAMEWORK(-lboost_unit_test_framework, BOOSTUTF=yes, BOOSTUTF=no) if test x$BOOSTUTF = xno; then AC_MSG_RESULT(no) - AC_MSG_ERROR([No boost-unit-test-framework library found]) else AC_MSG_RESULT([yes, libboost_unit_test_framework]) LIBS_BOOSTUTF="-lboost_unit_test_framework" + HAVEBOOSTUTF=yes fi else AC_MSG_RESULT([yes, libboost_unit_test_framework-mt]) LIBS_BOOSTUTF="-lboost_unit_test_framework-mt" + HAVEBOOSTUTF=yes fi +AC_SUBST(HAVEBOOSTUTF) +AC_SUBST(LIBS_BOOSTUTF) + # nvcc, cuda -- cgit v1.2.3 From 475b1746c133b0286871b7414918704557f1abcc Mon Sep 17 00:00:00 2001 From: "Daniel M. Pelt" Date: Mon, 9 Mar 2015 15:53:07 +0100 Subject: Remove old Logging code (only used in fft.cu) --- build/linux/Makefile.in | 1 - cuda/2d/astra.cu | 3 +- cuda/2d/fft.cu | 10 ++-- include/astra/Logger.h | 72 --------------------------- src/CudaFilteredBackProjectionAlgorithm.cpp | 14 +++--- src/Logger.cpp | 77 ----------------------------- 6 files changed, 10 insertions(+), 167 deletions(-) delete mode 100644 include/astra/Logger.h delete mode 100644 src/Logger.cpp diff --git a/build/linux/Makefile.in b/build/linux/Makefile.in index 92697b2..d9ff045 100644 --- a/build/linux/Makefile.in +++ b/build/linux/Makefile.in @@ -118,7 +118,6 @@ BASE_OBJECTS=\ src/Fourier.lo \ src/GeometryUtil3D.lo \ src/Globals.lo \ - src/Logger.lo \ src/ParallelBeamBlobKernelProjector2D.lo \ src/ParallelBeamLinearKernelProjector2D.lo \ src/ParallelBeamLineKernelProjector2D.lo \ diff --git a/cuda/2d/astra.cu b/cuda/2d/astra.cu index 0b5be06..bcc1a50 100644 --- a/cuda/2d/astra.cu +++ b/cuda/2d/astra.cu @@ -42,7 +42,6 @@ $Id$ #include #include -#include "../../include/astra/Logger.h" #include "../../include/astra/VolumeGeometry2D.h" #include "../../include/astra/ParallelProjectionGeometry2D.h" #include "../../include/astra/FanFlatProjectionGeometry2D.h" @@ -538,7 +537,7 @@ bool AstraFBP::setFilter(E_FBPFILTER _eFilter, const float * _pfHostFilter /* = int iMaxFilterIndex = iStartFilterIndex + iUsedFilterWidth; int iFilterShiftSize = _iFilterWidth / 2; - + for(int iDetectorIndex = iStartFilterIndex; iDetectorIndex < iMaxFilterIndex; iDetectorIndex++) { int iFFTInFilterIndex = (iDetectorIndex + iFFTRealDetCount - iFilterShiftSize) % iFFTRealDetCount; diff --git a/cuda/2d/fft.cu b/cuda/2d/fft.cu index d105e29..5fef360 100644 --- a/cuda/2d/fft.cu +++ b/cuda/2d/fft.cu @@ -34,7 +34,6 @@ $Id$ #include #include -#include "../../include/astra/Logger.h" using namespace astra; @@ -45,7 +44,6 @@ using namespace astra; if( cudaSuccess != err) { \ fprintf(stderr, "Cuda error: %s in file '%s' in line %i : %s.\n", \ errorMessage, __FILE__, __LINE__, cudaGetErrorString( err) );\ - CLogger::writeTerminalCUDAError(__FILE__, __LINE__, cudaGetErrorString( err)); \ exit(EXIT_FAILURE); \ } } while (0) @@ -54,14 +52,12 @@ using namespace astra; if( cudaSuccess != err) { \ fprintf(stderr, "Cuda error in file '%s' in line %i : %s.\n", \ __FILE__, __LINE__, cudaGetErrorString( err) ); \ - CLogger::writeTerminalCUDAError(__FILE__, __LINE__, cudaGetErrorString( err)); \ exit(EXIT_FAILURE); \ } \ err = cudaThreadSynchronize(); \ if( cudaSuccess != err) { \ fprintf(stderr, "Cuda error in file '%s' in line %i : %s.\n", \ __FILE__, __LINE__, cudaGetErrorString( err) ); \ - CLogger::writeTerminalCUDAError(__FILE__, __LINE__, cudaGetErrorString( err)); \ exit(EXIT_FAILURE); \ } } while (0) @@ -460,7 +456,7 @@ void genFilter(E_FBPFILTER _eFilter, float _fD, int _iProjectionCount, const float fA1 = 0.48f; const float fA2 = 0.38f; float fNMinusOne = (float)(_iFFTFourierDetectorCount) - 1.0f; - + for(int iDetectorIndex = 1; iDetectorIndex < _iFFTFourierDetectorCount; iDetectorIndex++) { float fSmallN = (float)iDetectorIndex; @@ -746,7 +742,7 @@ void testCudaFFT() { for(int iDetectorIndex = 0; iDetectorIndex < iDetectorCount; iDetectorIndex++) { -// int +// int // pfHostProj[iIndex] = (float)rand() / (float)RAND_MAX; } @@ -787,7 +783,7 @@ void testCudaFFT() float * pfHostFourProjImaginary = new float[iTotalElementCount]; convertComplexToRealImg(pHostFourProj, iTotalElementCount, pfHostFourProjReal, pfHostFourProjImaginary); - + writeToMatlabFile("proj_four_real.mat", pfHostFourProjReal, iProjectionCount, iDetectorCount); writeToMatlabFile("proj_four_imaginary.mat", pfHostFourProjImaginary, iProjectionCount, iDetectorCount); diff --git a/include/astra/Logger.h b/include/astra/Logger.h deleted file mode 100644 index 34fd364..0000000 --- a/include/astra/Logger.h +++ /dev/null @@ -1,72 +0,0 @@ -/* ------------------------------------------------------------------------ -Copyright: 2010-2015, iMinds-Vision Lab, University of Antwerp - 2014-2015, CWI, Amsterdam - -Contact: astra@uantwerpen.be -Website: http://sf.net/projects/astra-toolbox - -This file is part of the ASTRA Toolbox. - - -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. - -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 ASTRA Toolbox. If not, see . - ------------------------------------------------------------------------ -$Id$ -*/ - -#ifndef _INC_ASTRA_LOGGER -#define _INC_ASTRA_LOGGER - -#include - -namespace astra -{ - -/** - * This is the first stab at a decent logger. If the file "astra_logger.txt", it will be replaced - * with the text sent to this logger. If the file doesn't exist when the app starts, nothing is written. - */ -class CLogger -{ - static std::FILE * m_pOutFile; - static bool m_bInitialized; - - static void _assureIsInitialized(); - - CLogger(); - -public: - - /** - * Writes a line to the log file (newline is added). Ignored if logging is turned off. - * - * @param _text char pointer to text in line - */ - static void writeLine(const char * _text); - - /** - * Formats and writes a CUDA error to the log file. Ignored if logging is turned off. - * - * @param _fileName filename where error occurred (typically __FILE__) - * @param _line line in file (typically __LINE__) - * @param _errString string describing the error, can be output of cudaGetErrorString - */ - static void writeTerminalCUDAError(const char * _fileName, int _iLine, const char * _errString); -}; - -} - -#endif /* _INC_ASTRA_LOGGER */ - diff --git a/src/CudaFilteredBackProjectionAlgorithm.cpp b/src/CudaFilteredBackProjectionAlgorithm.cpp index fcdf860..77bd412 100644 --- a/src/CudaFilteredBackProjectionAlgorithm.cpp +++ b/src/CudaFilteredBackProjectionAlgorithm.cpp @@ -34,8 +34,6 @@ $Id$ #include "astra/AstraObjectManager.h" #include "../cuda/2d/astra.h" -#include - using namespace std; using namespace astra; @@ -105,7 +103,7 @@ bool CCudaFilteredBackProjectionAlgorithm::initialize(const Config& _cfg) } CC.markNodeParsed("FilterType"); ASTRA_DELETE(node); - + // filter node = _cfg.self->getSingleNode("FilterSinogramId"); if(node != NULL) @@ -168,7 +166,7 @@ bool CCudaFilteredBackProjectionAlgorithm::initialize(const Config& _cfg) CC.markOptionParsed("ShortScan"); } - + m_pFBP = new AstraFBP; @@ -186,7 +184,7 @@ bool CCudaFilteredBackProjectionAlgorithm::initialize(CFloat32ProjectionData2D * { clear(); } - + // required classes m_pSinogram = _pSinogram; m_pReconstruction = _pReconstruction; @@ -326,7 +324,7 @@ void CCudaFilteredBackProjectionAlgorithm::run(int _iNrIterations /* = 0 */) const CVolumeGeometry2D& volgeom = *m_pReconstruction->getGeometry(); ok &= m_pFBP->getReconstruction(m_pReconstruction->getData(), volgeom.getGridColCount()); - + ASTRA_ASSERT(ok); } @@ -335,7 +333,7 @@ bool CCudaFilteredBackProjectionAlgorithm::check() // check pointers ASTRA_CONFIG_CHECK(m_pSinogram, "FBP_CUDA", "Invalid Projection Data Object."); ASTRA_CONFIG_CHECK(m_pReconstruction, "FBP_CUDA", "Invalid Reconstruction Data Object."); - + if((m_eFilter == FILTER_PROJECTION) || (m_eFilter == FILTER_SINOGRAM) || (m_eFilter == FILTER_RPROJECTION) || (m_eFilter == FILTER_RSINOGRAM)) { ASTRA_CONFIG_CHECK(m_pfFilter, "FBP_CUDA", "Invalid filter pointer."); @@ -387,7 +385,7 @@ static bool stringCompareLowerCase(const char * _stringA, const char * _stringB) #else iCmpReturn = strcasecmp(_stringA, _stringB); #endif - + return (iCmpReturn == 0); } diff --git a/src/Logger.cpp b/src/Logger.cpp deleted file mode 100644 index 148e18c..0000000 --- a/src/Logger.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/* ------------------------------------------------------------------------ -Copyright: 2010-2015, iMinds-Vision Lab, University of Antwerp - 2014-2015, CWI, Amsterdam - -Contact: astra@uantwerpen.be -Website: http://sf.net/projects/astra-toolbox - -This file is part of the ASTRA Toolbox. - - -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. - -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 ASTRA Toolbox. If not, see . - ------------------------------------------------------------------------ -$Id$ -*/ - -#include - -using namespace astra; - -const char * g_loggerFileName = "astra_logger.txt"; - -void CLogger::_assureIsInitialized() -{ - if(!m_bInitialized) - { - m_pOutFile = fopen(g_loggerFileName, "r"); - if(m_pOutFile != NULL) - { - // file exists, users wants to log - fclose(m_pOutFile); - m_pOutFile = fopen(g_loggerFileName, "w"); - } - - m_bInitialized = true; - } -} - -void CLogger::writeLine(const char * _text) -{ - _assureIsInitialized(); - - if(m_pOutFile != NULL) - { - fprintf(m_pOutFile, "%s\n", _text); - fflush(m_pOutFile); - } -} - -void CLogger::writeTerminalCUDAError(const char * _fileName, int _iLine, const char * _errString) -{ - char buffer[256]; - - sprintf(buffer, "Cuda error in file '%s' in line %i : %s.", _fileName, _iLine, _errString); - - writeLine(buffer); -} - -CLogger::CLogger() -{ - ; -} - -FILE * CLogger::m_pOutFile = NULL; -bool CLogger::m_bInitialized = false; -- cgit v1.2.3 From 30208e988315c8f576da6848cdc3236413c0cd10 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Mon, 9 Mar 2015 18:12:37 +0100 Subject: Add check for required boost headers --- build/linux/configure.ac | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/build/linux/configure.ac b/build/linux/configure.ac index 6558445..d9e1f1a 100644 --- a/build/linux/configure.ac +++ b/build/linux/configure.ac @@ -72,6 +72,17 @@ fi AC_SUBST(HAVEBOOSTUTF) AC_SUBST(LIBS_BOOSTUTF) +BOOSTok=yes +AC_CHECK_HEADER([boost/lexical_cast.hpp],[],[BOOSTok=no],[]) +AC_CHECK_HEADER([boost/any.hpp],[],[BOOSTok=no],[]) +dnl AC_CHECK_HEADER([boost/thread.hpp],[],[BOOSTok=no],[]) +dnl AC_CHECK_HEADER([boost/bind.hpp],[],[BOOSTok=no],[]) +AC_CHECK_HEADER([boost/static_assert.hpp],[],[BOOSTok=no],[]) +AC_CHECK_HEADER([boost/throw_exception.hpp],[],[BOOSTok=no],[]) + +if test x$BOOSTok = xno; then + AC_MSG_ERROR([boost not found]) +fi # nvcc, cuda -- cgit v1.2.3 From a1dff91d7d8db49ecd79dfbcc6a6a663b114f9fd Mon Sep 17 00:00:00 2001 From: "Daniel M. Pelt" Date: Mon, 9 Mar 2015 17:51:42 +0100 Subject: Adds new logging capabilities (based on clog.h) --- build/linux/Makefile.in | 1 + include/astra/Logging.h | 147 ++++++++++++ include/astra/clog.h | 622 ++++++++++++++++++++++++++++++++++++++++++++++++ src/Logging.cpp | 175 ++++++++++++++ 4 files changed, 945 insertions(+) create mode 100644 include/astra/Logging.h create mode 100644 include/astra/clog.h create mode 100644 src/Logging.cpp diff --git a/build/linux/Makefile.in b/build/linux/Makefile.in index d9ff045..c2b9994 100644 --- a/build/linux/Makefile.in +++ b/build/linux/Makefile.in @@ -118,6 +118,7 @@ BASE_OBJECTS=\ src/Fourier.lo \ src/GeometryUtil3D.lo \ src/Globals.lo \ + src/Logging.lo \ src/ParallelBeamBlobKernelProjector2D.lo \ src/ParallelBeamLinearKernelProjector2D.lo \ src/ParallelBeamLineKernelProjector2D.lo \ diff --git a/include/astra/Logging.h b/include/astra/Logging.h new file mode 100644 index 0000000..ce777ae --- /dev/null +++ b/include/astra/Logging.h @@ -0,0 +1,147 @@ +/* +----------------------------------------------------------------------- +Copyright: 2010-2015, iMinds-Vision Lab, University of Antwerp + 2014-2015, CWI, Amsterdam + +Contact: astra@uantwerpen.be +Website: http://sf.net/projects/astra-toolbox + +This file is part of the ASTRA Toolbox. + + +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. + +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 ASTRA Toolbox. If not, see . + +----------------------------------------------------------------------- +$Id$ +*/ + +#ifndef _INC_ASTRA_LOGGING +#define _INC_ASTRA_LOGGING + +#define ASTRA_LOG(id) __FILE__, __LINE__, id + +namespace astra +{ + +enum log_level { + LOG_DEBUG, + LOG_INFO, + LOG_WARN, + LOG_ERROR +}; + +class CLogger +{ + CLogger(); + ~CLogger(); + static bool m_bEnabledFile; + static bool m_bEnabledScreen; + static bool m_bFileProvided; + static bool m_bInitialized; + static void _assureIsInitialized(); + static void _setLevel(int id, log_level m_eLevel); + +public: + + /** + * Writes a line to the log file (newline is added). Ignored if logging is turned off. + * + * @param sfile + * The name of the source file making this log call (e.g. __FILE__). + * + * @param sline + * The line number of the call in the source code (e.g. __LINE__). + * + * @param id + * The id of the logger to write to. + * + * @param fmt + * The format string for the message (printf formatting). + * + * @param ... + * Any additional format arguments. + */ + static void debug(const char *sfile, int sline, const char *fmt, ...); + static void info(const char *sfile, int sline, const char *fmt, ...); + static void warn(const char *sfile, int sline, const char *fmt, ...); + static void error(const char *sfile, int sline, const char *fmt, ...); + + /** + * Sets the file to log to, with logging level. + * + * @param filename + * File to log to. + * + * @param m_eLevel + * Logging level (LOG_DEBUG, LOG_WARN, LOG_INFO, LOG_ERROR). + * + */ + static void setOutputFile(const char *filename, log_level m_eLevel); + + /** + * Sets the screen to log to, with logging level. + * + * @param screen_fd + * Screen file descriptor (1 for stdout, 2 for stderr) + * + * @param m_eLevel + * Logging level (LOG_DEBUG, LOG_WARN, LOG_INFO, LOG_ERROR). + * + */ + static void setOutputScreen(int fd, log_level m_eLevel); + + /** + * Set the format string for log messages. Here are the substitutions you may + * use: + * + * %f: Source file name generating the log call. + * %n: Source line number where the log call was made. + * %m: The message text sent to the logger (after printf formatting). + * %d: The current date, formatted using the logger's date format. + * %t: The current time, formatted using the logger's time format. + * %l: The log level (one of "DEBUG", "INFO", "WARN", or "ERROR"). + * %%: A literal percent sign. + * + * The default format string is "%d %t %f(%n): %l: %m\n". + * + * @param fmt + * The new format string, which must be less than 256 bytes. + * You probably will want to end this with a newline (\n). + * + */ + static void setFormatFile(const char *fmt); + static void setFormatScreen(const char *fmt); + + + /** + * Enable logging. + * + */ + static void enable(); + static void enableScreen(); + static void enableFile(); + + /** + * Disable logging. + * + */ + static void disable(); + static void disableScreen(); + static void disableFile(); + +}; + +} + +#endif /* _INC_ASTRA_LOGGING */ diff --git a/include/astra/clog.h b/include/astra/clog.h new file mode 100644 index 0000000..4d8e39d --- /dev/null +++ b/include/astra/clog.h @@ -0,0 +1,622 @@ +/* clog: Extremely simple logger for C. + * + * Features: + * - Implemented purely as a single header file. + * - Create multiple loggers. + * - Four log levels (debug, info, warn, error). + * - Custom formats. + * - Fast. + * + * Dependencies: + * - Should conform to C89, C++98 (but requires vsnprintf, unfortunately). + * - POSIX environment. + * + * USAGE: + * + * Include this header in any file that wishes to write to logger(s). In + * exactly one file (per executable), define CLOG_MAIN first (e.g. in your + * main .c file). + * + * #define CLOG_MAIN + * #include "clog.h" + * + * This will define the actual objects that all the other units will use. + * + * Loggers are identified by integers (0 - 15). It's expected that you'll + * create meaningful constants and then refer to the loggers as such. + * + * Example: + * + * const int MY_LOGGER = 0; + * + * int main() { + * int r; + * r = clog_init_path(MY_LOGGER, "my_log.txt"); + * if (r != 0) { + * fprintf(stderr, "Logger initialization failed.\n"); + * return 1; + * } + * clog_info(CLOG(MY_LOGGER), "Hello, world!"); + * clog_free(MY_LOGGER); + * return 0; + * } + * + * The CLOG macro used in the call to clog_info is a helper that passes the + * __FILE__ and __LINE__ parameters for you, so you don't have to type them + * every time. (It could be prettier with variadic macros, but that requires + * C99 or C++11 to be standards compliant.) + * + * Errors encountered by clog will be printed to stderr. You can suppress + * these by defining a macro called CLOG_SILENT before including clog.h. + * + * License: Do whatever you want. It would be nice if you contribute + * improvements as pull requests here: + * + * https://github.com/mmueller/clog + * + * Copyright 2013 Mike Mueller . + * + * As is; no warranty is provided; use at your own risk. + */ + +#ifndef __CLOG_H__ +#define __CLOG_H__ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* Number of loggers that can be defined. */ +#define CLOG_MAX_LOGGERS 16 + +/* Format strings cannot be longer than this. */ +#define CLOG_FORMAT_LENGTH 256 + +/* Formatted times and dates should be less than this length. If they are not, + * they will not appear in the log. */ +#define CLOG_DATETIME_LENGTH 256 + +/* Default format strings. */ +#define CLOG_DEFAULT_FORMAT "%d %t %f(%n): %l: %m\n" +#define CLOG_DEFAULT_DATE_FORMAT "%Y-%m-%d" +#define CLOG_DEFAULT_TIME_FORMAT "%H:%M:%S" + +#ifdef __cplusplus +extern "C" { +#endif + +enum clog_level { + CLOG_DEBUG, + CLOG_INFO, + CLOG_WARN, + CLOG_ERROR +}; + +struct clog; + +/** + * Create a new logger writing to the given file path. The file will always + * be opened in append mode. + * + * @param id + * A constant integer between 0 and 15 that uniquely identifies this logger. + * + * @param path + * Path to the file where log messages will be written. + * + * @return + * Zero on success, non-zero on failure. + */ +int clog_init_path(int id, const char *const path); + +/** + * Create a new logger writing to a file descriptor. + * + * @param id + * A constant integer between 0 and 15 that uniquely identifies this logger. + * + * @param fd + * The file descriptor where log messages will be written. + * + * @return + * Zero on success, non-zero on failure. + */ +int clog_init_fd(int id, int fd); + +/** + * Destroy (clean up) a logger. You should do this at the end of execution, + * or when you are done using the logger. + * + * @param id + * The id of the logger to destroy. + */ +void clog_free(int id); + +#define CLOG(id) __FILE__, __LINE__, id + +/** + * Log functions (one per level). Call these to write messages to the log + * file. The first three arguments can be replaced with a call to the CLOG + * macro defined above, e.g.: + * + * clog_debug(CLOG(MY_LOGGER_ID), "This is a log message."); + * + * @param sfile + * The name of the source file making this log call (e.g. __FILE__). + * + * @param sline + * The line number of the call in the source code (e.g. __LINE__). + * + * @param id + * The id of the logger to write to. + * + * @param fmt + * The format string for the message (printf formatting). + * + * @param ... + * Any additional format arguments. + */ +void clog_debug(const char *sfile, int sline, int id, const char *fmt, va_list ap); +void clog_info(const char *sfile, int sline, int id, const char *fmt, va_list ap); +void clog_warn(const char *sfile, int sline, int id, const char *fmt, va_list ap); +void clog_error(const char *sfile, int sline, int id, const char *fmt, va_list ap); + +/** + * Set the minimum level of messages that should be written to the log. + * Messages below this level will not be written. By default, loggers are + * created with level == CLOG_DEBUG. + * + * @param id + * The identifier of the logger. + * + * @param level + * The new minimum log level. + * + * @return + * Zero on success, non-zero on failure. + */ +int clog_set_level(int id, enum clog_level level); + +/** + * Set the format string used for times. See strftime(3) for how this string + * should be defined. The default format string is CLOG_DEFAULT_TIME_FORMAT. + * + * @param fmt + * The new format string, which must be less than CLOG_FORMAT_LENGTH bytes. + * + * @return + * Zero on success, non-zero on failure. + */ +int clog_set_time_fmt(int id, const char *fmt); + +/** + * Set the format string used for dates. See strftime(3) for how this string + * should be defined. The default format string is CLOG_DEFAULT_DATE_FORMAT. + * + * @param fmt + * The new format string, which must be less than CLOG_FORMAT_LENGTH bytes. + * + * @return + * Zero on success, non-zero on failure. + */ +int clog_set_date_fmt(int id, const char *fmt); + +/** + * Set the format string for log messages. Here are the substitutions you may + * use: + * + * %f: Source file name generating the log call. + * %n: Source line number where the log call was made. + * %m: The message text sent to the logger (after printf formatting). + * %d: The current date, formatted using the logger's date format. + * %t: The current time, formatted using the logger's time format. + * %l: The log level (one of "DEBUG", "INFO", "WARN", or "ERROR"). + * %%: A literal percent sign. + * + * The default format string is CLOG_DEFAULT_FORMAT. + * + * @param fmt + * The new format string, which must be less than CLOG_FORMAT_LENGTH bytes. + * You probably will want to end this with a newline (\n). + * + * @return + * Zero on success, non-zero on failure. + */ +int clog_set_fmt(int id, const char *fmt); + +/* + * No need to read below this point. + */ + +/** + * The C logger structure. + */ +struct clog { + + /* The current level of this logger. Messages below it will be dropped. */ + enum clog_level level; + + /* The file being written. */ + int fd; + + /* The format specifier. */ + char fmt[CLOG_FORMAT_LENGTH]; + + /* Date format */ + char date_fmt[CLOG_FORMAT_LENGTH]; + + /* Time format */ + char time_fmt[CLOG_FORMAT_LENGTH]; + + /* Tracks whether the fd needs to be closed eventually. */ + int opened; +}; + +void _clog_err(const char *fmt, ...); + +#ifdef CLOG_MAIN +struct clog *_clog_loggers[CLOG_MAX_LOGGERS] = { 0 }; +#else +extern struct clog *_clog_loggers[CLOG_MAX_LOGGERS]; +#endif + +#ifdef CLOG_MAIN + +const char *const CLOG_LEVEL_NAMES[] = { + "DEBUG", + "INFO", + "WARN", + "ERROR", +}; + +int +clog_init_path(int id, const char *const path) +{ + int fd = open(path, O_CREAT | O_WRONLY | O_APPEND, 0666); + if (fd == -1) { + _clog_err("Unable to open %s: %s\n", path, strerror(errno)); + return 1; + } + if (clog_init_fd(id, fd)) { + close(fd); + return 1; + } + _clog_loggers[id]->opened = 1; + return 0; +} + +int +clog_init_fd(int id, int fd) +{ + struct clog *logger; + + if (_clog_loggers[id] != NULL) { + _clog_err("Logger %d already initialized.\n", id); + return 1; + } + + logger = (struct clog *) malloc(sizeof(struct clog)); + if (logger == NULL) { + _clog_err("Failed to allocate logger: %s\n", strerror(errno)); + return 1; + } + + logger->level = CLOG_DEBUG; + logger->fd = fd; + logger->opened = 0; + strcpy(logger->fmt, CLOG_DEFAULT_FORMAT); + strcpy(logger->date_fmt, CLOG_DEFAULT_DATE_FORMAT); + strcpy(logger->time_fmt, CLOG_DEFAULT_TIME_FORMAT); + + _clog_loggers[id] = logger; + return 0; +} + +void +clog_free(int id) +{ + if (_clog_loggers[id]) { + if (_clog_loggers[id]->opened) { + close(_clog_loggers[id]->fd); + } + free(_clog_loggers[id]); + _clog_loggers[id]=NULL; + } +} + +int +clog_set_level(int id, enum clog_level level) +{ + if (_clog_loggers[id] == NULL) { + return 1; + } + if ((unsigned) level > CLOG_ERROR) { + return 1; + } + _clog_loggers[id]->level = level; + return 0; +} + +int +clog_set_time_fmt(int id, const char *fmt) +{ + struct clog *logger = _clog_loggers[id]; + if (logger == NULL) { + _clog_err("clog_set_time_fmt: No such logger: %d\n", id); + return 1; + } + if (strlen(fmt) >= CLOG_FORMAT_LENGTH) { + _clog_err("clog_set_time_fmt: Format specifier too long.\n"); + return 1; + } + strcpy(logger->time_fmt, fmt); + return 0; +} + +int +clog_set_date_fmt(int id, const char *fmt) +{ + struct clog *logger = _clog_loggers[id]; + if (logger == NULL) { + _clog_err("clog_set_date_fmt: No such logger: %d\n", id); + return 1; + } + if (strlen(fmt) >= CLOG_FORMAT_LENGTH) { + _clog_err("clog_set_date_fmt: Format specifier too long.\n"); + return 1; + } + strcpy(logger->date_fmt, fmt); + return 0; +} + +int +clog_set_fmt(int id, const char *fmt) +{ + struct clog *logger = _clog_loggers[id]; + if (logger == NULL) { + _clog_err("clog_set_fmt: No such logger: %d\n", id); + return 1; + } + if (strlen(fmt) >= CLOG_FORMAT_LENGTH) { + _clog_err("clog_set_fmt: Format specifier too long.\n"); + return 1; + } + strcpy(logger->fmt, fmt); + return 0; +} + +/* Internal functions */ + +size_t +_clog_append_str(char **dst, char *orig_buf, const char *src, size_t cur_size) +{ + size_t new_size = cur_size; + + while (strlen(*dst) + strlen(src) >= new_size) { + new_size *= 2; + } + if (new_size != cur_size) { + if (*dst == orig_buf) { + *dst = (char *) malloc(new_size); + strcpy(*dst, orig_buf); + } else { + *dst = (char *) realloc(*dst, new_size); + } + } + + strcat(*dst, src); + return new_size; +} + +size_t +_clog_append_int(char **dst, char *orig_buf, long int d, size_t cur_size) +{ + char buf[40]; /* Enough for 128-bit decimal */ + if (snprintf(buf, 40, "%ld", d) >= 40) { + return cur_size; + } + return _clog_append_str(dst, orig_buf, buf, cur_size); +} + +size_t +_clog_append_time(char **dst, char *orig_buf, struct tm *lt, + const char *fmt, size_t cur_size) +{ + char buf[CLOG_DATETIME_LENGTH]; + size_t result = strftime(buf, CLOG_DATETIME_LENGTH, fmt, lt); + + if (result > 0) { + return _clog_append_str(dst, orig_buf, buf, cur_size); + } + + return cur_size; +} + +const char * +_clog_basename(const char *path) +{ + const char *slash = strrchr(path, '/'); + if (slash) { + path = slash + 1; + } +#ifdef _WIN32 + slash = strrchr(path, '\\'); + if (slash) { + path = slash + 1; + } +#endif + return path; +} + +char * +_clog_format(const struct clog *logger, char buf[], size_t buf_size, + const char *sfile, int sline, const char *level, + const char *message) +{ + size_t cur_size = buf_size; + char *result = buf; + enum { NORMAL, SUBST } state = NORMAL; + size_t fmtlen = strlen(logger->fmt); + size_t i; + time_t t = time(NULL); + struct tm *lt = localtime(&t); + + sfile = _clog_basename(sfile); + result[0] = 0; + for (i = 0; i < fmtlen; ++i) { + if (state == NORMAL) { + if (logger->fmt[i] == '%') { + state = SUBST; + } else { + char str[2] = { 0 }; + str[0] = logger->fmt[i]; + cur_size = _clog_append_str(&result, buf, str, cur_size); + } + } else { + switch (logger->fmt[i]) { + case '%': + cur_size = _clog_append_str(&result, buf, "%", cur_size); + break; + case 't': + cur_size = _clog_append_time(&result, buf, lt, + logger->time_fmt, cur_size); + break; + case 'd': + cur_size = _clog_append_time(&result, buf, lt, + logger->date_fmt, cur_size); + break; + case 'l': + cur_size = _clog_append_str(&result, buf, level, cur_size); + break; + case 'n': + cur_size = _clog_append_int(&result, buf, sline, cur_size); + break; + case 'f': + cur_size = _clog_append_str(&result, buf, sfile, cur_size); + break; + case 'm': + cur_size = _clog_append_str(&result, buf, message, + cur_size); + break; + } + state = NORMAL; + } + } + + return result; +} + +void +_clog_log(const char *sfile, int sline, enum clog_level level, + int id, const char *fmt, va_list ap) +{ + /* For speed: Use a stack buffer until message exceeds 4096, then switch + * to dynamically allocated. This should greatly reduce the number of + * memory allocations (and subsequent fragmentation). */ + char buf[4096]; + size_t buf_size = 4096; + char *dynbuf = buf; + char *message; + int result; + struct clog *logger = _clog_loggers[id]; + + if (!logger) { + _clog_err("No such logger: %d\n", id); + return; + } + + if (level < logger->level) { + return; + } + + /* Format the message text with the argument list. */ + result = vsnprintf(dynbuf, buf_size, fmt, ap); + if ((size_t) result >= buf_size) { + buf_size = result + 1; + dynbuf = (char *) malloc(buf_size); + result = vsnprintf(dynbuf, buf_size, fmt, ap); + if ((size_t) result >= buf_size) { + /* Formatting failed -- too large */ + _clog_err("Formatting failed (1).\n"); + free(dynbuf); + return; + } + } + + /* Format according to log format and write to log */ + { + char message_buf[4096]; + message = _clog_format(logger, message_buf, 4096, sfile, sline, + CLOG_LEVEL_NAMES[level], dynbuf); + if (!message) { + _clog_err("Formatting failed (2).\n"); + if (dynbuf != buf) { + free(dynbuf); + } + return; + } + result = write(logger->fd, message, strlen(message)); + if (result == -1) { + _clog_err("Unable to write to log file: %s\n", strerror(errno)); + } + if (message != message_buf) { + free(message); + } + if (dynbuf != buf) { + free(dynbuf); + } + fsync(logger->fd); + } +} + +void +clog_debug(const char *sfile, int sline, int id, const char *fmt, va_list ap) +{ + _clog_log(sfile, sline, CLOG_DEBUG, id, fmt, ap); +} + +void +clog_info(const char *sfile, int sline, int id, const char *fmt, va_list ap) +{ + _clog_log(sfile, sline, CLOG_INFO, id, fmt, ap); +} + +void +clog_warn(const char *sfile, int sline, int id, const char *fmt, va_list ap) +{ + _clog_log(sfile, sline, CLOG_WARN, id, fmt, ap); +} + +void +clog_error(const char *sfile, int sline, int id, const char *fmt, va_list ap) +{ + _clog_log(sfile, sline, CLOG_ERROR, id, fmt, ap); +} + +void +_clog_err(const char *fmt, ...) +{ +#ifdef CLOG_SILENT + (void) fmt; +#else + va_list ap; + + va_start(ap, fmt); + vfprintf(stderr, fmt, ap); +#endif +} + +#endif /* CLOG_MAIN */ + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __CLOG_H__ */ diff --git a/src/Logging.cpp b/src/Logging.cpp new file mode 100644 index 0000000..9011d37 --- /dev/null +++ b/src/Logging.cpp @@ -0,0 +1,175 @@ +/* +----------------------------------------------------------------------- +Copyright: 2010-2015, iMinds-Vision Lab, University of Antwerp + 2014-2015, CWI, Amsterdam + +Contact: astra@uantwerpen.be +Website: http://sf.net/projects/astra-toolbox + +This file is part of the ASTRA Toolbox. + + +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. + +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 ASTRA Toolbox. If not, see . + +----------------------------------------------------------------------- +$Id$ +*/ + +#define CLOG_MAIN +#include + +#include + +#include + +using namespace astra; + +void CLogger::enableScreen() +{ + m_bEnabledScreen = true; +} + +void CLogger::enableFile() +{ + m_bEnabledFile = true; +} + +void CLogger::enable() +{ + enableScreen(); + enableFile(); +} + +void CLogger::disableScreen() +{ + m_bEnabledScreen = false; +} + +void CLogger::disableFile() +{ + m_bEnabledFile = false; +} + +void CLogger::disable() +{ + disableScreen(); + disableFile(); +} + +void CLogger::debug(const char *sfile, int sline, const char *fmt, ...) +{ + _assureIsInitialized(); + va_list ap; + va_start(ap, fmt); + if(m_bEnabledScreen) clog_debug(sfile,sline,0,fmt,ap); + if(m_bEnabledFile && m_bFileProvided) clog_debug(sfile,sline,1,fmt,ap); +} + +void CLogger::info(const char *sfile, int sline, const char *fmt, ...) +{ + _assureIsInitialized(); + va_list ap; + va_start(ap, fmt); + if(m_bEnabledScreen) clog_info(sfile,sline,0,fmt,ap); + if(m_bEnabledFile && m_bFileProvided) clog_info(sfile,sline,1,fmt,ap); +} + +void CLogger::warn(const char *sfile, int sline, const char *fmt, ...) +{ + _assureIsInitialized(); + va_list ap; + va_start(ap, fmt); + if(m_bEnabledScreen) clog_warn(sfile,sline,0,fmt,ap); + if(m_bEnabledFile && m_bFileProvided) clog_warn(sfile,sline,1,fmt,ap); +} + +void CLogger::error(const char *sfile, int sline, const char *fmt, ...) +{ + _assureIsInitialized(); + va_list ap; + va_start(ap, fmt); + if(m_bEnabledScreen) clog_error(sfile,sline,0,fmt,ap); + if(m_bEnabledFile && m_bFileProvided) clog_error(sfile,sline,1,fmt,ap); +} + +void CLogger::_setLevel(int id, log_level m_eLevel) +{ + switch(m_eLevel){ + case LOG_DEBUG: + clog_set_level(id,CLOG_DEBUG); + break; + case LOG_INFO: + clog_set_level(id,CLOG_INFO); + break; + case LOG_WARN: + clog_set_level(id,CLOG_WARN); + break; + case LOG_ERROR: + clog_set_level(id,CLOG_ERROR); + break; + } +} + +void CLogger::setOutputScreen(int fd, log_level m_eLevel) +{ + _assureIsInitialized(); + clog_free(0); + clog_init_fd(0, fd); + _setLevel(0,m_eLevel); +} + +void CLogger::setOutputFile(const char *filename, log_level m_eLevel) +{ + if(m_bFileProvided){ + clog_free(1); + m_bFileProvided=false; + } + if(!clog_init_path(1,filename)){ + m_bFileProvided=true; + _setLevel(1,m_eLevel); + } +} + +void CLogger::_assureIsInitialized() +{ + if(!m_bInitialized) + { + clog_init_fd(0, 2); + clog_set_level(0, CLOG_INFO); + m_bInitialized = true; + } +} + +void CLogger::setFormatFile(const char *fmt) +{ + if(m_bFileProvided){ + clog_set_fmt(1,fmt); + }else{ + error(__FILE__,__LINE__,"No log file specified"); + } +} +void CLogger::setFormatScreen(const char *fmt) +{ + clog_set_fmt(0,fmt); +} + +CLogger::CLogger() +{ + ; +} + +bool CLogger::m_bEnabledScreen = true; +bool CLogger::m_bEnabledFile = true; +bool CLogger::m_bFileProvided = false; +bool CLogger::m_bInitialized = false; -- cgit v1.2.3 From 535564ccd8b9563fb52be0dff247b99495942f51 Mon Sep 17 00:00:00 2001 From: "Daniel M. Pelt" Date: Tue, 10 Mar 2015 12:54:08 +0100 Subject: Add logging support to Python --- python/astra/__init__.py | 1 + python/astra/log.py | 153 +++++++++++++++++++++++++++++++++++++++++++++++ python/astra/log_c.pyx | 96 +++++++++++++++++++++++++++++ 3 files changed, 250 insertions(+) create mode 100644 python/astra/log.py create mode 100644 python/astra/log_c.pyx diff --git a/python/astra/__init__.py b/python/astra/__init__.py index a61aafc..1d3176c 100644 --- a/python/astra/__init__.py +++ b/python/astra/__init__.py @@ -34,6 +34,7 @@ from . import data3d from . import algorithm from . import projector from . import matrix +from . import log import os try: diff --git a/python/astra/log.py b/python/astra/log.py new file mode 100644 index 0000000..3ec0df5 --- /dev/null +++ b/python/astra/log.py @@ -0,0 +1,153 @@ +#----------------------------------------------------------------------- +#Copyright 2013 Centrum Wiskunde & Informatica, Amsterdam +# +#Author: Daniel M. Pelt +#Contact: D.M.Pelt@cwi.nl +#Website: http://dmpelt.github.io/pyastratoolbox/ +# +# +#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 +#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. +# +#The Python interface to 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 . +# +#----------------------------------------------------------------------- + +from . import log_c as l + +import inspect + +def debug(message): + """Log a debug message. + + :param message: Message to log. + :type message: :class:`string` + """ + prev_f = inspect.getframeinfo(inspect.currentframe().f_back) + l.log_debug(prev_f.filename,prev_f.lineno,message) + +def info(message): + """Log an info message. + + :param message: Message to log. + :type message: :class:`string` + """ + prev_f = inspect.getframeinfo(inspect.currentframe().f_back) + l.log_info(prev_f.filename,prev_f.lineno,message) + +def warn(message): + """Log a warning message. + + :param message: Message to log. + :type message: :class:`string` + """ + prev_f = inspect.getframeinfo(inspect.currentframe().f_back) + l.log_warn(prev_f.filename,prev_f.lineno,message) + +def error(message): + """Log an error message. + + :param message: Message to log. + :type message: :class:`string` + """ + prev_f = inspect.getframeinfo(inspect.currentframe().f_back) + l.log_error(prev_f.filename,prev_f.lineno,message) + +def enable(): + """Enable logging to screen and file.""" + l.log_enable() + +def enableScreen(): + """Enable logging to screen.""" + l.log_enableScreen() + +def enableFile(): + """Enable logging to file (note that a file has to be set).""" + l.log_enableFile() + +def disable(): + """Disable all logging.""" + l.log_disable() + +def disableScreen(): + """Disable logging to screen.""" + l.log_disableScreen() + +def disableFile(): + """Disable logging to file.""" + l.log_disableFile() + +def setFormatFile(fmt): + """Set the format string for log messages. Here are the substitutions you may use: + + %f: Source file name generating the log call. + %n: Source line number where the log call was made. + %m: The message text sent to the logger (after printf formatting). + %d: The current date, formatted using the logger's date format. + %t: The current time, formatted using the logger's time format. + %l: The log level (one of "DEBUG", "INFO", "WARN", or "ERROR"). + %%: A literal percent sign. + + The default format string is "%d %t %f(%n): %l: %m\n". + + :param fmt: Format to use, end with "\n". + :type fmt: :class:`string` + """ + l.log_setFormatFile(fmt) + +def setFormatScreen(fmt): + """Set the format string for log messages. Here are the substitutions you may use: + + %f: Source file name generating the log call. + %n: Source line number where the log call was made. + %m: The message text sent to the logger (after printf formatting). + %d: The current date, formatted using the logger's date format. + %t: The current time, formatted using the logger's time format. + %l: The log level (one of "DEBUG", "INFO", "WARN", or "ERROR"). + %%: A literal percent sign. + + The default format string is "%d %t %f(%n): %l: %m\n". + + :param fmt: Format to use, end with "\n". + :type fmt: :class:`string` + """ + l.log_setFormatScreen(fmt) + +STDOUT=1 +STDERR=2 + +DEBUG=0 +INFO=1 +WARN=2 +ERROR=3 + +def setOutputScreen(fd, level): + """Set which screen to output to, and which level to use. + + :param fd: File descriptor of output screen (STDOUT or STDERR). + :type fd: :class:`int` + :param level: Logging level to use (DEBUG, INFO, WARN, or ERROR). + :type level: :class:`int` + """ + l.log_setOutputScreen(fd, level) + +def setOutputFile(filename, level): + """Set which file to output to, and which level to use. + + :param filename: File name of output file. + :type filename: :class:`string` + :param level: Logging level to use (DEBUG, INFO, WARN, or ERROR). + :type level: :class:`int` + """ + l.log_setOutputFile(filename, level) \ No newline at end of file diff --git a/python/astra/log_c.pyx b/python/astra/log_c.pyx new file mode 100644 index 0000000..969cc06 --- /dev/null +++ b/python/astra/log_c.pyx @@ -0,0 +1,96 @@ +#----------------------------------------------------------------------- +#Copyright 2013 Centrum Wiskunde & Informatica, Amsterdam +# +#Author: Daniel M. Pelt +#Contact: D.M.Pelt@cwi.nl +#Website: http://dmpelt.github.io/pyastratoolbox/ +# +# +#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 +#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. +# +#The Python interface to 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 . +# +#----------------------------------------------------------------------- +# distutils: language = c++ +# distutils: libraries = astra + +import six + +cdef extern from "astra/Logging.h" namespace "astra": + cdef enum log_level: + LOG_DEBUG + LOG_INFO + LOG_WARN + LOG_ERROR + +cdef extern from "astra/Logging.h" namespace "astra::CLogger": + void debug(const char *sfile, int sline, const char *fmt, ...) + void info(const char *sfile, int sline, const char *fmt, ...) + void warn(const char *sfile, int sline, const char *fmt, ...) + void error(const char *sfile, int sline, const char *fmt, ...) + void setOutputScreen(int fd, log_level m_eLevel) + void setOutputFile(const char *filename, log_level m_eLevel) + void enable() + void enableScreen() + void enableFile() + void disable() + void disableScreen() + void disableFile() + void setFormatFile(const char *fmt) + void setFormatScreen(const char *fmt) + +def log_debug(sfile, sline, message): + debug(six.b(sfile),sline,six.b(message)) + +def log_info(sfile, sline, message): + info(six.b(sfile),sline,six.b(message)) + +def log_warn(sfile, sline, message): + warn(six.b(sfile),sline,six.b(message)) + +def log_error(sfile, sline, message): + error(six.b(sfile),sline,six.b(message)) + +def log_enable(): + enable() + +def log_enableScreen(): + enableScreen() + +def log_enableFile(): + enableFile() + +def log_disable(): + disable() + +def log_disableScreen(): + disableScreen() + +def log_disableFile(): + disableFile() + +def log_setFormatFile(fmt): + setFormatFile(six.b(fmt)) + +def log_setFormatScreen(fmt): + setFormatScreen(six.b(fmt)) + +enumList = [LOG_DEBUG,LOG_INFO,LOG_WARN,LOG_ERROR] + +def log_setOutputScreen(fd, level): + setOutputScreen(fd, enumList[level]) + +def log_setOutputFile(filename, level): + setOutputFile(six.b(filename), enumList[level]) \ No newline at end of file -- cgit v1.2.3 From 150951875c236f95a64fd132c26576bd19daca80 Mon Sep 17 00:00:00 2001 From: "Daniel M. Pelt" Date: Tue, 10 Mar 2015 15:11:15 +0100 Subject: Use new logging API internally instead of printf / iostream --- cuda/2d/astra.cu | 4 +++- cuda/2d/fft.cu | 31 +++++++++++++++-------------- cuda/2d/util.cu | 8 +++++--- cuda/3d/util3d.cu | 12 ++++++----- src/ConeProjectionGeometry3D.cpp | 4 +++- src/Config.cpp | 7 ++++++- src/CudaFilteredBackProjectionAlgorithm.cpp | 4 +++- src/CudaForwardProjectionAlgorithm.cpp | 4 +++- src/CudaForwardProjectionAlgorithm3D.cpp | 4 +++- src/CudaReconstructionAlgorithm2D.cpp | 4 +++- src/FilteredBackProjectionAlgorithm.cpp | 4 +++- 11 files changed, 55 insertions(+), 31 deletions(-) diff --git a/cuda/2d/astra.cu b/cuda/2d/astra.cu index bcc1a50..71fd089 100644 --- a/cuda/2d/astra.cu +++ b/cuda/2d/astra.cu @@ -47,6 +47,8 @@ $Id$ #include "../../include/astra/FanFlatProjectionGeometry2D.h" #include "../../include/astra/FanFlatVecProjectionGeometry2D.h" +#include "../../include/astra/Logging.h" + // For fan beam FBP weighting #include "../3d/fdk.h" @@ -562,7 +564,7 @@ bool AstraFBP::setFilter(E_FBPFILTER _eFilter, const float * _pfHostFilter /* = } default: { - fprintf(stderr, "AstraFBP::setFilter: Unknown filter type requested"); + astra::CLogger::error(__FILE__,__LINE__,"AstraFBP::setFilter: Unknown filter type requested"); delete [] pHostFilter; return false; } diff --git a/cuda/2d/fft.cu b/cuda/2d/fft.cu index 5fef360..468c7c2 100644 --- a/cuda/2d/fft.cu +++ b/cuda/2d/fft.cu @@ -34,6 +34,7 @@ $Id$ #include #include +#include "../../include/astra/Logging.h" using namespace astra; @@ -42,22 +43,22 @@ using namespace astra; #define CHECK_ERROR(errorMessage) do { \ cudaError_t err = cudaThreadSynchronize(); \ if( cudaSuccess != err) { \ - fprintf(stderr, "Cuda error: %s in file '%s' in line %i : %s.\n", \ - errorMessage, __FILE__, __LINE__, cudaGetErrorString( err) );\ + astra::CLogger::error(__FILE__,__LINE__,"Cuda error %s : %s", \ + errorMessage,cudaGetErrorString( err)); \ exit(EXIT_FAILURE); \ } } while (0) #define SAFE_CALL( call) do { \ cudaError err = call; \ if( cudaSuccess != err) { \ - fprintf(stderr, "Cuda error in file '%s' in line %i : %s.\n", \ - __FILE__, __LINE__, cudaGetErrorString( err) ); \ + astra::CLogger::error(__FILE__,__LINE__,"Cuda error: %s ", \ + cudaGetErrorString( err)); \ exit(EXIT_FAILURE); \ } \ err = cudaThreadSynchronize(); \ if( cudaSuccess != err) { \ - fprintf(stderr, "Cuda error in file '%s' in line %i : %s.\n", \ - __FILE__, __LINE__, cudaGetErrorString( err) ); \ + astra::CLogger::error(__FILE__,__LINE__,"Cuda error: %s : ", \ + cudaGetErrorString( err)); \ exit(EXIT_FAILURE); \ } } while (0) @@ -136,7 +137,7 @@ static bool invokeCudaFFT(int _iProjectionCount, int _iDetectorCount, result = cufftPlan1d(&plan, _iDetectorCount, CUFFT_R2C, _iProjectionCount); if(result != CUFFT_SUCCESS) { - std::cerr << "Failed to plan 1d r2c fft" << std::endl; + astra::CLogger::error(__FILE__,__LINE__,"Failed to plan 1d r2c fft"); return false; } @@ -145,7 +146,7 @@ static bool invokeCudaFFT(int _iProjectionCount, int _iDetectorCount, if(result != CUFFT_SUCCESS) { - std::cerr << "Failed to exec 1d r2c fft" << std::endl; + astra::CLogger::error(__FILE__,__LINE__,"Failed to exec 1d r2c fft"); return false; } @@ -162,7 +163,7 @@ static bool invokeCudaIFFT(int _iProjectionCount, int _iDetectorCount, result = cufftPlan1d(&plan, _iDetectorCount, CUFFT_C2R, _iProjectionCount); if(result != CUFFT_SUCCESS) { - std::cerr << "Failed to plan 1d c2r fft" << std::endl; + astra::CLogger::error(__FILE__,__LINE__,"Failed to plan 1d c2r fft"); return false; } @@ -173,7 +174,7 @@ static bool invokeCudaIFFT(int _iProjectionCount, int _iDetectorCount, if(result != CUFFT_SUCCESS) { - std::cerr << "Failed to exec 1d c2r fft" << std::endl; + astra::CLogger::error(__FILE__,__LINE__,"Failed to exec 1d c2r fft"); return false; } @@ -629,7 +630,7 @@ void genFilter(E_FBPFILTER _eFilter, float _fD, int _iProjectionCount, } default: { - std::cerr << "Cannot serve requested filter" << std::endl; + astra::CLogger::error(__FILE__,__LINE__,"Cannot serve requested filter"); } } @@ -763,13 +764,13 @@ void testCudaFFT() result = cufftPlan1d(&plan, iDetectorCount, CUFFT_R2C, iProjectionCount); if(result != CUFFT_SUCCESS) { - cerr << "Failed to plan 1d r2c fft" << endl; + astra::CLogger::error(__FILE__,__LINE__,"Failed to plan 1d r2c fft"); } result = cufftExecR2C(plan, pfDevProj, pDevFourProj); if(result != CUFFT_SUCCESS) { - cerr << "Failed to exec 1d r2c fft" << endl; + astra::CLogger::error(__FILE__,__LINE__,"Failed to exec 1d r2c fft"); } cufftDestroy(plan); @@ -793,13 +794,13 @@ void testCudaFFT() result = cufftPlan1d(&plan, iDetectorCount, CUFFT_C2R, iProjectionCount); if(result != CUFFT_SUCCESS) { - cerr << "Failed to plan 1d c2r fft" << endl; + astra::CLogger::error(__FILE__,__LINE__,"Failed to plan 1d c2r fft"); } result = cufftExecC2R(plan, pDevFourProj, pfDevInFourProj); if(result != CUFFT_SUCCESS) { - cerr << "Failed to exec 1d c2r fft" << endl; + astra::CLogger::error(__FILE__,__LINE__,"Failed to exec 1d c2r fft"); } cufftDestroy(plan); diff --git a/cuda/2d/util.cu b/cuda/2d/util.cu index 81e368f..6ced557 100644 --- a/cuda/2d/util.cu +++ b/cuda/2d/util.cu @@ -30,6 +30,8 @@ $Id$ #include #include "util.h" +#include "../../include/astra/Logging.h" + namespace astraCUDA { bool copyVolumeToDevice(const float* in_data, unsigned int in_pitch, @@ -91,7 +93,7 @@ bool allocateVolume(float*& ptr, unsigned int width, unsigned int height, unsign cudaError_t ret = cudaMallocPitch((void**)&ptr, &p, sizeof(float)*width, height); if (ret != cudaSuccess) { reportCudaError(ret); - fprintf(stderr, "Failed to allocate %dx%d GPU buffer\n", width, height); + astra::CLogger::error(__FILE__,__LINE__,"Failed to allocate %dx%d GPU buffer", width, height); return false; } @@ -259,7 +261,7 @@ bool cudaTextForceKernelsCompletion() cudaError_t returnedCudaError = cudaThreadSynchronize(); if(returnedCudaError != cudaSuccess) { - fprintf(stderr, "Failed to force completion of cuda kernels: %d: %s.\n", returnedCudaError, cudaGetErrorString(returnedCudaError)); + astra::CLogger::error(__FILE__,__LINE__,"Failed to force completion of cuda kernels: %d: %s.", returnedCudaError, cudaGetErrorString(returnedCudaError)); return false; } @@ -269,7 +271,7 @@ bool cudaTextForceKernelsCompletion() void reportCudaError(cudaError_t err) { if(err != cudaSuccess) - fprintf(stderr, "CUDA error %d: %s.\n", err, cudaGetErrorString(err)); + astra::CLogger::error(__FILE__,__LINE__,"CUDA error %d: %s.", err, cudaGetErrorString(err)); } diff --git a/cuda/3d/util3d.cu b/cuda/3d/util3d.cu index d85a928..f2d16b3 100644 --- a/cuda/3d/util3d.cu +++ b/cuda/3d/util3d.cu @@ -31,6 +31,8 @@ $Id$ #include "util3d.h" #include "../2d/util.h" +#include "../../include/astra/Logging.h" + namespace astraCUDA3d { @@ -46,7 +48,7 @@ cudaPitchedPtr allocateVolumeData(const SDimensions3D& dims) cudaError err = cudaMalloc3D(&volData, extentV); if (err != cudaSuccess) { astraCUDA::reportCudaError(err); - fprintf(stderr, "Failed to allocate %dx%dx%d GPU buffer\n", dims.iVolX, dims.iVolY, dims.iVolZ); + astra::CLogger::error(__FILE__,__LINE__,"Failed to allocate %dx%dx%d GPU buffer", dims.iVolX, dims.iVolY, dims.iVolZ); volData.ptr = 0; // TODO: return 0 somehow? } @@ -65,7 +67,7 @@ cudaPitchedPtr allocateProjectionData(const SDimensions3D& dims) cudaError err = cudaMalloc3D(&projData, extentP); if (err != cudaSuccess) { astraCUDA::reportCudaError(err); - fprintf(stderr, "Failed to allocate %dx%dx%d GPU buffer\n", dims.iProjU, dims.iProjAngles, dims.iProjV); + astra::CLogger::error(__FILE__,__LINE__,"Failed to allocate %dx%dx%d GPU buffer", dims.iProjU, dims.iProjAngles, dims.iProjV); projData.ptr = 0; // TODO: return 0 somehow? } @@ -303,7 +305,7 @@ cudaArray* allocateVolumeArray(const SDimensions3D& dims) cudaError err = cudaMalloc3DArray(&cuArray, &channelDesc, extentA); if (err != cudaSuccess) { astraCUDA::reportCudaError(err); - fprintf(stderr, "Failed to allocate %dx%dx%d GPU array\n", dims.iVolX, dims.iVolY, dims.iVolZ); + astra::CLogger::error(__FILE__,__LINE__,"Failed to allocate %dx%dx%d GPU array", dims.iVolX, dims.iVolY, dims.iVolZ); return 0; } @@ -321,7 +323,7 @@ cudaArray* allocateProjectionArray(const SDimensions3D& dims) if (err != cudaSuccess) { astraCUDA::reportCudaError(err); - fprintf(stderr, "Failed to allocate %dx%dx%d GPU array\n", dims.iProjU, dims.iProjAngles, dims.iProjV); + astra::CLogger::error(__FILE__,__LINE__,"Failed to allocate %dx%dx%d GPU array", dims.iProjU, dims.iProjAngles, dims.iProjV); return 0; } @@ -397,7 +399,7 @@ bool cudaTextForceKernelsCompletion() cudaError_t returnedCudaError = cudaThreadSynchronize(); if(returnedCudaError != cudaSuccess) { - fprintf(stderr, "Failed to force completion of cuda kernels: %d: %s.\n", returnedCudaError, cudaGetErrorString(returnedCudaError)); + astra::CLogger::error(__FILE__,__LINE__,"Failed to force completion of cuda kernels: %d: %s.", returnedCudaError, cudaGetErrorString(returnedCudaError)); return false; } diff --git a/src/ConeProjectionGeometry3D.cpp b/src/ConeProjectionGeometry3D.cpp index eb9adcf..13f147b 100644 --- a/src/ConeProjectionGeometry3D.cpp +++ b/src/ConeProjectionGeometry3D.cpp @@ -28,6 +28,8 @@ $Id$ #include "astra/ConeProjectionGeometry3D.h" +#include "astra/Logging.h" + #include #include @@ -257,7 +259,7 @@ void CConeProjectionGeometry3D::projectPoint(float32 fX, float32 fY, float32 fZ, // Scale fS to detector plane fU = detectorOffsetXToColIndexFloat( (fS * (m_fOriginSourceDistance + m_fOriginDetectorDistance)) / fD ); - fprintf(stderr, "alpha: %f, D: %f, V: %f, S: %f, U: %f\n", alpha, fD, fV, fS, fU); + astra::CLogger::debug(__FILE__,__LINE__,"alpha: %f, D: %f, V: %f, S: %f, U: %f", alpha, fD, fV, fS, fU); } diff --git a/src/Config.cpp b/src/Config.cpp index 653935e..0a85b3c 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -37,6 +37,9 @@ $Id$ #include "astra/Projector2D.h" #include "astra/Projector3D.h" +#include "astra/Logging.h" +#include + using namespace astra; using namespace std; @@ -144,7 +147,9 @@ bool ConfigStackCheck::stopParsing() nodes.clear(); if (!errors.empty()) { - cout << "Warning: " << name << ": unused configuration options: " << errors << std::endl; + ostringstream os; + os << "Warning: " << name << ": unused configuration options: " << errors; + astra::CLogger::warn(__FILE__,__LINE__,os.str().c_str()); return false; } diff --git a/src/CudaFilteredBackProjectionAlgorithm.cpp b/src/CudaFilteredBackProjectionAlgorithm.cpp index 77bd412..26b848e 100644 --- a/src/CudaFilteredBackProjectionAlgorithm.cpp +++ b/src/CudaFilteredBackProjectionAlgorithm.cpp @@ -34,6 +34,8 @@ $Id$ #include "astra/AstraObjectManager.h" #include "../cuda/2d/astra.h" +#include "astra/Logging.h" + using namespace std; using namespace astra; @@ -483,7 +485,7 @@ E_FBPFILTER CCudaFilteredBackProjectionAlgorithm::_convertStringToFilter(const c } else { - cerr << "Failed to convert \"" << _filterType << "\" into a filter." << endl; + astra::CLogger::error(__FILE__,__LINE__,"Failed to convert \"%s\" into a filter.",_filterType); } return output; diff --git a/src/CudaForwardProjectionAlgorithm.cpp b/src/CudaForwardProjectionAlgorithm.cpp index ab0d643..1ae6b83 100644 --- a/src/CudaForwardProjectionAlgorithm.cpp +++ b/src/CudaForwardProjectionAlgorithm.cpp @@ -42,6 +42,8 @@ $Id$ #include "astra/FanFlatVecProjectionGeometry2D.h" #include "astra/CudaProjector2D.h" +#include "astra/Logging.h" + using namespace std; namespace astra { @@ -104,7 +106,7 @@ bool CCudaForwardProjectionAlgorithm::initialize(const Config& _cfg) id = boost::lexical_cast(node->getContent()); CProjector2D *projector = CProjector2DManager::getSingleton().get(id); if (!dynamic_cast(projector)) { - cout << "Warning: non-CUDA Projector2D passed to FP_CUDA" << std::endl; + astra::CLogger::warn(__FILE__,__LINE__,"Warning: non-CUDA Projector2D passed to FP_CUDA"); } delete node; } diff --git a/src/CudaForwardProjectionAlgorithm3D.cpp b/src/CudaForwardProjectionAlgorithm3D.cpp index bb122e0..57e1094 100644 --- a/src/CudaForwardProjectionAlgorithm3D.cpp +++ b/src/CudaForwardProjectionAlgorithm3D.cpp @@ -40,6 +40,8 @@ $Id$ #include "astra/ParallelVecProjectionGeometry3D.h" #include "astra/ConeVecProjectionGeometry3D.h" +#include "astra/Logging.h" + #include "../cuda/3d/astra3d.h" using namespace std; @@ -265,7 +267,7 @@ void CCudaForwardProjectionAlgorithm3D::run(int) for (int k = 0; k < 2; ++k) { float fU, fV; projgeom->projectPoint(fX[i], fY[j], fZ[k], a, fU, fV); - fprintf(stderr, "%3d %c1,%c1,%c1 -> %12f %12f\n", a, i ? ' ' : '-', j ? ' ' : '-', k ? ' ' : '-', fU, fV); + astra::CLogger::debug(__FILE__,__LINE__,"%3d %c1,%c1,%c1 -> %12f %12f", a, i ? ' ' : '-', j ? ' ' : '-', k ? ' ' : '-', fU, fV); } } #endif diff --git a/src/CudaReconstructionAlgorithm2D.cpp b/src/CudaReconstructionAlgorithm2D.cpp index d3dedc5..b434e8a 100644 --- a/src/CudaReconstructionAlgorithm2D.cpp +++ b/src/CudaReconstructionAlgorithm2D.cpp @@ -37,6 +37,8 @@ $Id$ #include "astra/FanFlatVecProjectionGeometry2D.h" #include "astra/CudaProjector2D.h" +#include "astra/Logging.h" + #include "../cuda/2d/algo.h" #include @@ -176,7 +178,7 @@ bool CCudaReconstructionAlgorithm2D::initialize(const Config& _cfg) id = boost::lexical_cast(node->getContent()); CProjector2D *projector = CProjector2DManager::getSingleton().get(id); if (!dynamic_cast(projector)) { - cout << "Warning: non-CUDA Projector2D passed" << std::endl; + astra::CLogger::warn(__FILE__,__LINE__,"Warning: non-CUDA Projector2D passed"); } delete node; } diff --git a/src/FilteredBackProjectionAlgorithm.cpp b/src/FilteredBackProjectionAlgorithm.cpp index 50cf939..47315bb 100644 --- a/src/FilteredBackProjectionAlgorithm.cpp +++ b/src/FilteredBackProjectionAlgorithm.cpp @@ -39,6 +39,8 @@ $Id$ #include "astra/Fourier.h" #include "astra/DataProjector.h" +#include "astra/Logging.h" + using namespace std; namespace astra { @@ -133,7 +135,7 @@ bool CFilteredBackProjectionAlgorithm::initialize(const Config& _cfg) for (int i = 0; i < angleCount; i ++) { if (projectionIndex[i] > m_pProjector->getProjectionGeometry()->getProjectionAngleCount() -1 ) { - cout << "Invalid Projection Index" << endl; + astra::CLogger::error(__FILE__,__LINE__,"Invalid Projection Index"); return false; } else { int orgIndex = (int)projectionIndex[i]; -- cgit v1.2.3 From c5507b6ef2abfab169150528a374526bb348bf62 Mon Sep 17 00:00:00 2001 From: "Daniel M. Pelt" Date: Fri, 13 Mar 2015 12:18:21 +0100 Subject: Adds ASTRA_*** defines for easier logging, and changes internal calls to these defines --- cuda/2d/astra.cu | 2 +- cuda/2d/fft.cu | 24 ++++++++++++------------ cuda/2d/util.cu | 6 +++--- cuda/3d/util3d.cu | 10 +++++----- include/astra/Logging.h | 5 ++++- src/ConeProjectionGeometry3D.cpp | 2 +- src/Config.cpp | 2 +- src/CudaFilteredBackProjectionAlgorithm.cpp | 2 +- src/CudaForwardProjectionAlgorithm.cpp | 2 +- src/CudaForwardProjectionAlgorithm3D.cpp | 2 +- src/CudaReconstructionAlgorithm2D.cpp | 2 +- src/FilteredBackProjectionAlgorithm.cpp | 2 +- 12 files changed, 32 insertions(+), 29 deletions(-) diff --git a/cuda/2d/astra.cu b/cuda/2d/astra.cu index 71fd089..2f72db0 100644 --- a/cuda/2d/astra.cu +++ b/cuda/2d/astra.cu @@ -564,7 +564,7 @@ bool AstraFBP::setFilter(E_FBPFILTER _eFilter, const float * _pfHostFilter /* = } default: { - astra::CLogger::error(__FILE__,__LINE__,"AstraFBP::setFilter: Unknown filter type requested"); + ASTRA_ERROR("AstraFBP::setFilter: Unknown filter type requested"); delete [] pHostFilter; return false; } diff --git a/cuda/2d/fft.cu b/cuda/2d/fft.cu index 468c7c2..49c696c 100644 --- a/cuda/2d/fft.cu +++ b/cuda/2d/fft.cu @@ -43,7 +43,7 @@ using namespace astra; #define CHECK_ERROR(errorMessage) do { \ cudaError_t err = cudaThreadSynchronize(); \ if( cudaSuccess != err) { \ - astra::CLogger::error(__FILE__,__LINE__,"Cuda error %s : %s", \ + ASTRA_ERROR("Cuda error %s : %s", \ errorMessage,cudaGetErrorString( err)); \ exit(EXIT_FAILURE); \ } } while (0) @@ -51,13 +51,13 @@ using namespace astra; #define SAFE_CALL( call) do { \ cudaError err = call; \ if( cudaSuccess != err) { \ - astra::CLogger::error(__FILE__,__LINE__,"Cuda error: %s ", \ + ASTRA_ERROR("Cuda error: %s ", \ cudaGetErrorString( err)); \ exit(EXIT_FAILURE); \ } \ err = cudaThreadSynchronize(); \ if( cudaSuccess != err) { \ - astra::CLogger::error(__FILE__,__LINE__,"Cuda error: %s : ", \ + ASTRA_ERROR("Cuda error: %s : ", \ cudaGetErrorString( err)); \ exit(EXIT_FAILURE); \ } } while (0) @@ -137,7 +137,7 @@ static bool invokeCudaFFT(int _iProjectionCount, int _iDetectorCount, result = cufftPlan1d(&plan, _iDetectorCount, CUFFT_R2C, _iProjectionCount); if(result != CUFFT_SUCCESS) { - astra::CLogger::error(__FILE__,__LINE__,"Failed to plan 1d r2c fft"); + ASTRA_ERROR("Failed to plan 1d r2c fft"); return false; } @@ -146,7 +146,7 @@ static bool invokeCudaFFT(int _iProjectionCount, int _iDetectorCount, if(result != CUFFT_SUCCESS) { - astra::CLogger::error(__FILE__,__LINE__,"Failed to exec 1d r2c fft"); + ASTRA_ERROR("Failed to exec 1d r2c fft"); return false; } @@ -163,7 +163,7 @@ static bool invokeCudaIFFT(int _iProjectionCount, int _iDetectorCount, result = cufftPlan1d(&plan, _iDetectorCount, CUFFT_C2R, _iProjectionCount); if(result != CUFFT_SUCCESS) { - astra::CLogger::error(__FILE__,__LINE__,"Failed to plan 1d c2r fft"); + ASTRA_ERROR("Failed to plan 1d c2r fft"); return false; } @@ -174,7 +174,7 @@ static bool invokeCudaIFFT(int _iProjectionCount, int _iDetectorCount, if(result != CUFFT_SUCCESS) { - astra::CLogger::error(__FILE__,__LINE__,"Failed to exec 1d c2r fft"); + ASTRA_ERROR("Failed to exec 1d c2r fft"); return false; } @@ -630,7 +630,7 @@ void genFilter(E_FBPFILTER _eFilter, float _fD, int _iProjectionCount, } default: { - astra::CLogger::error(__FILE__,__LINE__,"Cannot serve requested filter"); + ASTRA_ERROR("Cannot serve requested filter"); } } @@ -764,13 +764,13 @@ void testCudaFFT() result = cufftPlan1d(&plan, iDetectorCount, CUFFT_R2C, iProjectionCount); if(result != CUFFT_SUCCESS) { - astra::CLogger::error(__FILE__,__LINE__,"Failed to plan 1d r2c fft"); + ASTRA_ERROR("Failed to plan 1d r2c fft"); } result = cufftExecR2C(plan, pfDevProj, pDevFourProj); if(result != CUFFT_SUCCESS) { - astra::CLogger::error(__FILE__,__LINE__,"Failed to exec 1d r2c fft"); + ASTRA_ERROR("Failed to exec 1d r2c fft"); } cufftDestroy(plan); @@ -794,13 +794,13 @@ void testCudaFFT() result = cufftPlan1d(&plan, iDetectorCount, CUFFT_C2R, iProjectionCount); if(result != CUFFT_SUCCESS) { - astra::CLogger::error(__FILE__,__LINE__,"Failed to plan 1d c2r fft"); + ASTRA_ERROR("Failed to plan 1d c2r fft"); } result = cufftExecC2R(plan, pDevFourProj, pfDevInFourProj); if(result != CUFFT_SUCCESS) { - astra::CLogger::error(__FILE__,__LINE__,"Failed to exec 1d c2r fft"); + ASTRA_ERROR("Failed to exec 1d c2r fft"); } cufftDestroy(plan); diff --git a/cuda/2d/util.cu b/cuda/2d/util.cu index 6ced557..a4f8f3e 100644 --- a/cuda/2d/util.cu +++ b/cuda/2d/util.cu @@ -93,7 +93,7 @@ bool allocateVolume(float*& ptr, unsigned int width, unsigned int height, unsign cudaError_t ret = cudaMallocPitch((void**)&ptr, &p, sizeof(float)*width, height); if (ret != cudaSuccess) { reportCudaError(ret); - astra::CLogger::error(__FILE__,__LINE__,"Failed to allocate %dx%d GPU buffer", width, height); + ASTRA_ERROR("Failed to allocate %dx%d GPU buffer", width, height); return false; } @@ -261,7 +261,7 @@ bool cudaTextForceKernelsCompletion() cudaError_t returnedCudaError = cudaThreadSynchronize(); if(returnedCudaError != cudaSuccess) { - astra::CLogger::error(__FILE__,__LINE__,"Failed to force completion of cuda kernels: %d: %s.", returnedCudaError, cudaGetErrorString(returnedCudaError)); + ASTRA_ERROR("Failed to force completion of cuda kernels: %d: %s.", returnedCudaError, cudaGetErrorString(returnedCudaError)); return false; } @@ -271,7 +271,7 @@ bool cudaTextForceKernelsCompletion() void reportCudaError(cudaError_t err) { if(err != cudaSuccess) - astra::CLogger::error(__FILE__,__LINE__,"CUDA error %d: %s.", err, cudaGetErrorString(err)); + ASTRA_ERROR("CUDA error %d: %s.", err, cudaGetErrorString(err)); } diff --git a/cuda/3d/util3d.cu b/cuda/3d/util3d.cu index f2d16b3..537ed69 100644 --- a/cuda/3d/util3d.cu +++ b/cuda/3d/util3d.cu @@ -48,7 +48,7 @@ cudaPitchedPtr allocateVolumeData(const SDimensions3D& dims) cudaError err = cudaMalloc3D(&volData, extentV); if (err != cudaSuccess) { astraCUDA::reportCudaError(err); - astra::CLogger::error(__FILE__,__LINE__,"Failed to allocate %dx%dx%d GPU buffer", dims.iVolX, dims.iVolY, dims.iVolZ); + ASTRA_ERROR("Failed to allocate %dx%dx%d GPU buffer", dims.iVolX, dims.iVolY, dims.iVolZ); volData.ptr = 0; // TODO: return 0 somehow? } @@ -67,7 +67,7 @@ cudaPitchedPtr allocateProjectionData(const SDimensions3D& dims) cudaError err = cudaMalloc3D(&projData, extentP); if (err != cudaSuccess) { astraCUDA::reportCudaError(err); - astra::CLogger::error(__FILE__,__LINE__,"Failed to allocate %dx%dx%d GPU buffer", dims.iProjU, dims.iProjAngles, dims.iProjV); + ASTRA_ERROR("Failed to allocate %dx%dx%d GPU buffer", dims.iProjU, dims.iProjAngles, dims.iProjV); projData.ptr = 0; // TODO: return 0 somehow? } @@ -305,7 +305,7 @@ cudaArray* allocateVolumeArray(const SDimensions3D& dims) cudaError err = cudaMalloc3DArray(&cuArray, &channelDesc, extentA); if (err != cudaSuccess) { astraCUDA::reportCudaError(err); - astra::CLogger::error(__FILE__,__LINE__,"Failed to allocate %dx%dx%d GPU array", dims.iVolX, dims.iVolY, dims.iVolZ); + ASTRA_ERROR("Failed to allocate %dx%dx%d GPU array", dims.iVolX, dims.iVolY, dims.iVolZ); return 0; } @@ -323,7 +323,7 @@ cudaArray* allocateProjectionArray(const SDimensions3D& dims) if (err != cudaSuccess) { astraCUDA::reportCudaError(err); - astra::CLogger::error(__FILE__,__LINE__,"Failed to allocate %dx%dx%d GPU array", dims.iProjU, dims.iProjAngles, dims.iProjV); + ASTRA_ERROR("Failed to allocate %dx%dx%d GPU array", dims.iProjU, dims.iProjAngles, dims.iProjV); return 0; } @@ -399,7 +399,7 @@ bool cudaTextForceKernelsCompletion() cudaError_t returnedCudaError = cudaThreadSynchronize(); if(returnedCudaError != cudaSuccess) { - astra::CLogger::error(__FILE__,__LINE__,"Failed to force completion of cuda kernels: %d: %s.", returnedCudaError, cudaGetErrorString(returnedCudaError)); + ASTRA_ERROR("Failed to force completion of cuda kernels: %d: %s.", returnedCudaError, cudaGetErrorString(returnedCudaError)); return false; } diff --git a/include/astra/Logging.h b/include/astra/Logging.h index ce777ae..5695663 100644 --- a/include/astra/Logging.h +++ b/include/astra/Logging.h @@ -29,7 +29,10 @@ $Id$ #ifndef _INC_ASTRA_LOGGING #define _INC_ASTRA_LOGGING -#define ASTRA_LOG(id) __FILE__, __LINE__, id +#define ASTRA_DEBUG(...) astra::CLogger::debug(__FILE__,__LINE__, __VA_ARGS__) +#define ASTRA_INFO(...) astra::CLogger::info(__FILE__,__LINE__, __VA_ARGS__) +#define ASTRA_WARN(...) astra::CLogger::warn(__FILE__,__LINE__, __VA_ARGS__) +#define ASTRA_ERROR(...) astra::CLogger::error(__FILE__,__LINE__, __VA_ARGS__) namespace astra { diff --git a/src/ConeProjectionGeometry3D.cpp b/src/ConeProjectionGeometry3D.cpp index 13f147b..1976901 100644 --- a/src/ConeProjectionGeometry3D.cpp +++ b/src/ConeProjectionGeometry3D.cpp @@ -259,7 +259,7 @@ void CConeProjectionGeometry3D::projectPoint(float32 fX, float32 fY, float32 fZ, // Scale fS to detector plane fU = detectorOffsetXToColIndexFloat( (fS * (m_fOriginSourceDistance + m_fOriginDetectorDistance)) / fD ); - astra::CLogger::debug(__FILE__,__LINE__,"alpha: %f, D: %f, V: %f, S: %f, U: %f", alpha, fD, fV, fS, fU); + ASTRA_DEBUG("alpha: %f, D: %f, V: %f, S: %f, U: %f", alpha, fD, fV, fS, fU); } diff --git a/src/Config.cpp b/src/Config.cpp index 0a85b3c..388cfdf 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -149,7 +149,7 @@ bool ConfigStackCheck::stopParsing() if (!errors.empty()) { ostringstream os; os << "Warning: " << name << ": unused configuration options: " << errors; - astra::CLogger::warn(__FILE__,__LINE__,os.str().c_str()); + ASTRA_WARN(os.str().c_str()); return false; } diff --git a/src/CudaFilteredBackProjectionAlgorithm.cpp b/src/CudaFilteredBackProjectionAlgorithm.cpp index 26b848e..0badc20 100644 --- a/src/CudaFilteredBackProjectionAlgorithm.cpp +++ b/src/CudaFilteredBackProjectionAlgorithm.cpp @@ -485,7 +485,7 @@ E_FBPFILTER CCudaFilteredBackProjectionAlgorithm::_convertStringToFilter(const c } else { - astra::CLogger::error(__FILE__,__LINE__,"Failed to convert \"%s\" into a filter.",_filterType); + ASTRA_ERROR("Failed to convert \"%s\" into a filter.",_filterType); } return output; diff --git a/src/CudaForwardProjectionAlgorithm.cpp b/src/CudaForwardProjectionAlgorithm.cpp index 1ae6b83..19cadd6 100644 --- a/src/CudaForwardProjectionAlgorithm.cpp +++ b/src/CudaForwardProjectionAlgorithm.cpp @@ -106,7 +106,7 @@ bool CCudaForwardProjectionAlgorithm::initialize(const Config& _cfg) id = boost::lexical_cast(node->getContent()); CProjector2D *projector = CProjector2DManager::getSingleton().get(id); if (!dynamic_cast(projector)) { - astra::CLogger::warn(__FILE__,__LINE__,"Warning: non-CUDA Projector2D passed to FP_CUDA"); + ASTRA_WARN("Warning: non-CUDA Projector2D passed to FP_CUDA"); } delete node; } diff --git a/src/CudaForwardProjectionAlgorithm3D.cpp b/src/CudaForwardProjectionAlgorithm3D.cpp index 57e1094..8e6bab5 100644 --- a/src/CudaForwardProjectionAlgorithm3D.cpp +++ b/src/CudaForwardProjectionAlgorithm3D.cpp @@ -267,7 +267,7 @@ void CCudaForwardProjectionAlgorithm3D::run(int) for (int k = 0; k < 2; ++k) { float fU, fV; projgeom->projectPoint(fX[i], fY[j], fZ[k], a, fU, fV); - astra::CLogger::debug(__FILE__,__LINE__,"%3d %c1,%c1,%c1 -> %12f %12f", a, i ? ' ' : '-', j ? ' ' : '-', k ? ' ' : '-', fU, fV); + ASTRA_DEBUG("%3d %c1,%c1,%c1 -> %12f %12f", a, i ? ' ' : '-', j ? ' ' : '-', k ? ' ' : '-', fU, fV); } } #endif diff --git a/src/CudaReconstructionAlgorithm2D.cpp b/src/CudaReconstructionAlgorithm2D.cpp index b434e8a..929f0f1 100644 --- a/src/CudaReconstructionAlgorithm2D.cpp +++ b/src/CudaReconstructionAlgorithm2D.cpp @@ -178,7 +178,7 @@ bool CCudaReconstructionAlgorithm2D::initialize(const Config& _cfg) id = boost::lexical_cast(node->getContent()); CProjector2D *projector = CProjector2DManager::getSingleton().get(id); if (!dynamic_cast(projector)) { - astra::CLogger::warn(__FILE__,__LINE__,"Warning: non-CUDA Projector2D passed"); + ASTRA_WARN("Warning: non-CUDA Projector2D passed"); } delete node; } diff --git a/src/FilteredBackProjectionAlgorithm.cpp b/src/FilteredBackProjectionAlgorithm.cpp index 47315bb..4a8e5ac 100644 --- a/src/FilteredBackProjectionAlgorithm.cpp +++ b/src/FilteredBackProjectionAlgorithm.cpp @@ -135,7 +135,7 @@ bool CFilteredBackProjectionAlgorithm::initialize(const Config& _cfg) for (int i = 0; i < angleCount; i ++) { if (projectionIndex[i] > m_pProjector->getProjectionGeometry()->getProjectionAngleCount() -1 ) { - astra::CLogger::error(__FILE__,__LINE__,"Invalid Projection Index"); + ASTRA_ERROR("Invalid Projection Index"); return false; } else { int orgIndex = (int)projectionIndex[i]; -- cgit v1.2.3 From e4614cf09b90cc9a0e38d370bb090a11f3877b33 Mon Sep 17 00:00:00 2001 From: "Daniel M. Pelt" Date: Fri, 13 Mar 2015 14:21:53 +0100 Subject: Add logging support to Matlab --- build/linux/Makefile.in | 1 + matlab/mex/astra_mex_log_c.cpp | 302 +++++++++++++++++++++++++++++++++++++++++ matlab/tools/astra_mex_log.m | 33 +++++ 3 files changed, 336 insertions(+) create mode 100644 matlab/mex/astra_mex_log_c.cpp create mode 100644 matlab/tools/astra_mex_log.m diff --git a/build/linux/Makefile.in b/build/linux/Makefile.in index c2b9994..f862114 100644 --- a/build/linux/Makefile.in +++ b/build/linux/Makefile.in @@ -225,6 +225,7 @@ MATLAB_MEX=\ matlab/mex/astra_mex_matrix_c.$(MEXSUFFIX) \ matlab/mex/astra_mex_projector_c.$(MEXSUFFIX) \ matlab/mex/astra_mex_projector3d_c.$(MEXSUFFIX) \ + matlab/mex/astra_mex_log_c.$(MEXSUFFIX) \ matlab/mex/astra_mex_data3d_c.$(MEXSUFFIX) diff --git a/matlab/mex/astra_mex_log_c.cpp b/matlab/mex/astra_mex_log_c.cpp new file mode 100644 index 0000000..14ae391 --- /dev/null +++ b/matlab/mex/astra_mex_log_c.cpp @@ -0,0 +1,302 @@ +/* +----------------------------------------------------------------------- +Copyright: 2010-2015, iMinds-Vision Lab, University of Antwerp + 2014-2015, CWI, Amsterdam + +Contact: astra@uantwerpen.be +Website: http://sf.net/projects/astra-toolbox + +This file is part of the ASTRA Toolbox. + + +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. + +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 ASTRA Toolbox. If not, see . + +----------------------------------------------------------------------- +$Id$ +*/ + +/** \file astra_mex_algorithm_c.cpp + * + * \brief Creates and manages algorithms (reconstruction,projection,...). + */ +#include +#include "mexHelpFunctions.h" + +#include "astra/Logging.h" + +using namespace std; +using namespace astra; +//----------------------------------------------------------------------------------------- +/** astra_mex_log('debug', file, line, message); + * + * Log a debug message. + * file: Originating file name + * line: Originating line number + * message: Log message. + */ +void astra_mex_log_debug(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]) +{ + if (nrhs < 4) { + mexErrMsgTxt("Not enough arguments. See the help document for a detailed argument list. \n"); + return; + } + string filename = mexToString(prhs[1]); + int linenumber = (int)mxGetScalar(prhs[2]); + string message = mexToString(prhs[3]); + astra::CLogger::debug(filename.c_str(),linenumber,message.c_str()); +} + +//----------------------------------------------------------------------------------------- +/** astra_mex_log('info', file, line, message); + * + * Log an info message. + * file: Originating file name + * line: Originating line number + * message: Log message. + */ +void astra_mex_log_info(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]) +{ + if (nrhs < 4) { + mexErrMsgTxt("Not enough arguments. See the help document for a detailed argument list. \n"); + return; + } + string filename = mexToString(prhs[1]); + int linenumber = (int)mxGetScalar(prhs[2]); + string message = mexToString(prhs[3]); + astra::CLogger::info(filename.c_str(),linenumber,message.c_str()); +} + +//----------------------------------------------------------------------------------------- +/** astra_mex_log('warn', file, line, message); + * + * Log a warning message. + * file: Originating file name + * line: Originating line number + * message: Log message. + */ +void astra_mex_log_warn(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]) +{ + if (nrhs < 4) { + mexErrMsgTxt("Not enough arguments. See the help document for a detailed argument list. \n"); + return; + } + string filename = mexToString(prhs[1]); + int linenumber = (int)mxGetScalar(prhs[2]); + string message = mexToString(prhs[3]); + astra::CLogger::warn(filename.c_str(),linenumber,message.c_str()); +} + +//----------------------------------------------------------------------------------------- +/** astra_mex_log('error', file, line, message); + * + * Log an error message. + * file: Originating file name + * line: Originating line number + * message: Log message. + */ +void astra_mex_log_error(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]) +{ + if (nrhs < 4) { + mexErrMsgTxt("Not enough arguments. See the help document for a detailed argument list. \n"); + return; + } + string filename = mexToString(prhs[1]); + int linenumber = (int)mxGetScalar(prhs[2]); + string message = mexToString(prhs[3]); + astra::CLogger::error(filename.c_str(),linenumber,message.c_str()); +} + +//----------------------------------------------------------------------------------------- +/** astra_mex_log('enable', type); + * + * Enable logging. + * type: which output to enable ('all', 'file', 'screen') + */ +void astra_mex_log_enable(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]) +{ + if (nrhs < 2) { + mexErrMsgTxt("Not enough arguments. See the help document for a detailed argument list. \n"); + return; + } + string sType = mexToString(prhs[1]); + if(sType == "all"){ + astra::CLogger::enable(); + }else if(sType == "file"){ + astra::CLogger::enableFile(); + }else if(sType == "screen"){ + astra::CLogger::enableScreen(); + } else { + mexErrMsgTxt("Specify which output to enable ('all', 'file', or 'screen')"); + } +} + +//----------------------------------------------------------------------------------------- +/** astra_mex_log('disable', type); + * + * Disable logging. + * type: which output to disable ('all', 'file', 'screen') + */ +void astra_mex_log_disable(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]) +{ + if (nrhs < 2) { + mexErrMsgTxt("Not enough arguments. See the help document for a detailed argument list. \n"); + return; + } + string sType = mexToString(prhs[1]); + if(sType == "all"){ + astra::CLogger::disable(); + }else if(sType == "file"){ + astra::CLogger::disableFile(); + }else if(sType == "screen"){ + astra::CLogger::disableScreen(); + } else { + mexErrMsgTxt("Specify which output to disable ('all', 'file', or 'screen')"); + } +} + +//----------------------------------------------------------------------------------------- +/** astra_mex_log('format', type, fmt); + * + * Enable logging. + * type: which output to format ('file', 'screen') + * fmt: format string + * Here are the substitutions you may use: + * %f: Source file name generating the log call. + * %n: Source line number where the log call was made. + * %m: The message text sent to the logger (after printf formatting). + * %d: The current date, formatted using the logger's date format. + * %t: The current time, formatted using the logger's time format. + * %l: The log level (one of "DEBUG", "INFO", "WARN", or "ERROR"). + * %%: A literal percent sign. + * The default format string is "%d %t %f(%n): %l: %m\n". + */ +void astra_mex_log_format(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]) +{ + if (nrhs < 3) { + mexErrMsgTxt("Not enough arguments. See the help document for a detailed argument list. \n"); + return; + } + string sType = mexToString(prhs[1]); + string sFormat = mexToString(prhs[2]); + if (!sFormat.empty()) + { + char lastChar = *sFormat.rbegin(); + if (lastChar!='\n'){ + sFormat += '\n'; + } + }else{ + sFormat += '\n'; + } + if(sType == "file"){ + astra::CLogger::setFormatFile(sFormat.c_str()); + }else if(sType == "screen"){ + astra::CLogger::setFormatScreen(sFormat.c_str()); + } else { + mexErrMsgTxt("Specify which output to format ('file' or 'screen')"); + } +} + +//----------------------------------------------------------------------------------------- +/** astra_mex_log('output', type, output, level); + * + * Set output file / output screen. + * type: which output to set ('file', 'screen') + * output: which output file / screen to use: + * 'file': filename + * 'screen': 'stdout' or 'stderr' + * level: logging level to use ('debug', 'info', 'warn', or 'error') + */ +void astra_mex_log_output(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]) +{ + if (nrhs < 4) { + mexErrMsgTxt("Not enough arguments. See the help document for a detailed argument list. \n"); + return; + } + string sType = mexToString(prhs[1]); + string sOutput = mexToString(prhs[2]); + string sLevel = mexToString(prhs[3]); + log_level eLevel; + if(sLevel == "debug"){ + eLevel = LOG_DEBUG; + }else if(sLevel == "info"){ + eLevel = LOG_INFO; + }else if(sLevel == "warn"){ + eLevel = LOG_WARN; + }else if(sLevel == "error"){ + eLevel = LOG_ERROR; + }else{ + mexErrMsgTxt("Specify which log level to use ('debug', 'info', 'warn', or 'error')"); + } + if(sType == "file"){ + astra::CLogger::setOutputFile(sOutput.c_str(),eLevel); + }else if(sType == "screen"){ + int fd; + if(sOutput == "stdout"){ + fd=1; + }else if(sOutput == "stderr"){ + fd=2; + }else{ + mexErrMsgTxt("Specify which screen to output to ('stdout' or 'stderr')"); + } + astra::CLogger::setOutputScreen(fd,eLevel); + } else { + mexErrMsgTxt("Specify which output to set ('file' or 'screen')"); + } +} + +//----------------------------------------------------------------------------------------- +static void printHelp() +{ + mexPrintf("Please specify a mode of operation.\n"); + mexPrintf("Valid modes: debug, info, warn, error, enable, disable, format, output\n"); +} + +//----------------------------------------------------------------------------------------- +/** + * ... = astra_mex_log(mode, ...); + */ +void mexFunction(int nlhs, mxArray* plhs[], + int nrhs, const mxArray* prhs[]) +{ + // INPUT: Mode + string sMode = ""; + if (1 <= nrhs) { + sMode = mexToString(prhs[0]); + } else { + printHelp(); + return; + } + + // SWITCH (MODE) + if (sMode == "debug") { + astra_mex_log_debug(nlhs, plhs, nrhs, prhs); + }else if (sMode == "info") { + astra_mex_log_info(nlhs, plhs, nrhs, prhs); + }else if (sMode == "warn") { + astra_mex_log_warn(nlhs, plhs, nrhs, prhs); + }else if (sMode == "error") { + astra_mex_log_error(nlhs, plhs, nrhs, prhs); + }else if (sMode == "enable") { + astra_mex_log_enable(nlhs, plhs, nrhs, prhs); + }else if (sMode == "disable") { + astra_mex_log_disable(nlhs, plhs, nrhs, prhs); + }else if (sMode == "format") { + astra_mex_log_format(nlhs, plhs, nrhs, prhs); + }else if (sMode == "output") { + astra_mex_log_output(nlhs, plhs, nrhs, prhs); + } else { + printHelp(); + } + return; +} diff --git a/matlab/tools/astra_mex_log.m b/matlab/tools/astra_mex_log.m new file mode 100644 index 0000000..28cfa18 --- /dev/null +++ b/matlab/tools/astra_mex_log.m @@ -0,0 +1,33 @@ +function [varargout] = astra_mex_log(varargin) +%------------------------------------------------------------------------ +% Reference page in Help browser +% astra_mex_log. +%------------------------------------------------------------------------ +%------------------------------------------------------------------------ +% This file is part of the ASTRA Toolbox +% +% Copyright: 2010-2015, iMinds-Vision Lab, University of Antwerp +% 2014-2015, CWI, Amsterdam +% License: Open Source under GPLv3 +% Contact: astra@uantwerpen.be +% Website: http://sf.net/projects/astra-toolbox +%------------------------------------------------------------------------ +% $Id$ +if size(varargin,2)==2 && (strcmp(varargin{1},'debug') || strcmp(varargin{1},'info') || strcmp(varargin{1},'warn') || strcmp(varargin{1},'error')) + d = dbstack(1); + if size(d,1)==0 + astra_mex_log_c(varargin{1},'Unknown',0,varargin{2}) + else + astra_mex_log_c(varargin{1},d(1).file,d(1).line,varargin{2}) + end +else + if nargout == 0 + astra_mex_log_c(varargin{:}); + if exist('ans','var') + varargout{1} = ans; + end + else + varargout = cell(1,nargout); + [varargout{:}] = astra_mex_log_c(varargin{:}); + end +end \ No newline at end of file -- cgit v1.2.3 From f21700e00e81538d5510973a51b8ae97fb4a24dd Mon Sep 17 00:00:00 2001 From: "Daniel M. Pelt" Date: Fri, 13 Mar 2015 17:12:42 +0100 Subject: Enable logging to Matlab window using callback function Also introduces a mex initialize function that is called at the first invocation of any mex method. --- build/linux/Makefile.in | 1 + include/astra/Logging.h | 9 +++++- include/astra/clog.h | 53 ++++++++++++++++++++++++++++++++++ matlab/mex/astra_mex.cpp | 3 ++ matlab/mex/astra_mex_algorithm_c.cpp | 3 ++ matlab/mex/astra_mex_c.cpp | 3 ++ matlab/mex/astra_mex_data2d_c.cpp | 3 ++ matlab/mex/astra_mex_data3d_c.cpp | 3 ++ matlab/mex/astra_mex_log_c.cpp | 3 ++ matlab/mex/astra_mex_matrix_c.cpp | 3 ++ matlab/mex/astra_mex_projector3d_c.cpp | 3 ++ matlab/mex/astra_mex_projector_c.cpp | 3 ++ matlab/mex/mexInitFunctions.cpp | 24 +++++++++++++++ matlab/mex/mexInitFunctions.h | 6 ++++ src/Logging.cpp | 8 +++-- 15 files changed, 125 insertions(+), 3 deletions(-) create mode 100644 matlab/mex/mexInitFunctions.cpp create mode 100644 matlab/mex/mexInitFunctions.h diff --git a/build/linux/Makefile.in b/build/linux/Makefile.in index f862114..49220df 100644 --- a/build/linux/Makefile.in +++ b/build/linux/Makefile.in @@ -216,6 +216,7 @@ TEST_OBJECTS=\ MATLAB_CXX_OBJECTS=\ matlab/mex/mexHelpFunctions.o \ matlab/mex/mexCopyDataHelpFunctions.o \ + matlab/mex/mexInitFunctions.o \ matlab/mex/mexDataManagerHelpFunctions.o MATLAB_MEX=\ diff --git a/include/astra/Logging.h b/include/astra/Logging.h index 5695663..e822c24 100644 --- a/include/astra/Logging.h +++ b/include/astra/Logging.h @@ -75,7 +75,7 @@ public: * @param ... * Any additional format arguments. */ - static void debug(const char *sfile, int sline, const char *fmt, ...); + static void debug(const char *sfile, int sline, const char *fmt, ...); static void info(const char *sfile, int sline, const char *fmt, ...); static void warn(const char *sfile, int sline, const char *fmt, ...); static void error(const char *sfile, int sline, const char *fmt, ...); @@ -143,6 +143,13 @@ public: static void disableScreen(); static void disableFile(); + /** + * Set callback function for logging to screen. + * @return whether callback was set succesfully. + * + */ + static bool setCallbackScreen(void (*cb)(const char *msg, size_t len)); + }; } diff --git a/include/astra/clog.h b/include/astra/clog.h index 4d8e39d..3b7e18b 100644 --- a/include/astra/clog.h +++ b/include/astra/clog.h @@ -231,6 +231,32 @@ int clog_set_date_fmt(int id, const char *fmt); */ int clog_set_fmt(int id, const char *fmt); +/** + * Set the callback function. + * + * @param cb + * The new callback function. + * + * @return + * Zero on success, non-zero on failure. + */ +int clog_set_cb(int id, void (*cb)(const char *msg, size_t len)); + +/** + * Set the file descriptor. + * + * @param id + * The identifier of the logger. + * + * @param fd + * The new file descriptor. + * + * @return + * Zero on success, non-zero on failure. + */ +int clog_set_fd(int id, int fd); + + /* * No need to read below this point. */ @@ -257,6 +283,9 @@ struct clog { /* Tracks whether the fd needs to be closed eventually. */ int opened; + + /* Callback function for each log message. */ + void (*cb)(const char *msg, size_t len); }; void _clog_err(const char *fmt, ...); @@ -314,6 +343,7 @@ clog_init_fd(int id, int fd) strcpy(logger->fmt, CLOG_DEFAULT_FORMAT); strcpy(logger->date_fmt, CLOG_DEFAULT_DATE_FORMAT); strcpy(logger->time_fmt, CLOG_DEFAULT_TIME_FORMAT); + logger->cb = NULL; _clog_loggers[id] = logger; return 0; @@ -344,6 +374,16 @@ clog_set_level(int id, enum clog_level level) return 0; } +int +clog_set_fd(int id, int fd) +{ + if (_clog_loggers[id] == NULL) { + return 1; + } + _clog_loggers[id]->fd = fd; + return 0; +} + int clog_set_time_fmt(int id, const char *fmt) { @@ -392,6 +432,18 @@ clog_set_fmt(int id, const char *fmt) return 0; } +int +clog_set_cb(int id, void (*cb)(const char *msg, size_t len)) +{ + struct clog *logger = _clog_loggers[id]; + if (logger == NULL) { + _clog_err("clog_set_cb: No such logger: %d\n", id); + return 1; + } + logger->cb = cb; + return 0; +} + /* Internal functions */ size_t @@ -563,6 +615,7 @@ _clog_log(const char *sfile, int sline, enum clog_level level, return; } result = write(logger->fd, message, strlen(message)); + if (logger->cb) logger->cb(message,strlen(message)); if (result == -1) { _clog_err("Unable to write to log file: %s\n", strerror(errno)); } diff --git a/matlab/mex/astra_mex.cpp b/matlab/mex/astra_mex.cpp index 0eb5662..4bf42dd 100644 --- a/matlab/mex/astra_mex.cpp +++ b/matlab/mex/astra_mex.cpp @@ -28,6 +28,7 @@ $Id$ #include #include "mexHelpFunctions.h" +#include "mexInitFunctions.h" #include "astra/Globals.h" @@ -104,6 +105,8 @@ void mexFunction(int nlhs, mxArray* plhs[], return; } + initASTRAMex(); + // SWITCH (MODE) if (sMode == std::string("version")) { astra_mex_version(nlhs, plhs, nrhs, prhs); diff --git a/matlab/mex/astra_mex_algorithm_c.cpp b/matlab/mex/astra_mex_algorithm_c.cpp index 669af8c..e4afa63 100644 --- a/matlab/mex/astra_mex_algorithm_c.cpp +++ b/matlab/mex/astra_mex_algorithm_c.cpp @@ -32,6 +32,7 @@ $Id$ */ #include #include "mexHelpFunctions.h" +#include "mexInitFunctions.h" #include "astra/Globals.h" #define USE_MATLAB_UNDOCUMENTED @@ -325,6 +326,8 @@ void mexFunction(int nlhs, mxArray* plhs[], return; } + initASTRAMex(); + // SWITCH (MODE) if (sMode == "create") { astra_mex_algorithm_create(nlhs, plhs, nrhs, prhs); diff --git a/matlab/mex/astra_mex_c.cpp b/matlab/mex/astra_mex_c.cpp index 760bd51..4a331f5 100644 --- a/matlab/mex/astra_mex_c.cpp +++ b/matlab/mex/astra_mex_c.cpp @@ -33,6 +33,7 @@ $Id$ #include #include "mexHelpFunctions.h" +#include "mexInitFunctions.h" #include "astra/Globals.h" @@ -128,6 +129,8 @@ void mexFunction(int nlhs, mxArray* plhs[], return; } + initASTRAMex(); + // SWITCH (MODE) if (sMode == std::string("version")) { astra_mex_version(nlhs, plhs, nrhs, prhs); diff --git a/matlab/mex/astra_mex_data2d_c.cpp b/matlab/mex/astra_mex_data2d_c.cpp index 5f79e98..9576896 100644 --- a/matlab/mex/astra_mex_data2d_c.cpp +++ b/matlab/mex/astra_mex_data2d_c.cpp @@ -32,6 +32,7 @@ $Id$ */ #include #include "mexHelpFunctions.h" +#include "mexInitFunctions.h" #include @@ -635,6 +636,8 @@ void mexFunction(int nlhs, mxArray* plhs[], return; } + initASTRAMex(); + // SWITCH (MODE) if (sMode == std::string("get")) { astra_mex_data2d_get(nlhs, plhs, nrhs, prhs); diff --git a/matlab/mex/astra_mex_data3d_c.cpp b/matlab/mex/astra_mex_data3d_c.cpp index 0a3f85d..32b0ba7 100644 --- a/matlab/mex/astra_mex_data3d_c.cpp +++ b/matlab/mex/astra_mex_data3d_c.cpp @@ -32,6 +32,7 @@ $Id$ */ #include #include "mexHelpFunctions.h" +#include "mexInitFunctions.h" #include "mexCopyDataHelpFunctions.h" #include "mexDataManagerHelpFunctions.h" @@ -371,6 +372,8 @@ void mexFunction(int nlhs, mxArray* plhs[], return; } + initASTRAMex(); + // 3D data if (sMode == std::string("create")) { astra_mex_data3d_create(nlhs, plhs, nrhs, prhs); diff --git a/matlab/mex/astra_mex_log_c.cpp b/matlab/mex/astra_mex_log_c.cpp index 14ae391..79fe3d5 100644 --- a/matlab/mex/astra_mex_log_c.cpp +++ b/matlab/mex/astra_mex_log_c.cpp @@ -32,6 +32,7 @@ $Id$ */ #include #include "mexHelpFunctions.h" +#include "mexInitFunctions.h" #include "astra/Logging.h" @@ -278,6 +279,8 @@ void mexFunction(int nlhs, mxArray* plhs[], return; } + initASTRAMex(); + // SWITCH (MODE) if (sMode == "debug") { astra_mex_log_debug(nlhs, plhs, nrhs, prhs); diff --git a/matlab/mex/astra_mex_matrix_c.cpp b/matlab/mex/astra_mex_matrix_c.cpp index 01ad08b..aa31383 100644 --- a/matlab/mex/astra_mex_matrix_c.cpp +++ b/matlab/mex/astra_mex_matrix_c.cpp @@ -32,6 +32,7 @@ $Id$ */ #include #include "mexHelpFunctions.h" +#include "mexInitFunctions.h" #include @@ -412,6 +413,8 @@ void mexFunction(int nlhs, mxArray* plhs[], return; } + initASTRAMex(); + // SWITCH (MODE) if (sMode == std::string("get")) { astra_mex_matrix_get(nlhs, plhs, nrhs, prhs); diff --git a/matlab/mex/astra_mex_projector3d_c.cpp b/matlab/mex/astra_mex_projector3d_c.cpp index 5381cf6..c3b547f 100644 --- a/matlab/mex/astra_mex_projector3d_c.cpp +++ b/matlab/mex/astra_mex_projector3d_c.cpp @@ -33,6 +33,7 @@ $Id$ #include #include "mexHelpFunctions.h" +#include "mexInitFunctions.h" #include "astra/Globals.h" @@ -403,6 +404,8 @@ void mexFunction(int nlhs, mxArray* plhs[], return; } + initASTRAMex(); + // SWITCH (MODE) if (sMode == "create") { astra_mex_projector3d_create(nlhs, plhs, nrhs, prhs); diff --git a/matlab/mex/astra_mex_projector_c.cpp b/matlab/mex/astra_mex_projector_c.cpp index 58cd953..204ba8e 100644 --- a/matlab/mex/astra_mex_projector_c.cpp +++ b/matlab/mex/astra_mex_projector_c.cpp @@ -34,6 +34,7 @@ $Id$ #include #include "mexHelpFunctions.h" +#include "mexInitFunctions.h" #include "astra/AstraObjectManager.h" #include "astra/Projector2D.h" @@ -476,6 +477,8 @@ void mexFunction(int nlhs, mxArray* plhs[], return; } + initASTRAMex(); + // SWITCH (MODE) if (sMode == "create") { astra_mex_projector_create(nlhs, plhs, nrhs, prhs); diff --git a/matlab/mex/mexInitFunctions.cpp b/matlab/mex/mexInitFunctions.cpp new file mode 100644 index 0000000..d8a50d7 --- /dev/null +++ b/matlab/mex/mexInitFunctions.cpp @@ -0,0 +1,24 @@ +#include +#include "astra/Logging.h" + +bool mexIsInitialized=false; + +/** + * Callback to print log message to Matlab window. + * + */ +void logCallBack(const char *msg, size_t len){ + mexPrintf(msg); +} + +/** + * Initialize mex functions. + * + */ +void initASTRAMex(){ + if(mexIsInitialized) return; + if(!astra::CLogger::setCallbackScreen(&logCallBack)){ + mexErrMsgTxt("Error initializing mex functions."); + } + mexIsInitialized=true; +} diff --git a/matlab/mex/mexInitFunctions.h b/matlab/mex/mexInitFunctions.h new file mode 100644 index 0000000..f16e9c9 --- /dev/null +++ b/matlab/mex/mexInitFunctions.h @@ -0,0 +1,6 @@ +#ifndef _INC_ASTRA_MEX_INITFUNCTIONS +#define _INC_ASTRA_MEX_INITFUNCTIONS + +void initASTRAMex(); + +#endif \ No newline at end of file diff --git a/src/Logging.cpp b/src/Logging.cpp index 9011d37..9d7c219 100644 --- a/src/Logging.cpp +++ b/src/Logging.cpp @@ -124,8 +124,7 @@ void CLogger::_setLevel(int id, log_level m_eLevel) void CLogger::setOutputScreen(int fd, log_level m_eLevel) { _assureIsInitialized(); - clog_free(0); - clog_init_fd(0, fd); + clog_set_fd(0, fd); _setLevel(0,m_eLevel); } @@ -169,6 +168,11 @@ CLogger::CLogger() ; } +bool CLogger::setCallbackScreen(void (*cb)(const char *msg, size_t len)){ + _assureIsInitialized(); + return clog_set_cb(0,cb)==0; +} + bool CLogger::m_bEnabledScreen = true; bool CLogger::m_bEnabledFile = true; bool CLogger::m_bFileProvided = false; -- cgit v1.2.3 From 35fadf8641b05d357a37e8098b9a801ba0e815b9 Mon Sep 17 00:00:00 2001 From: "Daniel M. Pelt" Date: Fri, 13 Mar 2015 17:22:41 +0100 Subject: Use a less verbose default fmt for screen logging and cleaner messages --- include/astra/clog.h | 8 ++++---- src/Config.cpp | 2 +- src/CudaForwardProjectionAlgorithm.cpp | 2 +- src/CudaReconstructionAlgorithm2D.cpp | 2 +- src/Logging.cpp | 1 + 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/include/astra/clog.h b/include/astra/clog.h index 3b7e18b..ce082df 100644 --- a/include/astra/clog.h +++ b/include/astra/clog.h @@ -299,10 +299,10 @@ extern struct clog *_clog_loggers[CLOG_MAX_LOGGERS]; #ifdef CLOG_MAIN const char *const CLOG_LEVEL_NAMES[] = { - "DEBUG", - "INFO", - "WARN", - "ERROR", + "Debug", + "Info", + "Warning", + "Error", }; int diff --git a/src/Config.cpp b/src/Config.cpp index 388cfdf..d860638 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -148,7 +148,7 @@ bool ConfigStackCheck::stopParsing() if (!errors.empty()) { ostringstream os; - os << "Warning: " << name << ": unused configuration options: " << errors; + os << name << ": unused configuration options: " << errors; ASTRA_WARN(os.str().c_str()); return false; } diff --git a/src/CudaForwardProjectionAlgorithm.cpp b/src/CudaForwardProjectionAlgorithm.cpp index 19cadd6..95abb62 100644 --- a/src/CudaForwardProjectionAlgorithm.cpp +++ b/src/CudaForwardProjectionAlgorithm.cpp @@ -106,7 +106,7 @@ bool CCudaForwardProjectionAlgorithm::initialize(const Config& _cfg) id = boost::lexical_cast(node->getContent()); CProjector2D *projector = CProjector2DManager::getSingleton().get(id); if (!dynamic_cast(projector)) { - ASTRA_WARN("Warning: non-CUDA Projector2D passed to FP_CUDA"); + ASTRA_WARN("non-CUDA Projector2D passed to FP_CUDA"); } delete node; } diff --git a/src/CudaReconstructionAlgorithm2D.cpp b/src/CudaReconstructionAlgorithm2D.cpp index 929f0f1..1c6b763 100644 --- a/src/CudaReconstructionAlgorithm2D.cpp +++ b/src/CudaReconstructionAlgorithm2D.cpp @@ -178,7 +178,7 @@ bool CCudaReconstructionAlgorithm2D::initialize(const Config& _cfg) id = boost::lexical_cast(node->getContent()); CProjector2D *projector = CProjector2DManager::getSingleton().get(id); if (!dynamic_cast(projector)) { - ASTRA_WARN("Warning: non-CUDA Projector2D passed"); + ASTRA_WARN("non-CUDA Projector2D passed"); } delete node; } diff --git a/src/Logging.cpp b/src/Logging.cpp index 9d7c219..f95df0e 100644 --- a/src/Logging.cpp +++ b/src/Logging.cpp @@ -146,6 +146,7 @@ void CLogger::_assureIsInitialized() { clog_init_fd(0, 2); clog_set_level(0, CLOG_INFO); + clog_set_fmt(0, "%l: %m\n"); m_bInitialized = true; } } -- cgit v1.2.3 From 476fd5388da4aa6e23658460199e26e88e05dc5d Mon Sep 17 00:00:00 2001 From: "Daniel M. Pelt" Date: Fri, 13 Mar 2015 17:49:55 +0100 Subject: Only allow stdout and stderr for screen logging --- src/Logging.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Logging.cpp b/src/Logging.cpp index f95df0e..8290ca0 100644 --- a/src/Logging.cpp +++ b/src/Logging.cpp @@ -124,7 +124,11 @@ void CLogger::_setLevel(int id, log_level m_eLevel) void CLogger::setOutputScreen(int fd, log_level m_eLevel) { _assureIsInitialized(); - clog_set_fd(0, fd); + if(fd==1||fd==2){ + clog_set_fd(0, fd); + }else{ + error(__FILE__,__LINE__,"Invalid file descriptor"); + } _setLevel(0,m_eLevel); } -- cgit v1.2.3 From d1ad446669cea2a76d7146023e4862a1fdbf3e13 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Thu, 19 Mar 2015 16:47:23 +0100 Subject: Fix windows build --- include/astra/Logging.h | 4 +++- include/astra/clog.h | 11 +++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/include/astra/Logging.h b/include/astra/Logging.h index e822c24..8e19ea4 100644 --- a/include/astra/Logging.h +++ b/include/astra/Logging.h @@ -29,6 +29,8 @@ $Id$ #ifndef _INC_ASTRA_LOGGING #define _INC_ASTRA_LOGGING +#include "astra/Globals.h" + #define ASTRA_DEBUG(...) astra::CLogger::debug(__FILE__,__LINE__, __VA_ARGS__) #define ASTRA_INFO(...) astra::CLogger::info(__FILE__,__LINE__, __VA_ARGS__) #define ASTRA_WARN(...) astra::CLogger::warn(__FILE__,__LINE__, __VA_ARGS__) @@ -44,7 +46,7 @@ enum log_level { LOG_ERROR }; -class CLogger +class _AstraExport CLogger { CLogger(); ~CLogger(); diff --git a/include/astra/clog.h b/include/astra/clog.h index ce082df..c0cbae4 100644 --- a/include/astra/clog.h +++ b/include/astra/clog.h @@ -71,7 +71,15 @@ #include #include #include +#ifndef _MSC_VER #include +#else +#include +#define open _open +#define close _close +#define write _write +#define snprintf _snprintf +#endif /* Number of loggers that can be defined. */ #define CLOG_MAX_LOGGERS 16 @@ -625,7 +633,10 @@ _clog_log(const char *sfile, int sline, enum clog_level level, if (dynbuf != buf) { free(dynbuf); } +#ifndef _MSC_VER + // FIXME fsync(logger->fd); +#endif } } -- cgit v1.2.3 From 230afc786fb86a53f938843a5a9ddfc6e4198974 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Thu, 19 Mar 2015 17:12:15 +0100 Subject: Generate MSVC 2008/2012 project files with a Python script --- astra_vc08.sln | 215 -- astra_vc08.vcproj | 3158 ------------------------ astra_vc09.sln | 199 ++ astra_vc09.vcproj | 3180 +++++++++++++++++++++++++ astra_vc11.sln | 32 +- astra_vc11.vcxproj | 586 ++++- astra_vc11.vcxproj.filters | 232 +- build/msvc/gen.py | 1088 +++++++++ matlab/mex/astra_mex_algorithm_vc08.vcproj | 593 ----- matlab/mex/astra_mex_algorithm_vc09.vcproj | 604 +++++ matlab/mex/astra_mex_algorithm_vc11.vcxproj | 207 +- matlab/mex/astra_mex_data2d_vc08.vcproj | 591 ----- matlab/mex/astra_mex_data2d_vc09.vcproj | 620 +++++ matlab/mex/astra_mex_data2d_vc11.vcxproj | 205 +- matlab/mex/astra_mex_data3d_vc08.vcproj | 588 ----- matlab/mex/astra_mex_data3d_vc09.vcproj | 620 +++++ matlab/mex/astra_mex_data3d_vc11.vcxproj | 204 +- matlab/mex/astra_mex_matrix_vc08.vcproj | 591 ----- matlab/mex/astra_mex_matrix_vc09.vcproj | 604 +++++ matlab/mex/astra_mex_matrix_vc11.vcxproj | 205 +- matlab/mex/astra_mex_projector3d_vc08.vcproj | 588 ----- matlab/mex/astra_mex_projector3d_vc09.vcproj | 604 +++++ matlab/mex/astra_mex_projector3d_vc11.vcxproj | 204 +- matlab/mex/astra_mex_projector_vc08.vcproj | 591 ----- matlab/mex/astra_mex_projector_vc09.vcproj | 604 +++++ matlab/mex/astra_mex_projector_vc11.vcxproj | 205 +- matlab/mex/astra_mex_vc08.vcproj | 591 ----- matlab/mex/astra_mex_vc09.vcproj | 604 +++++ matlab/mex/astra_mex_vc11.vcxproj | 205 +- 29 files changed, 10141 insertions(+), 8377 deletions(-) delete mode 100644 astra_vc08.sln delete mode 100644 astra_vc08.vcproj create mode 100644 astra_vc09.sln create mode 100644 astra_vc09.vcproj create mode 100644 build/msvc/gen.py delete mode 100644 matlab/mex/astra_mex_algorithm_vc08.vcproj create mode 100644 matlab/mex/astra_mex_algorithm_vc09.vcproj delete mode 100644 matlab/mex/astra_mex_data2d_vc08.vcproj create mode 100644 matlab/mex/astra_mex_data2d_vc09.vcproj delete mode 100644 matlab/mex/astra_mex_data3d_vc08.vcproj create mode 100644 matlab/mex/astra_mex_data3d_vc09.vcproj delete mode 100644 matlab/mex/astra_mex_matrix_vc08.vcproj create mode 100644 matlab/mex/astra_mex_matrix_vc09.vcproj delete mode 100644 matlab/mex/astra_mex_projector3d_vc08.vcproj create mode 100644 matlab/mex/astra_mex_projector3d_vc09.vcproj delete mode 100644 matlab/mex/astra_mex_projector_vc08.vcproj create mode 100644 matlab/mex/astra_mex_projector_vc09.vcproj delete mode 100644 matlab/mex/astra_mex_vc08.vcproj create mode 100644 matlab/mex/astra_mex_vc09.vcproj diff --git a/astra_vc08.sln b/astra_vc08.sln deleted file mode 100644 index 60f2e25..0000000 --- a/astra_vc08.sln +++ /dev/null @@ -1,215 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "astra_mex", "astra_mex", "{33EF0AC5-B475-40BF-BAE5-67075B204D10}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "astra_mex_matrix", "matlab\mex\astra_mex_matrix_vc08.vcproj", "{9D041710-2119-4230-BCF2-5FBE753FDE49}" - ProjectSection(ProjectDependencies) = postProject - {12926444-6723-46A8-B388-12E65E0577FA} = {12926444-6723-46A8-B388-12E65E0577FA} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "astra", "astra_vc08.vcproj", "{12926444-6723-46A8-B388-12E65E0577FA}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tests", "tests\tests_vc08.vcproj", "{32C1BDD3-38C2-4C80-A03C-2129782F59B5}" - ProjectSection(ProjectDependencies) = postProject - {12926444-6723-46A8-B388-12E65E0577FA} = {12926444-6723-46A8-B388-12E65E0577FA} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "astra_mex_projector", "matlab\mex\astra_mex_projector_vc08.vcproj", "{4DD6056F-8EEE-4C9A-B2A9-923F01A32E97}" - ProjectSection(ProjectDependencies) = postProject - {12926444-6723-46A8-B388-12E65E0577FA} = {12926444-6723-46A8-B388-12E65E0577FA} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "astra_mex_projector3d", "matlab\mex\astra_mex_projector3d_vc08.vcproj", "{F94CCD79-AA11-42DF-AC8A-6C9D2238A883}" - ProjectSection(ProjectDependencies) = postProject - {12926444-6723-46A8-B388-12E65E0577FA} = {12926444-6723-46A8-B388-12E65E0577FA} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "astra_mex_data3d", "matlab\mex\astra_mex_data3d_vc08.vcproj", "{0BEC029B-0929-4BF9-BD8B-9C9806A52065}" - ProjectSection(ProjectDependencies) = postProject - {12926444-6723-46A8-B388-12E65E0577FA} = {12926444-6723-46A8-B388-12E65E0577FA} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "astra_mex_data2d", "matlab\mex\astra_mex_data2d_vc08.vcproj", "{E4092269-B19C-46F7-A84E-4F146CC70E44}" - ProjectSection(ProjectDependencies) = postProject - {12926444-6723-46A8-B388-12E65E0577FA} = {12926444-6723-46A8-B388-12E65E0577FA} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "astra_mex_algorithm", "matlab\mex\astra_mex_algorithm_vc08.vcproj", "{056BF7A9-294D-487C-8CC3-BE629077CA94}" - ProjectSection(ProjectDependencies) = postProject - {12926444-6723-46A8-B388-12E65E0577FA} = {12926444-6723-46A8-B388-12E65E0577FA} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "astra_mex", "matlab\mex\astra_mex_vc08.vcproj", "{3FDA35E0-0D54-4663-A3E6-5ABA96F32221}" - ProjectSection(ProjectDependencies) = postProject - {12926444-6723-46A8-B388-12E65E0577FA} = {12926444-6723-46A8-B388-12E65E0577FA} - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug_CUDA|Win32 = Debug_CUDA|Win32 - Debug_CUDA|x64 = Debug_CUDA|x64 - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release_CUDA|Win32 = Release_CUDA|Win32 - Release_CUDA|x64 = Release_CUDA|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {9D041710-2119-4230-BCF2-5FBE753FDE49}.Debug_CUDA|Win32.ActiveCfg = Debug_CUDA|Win32 - {9D041710-2119-4230-BCF2-5FBE753FDE49}.Debug_CUDA|Win32.Build.0 = Debug_CUDA|Win32 - {9D041710-2119-4230-BCF2-5FBE753FDE49}.Debug_CUDA|x64.ActiveCfg = Debug_CUDA|x64 - {9D041710-2119-4230-BCF2-5FBE753FDE49}.Debug_CUDA|x64.Build.0 = Debug_CUDA|x64 - {9D041710-2119-4230-BCF2-5FBE753FDE49}.Debug|Win32.ActiveCfg = Debug|Win32 - {9D041710-2119-4230-BCF2-5FBE753FDE49}.Debug|Win32.Build.0 = Debug|Win32 - {9D041710-2119-4230-BCF2-5FBE753FDE49}.Debug|x64.ActiveCfg = Debug|x64 - {9D041710-2119-4230-BCF2-5FBE753FDE49}.Debug|x64.Build.0 = Debug|x64 - {9D041710-2119-4230-BCF2-5FBE753FDE49}.Release_CUDA|Win32.ActiveCfg = Release_CUDA|Win32 - {9D041710-2119-4230-BCF2-5FBE753FDE49}.Release_CUDA|Win32.Build.0 = Release_CUDA|Win32 - {9D041710-2119-4230-BCF2-5FBE753FDE49}.Release_CUDA|x64.ActiveCfg = Release_CUDA|x64 - {9D041710-2119-4230-BCF2-5FBE753FDE49}.Release_CUDA|x64.Build.0 = Release_CUDA|x64 - {9D041710-2119-4230-BCF2-5FBE753FDE49}.Release|Win32.ActiveCfg = Release|Win32 - {9D041710-2119-4230-BCF2-5FBE753FDE49}.Release|Win32.Build.0 = Release|Win32 - {9D041710-2119-4230-BCF2-5FBE753FDE49}.Release|x64.ActiveCfg = Release|x64 - {9D041710-2119-4230-BCF2-5FBE753FDE49}.Release|x64.Build.0 = Release|x64 - {12926444-6723-46A8-B388-12E65E0577FA}.Debug_CUDA|Win32.ActiveCfg = Debug_CUDA|Win32 - {12926444-6723-46A8-B388-12E65E0577FA}.Debug_CUDA|Win32.Build.0 = Debug_CUDA|Win32 - {12926444-6723-46A8-B388-12E65E0577FA}.Debug_CUDA|x64.ActiveCfg = Debug_CUDA|x64 - {12926444-6723-46A8-B388-12E65E0577FA}.Debug_CUDA|x64.Build.0 = Debug_CUDA|x64 - {12926444-6723-46A8-B388-12E65E0577FA}.Debug|Win32.ActiveCfg = Debug|Win32 - {12926444-6723-46A8-B388-12E65E0577FA}.Debug|Win32.Build.0 = Debug|Win32 - {12926444-6723-46A8-B388-12E65E0577FA}.Debug|x64.ActiveCfg = Debug|x64 - {12926444-6723-46A8-B388-12E65E0577FA}.Debug|x64.Build.0 = Debug|x64 - {12926444-6723-46A8-B388-12E65E0577FA}.Release_CUDA|Win32.ActiveCfg = Release_CUDA|Win32 - {12926444-6723-46A8-B388-12E65E0577FA}.Release_CUDA|Win32.Build.0 = Release_CUDA|Win32 - {12926444-6723-46A8-B388-12E65E0577FA}.Release_CUDA|x64.ActiveCfg = Release_CUDA|x64 - {12926444-6723-46A8-B388-12E65E0577FA}.Release_CUDA|x64.Build.0 = Release_CUDA|x64 - {12926444-6723-46A8-B388-12E65E0577FA}.Release|Win32.ActiveCfg = Release|Win32 - {12926444-6723-46A8-B388-12E65E0577FA}.Release|Win32.Build.0 = Release|Win32 - {12926444-6723-46A8-B388-12E65E0577FA}.Release|x64.ActiveCfg = Release|x64 - {12926444-6723-46A8-B388-12E65E0577FA}.Release|x64.Build.0 = Release|x64 - {32C1BDD3-38C2-4C80-A03C-2129782F59B5}.Debug_CUDA|Win32.ActiveCfg = Debug_CUDA|Win32 - {32C1BDD3-38C2-4C80-A03C-2129782F59B5}.Debug_CUDA|Win32.Build.0 = Debug_CUDA|Win32 - {32C1BDD3-38C2-4C80-A03C-2129782F59B5}.Debug_CUDA|x64.ActiveCfg = Debug_CUDA|x64 - {32C1BDD3-38C2-4C80-A03C-2129782F59B5}.Debug|Win32.ActiveCfg = Debug|Win32 - {32C1BDD3-38C2-4C80-A03C-2129782F59B5}.Debug|Win32.Build.0 = Debug|Win32 - {32C1BDD3-38C2-4C80-A03C-2129782F59B5}.Debug|x64.ActiveCfg = Debug|x64 - {32C1BDD3-38C2-4C80-A03C-2129782F59B5}.Debug|x64.Build.0 = Debug|x64 - {32C1BDD3-38C2-4C80-A03C-2129782F59B5}.Release_CUDA|Win32.ActiveCfg = Release_CUDA|Win32 - {32C1BDD3-38C2-4C80-A03C-2129782F59B5}.Release_CUDA|Win32.Build.0 = Release_CUDA|Win32 - {32C1BDD3-38C2-4C80-A03C-2129782F59B5}.Release_CUDA|x64.ActiveCfg = Release_CUDA|x64 - {32C1BDD3-38C2-4C80-A03C-2129782F59B5}.Release|Win32.ActiveCfg = Release|Win32 - {32C1BDD3-38C2-4C80-A03C-2129782F59B5}.Release|Win32.Build.0 = Release|Win32 - {32C1BDD3-38C2-4C80-A03C-2129782F59B5}.Release|x64.ActiveCfg = Release|x64 - {4DD6056F-8EEE-4C9A-B2A9-923F01A32E97}.Debug_CUDA|Win32.ActiveCfg = Debug_CUDA|Win32 - {4DD6056F-8EEE-4C9A-B2A9-923F01A32E97}.Debug_CUDA|Win32.Build.0 = Debug_CUDA|Win32 - {4DD6056F-8EEE-4C9A-B2A9-923F01A32E97}.Debug_CUDA|x64.ActiveCfg = Debug_CUDA|x64 - {4DD6056F-8EEE-4C9A-B2A9-923F01A32E97}.Debug_CUDA|x64.Build.0 = Debug_CUDA|x64 - {4DD6056F-8EEE-4C9A-B2A9-923F01A32E97}.Debug|Win32.ActiveCfg = Debug|Win32 - {4DD6056F-8EEE-4C9A-B2A9-923F01A32E97}.Debug|Win32.Build.0 = Debug|Win32 - {4DD6056F-8EEE-4C9A-B2A9-923F01A32E97}.Debug|x64.ActiveCfg = Debug|x64 - {4DD6056F-8EEE-4C9A-B2A9-923F01A32E97}.Debug|x64.Build.0 = Debug|x64 - {4DD6056F-8EEE-4C9A-B2A9-923F01A32E97}.Release_CUDA|Win32.ActiveCfg = Release_CUDA|Win32 - {4DD6056F-8EEE-4C9A-B2A9-923F01A32E97}.Release_CUDA|Win32.Build.0 = Release_CUDA|Win32 - {4DD6056F-8EEE-4C9A-B2A9-923F01A32E97}.Release_CUDA|x64.ActiveCfg = Release_CUDA|x64 - {4DD6056F-8EEE-4C9A-B2A9-923F01A32E97}.Release_CUDA|x64.Build.0 = Release_CUDA|x64 - {4DD6056F-8EEE-4C9A-B2A9-923F01A32E97}.Release|Win32.ActiveCfg = Release|Win32 - {4DD6056F-8EEE-4C9A-B2A9-923F01A32E97}.Release|Win32.Build.0 = Release|Win32 - {4DD6056F-8EEE-4C9A-B2A9-923F01A32E97}.Release|x64.ActiveCfg = Release|x64 - {4DD6056F-8EEE-4C9A-B2A9-923F01A32E97}.Release|x64.Build.0 = Release|x64 - {F94CCD79-AA11-42DF-AC8A-6C9D2238A883}.Debug_CUDA|Win32.ActiveCfg = Debug_CUDA|Win32 - {F94CCD79-AA11-42DF-AC8A-6C9D2238A883}.Debug_CUDA|Win32.Build.0 = Debug_CUDA|Win32 - {F94CCD79-AA11-42DF-AC8A-6C9D2238A883}.Debug_CUDA|x64.ActiveCfg = Debug_CUDA|x64 - {F94CCD79-AA11-42DF-AC8A-6C9D2238A883}.Debug_CUDA|x64.Build.0 = Debug_CUDA|x64 - {F94CCD79-AA11-42DF-AC8A-6C9D2238A883}.Debug|Win32.ActiveCfg = Debug|Win32 - {F94CCD79-AA11-42DF-AC8A-6C9D2238A883}.Debug|Win32.Build.0 = Debug|Win32 - {F94CCD79-AA11-42DF-AC8A-6C9D2238A883}.Debug|x64.ActiveCfg = Debug|x64 - {F94CCD79-AA11-42DF-AC8A-6C9D2238A883}.Debug|x64.Build.0 = Debug|x64 - {F94CCD79-AA11-42DF-AC8A-6C9D2238A883}.Release_CUDA|Win32.ActiveCfg = Release_CUDA|Win32 - {F94CCD79-AA11-42DF-AC8A-6C9D2238A883}.Release_CUDA|Win32.Build.0 = Release_CUDA|Win32 - {F94CCD79-AA11-42DF-AC8A-6C9D2238A883}.Release_CUDA|x64.ActiveCfg = Release_CUDA|x64 - {F94CCD79-AA11-42DF-AC8A-6C9D2238A883}.Release_CUDA|x64.Build.0 = Release_CUDA|x64 - {F94CCD79-AA11-42DF-AC8A-6C9D2238A883}.Release|Win32.ActiveCfg = Release|Win32 - {F94CCD79-AA11-42DF-AC8A-6C9D2238A883}.Release|Win32.Build.0 = Release|Win32 - {F94CCD79-AA11-42DF-AC8A-6C9D2238A883}.Release|x64.ActiveCfg = Release|x64 - {F94CCD79-AA11-42DF-AC8A-6C9D2238A883}.Release|x64.Build.0 = Release|x64 - - {0BEC029B-0929-4BF9-BD8B-9C9806A52065}.Debug_CUDA|Win32.ActiveCfg = Debug_CUDA|Win32 - {0BEC029B-0929-4BF9-BD8B-9C9806A52065}.Debug_CUDA|Win32.Build.0 = Debug_CUDA|Win32 - {0BEC029B-0929-4BF9-BD8B-9C9806A52065}.Debug_CUDA|x64.ActiveCfg = Debug_CUDA|x64 - {0BEC029B-0929-4BF9-BD8B-9C9806A52065}.Debug_CUDA|x64.Build.0 = Debug_CUDA|x64 - {0BEC029B-0929-4BF9-BD8B-9C9806A52065}.Debug|Win32.ActiveCfg = Debug|Win32 - {0BEC029B-0929-4BF9-BD8B-9C9806A52065}.Debug|Win32.Build.0 = Debug|Win32 - {0BEC029B-0929-4BF9-BD8B-9C9806A52065}.Debug|x64.ActiveCfg = Debug|x64 - {0BEC029B-0929-4BF9-BD8B-9C9806A52065}.Debug|x64.Build.0 = Debug|x64 - {0BEC029B-0929-4BF9-BD8B-9C9806A52065}.Release_CUDA|Win32.ActiveCfg = Release_CUDA|Win32 - {0BEC029B-0929-4BF9-BD8B-9C9806A52065}.Release_CUDA|Win32.Build.0 = Release_CUDA|Win32 - {0BEC029B-0929-4BF9-BD8B-9C9806A52065}.Release_CUDA|x64.ActiveCfg = Release_CUDA|x64 - {0BEC029B-0929-4BF9-BD8B-9C9806A52065}.Release_CUDA|x64.Build.0 = Release_CUDA|x64 - {0BEC029B-0929-4BF9-BD8B-9C9806A52065}.Release|Win32.ActiveCfg = Release|Win32 - {0BEC029B-0929-4BF9-BD8B-9C9806A52065}.Release|Win32.Build.0 = Release|Win32 - {0BEC029B-0929-4BF9-BD8B-9C9806A52065}.Release|x64.ActiveCfg = Release|x64 - {0BEC029B-0929-4BF9-BD8B-9C9806A52065}.Release|x64.Build.0 = Release|x64 - {E4092269-B19C-46F7-A84E-4F146CC70E44}.Debug_CUDA|Win32.ActiveCfg = Debug_CUDA|Win32 - {E4092269-B19C-46F7-A84E-4F146CC70E44}.Debug_CUDA|Win32.Build.0 = Debug_CUDA|Win32 - {E4092269-B19C-46F7-A84E-4F146CC70E44}.Debug_CUDA|x64.ActiveCfg = Debug_CUDA|x64 - {E4092269-B19C-46F7-A84E-4F146CC70E44}.Debug_CUDA|x64.Build.0 = Debug_CUDA|x64 - {E4092269-B19C-46F7-A84E-4F146CC70E44}.Debug|Win32.ActiveCfg = Debug|Win32 - {E4092269-B19C-46F7-A84E-4F146CC70E44}.Debug|Win32.Build.0 = Debug|Win32 - {E4092269-B19C-46F7-A84E-4F146CC70E44}.Debug|x64.ActiveCfg = Debug|x64 - {E4092269-B19C-46F7-A84E-4F146CC70E44}.Debug|x64.Build.0 = Debug|x64 - {E4092269-B19C-46F7-A84E-4F146CC70E44}.Release_CUDA|Win32.ActiveCfg = Release_CUDA|Win32 - {E4092269-B19C-46F7-A84E-4F146CC70E44}.Release_CUDA|Win32.Build.0 = Release_CUDA|Win32 - {E4092269-B19C-46F7-A84E-4F146CC70E44}.Release_CUDA|x64.ActiveCfg = Release_CUDA|x64 - {E4092269-B19C-46F7-A84E-4F146CC70E44}.Release_CUDA|x64.Build.0 = Release_CUDA|x64 - {E4092269-B19C-46F7-A84E-4F146CC70E44}.Release|Win32.ActiveCfg = Release|Win32 - {E4092269-B19C-46F7-A84E-4F146CC70E44}.Release|Win32.Build.0 = Release|Win32 - {E4092269-B19C-46F7-A84E-4F146CC70E44}.Release|x64.ActiveCfg = Release|x64 - {E4092269-B19C-46F7-A84E-4F146CC70E44}.Release|x64.Build.0 = Release|x64 - {056BF7A9-294D-487C-8CC3-BE629077CA94}.Debug_CUDA|Win32.ActiveCfg = Debug_CUDA|Win32 - {056BF7A9-294D-487C-8CC3-BE629077CA94}.Debug_CUDA|Win32.Build.0 = Debug_CUDA|Win32 - {056BF7A9-294D-487C-8CC3-BE629077CA94}.Debug_CUDA|x64.ActiveCfg = Debug_CUDA|x64 - {056BF7A9-294D-487C-8CC3-BE629077CA94}.Debug_CUDA|x64.Build.0 = Debug_CUDA|x64 - {056BF7A9-294D-487C-8CC3-BE629077CA94}.Debug|Win32.ActiveCfg = Debug|Win32 - {056BF7A9-294D-487C-8CC3-BE629077CA94}.Debug|Win32.Build.0 = Debug|Win32 - {056BF7A9-294D-487C-8CC3-BE629077CA94}.Debug|x64.ActiveCfg = Debug|x64 - {056BF7A9-294D-487C-8CC3-BE629077CA94}.Debug|x64.Build.0 = Debug|x64 - {056BF7A9-294D-487C-8CC3-BE629077CA94}.Release_CUDA|Win32.ActiveCfg = Release_CUDA|Win32 - {056BF7A9-294D-487C-8CC3-BE629077CA94}.Release_CUDA|Win32.Build.0 = Release_CUDA|Win32 - {056BF7A9-294D-487C-8CC3-BE629077CA94}.Release_CUDA|x64.ActiveCfg = Release_CUDA|x64 - {056BF7A9-294D-487C-8CC3-BE629077CA94}.Release_CUDA|x64.Build.0 = Release_CUDA|x64 - {056BF7A9-294D-487C-8CC3-BE629077CA94}.Release|Win32.ActiveCfg = Release|Win32 - {056BF7A9-294D-487C-8CC3-BE629077CA94}.Release|Win32.Build.0 = Release|Win32 - {056BF7A9-294D-487C-8CC3-BE629077CA94}.Release|x64.ActiveCfg = Release|x64 - {056BF7A9-294D-487C-8CC3-BE629077CA94}.Release|x64.Build.0 = Release|x64 - {3FDA35E0-0D54-4663-A3E6-5ABA96F32221}.Debug_CUDA|Win32.ActiveCfg = Debug_CUDA|Win32 - {3FDA35E0-0D54-4663-A3E6-5ABA96F32221}.Debug_CUDA|Win32.Build.0 = Debug_CUDA|Win32 - {3FDA35E0-0D54-4663-A3E6-5ABA96F32221}.Debug_CUDA|x64.ActiveCfg = Debug_CUDA|x64 - {3FDA35E0-0D54-4663-A3E6-5ABA96F32221}.Debug_CUDA|x64.Build.0 = Debug_CUDA|x64 - {3FDA35E0-0D54-4663-A3E6-5ABA96F32221}.Debug|Win32.ActiveCfg = Debug|Win32 - {3FDA35E0-0D54-4663-A3E6-5ABA96F32221}.Debug|Win32.Build.0 = Debug|Win32 - {3FDA35E0-0D54-4663-A3E6-5ABA96F32221}.Debug|x64.ActiveCfg = Debug|x64 - {3FDA35E0-0D54-4663-A3E6-5ABA96F32221}.Debug|x64.Build.0 = Debug|x64 - {3FDA35E0-0D54-4663-A3E6-5ABA96F32221}.Release_CUDA|Win32.ActiveCfg = Release_CUDA|Win32 - {3FDA35E0-0D54-4663-A3E6-5ABA96F32221}.Release_CUDA|Win32.Build.0 = Release_CUDA|Win32 - {3FDA35E0-0D54-4663-A3E6-5ABA96F32221}.Release_CUDA|x64.ActiveCfg = Release_CUDA|x64 - {3FDA35E0-0D54-4663-A3E6-5ABA96F32221}.Release_CUDA|x64.Build.0 = Release_CUDA|x64 - {3FDA35E0-0D54-4663-A3E6-5ABA96F32221}.Release|Win32.ActiveCfg = Release|Win32 - {3FDA35E0-0D54-4663-A3E6-5ABA96F32221}.Release|Win32.Build.0 = Release|Win32 - {3FDA35E0-0D54-4663-A3E6-5ABA96F32221}.Release|x64.ActiveCfg = Release|x64 - {3FDA35E0-0D54-4663-A3E6-5ABA96F32221}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {9D041710-2119-4230-BCF2-5FBE753FDE49} = {33EF0AC5-B475-40BF-BAE5-67075B204D10} - {4DD6056F-8EEE-4C9A-B2A9-923F01A32E97} = {33EF0AC5-B475-40BF-BAE5-67075B204D10} - {F94CCD79-AA11-42DF-AC8A-6C9D2238A883} = {33EF0AC5-B475-40BF-BAE5-67075B204D10} - {0BEC029B-0929-4BF9-BD8B-9C9806A52065} = {33EF0AC5-B475-40BF-BAE5-67075B204D10} - {E4092269-B19C-46F7-A84E-4F146CC70E44} = {33EF0AC5-B475-40BF-BAE5-67075B204D10} - {056BF7A9-294D-487C-8CC3-BE629077CA94} = {33EF0AC5-B475-40BF-BAE5-67075B204D10} - {3FDA35E0-0D54-4663-A3E6-5ABA96F32221} = {33EF0AC5-B475-40BF-BAE5-67075B204D10} - EndGlobalSection -EndGlobal diff --git a/astra_vc08.vcproj b/astra_vc08.vcproj deleted file mode 100644 index 957586a..0000000 --- a/astra_vc08.vcproj +++ /dev/null @@ -1,3158 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/astra_vc09.sln b/astra_vc09.sln new file mode 100644 index 0000000..691ad91 --- /dev/null +++ b/astra_vc09.sln @@ -0,0 +1,199 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "astra", "astra_vc09.vcproj", "{12926444-6723-46A8-B388-12E65E0577FA}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "astra_mex", "astra_mex", "{33EF0AC5-B475-40BF-BAE5-67075B204D10}" + ProjectSection(ProjectDependencies) = postProject + {12926444-6723-46A8-B388-12E65E0577FA} = {12926444-6723-46A8-B388-12E65E0577FA} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "astra_mex", "matlab\mex\astra_mex_vc09.vcproj", "{3FDA35E0-0D54-4663-A3E6-5ABA96F32221}" + ProjectSection(ProjectDependencies) = postProject + {12926444-6723-46A8-B388-12E65E0577FA} = {12926444-6723-46A8-B388-12E65E0577FA} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "astra_mex_algorithm", "matlab\mex\astra_mex_algorithm_vc09.vcproj", "{056BF7A9-294D-487C-8CC3-BE629077CA94}" + ProjectSection(ProjectDependencies) = postProject + {12926444-6723-46A8-B388-12E65E0577FA} = {12926444-6723-46A8-B388-12E65E0577FA} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "astra_mex_data2d", "matlab\mex\astra_mex_data2d_vc09.vcproj", "{E4092269-B19C-46F7-A84E-4F146CC70E44}" + ProjectSection(ProjectDependencies) = postProject + {12926444-6723-46A8-B388-12E65E0577FA} = {12926444-6723-46A8-B388-12E65E0577FA} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "astra_mex_data3d", "matlab\mex\astra_mex_data3d_vc09.vcproj", "{0BEC029B-0929-4BF9-BD8B-9C9806A52065}" + ProjectSection(ProjectDependencies) = postProject + {12926444-6723-46A8-B388-12E65E0577FA} = {12926444-6723-46A8-B388-12E65E0577FA} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "astra_mex_matrix", "matlab\mex\astra_mex_matrix_vc09.vcproj", "{9D041710-2119-4230-BCF2-5FBE753FDE49}" + ProjectSection(ProjectDependencies) = postProject + {12926444-6723-46A8-B388-12E65E0577FA} = {12926444-6723-46A8-B388-12E65E0577FA} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "astra_mex_projector", "matlab\mex\astra_mex_projector_vc09.vcproj", "{4DD6056F-8EEE-4C9A-B2A9-923F01A32E97}" + ProjectSection(ProjectDependencies) = postProject + {12926444-6723-46A8-B388-12E65E0577FA} = {12926444-6723-46A8-B388-12E65E0577FA} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "astra_mex_projector3d", "matlab\mex\astra_mex_projector3d_vc09.vcproj", "{F94CCD79-AA11-42DF-AC8A-6C9D2238A883}" + ProjectSection(ProjectDependencies) = postProject + {12926444-6723-46A8-B388-12E65E0577FA} = {12926444-6723-46A8-B388-12E65E0577FA} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug_CUDA|Win32 = Debug_CUDA|Win32 + Debug_CUDA|x64 = Debug_CUDA|x64 + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release_CUDA|Win32 = Release_CUDA|Win32 + Release_CUDA|x64 = Release_CUDA|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {12926444-6723-46A8-B388-12E65E0577FA}.Debug_CUDA|Win32.ActiveCfg = Debug_CUDA|Win32 + {12926444-6723-46A8-B388-12E65E0577FA}.Debug_CUDA|Win32.Build.0 = Debug_CUDA|Win32 + {12926444-6723-46A8-B388-12E65E0577FA}.Debug_CUDA|x64.ActiveCfg = Debug_CUDA|x64 + {12926444-6723-46A8-B388-12E65E0577FA}.Debug_CUDA|x64.Build.0 = Debug_CUDA|x64 + {12926444-6723-46A8-B388-12E65E0577FA}.Debug|Win32.ActiveCfg = Debug|Win32 + {12926444-6723-46A8-B388-12E65E0577FA}.Debug|Win32.Build.0 = Debug|Win32 + {12926444-6723-46A8-B388-12E65E0577FA}.Debug|x64.ActiveCfg = Debug|x64 + {12926444-6723-46A8-B388-12E65E0577FA}.Debug|x64.Build.0 = Debug|x64 + {12926444-6723-46A8-B388-12E65E0577FA}.Release_CUDA|Win32.ActiveCfg = Release_CUDA|Win32 + {12926444-6723-46A8-B388-12E65E0577FA}.Release_CUDA|Win32.Build.0 = Release_CUDA|Win32 + {12926444-6723-46A8-B388-12E65E0577FA}.Release_CUDA|x64.ActiveCfg = Release_CUDA|x64 + {12926444-6723-46A8-B388-12E65E0577FA}.Release_CUDA|x64.Build.0 = Release_CUDA|x64 + {12926444-6723-46A8-B388-12E65E0577FA}.Release|Win32.ActiveCfg = Release|Win32 + {12926444-6723-46A8-B388-12E65E0577FA}.Release|Win32.Build.0 = Release|Win32 + {12926444-6723-46A8-B388-12E65E0577FA}.Release|x64.ActiveCfg = Release|x64 + {12926444-6723-46A8-B388-12E65E0577FA}.Release|x64.Build.0 = Release|x64 + {3FDA35E0-0D54-4663-A3E6-5ABA96F32221}.Debug_CUDA|Win32.ActiveCfg = Debug_CUDA|Win32 + {3FDA35E0-0D54-4663-A3E6-5ABA96F32221}.Debug_CUDA|Win32.Build.0 = Debug_CUDA|Win32 + {3FDA35E0-0D54-4663-A3E6-5ABA96F32221}.Debug_CUDA|x64.ActiveCfg = Debug_CUDA|x64 + {3FDA35E0-0D54-4663-A3E6-5ABA96F32221}.Debug_CUDA|x64.Build.0 = Debug_CUDA|x64 + {3FDA35E0-0D54-4663-A3E6-5ABA96F32221}.Debug|Win32.ActiveCfg = Debug|Win32 + {3FDA35E0-0D54-4663-A3E6-5ABA96F32221}.Debug|Win32.Build.0 = Debug|Win32 + {3FDA35E0-0D54-4663-A3E6-5ABA96F32221}.Debug|x64.ActiveCfg = Debug|x64 + {3FDA35E0-0D54-4663-A3E6-5ABA96F32221}.Debug|x64.Build.0 = Debug|x64 + {3FDA35E0-0D54-4663-A3E6-5ABA96F32221}.Release_CUDA|Win32.ActiveCfg = Release_CUDA|Win32 + {3FDA35E0-0D54-4663-A3E6-5ABA96F32221}.Release_CUDA|Win32.Build.0 = Release_CUDA|Win32 + {3FDA35E0-0D54-4663-A3E6-5ABA96F32221}.Release_CUDA|x64.ActiveCfg = Release_CUDA|x64 + {3FDA35E0-0D54-4663-A3E6-5ABA96F32221}.Release_CUDA|x64.Build.0 = Release_CUDA|x64 + {3FDA35E0-0D54-4663-A3E6-5ABA96F32221}.Release|Win32.ActiveCfg = Release|Win32 + {3FDA35E0-0D54-4663-A3E6-5ABA96F32221}.Release|Win32.Build.0 = Release|Win32 + {3FDA35E0-0D54-4663-A3E6-5ABA96F32221}.Release|x64.ActiveCfg = Release|x64 + {3FDA35E0-0D54-4663-A3E6-5ABA96F32221}.Release|x64.Build.0 = Release|x64 + {056BF7A9-294D-487C-8CC3-BE629077CA94}.Debug_CUDA|Win32.ActiveCfg = Debug_CUDA|Win32 + {056BF7A9-294D-487C-8CC3-BE629077CA94}.Debug_CUDA|Win32.Build.0 = Debug_CUDA|Win32 + {056BF7A9-294D-487C-8CC3-BE629077CA94}.Debug_CUDA|x64.ActiveCfg = Debug_CUDA|x64 + {056BF7A9-294D-487C-8CC3-BE629077CA94}.Debug_CUDA|x64.Build.0 = Debug_CUDA|x64 + {056BF7A9-294D-487C-8CC3-BE629077CA94}.Debug|Win32.ActiveCfg = Debug|Win32 + {056BF7A9-294D-487C-8CC3-BE629077CA94}.Debug|Win32.Build.0 = Debug|Win32 + {056BF7A9-294D-487C-8CC3-BE629077CA94}.Debug|x64.ActiveCfg = Debug|x64 + {056BF7A9-294D-487C-8CC3-BE629077CA94}.Debug|x64.Build.0 = Debug|x64 + {056BF7A9-294D-487C-8CC3-BE629077CA94}.Release_CUDA|Win32.ActiveCfg = Release_CUDA|Win32 + {056BF7A9-294D-487C-8CC3-BE629077CA94}.Release_CUDA|Win32.Build.0 = Release_CUDA|Win32 + {056BF7A9-294D-487C-8CC3-BE629077CA94}.Release_CUDA|x64.ActiveCfg = Release_CUDA|x64 + {056BF7A9-294D-487C-8CC3-BE629077CA94}.Release_CUDA|x64.Build.0 = Release_CUDA|x64 + {056BF7A9-294D-487C-8CC3-BE629077CA94}.Release|Win32.ActiveCfg = Release|Win32 + {056BF7A9-294D-487C-8CC3-BE629077CA94}.Release|Win32.Build.0 = Release|Win32 + {056BF7A9-294D-487C-8CC3-BE629077CA94}.Release|x64.ActiveCfg = Release|x64 + {056BF7A9-294D-487C-8CC3-BE629077CA94}.Release|x64.Build.0 = Release|x64 + {E4092269-B19C-46F7-A84E-4F146CC70E44}.Debug_CUDA|Win32.ActiveCfg = Debug_CUDA|Win32 + {E4092269-B19C-46F7-A84E-4F146CC70E44}.Debug_CUDA|Win32.Build.0 = Debug_CUDA|Win32 + {E4092269-B19C-46F7-A84E-4F146CC70E44}.Debug_CUDA|x64.ActiveCfg = Debug_CUDA|x64 + {E4092269-B19C-46F7-A84E-4F146CC70E44}.Debug_CUDA|x64.Build.0 = Debug_CUDA|x64 + {E4092269-B19C-46F7-A84E-4F146CC70E44}.Debug|Win32.ActiveCfg = Debug|Win32 + {E4092269-B19C-46F7-A84E-4F146CC70E44}.Debug|Win32.Build.0 = Debug|Win32 + {E4092269-B19C-46F7-A84E-4F146CC70E44}.Debug|x64.ActiveCfg = Debug|x64 + {E4092269-B19C-46F7-A84E-4F146CC70E44}.Debug|x64.Build.0 = Debug|x64 + {E4092269-B19C-46F7-A84E-4F146CC70E44}.Release_CUDA|Win32.ActiveCfg = Release_CUDA|Win32 + {E4092269-B19C-46F7-A84E-4F146CC70E44}.Release_CUDA|Win32.Build.0 = Release_CUDA|Win32 + {E4092269-B19C-46F7-A84E-4F146CC70E44}.Release_CUDA|x64.ActiveCfg = Release_CUDA|x64 + {E4092269-B19C-46F7-A84E-4F146CC70E44}.Release_CUDA|x64.Build.0 = Release_CUDA|x64 + {E4092269-B19C-46F7-A84E-4F146CC70E44}.Release|Win32.ActiveCfg = Release|Win32 + {E4092269-B19C-46F7-A84E-4F146CC70E44}.Release|Win32.Build.0 = Release|Win32 + {E4092269-B19C-46F7-A84E-4F146CC70E44}.Release|x64.ActiveCfg = Release|x64 + {E4092269-B19C-46F7-A84E-4F146CC70E44}.Release|x64.Build.0 = Release|x64 + {0BEC029B-0929-4BF9-BD8B-9C9806A52065}.Debug_CUDA|Win32.ActiveCfg = Debug_CUDA|Win32 + {0BEC029B-0929-4BF9-BD8B-9C9806A52065}.Debug_CUDA|Win32.Build.0 = Debug_CUDA|Win32 + {0BEC029B-0929-4BF9-BD8B-9C9806A52065}.Debug_CUDA|x64.ActiveCfg = Debug_CUDA|x64 + {0BEC029B-0929-4BF9-BD8B-9C9806A52065}.Debug_CUDA|x64.Build.0 = Debug_CUDA|x64 + {0BEC029B-0929-4BF9-BD8B-9C9806A52065}.Debug|Win32.ActiveCfg = Debug|Win32 + {0BEC029B-0929-4BF9-BD8B-9C9806A52065}.Debug|Win32.Build.0 = Debug|Win32 + {0BEC029B-0929-4BF9-BD8B-9C9806A52065}.Debug|x64.ActiveCfg = Debug|x64 + {0BEC029B-0929-4BF9-BD8B-9C9806A52065}.Debug|x64.Build.0 = Debug|x64 + {0BEC029B-0929-4BF9-BD8B-9C9806A52065}.Release_CUDA|Win32.ActiveCfg = Release_CUDA|Win32 + {0BEC029B-0929-4BF9-BD8B-9C9806A52065}.Release_CUDA|Win32.Build.0 = Release_CUDA|Win32 + {0BEC029B-0929-4BF9-BD8B-9C9806A52065}.Release_CUDA|x64.ActiveCfg = Release_CUDA|x64 + {0BEC029B-0929-4BF9-BD8B-9C9806A52065}.Release_CUDA|x64.Build.0 = Release_CUDA|x64 + {0BEC029B-0929-4BF9-BD8B-9C9806A52065}.Release|Win32.ActiveCfg = Release|Win32 + {0BEC029B-0929-4BF9-BD8B-9C9806A52065}.Release|Win32.Build.0 = Release|Win32 + {0BEC029B-0929-4BF9-BD8B-9C9806A52065}.Release|x64.ActiveCfg = Release|x64 + {0BEC029B-0929-4BF9-BD8B-9C9806A52065}.Release|x64.Build.0 = Release|x64 + {9D041710-2119-4230-BCF2-5FBE753FDE49}.Debug_CUDA|Win32.ActiveCfg = Debug_CUDA|Win32 + {9D041710-2119-4230-BCF2-5FBE753FDE49}.Debug_CUDA|Win32.Build.0 = Debug_CUDA|Win32 + {9D041710-2119-4230-BCF2-5FBE753FDE49}.Debug_CUDA|x64.ActiveCfg = Debug_CUDA|x64 + {9D041710-2119-4230-BCF2-5FBE753FDE49}.Debug_CUDA|x64.Build.0 = Debug_CUDA|x64 + {9D041710-2119-4230-BCF2-5FBE753FDE49}.Debug|Win32.ActiveCfg = Debug|Win32 + {9D041710-2119-4230-BCF2-5FBE753FDE49}.Debug|Win32.Build.0 = Debug|Win32 + {9D041710-2119-4230-BCF2-5FBE753FDE49}.Debug|x64.ActiveCfg = Debug|x64 + {9D041710-2119-4230-BCF2-5FBE753FDE49}.Debug|x64.Build.0 = Debug|x64 + {9D041710-2119-4230-BCF2-5FBE753FDE49}.Release_CUDA|Win32.ActiveCfg = Release_CUDA|Win32 + {9D041710-2119-4230-BCF2-5FBE753FDE49}.Release_CUDA|Win32.Build.0 = Release_CUDA|Win32 + {9D041710-2119-4230-BCF2-5FBE753FDE49}.Release_CUDA|x64.ActiveCfg = Release_CUDA|x64 + {9D041710-2119-4230-BCF2-5FBE753FDE49}.Release_CUDA|x64.Build.0 = Release_CUDA|x64 + {9D041710-2119-4230-BCF2-5FBE753FDE49}.Release|Win32.ActiveCfg = Release|Win32 + {9D041710-2119-4230-BCF2-5FBE753FDE49}.Release|Win32.Build.0 = Release|Win32 + {9D041710-2119-4230-BCF2-5FBE753FDE49}.Release|x64.ActiveCfg = Release|x64 + {9D041710-2119-4230-BCF2-5FBE753FDE49}.Release|x64.Build.0 = Release|x64 + {4DD6056F-8EEE-4C9A-B2A9-923F01A32E97}.Debug_CUDA|Win32.ActiveCfg = Debug_CUDA|Win32 + {4DD6056F-8EEE-4C9A-B2A9-923F01A32E97}.Debug_CUDA|Win32.Build.0 = Debug_CUDA|Win32 + {4DD6056F-8EEE-4C9A-B2A9-923F01A32E97}.Debug_CUDA|x64.ActiveCfg = Debug_CUDA|x64 + {4DD6056F-8EEE-4C9A-B2A9-923F01A32E97}.Debug_CUDA|x64.Build.0 = Debug_CUDA|x64 + {4DD6056F-8EEE-4C9A-B2A9-923F01A32E97}.Debug|Win32.ActiveCfg = Debug|Win32 + {4DD6056F-8EEE-4C9A-B2A9-923F01A32E97}.Debug|Win32.Build.0 = Debug|Win32 + {4DD6056F-8EEE-4C9A-B2A9-923F01A32E97}.Debug|x64.ActiveCfg = Debug|x64 + {4DD6056F-8EEE-4C9A-B2A9-923F01A32E97}.Debug|x64.Build.0 = Debug|x64 + {4DD6056F-8EEE-4C9A-B2A9-923F01A32E97}.Release_CUDA|Win32.ActiveCfg = Release_CUDA|Win32 + {4DD6056F-8EEE-4C9A-B2A9-923F01A32E97}.Release_CUDA|Win32.Build.0 = Release_CUDA|Win32 + {4DD6056F-8EEE-4C9A-B2A9-923F01A32E97}.Release_CUDA|x64.ActiveCfg = Release_CUDA|x64 + {4DD6056F-8EEE-4C9A-B2A9-923F01A32E97}.Release_CUDA|x64.Build.0 = Release_CUDA|x64 + {4DD6056F-8EEE-4C9A-B2A9-923F01A32E97}.Release|Win32.ActiveCfg = Release|Win32 + {4DD6056F-8EEE-4C9A-B2A9-923F01A32E97}.Release|Win32.Build.0 = Release|Win32 + {4DD6056F-8EEE-4C9A-B2A9-923F01A32E97}.Release|x64.ActiveCfg = Release|x64 + {4DD6056F-8EEE-4C9A-B2A9-923F01A32E97}.Release|x64.Build.0 = Release|x64 + {F94CCD79-AA11-42DF-AC8A-6C9D2238A883}.Debug_CUDA|Win32.ActiveCfg = Debug_CUDA|Win32 + {F94CCD79-AA11-42DF-AC8A-6C9D2238A883}.Debug_CUDA|Win32.Build.0 = Debug_CUDA|Win32 + {F94CCD79-AA11-42DF-AC8A-6C9D2238A883}.Debug_CUDA|x64.ActiveCfg = Debug_CUDA|x64 + {F94CCD79-AA11-42DF-AC8A-6C9D2238A883}.Debug_CUDA|x64.Build.0 = Debug_CUDA|x64 + {F94CCD79-AA11-42DF-AC8A-6C9D2238A883}.Debug|Win32.ActiveCfg = Debug|Win32 + {F94CCD79-AA11-42DF-AC8A-6C9D2238A883}.Debug|Win32.Build.0 = Debug|Win32 + {F94CCD79-AA11-42DF-AC8A-6C9D2238A883}.Debug|x64.ActiveCfg = Debug|x64 + {F94CCD79-AA11-42DF-AC8A-6C9D2238A883}.Debug|x64.Build.0 = Debug|x64 + {F94CCD79-AA11-42DF-AC8A-6C9D2238A883}.Release_CUDA|Win32.ActiveCfg = Release_CUDA|Win32 + {F94CCD79-AA11-42DF-AC8A-6C9D2238A883}.Release_CUDA|Win32.Build.0 = Release_CUDA|Win32 + {F94CCD79-AA11-42DF-AC8A-6C9D2238A883}.Release_CUDA|x64.ActiveCfg = Release_CUDA|x64 + {F94CCD79-AA11-42DF-AC8A-6C9D2238A883}.Release_CUDA|x64.Build.0 = Release_CUDA|x64 + {F94CCD79-AA11-42DF-AC8A-6C9D2238A883}.Release|Win32.ActiveCfg = Release|Win32 + {F94CCD79-AA11-42DF-AC8A-6C9D2238A883}.Release|Win32.Build.0 = Release|Win32 + {F94CCD79-AA11-42DF-AC8A-6C9D2238A883}.Release|x64.ActiveCfg = Release|x64 + {F94CCD79-AA11-42DF-AC8A-6C9D2238A883}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {3FDA35E0-0D54-4663-A3E6-5ABA96F32221} = {33EF0AC5-B475-40BF-BAE5-67075B204D10} + {056BF7A9-294D-487C-8CC3-BE629077CA94} = {33EF0AC5-B475-40BF-BAE5-67075B204D10} + {E4092269-B19C-46F7-A84E-4F146CC70E44} = {33EF0AC5-B475-40BF-BAE5-67075B204D10} + {0BEC029B-0929-4BF9-BD8B-9C9806A52065} = {33EF0AC5-B475-40BF-BAE5-67075B204D10} + {9D041710-2119-4230-BCF2-5FBE753FDE49} = {33EF0AC5-B475-40BF-BAE5-67075B204D10} + {4DD6056F-8EEE-4C9A-B2A9-923F01A32E97} = {33EF0AC5-B475-40BF-BAE5-67075B204D10} + {F94CCD79-AA11-42DF-AC8A-6C9D2238A883} = {33EF0AC5-B475-40BF-BAE5-67075B204D10} + EndGlobalSection +EndGlobal diff --git a/astra_vc09.vcproj b/astra_vc09.vcproj new file mode 100644 index 0000000..f84eaaf --- /dev/null +++ b/astra_vc09.vcproj @@ -0,0 +1,3180 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/astra_vc11.sln b/astra_vc11.sln index 784fe7a..0ff0ef8 100644 --- a/astra_vc11.sln +++ b/astra_vc11.sln @@ -4,20 +4,44 @@ Microsoft Visual Studio Solution File, Format Version 12.00 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "astra_vc11", "astra_vc11.vcxproj", "{BE9F1326-527C-4284-AE2C-D1E25D539CEA}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "astra_mex", "astra_mex", "{5E99A109-374E-4102-BE9B-99BA1FA8AA30}" + ProjectSection(ProjectDependencies) = postProject + {BE9F1326-527C-4284-AE2C-D1E25D539CEA} = {BE9F1326-527C-4284-AE2C-D1E25D539CEA} + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "astra_mex", "matlab\mex\astra_mex_vc11.vcxproj", "{3FDA35E0-0D54-4663-A3E6-5ABA96F32221}" + ProjectSection(ProjectDependencies) = postProject + {BE9F1326-527C-4284-AE2C-D1E25D539CEA} = {BE9F1326-527C-4284-AE2C-D1E25D539CEA} + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "astra_mex_algorithm", "matlab\mex\astra_mex_algorithm_vc11.vcxproj", "{056BF7A9-294D-487C-8CC3-BE629077CA94}" + ProjectSection(ProjectDependencies) = postProject + {BE9F1326-527C-4284-AE2C-D1E25D539CEA} = {BE9F1326-527C-4284-AE2C-D1E25D539CEA} + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "astra_mex_data2d", "matlab\mex\astra_mex_data2d_vc11.vcxproj", "{E4092269-B19C-46F7-A84E-4F146CC70E44}" + ProjectSection(ProjectDependencies) = postProject + {BE9F1326-527C-4284-AE2C-D1E25D539CEA} = {BE9F1326-527C-4284-AE2C-D1E25D539CEA} + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "astra_mex_data3d", "matlab\mex\astra_mex_data3d_vc11.vcxproj", "{0BEC029B-0929-4BF9-BD8B-9C9806A52065}" + ProjectSection(ProjectDependencies) = postProject + {BE9F1326-527C-4284-AE2C-D1E25D539CEA} = {BE9F1326-527C-4284-AE2C-D1E25D539CEA} + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "astra_mex_matrix", "matlab\mex\astra_mex_matrix_vc11.vcxproj", "{9D041710-2119-4230-BCF2-5FBE753FDE49}" + ProjectSection(ProjectDependencies) = postProject + {BE9F1326-527C-4284-AE2C-D1E25D539CEA} = {BE9F1326-527C-4284-AE2C-D1E25D539CEA} + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "astra_mex_projector", "matlab\mex\astra_mex_projector_vc11.vcxproj", "{4DD6056F-8EEE-4C9A-B2A9-923F01A32E97}" + ProjectSection(ProjectDependencies) = postProject + {BE9F1326-527C-4284-AE2C-D1E25D539CEA} = {BE9F1326-527C-4284-AE2C-D1E25D539CEA} + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "astra_mex_projector3d", "matlab\mex\astra_mex_projector3d_vc11.vcxproj", "{F94CCD79-AA11-42DF-AC8A-6C9D2238A883}" + ProjectSection(ProjectDependencies) = postProject + {BE9F1326-527C-4284-AE2C-D1E25D539CEA} = {BE9F1326-527C-4284-AE2C-D1E25D539CEA} + EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -31,10 +55,10 @@ Global Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {BE9F1326-527C-4284-AE2C-D1E25D539CEA}.Debug_CUDA|Win32.ActiveCfg = Debug|Win32 - {BE9F1326-527C-4284-AE2C-D1E25D539CEA}.Debug_CUDA|Win32.Build.0 = Debug|Win32 - {BE9F1326-527C-4284-AE2C-D1E25D539CEA}.Debug_CUDA|x64.ActiveCfg = Debug|x64 - {BE9F1326-527C-4284-AE2C-D1E25D539CEA}.Debug_CUDA|x64.Build.0 = Debug|x64 + {BE9F1326-527C-4284-AE2C-D1E25D539CEA}.Debug_CUDA|Win32.ActiveCfg = Debug_CUDA|Win32 + {BE9F1326-527C-4284-AE2C-D1E25D539CEA}.Debug_CUDA|Win32.Build.0 = Debug_CUDA|Win32 + {BE9F1326-527C-4284-AE2C-D1E25D539CEA}.Debug_CUDA|x64.ActiveCfg = Debug_CUDA|x64 + {BE9F1326-527C-4284-AE2C-D1E25D539CEA}.Debug_CUDA|x64.Build.0 = Debug_CUDA|x64 {BE9F1326-527C-4284-AE2C-D1E25D539CEA}.Debug|Win32.ActiveCfg = Debug|Win32 {BE9F1326-527C-4284-AE2C-D1E25D539CEA}.Debug|Win32.Build.0 = Debug|Win32 {BE9F1326-527C-4284-AE2C-D1E25D539CEA}.Debug|x64.ActiveCfg = Debug|x64 diff --git a/astra_vc11.vcxproj b/astra_vc11.vcxproj index 6596a05..0cedf20 100644 --- a/astra_vc11.vcxproj +++ b/astra_vc11.vcxproj @@ -1,6 +1,14 @@  + + Debug_CUDA + Win32 + + + Debug_CUDA + x64 + Debug Win32 @@ -31,40 +39,52 @@ astra_vc11 + + DynamicLibrary + true + v110 + MultiByte + + + DynamicLibrary + true + v110 + MultiByte + - Application + DynamicLibrary true v110 MultiByte - Application + DynamicLibrary true v110 MultiByte - - Application + + DynamicLibrary false v110 true MultiByte - - Application + + DynamicLibrary false v110 true MultiByte - + DynamicLibrary false v110 true MultiByte - + DynamicLibrary false v110 @@ -75,133 +95,282 @@ + + + + + + - + - + - + - + - + - + + $(CUDA_INC_PATH);$(IncludePath) + $(CUDA_LIB_PATH);$(LibraryPath) + $(SolutionDir)bin\$(Platform)\Debug_CUDA\ + $(OutDir)obj\ + .dll + AstraCuda32D + true + + + $(CUDA_INC_PATH);$(IncludePath) + $(CUDA_LIB_PATH);$(LibraryPath) + $(SolutionDir)bin\$(Platform)\Debug_CUDA\ + $(OutDir)obj\ + .dll + AstraCuda64D + true + + + $(SolutionDir)bin\$(Platform)\Debug\ + $(OutDir)obj\ + .dll + Astra32D + true + + + $(SolutionDir)bin\$(Platform)\Debug\ + $(OutDir)obj\ + .dll + Astra64D + true + + $(CUDA_INC_PATH);$(IncludePath) $(CUDA_LIB_PATH);$(LibraryPath) $(SolutionDir)bin\$(Platform)\Release_CUDA\ $(OutDir)obj\ .dll + AstraCuda32 + true $(CUDA_INC_PATH);$(IncludePath) $(CUDA_LIB_PATH);$(LibraryPath) $(SolutionDir)bin\$(Platform)\Release_CUDA\ - $(OutDir)\obj\ + $(OutDir)obj\ .dll - false AstraCuda64 + true + + + $(SolutionDir)bin\$(Platform)\Release\ + $(OutDir)obj\ + .dll + Astra32 + true + + $(SolutionDir)bin\$(Platform)\Release\ + $(OutDir)obj\ + .dll + Astra64 + true + + + + MultiThreadedDebugDLL + Level3 + lib\include;include\;%(AdditionalIncludeDirectories) + true + StreamingSIMDExtensions2 + Disabled + ASTRA_CUDA;__SSE2__;DLL_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + true + + + true + bin\Win32\Debug_CUDA\AstraCuda32D.dll + cudart.lib;cufft.lib;%(AdditionalDependencies) + lib\win32;%(AdditionalLibraryDirectories);$(CudaToolkitLibDir) + + + 32 + true + compute_20,sm_20;compute_30,sm_30;compute_30,sm_35;compute_30,compute_30 + + + + + MultiThreadedDebugDLL + Level3 + lib\include;include\;%(AdditionalIncludeDirectories) + true + Disabled + ASTRA_CUDA;__SSE2__;DLL_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + true + + + true + bin\x64\Debug_CUDA\AstraCuda64D.dll + cudart.lib;cufft.lib;%(AdditionalDependencies) + lib\x64;%(AdditionalLibraryDirectories);$(CudaToolkitLibDir) + + + 64 + true + compute_20,sm_20;compute_30,sm_30;compute_30,sm_35;compute_30,compute_30 + + + MultiThreadedDebugDLL Level3 + lib\include;include\;%(AdditionalIncludeDirectories) + true + StreamingSIMDExtensions2 Disabled + __SSE2__;DLL_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true true true + bin\Win32\Debug\Astra32D.dll + lib\win32;%(AdditionalLibraryDirectories) + MultiThreadedDebugDLL Level3 + lib\include;include\;%(AdditionalIncludeDirectories) + true Disabled + __SSE2__;DLL_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true true true + bin\x64\Debug\Astra64D.dll + lib\x64;%(AdditionalLibraryDirectories) - + + MultiThreadedDLL Level3 + lib\include;include\;%(AdditionalIncludeDirectories) + true + StreamingSIMDExtensions2 MaxSpeed true true + AnySuitable + Speed + ASTRA_CUDA;__SSE2__;DLL_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true true true true true + bin\Win32\Release_CUDA\AstraCuda32.dll + cudart.lib;cufft.lib;%(AdditionalDependencies) + lib\win32;%(AdditionalLibraryDirectories);$(CudaToolkitLibDir) + + 32 + true + compute_20,sm_20;compute_30,sm_30;compute_30,sm_35;compute_30,compute_30 + - + + MultiThreadedDLL Level3 + lib\include;include\;%(AdditionalIncludeDirectories) + true MaxSpeed true true + AnySuitable + Speed + ASTRA_CUDA;__SSE2__;DLL_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true true true true true + bin\x64\Release_CUDA\AstraCuda64.dll + cudart.lib;cufft.lib;%(AdditionalDependencies) + lib\x64;%(AdditionalLibraryDirectories);$(CudaToolkitLibDir) + + 64 + true + compute_20,sm_20;compute_30,sm_30;compute_30,sm_35;compute_30,compute_30 + - + + MultiThreadedDLL Level3 + lib\include;include\;%(AdditionalIncludeDirectories) + true + StreamingSIMDExtensions2 MaxSpeed true true + AnySuitable + Speed + __SSE2__;DLL_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true true true true true + bin\Win32\Release\Astra32.dll + lib\win32;%(AdditionalLibraryDirectories) - - 64 - - + - Level1 + MultiThreadedDLL + Level3 + lib\include;include\;%(AdditionalIncludeDirectories) + true MaxSpeed true true - true - lib\include;lib\include\cuda;include\;%(AdditionalIncludeDirectories) - true AnySuitable Speed - ASTRA_CUDA;DLL_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + __SSE2__;DLL_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + true true true true - bin\x64\Release_CUDA\AstraCuda64.dll - lib\x64;$(CUDA_LIB_PATH);$(NVSDKCUDA_ROOT)\common\lib;$(NVSDKCOMPUTE_ROOT)/C/common/lib;%(AdditionalLibraryDirectories) - cudart.lib;cufft.lib;%(AdditionalDependencies) - false + bin\x64\Release\Astra64.dll + lib\x64;%(AdditionalLibraryDirectories) - - 64 - true - compute_20,sm_20 - @@ -214,27 +383,132 @@ - - - - - - - - - - - - - - - - - - - - - + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + @@ -254,12 +528,12 @@ - + - + @@ -344,7 +618,6 @@ - @@ -364,13 +637,13 @@ - + - + @@ -390,6 +663,7 @@ + @@ -397,40 +671,170 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + - + @@ -438,4 +842,4 @@ - + \ No newline at end of file diff --git a/astra_vc11.vcxproj.filters b/astra_vc11.vcxproj.filters index c4ba594..c7e4db9 100644 --- a/astra_vc11.vcxproj.filters +++ b/astra_vc11.vcxproj.filters @@ -4,79 +4,76 @@ CUDA\cuda source - - CUDA\cuda source - CUDA\cuda source - + CUDA\cuda source - + CUDA\cuda source - + CUDA\cuda source - + CUDA\cuda source - + CUDA\cuda source - + CUDA\cuda source - + CUDA\cuda source - + CUDA\cuda source - + CUDA\cuda source - + CUDA\cuda source - + CUDA\cuda source - + CUDA\cuda source - + CUDA\cuda source - + CUDA\cuda source - + CUDA\cuda source - + CUDA\cuda source - + CUDA\cuda source - + CUDA\cuda source - + CUDA\cuda source - + CUDA\cuda source - + CUDA\cuda source - + CUDA\cuda source - + CUDA\cuda source @@ -192,6 +189,9 @@ Geometries\source + + Geometries\source + Geometries\source @@ -332,7 +332,10 @@ Algorithms\headers - + + Algorithms\headers + + Algorithms\headers @@ -413,6 +416,9 @@ Global & Other\headers + + Global & Other\headers + Global & Other\headers @@ -434,6 +440,12 @@ Geometries\headers + + Geometries\headers + + + Geometries\headers + Geometries\headers @@ -494,46 +506,79 @@ Projectors\headers - - CUDA\cuda headers + + CUDA\astra headers - - CUDA\cuda headers + + CUDA\astra headers - - CUDA\cuda headers + + CUDA\astra headers - - CUDA\cuda headers + + CUDA\astra headers - - CUDA\cuda headers + + CUDA\astra headers - - CUDA\cuda headers + + CUDA\astra headers - - CUDA\cuda headers + + CUDA\astra headers - - CUDA\cuda headers + + CUDA\astra headers - + + CUDA\astra headers + + + CUDA\astra headers + + + CUDA\astra headers + + + CUDA\astra headers + + + CUDA\astra headers + + + CUDA\astra headers + + + CUDA\astra headers + + + CUDA\astra headers + + + CUDA\astra headers + + + CUDA\astra headers + + + CUDA\astra headers + + CUDA\cuda headers - + CUDA\cuda headers - + CUDA\cuda headers - + CUDA\cuda headers - + CUDA\cuda headers - + CUDA\cuda headers @@ -548,18 +593,9 @@ CUDA\cuda headers - - CUDA\cuda headers - CUDA\cuda headers - - CUDA\cuda headers - - - CUDA\cuda headers - CUDA\cuda headers @@ -572,74 +608,44 @@ CUDA\cuda headers - - CUDA\cuda headers - CUDA\cuda headers - - CUDA\astra headers - - - CUDA\astra headers - - - CUDA\astra headers - - - CUDA\astra headers - - - CUDA\astra headers - - - CUDA\astra headers - - - CUDA\astra headers - - - CUDA\astra headers - - - CUDA\astra headers - - - CUDA\astra headers + + CUDA\cuda headers - - CUDA\astra headers + + CUDA\cuda headers - - CUDA\astra headers + + CUDA\cuda headers - - CUDA\astra headers + + CUDA\cuda headers - - CUDA\astra headers + + CUDA\cuda headers - - CUDA\astra headers + + CUDA\cuda headers - - CUDA\astra headers + + CUDA\cuda headers - - CUDA\astra headers + + CUDA\cuda headers - - CUDA\astra headers + + CUDA\cuda headers - - CUDA\astra headers + + CUDA\cuda headers - - CUDA\astra headers + + CUDA\cuda headers - - CUDA\astra headers + + CUDA\cuda headers CUDA\cuda headers @@ -736,4 +742,4 @@ {04a878ed-77b4-4525-9bc2-38ccd65282c5} - + \ No newline at end of file diff --git a/build/msvc/gen.py b/build/msvc/gen.py new file mode 100644 index 0000000..0eb306e --- /dev/null +++ b/build/msvc/gen.py @@ -0,0 +1,1088 @@ +from __future__ import print_function +import sys +import os + +vcppguid = "8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942" # C++ project +siguid = "2150E333-8FDC-42A3-9474-1A3956D46DE8" # project group + + +def create_mex_project(name, uuid11, uuid09): + return { "type": vcppguid, "name": name, "file11": "matlab\\mex\\" + name + "_vc11.vcxproj", "file09": "matlab\\mex\\" + name + "_vc09.vcproj", "uuid11": uuid11, "uuid09": uuid09, "files": [] } + +P_astra = { "type": vcppguid, "name": "astra_vc11", "file11": "astra_vc11.vcxproj", "file09": "astra_vc09.vcproj", "uuid11": "BE9F1326-527C-4284-AE2C-D1E25D539CEA", "uuid09": "12926444-6723-46A8-B388-12E65E0577FA" } + +P0 = create_mex_project("astra_mex", "3FDA35E0-0D54-4663-A3E6-5ABA96F32221", "3FDA35E0-0D54-4663-A3E6-5ABA96F32221") + +P1 = create_mex_project("astra_mex_algorithm", "056BF7A9-294D-487C-8CC3-BE629077CA94", "056BF7A9-294D-487C-8CC3-BE629077CA94") +P2 = create_mex_project("astra_mex_data2d", "E4092269-B19C-46F7-A84E-4F146CC70E44", "E4092269-B19C-46F7-A84E-4F146CC70E44") +P3 = create_mex_project("astra_mex_data3d", "0BEC029B-0929-4BF9-BD8B-9C9806A52065", "0BEC029B-0929-4BF9-BD8B-9C9806A52065") +P4 = create_mex_project("astra_mex_matrix", "9D041710-2119-4230-BCF2-5FBE753FDE49", "9D041710-2119-4230-BCF2-5FBE753FDE49") +P5 = create_mex_project("astra_mex_projector", "4DD6056F-8EEE-4C9A-B2A9-923F01A32E97", "4DD6056F-8EEE-4C9A-B2A9-923F01A32E97") +P6 = create_mex_project("astra_mex_projector3d", "F94CCD79-AA11-42DF-AC8A-6C9D2238A883", "F94CCD79-AA11-42DF-AC8A-6C9D2238A883") + +F_astra_mex = { "type": siguid, + "name": "astra_mex", + "file11": "astra_mex", + "file09": "astra_mex", + "uuid11": "5E99A109-374E-4102-BE9B-99BA1FA8AA30", + "uuid09": "33EF0AC5-B475-40BF-BAE5-67075B204D10", + "entries": [ P0, P1, P2, P3, P4, P5, P6 ] } + + +P0["files"] = [ +"astra_mex_c.cpp", +"mexHelpFunctions.cpp", +"mexHelpFunctions.h", +] +P1["files"] = [ +"astra_mex_algorithm_c.cpp", +"mexHelpFunctions.cpp", +"mexHelpFunctions.h", +] +P2["files"] = [ +"astra_mex_data2d_c.cpp", +"mexHelpFunctions.cpp", +"mexHelpFunctions.h", +"mexCopyDataHelpFunctions.cpp", +"mexCopyDataHelpFunctions.h", +"mexDataManagerHelpFunctions.cpp", +"mexDataManagerHelpFunctions.h", +] +P3["files"] = [ +"astra_mex_data3d_c.cpp", +"mexHelpFunctions.cpp", +"mexHelpFunctions.h", +"mexCopyDataHelpFunctions.cpp", +"mexCopyDataHelpFunctions.h", +"mexDataManagerHelpFunctions.cpp", +"mexDataManagerHelpFunctions.h", +] +P4["files"] = [ +"astra_mex_matrix_c.cpp", +"mexHelpFunctions.cpp", +"mexHelpFunctions.h", +] +P5["files"] = [ +"astra_mex_projector_c.cpp", +"mexHelpFunctions.cpp", +"mexHelpFunctions.h", +] +P6["files"] = [ +"astra_mex_projector3d_c.cpp", +"mexHelpFunctions.cpp", +"mexHelpFunctions.h", +] + + +P_astra["filter_names"] = [ +"Algorithms", +"Data Structures", +"Projectors", +"CUDA", +"Global & Other", +"Geometries", +"Algorithms\\headers", +"Algorithms\\source", +"Data Structures\\headers", +"Data Structures\\source", +"Global & Other\\headers", +"Global & Other\\source", +"Geometries\\headers", +"Geometries\\source", +"Projectors\\headers", +"Projectors\\inline", +"Projectors\\source", +"CUDA\\astra headers", +"CUDA\\astra source", +"CUDA\\cuda headers", +"CUDA\\cuda source", +] +P_astra["filters"] = {} +P_astra["filters"]["Algorithms"] = [ "262b0d17-774a-4cb1-b51a-b358d2d02791" ] +P_astra["filters"]["Data Structures"] = [ "76d6d672-670b-4454-b3ab-10dc8f9b8710" ] +P_astra["filters"]["Projectors"] = [ "77a581a9-60da-4265-97c0-80cdf97408c0" ] +P_astra["filters"]["CUDA"] = [ "c1af0e56-5fcc-4e75-b5db-88eeb4148185" ] +P_astra["filters"]["Global & Other"] = [ "72fbe846-10ef-4c52-88df-13bd66c4cbfc" ] +P_astra["filters"]["Geometries"] = [ "7ef37c12-c98c-4dd6-938d-12f49279eae0" ] +P_astra["filters"]["CUDA\\cuda source"] = [ +"04a878ed-77b4-4525-9bc2-38ccd65282c5", +"cuda\\2d\\algo.cu", +"cuda\\2d\\arith.cu", +"cuda\\2d\\astra.cu", +"cuda\\2d\\cgls.cu", +"cuda\\2d\\darthelper.cu", +"cuda\\2d\\em.cu", +"cuda\\2d\\fan_bp.cu", +"cuda\\2d\\fan_fp.cu", +"cuda\\2d\\fft.cu", +"cuda\\2d\\par_bp.cu", +"cuda\\2d\\par_fp.cu", +"cuda\\2d\\sart.cu", +"cuda\\2d\\sirt.cu", +"cuda\\2d\\util.cu", +"cuda\\3d\\algo3d.cu", +"cuda\\3d\\arith3d.cu", +"cuda\\3d\\astra3d.cu", +"cuda\\3d\\cgls3d.cu", +"cuda\\3d\\cone_bp.cu", +"cuda\\3d\\cone_fp.cu", +"cuda\\3d\\darthelper3d.cu", +"cuda\\3d\\fdk.cu", +"cuda\\3d\\par3d_bp.cu", +"cuda\\3d\\par3d_fp.cu", +"cuda\\3d\\sirt3d.cu", +"cuda\\3d\\util3d.cu", +] +P_astra["filters"]["Algorithms\\source"] = [ +"9df653ab-26c3-4bec-92a2-3dda22fda761", +"src\\Algorithm.cpp", +"src\\ArtAlgorithm.cpp", +"src\\AsyncAlgorithm.cpp", +"src\\BackProjectionAlgorithm.cpp", +"src\\CglsAlgorithm.cpp", +"src\\FilteredBackProjectionAlgorithm.cpp", +"src\\ForwardProjectionAlgorithm.cpp", +"src\\ReconstructionAlgorithm2D.cpp", +"src\\ReconstructionAlgorithm3D.cpp", +"src\\SartAlgorithm.cpp", +"src\\SirtAlgorithm.cpp", +] +P_astra["filters"]["Data Structures\\source"] = [ +"95346487-8185-487b-a794-3e7fb5fcbd4c", +"src\\Float32Data.cpp", +"src\\Float32Data2D.cpp", +"src\\Float32Data3D.cpp", +"src\\Float32Data3DMemory.cpp", +"src\\Float32ProjectionData2D.cpp", +"src\\Float32ProjectionData3D.cpp", +"src\\Float32ProjectionData3DMemory.cpp", +"src\\Float32VolumeData2D.cpp", +"src\\Float32VolumeData3D.cpp", +"src\\Float32VolumeData3DMemory.cpp", +"src\\SparseMatrix.cpp", +] +P_astra["filters"]["Global & Other\\source"] = [ +"1546cb47-7e5b-42c2-b695-ef172024c14b", +"src\\AstraObjectFactory.cpp", +"src\\AstraObjectManager.cpp", +"src\\Config.cpp", +"src\\Fourier.cpp", +"src\\Globals.cpp", +"src\\Logger.cpp", +"src\\PlatformDepSystemCode.cpp", +"src\\Utilities.cpp", +"src\\XMLDocument.cpp", +"src\\XMLNode.cpp", +] +P_astra["filters"]["Geometries\\source"] = [ +"dc27bff7-4256-4311-a131-47612a44af20", +"src\\ConeProjectionGeometry3D.cpp", +"src\\ConeVecProjectionGeometry3D.cpp", +"src\\FanFlatProjectionGeometry2D.cpp", +"src\\FanFlatVecProjectionGeometry2D.cpp", +"src\\GeometryUtil3D.cpp", +"src\\ParallelProjectionGeometry2D.cpp", +"src\\ParallelProjectionGeometry3D.cpp", +"src\\ParallelVecProjectionGeometry3D.cpp", +"src\\ProjectionGeometry2D.cpp", +"src\\ProjectionGeometry3D.cpp", +"src\\SparseMatrixProjectionGeometry2D.cpp", +"src\\VolumeGeometry2D.cpp", +"src\\VolumeGeometry3D.cpp", +] +P_astra["filters"]["Projectors\\source"] = [ +"2d60e3c8-7874-4cee-b139-991ac15e811d", +"src\\DataProjector.cpp", +"src\\DataProjectorPolicies.cpp", +"src\\FanFlatBeamLineKernelProjector2D.cpp", +"src\\FanFlatBeamStripKernelProjector2D.cpp", +"src\\ParallelBeamBlobKernelProjector2D.cpp", +"src\\ParallelBeamLinearKernelProjector2D.cpp", +"src\\ParallelBeamLineKernelProjector2D.cpp", +"src\\ParallelBeamStripKernelProjector2D.cpp", +"src\\Projector2D.cpp", +"src\\Projector3D.cpp", +"src\\SparseMatrixProjector2D.cpp", +] +P_astra["filters"]["CUDA\\astra source"] = [ +"bbef012e-598a-456f-90d8-416bdcb4221c", +"src\\CudaBackProjectionAlgorithm.cpp", +"src\\CudaBackProjectionAlgorithm3D.cpp", +"src\\CudaCglsAlgorithm.cpp", +"src\\CudaCglsAlgorithm3D.cpp", +"src\\CudaDartMaskAlgorithm.cpp", +"src\\CudaDartMaskAlgorithm3D.cpp", +"src\\CudaDartSmoothingAlgorithm.cpp", +"src\\CudaDartSmoothingAlgorithm3D.cpp", +"src\\CudaDataOperationAlgorithm.cpp", +"src\\CudaEMAlgorithm.cpp", +"src\\CudaFDKAlgorithm3D.cpp", +"src\\CudaFilteredBackProjectionAlgorithm.cpp", +"src\\CudaForwardProjectionAlgorithm.cpp", +"src\\CudaForwardProjectionAlgorithm3D.cpp", +"src\\CudaProjector2D.cpp", +"src\\CudaProjector3D.cpp", +"src\\CudaReconstructionAlgorithm2D.cpp", +"src\\CudaRoiSelectAlgorithm.cpp", +"src\\CudaSartAlgorithm.cpp", +"src\\CudaSirtAlgorithm.cpp", +"src\\CudaSirtAlgorithm3D.cpp", +] +P_astra["filters"]["CUDA\\cuda headers"] = [ +"4e17872e-db7d-41bc-9760-fad1c253b583", +"cuda\\2d\\algo.h", +"cuda\\2d\\arith.h", +"cuda\\2d\\astra.h", +"cuda\\2d\\cgls.h", +"cuda\\2d\\darthelper.h", +"cuda\\2d\\dims.h", +"cuda\\2d\\em.h", +"cuda\\2d\\fan_bp.h", +"cuda\\2d\\fan_fp.h", +"cuda\\2d\\fbp_filters.h", +"cuda\\2d\\fft.h", +"cuda\\2d\\par_bp.h", +"cuda\\2d\\par_fp.h", +"cuda\\2d\\sart.h", +"cuda\\2d\\sirt.h", +"cuda\\2d\\util.h", +"cuda\\3d\\algo3d.h", +"cuda\\3d\\arith3d.h", +"cuda\\3d\\astra3d.h", +"cuda\\3d\\cgls3d.h", +"cuda\\3d\\cone_bp.h", +"cuda\\3d\\cone_fp.h", +"cuda\\3d\\darthelper3d.h", +"cuda\\3d\\dims3d.h", +"cuda\\3d\\fdk.h", +"cuda\\3d\\par3d_bp.h", +"cuda\\3d\\par3d_fp.h", +"cuda\\3d\\sirt3d.h", +"cuda\\3d\\util3d.h", +] +P_astra["filters"]["Algorithms\\headers"] = [ +"a76ffd6d-3895-4365-b27e-fc9a72f2ed75", +"include\\astra\\Algorithm.h", +"include\\astra\\AlgorithmTypelist.h", +"include\\astra\\ArtAlgorithm.h", +"include\\astra\\AsyncAlgorithm.h", +"include\\astra\\BackProjectionAlgorithm.h", +"include\\astra\\CglsAlgorithm.h", +"include\\astra\\CudaBackProjectionAlgorithm.h", +"include\\astra\\CudaBackProjectionAlgorithm3D.h", +"include\\astra\\FilteredBackProjectionAlgorithm.h", +"include\\astra\\ForwardProjectionAlgorithm.h", +"include\\astra\\ReconstructionAlgorithm2D.h", +"include\\astra\\ReconstructionAlgorithm3D.h", +"include\\astra\\SartAlgorithm.h", +"include\\astra\\SirtAlgorithm.h", +] +P_astra["filters"]["Data Structures\\headers"] = [ +"444c44b0-6454-483a-be26-7cb9c8ab0b98", +"include\\astra\\Float32Data.h", +"include\\astra\\Float32Data2D.h", +"include\\astra\\Float32Data3D.h", +"include\\astra\\Float32Data3DMemory.h", +"include\\astra\\Float32ProjectionData2D.h", +"include\\astra\\Float32ProjectionData3D.h", +"include\\astra\\Float32ProjectionData3DMemory.h", +"include\\astra\\Float32VolumeData2D.h", +"include\\astra\\Float32VolumeData3D.h", +"include\\astra\\Float32VolumeData3DMemory.h", +"include\\astra\\SparseMatrix.h", +] +P_astra["filters"]["Global & Other\\headers"] = [ +"1c52efc8-a77e-4c72-b9be-f6429a87e6d7", +"include\\astra\\AstraObjectFactory.h", +"include\\astra\\AstraObjectManager.h", +"include\\astra\\Config.h", +"include\\astra\\Fourier.h", +"include\\astra\\Globals.h", +"include\\astra\\Logger.h", +"include\\astra\\PlatformDepSystemCode.h", +"include\\astra\\Singleton.h", +"include\\astra\\TypeList.h", +"include\\astra\\Utilities.h", +"include\\astra\\Vector3D.h", +"include\\astra\\XMLDocument.h", +"include\\astra\\XMLNode.h", +] +P_astra["filters"]["Geometries\\headers"] = [ +"eddb31ba-0db7-4ab1-a490-36623aaf8901", +"include\\astra\\ConeProjectionGeometry3D.h", +"include\\astra\\ConeVecProjectionGeometry3D.h", +"include\\astra\\FanFlatProjectionGeometry2D.h", +"include\\astra\\FanFlatVecProjectionGeometry2D.h", +"include\\astra\\GeometryUtil2D.h", +"include\\astra\\GeometryUtil3D.h", +"include\\astra\\ParallelProjectionGeometry2D.h", +"include\\astra\\ParallelProjectionGeometry3D.h", +"include\\astra\\ParallelVecProjectionGeometry3D.h", +"include\\astra\\ProjectionGeometry2D.h", +"include\\astra\\ProjectionGeometry3D.h", +"include\\astra\\SparseMatrixProjectionGeometry2D.h", +"include\\astra\\VolumeGeometry2D.h", +"include\\astra\\VolumeGeometry3D.h", +] +P_astra["filters"]["Projectors\\headers"] = [ +"91ae2cfd-6b45-46eb-ad99-2f16e5ce4b1e", +"include\\astra\\DataProjector.h", +"include\\astra\\DataProjectorPolicies.h", +"include\\astra\\FanFlatBeamLineKernelProjector2D.h", +"include\\astra\\FanFlatBeamStripKernelProjector2D.h", +"include\\astra\\ParallelBeamBlobKernelProjector2D.h", +"include\\astra\\ParallelBeamLinearKernelProjector2D.h", +"include\\astra\\ParallelBeamLineKernelProjector2D.h", +"include\\astra\\ParallelBeamStripKernelProjector2D.h", +"include\\astra\\Projector2D.h", +"include\\astra\\Projector3D.h", +"include\\astra\\ProjectorTypelist.h", +"include\\astra\\SparseMatrixProjector2D.h", +] +P_astra["filters"]["CUDA\\astra headers"] = [ +"bd4e1f94-2f56-4db6-b946-20c29d65a351", +"include\\astra\\CudaCglsAlgorithm.h", +"include\\astra\\CudaCglsAlgorithm3D.h", +"include\\astra\\CudaDartMaskAlgorithm.h", +"include\\astra\\CudaDartMaskAlgorithm3D.h", +"include\\astra\\CudaDartSmoothingAlgorithm.h", +"include\\astra\\CudaDartSmoothingAlgorithm3D.h", +"include\\astra\\CudaDataOperationAlgorithm.h", +"include\\astra\\CudaEMAlgorithm.h", +"include\\astra\\CudaFDKAlgorithm3D.h", +"include\\astra\\CudaFilteredBackProjectionAlgorithm.h", +"include\\astra\\CudaForwardProjectionAlgorithm.h", +"include\\astra\\CudaForwardProjectionAlgorithm3D.h", +"include\\astra\\CudaProjector2D.h", +"include\\astra\\CudaProjector3D.h", +"include\\astra\\CudaReconstructionAlgorithm2D.h", +"include\\astra\\CudaRoiSelectAlgorithm.h", +"include\\astra\\CudaSartAlgorithm.h", +"include\\astra\\CudaSirtAlgorithm.h", +"include\\astra\\CudaSirtAlgorithm3D.h", + +] +P_astra["filters"]["Projectors\\inline"] = [ +"0daffd63-ba49-4a5f-8d7a-5322e0e74f22", +"include\\astra\\DataProjectorPolicies.inl", +"include\\astra\\FanFlatBeamLineKernelProjector2D.inl", +"include\\astra\\FanFlatBeamStripKernelProjector2D.inl", +"include\\astra\\ParallelBeamBlobKernelProjector2D.inl", +"include\\astra\\ParallelBeamLinearKernelProjector2D.inl", +"include\\astra\\ParallelBeamLineKernelProjector2D.inl", +"include\\astra\\ParallelBeamStripKernelProjector2D.inl", +"include\\astra\\SparseMatrixProjector2D.inl", +] + +P_astra["files"] = [] +for f in P_astra["filters"]: + P_astra["files"].extend(P_astra["filters"][f][1:]) +P_astra["files"].sort() + +projects = [ P_astra, F_astra_mex, P0, P1, P2, P3, P4, P5, P6 ] + +bom = "\xef\xbb\xbf" + +class Configuration: + def __init__(self, debug, cuda, x64): + self.debug = debug + self.cuda = cuda + self.x64 = x64 + def type(self): + if self.debug: + return "Debug" + else: + return "Release" + def config(self): + n = self.type() + if self.cuda: + n += "_CUDA" + return n + def platform(self): + if self.x64: + n = "x64" + else: + n = "Win32" + return n + def name(self): + n = self.config() + n += "|" + n += self.platform() + return n + def target(self): + n = "Astra" + if self.cuda: + n += "Cuda" + if self.x64: + n += "64" + else: + n += "32" + if self.debug: + n += "D" + return n + + + +configs = [ Configuration(a,b,c) for a in [ True, False ] for b in [ True, False ] for c in [ False, True ] ] + +def write_sln(version): + main_project = P_astra + if version == 9: + F = open("astra_vc09.sln", "w") + elif version == 11: + F = open("astra_vc11.sln", "w") + else: + assert(False) + print(bom, file=F) + if version == 9: + print("Microsoft Visual Studio Solution File, Format Version 10.00", file=F) + print("# Visual Studio 2008", file=F) + uuid = "uuid09" + file_ = "file09" + elif version == 11: + print("Microsoft Visual Studio Solution File, Format Version 12.00", file=F) + print("# Visual Studio 2012", file=F) + uuid = "uuid11" + file_ = "file11" + for p in projects: + s = '''Project("{%s}") = "%s", "%s", "{%s}"''' % (p["type"], p["name"], p[file_], p[uuid]) + print(s, file=F) + if "mex" in p["name"]: + print("\tProjectSection(ProjectDependencies) = postProject", file=F) + print("\t\t{%s} = {%s}" % (main_project[uuid], main_project[uuid]), file=F) + print("\tEndProjectSection", file=F) + print("EndProject", file=F) + print("Global", file=F) + print("\tGlobalSection(SolutionConfigurationPlatforms) = preSolution", file=F) + for c in configs: + print("\t\t" + c.name() + " = " + c.name(), file=F) + print("\tEndGlobalSection", file=F) + print("\tGlobalSection(ProjectConfigurationPlatforms) = postSolution", file=F) + for p in projects: + if "entries" in p: + continue + for c in configs: + print("\t\t{" + p[uuid] + "}." + c.name() + ".ActiveCfg = " + c.name(), file=F) + print("\t\t{" + p[uuid] + "}." + c.name() + ".Build.0 = " + c.name(), file=F) + print("\tEndGlobalSection", file=F) + print("\tGlobalSection(SolutionProperties) = preSolution", file=F) + print("\t\tHideSolutionNode = FALSE", file=F) + print("\tEndGlobalSection", file=F) + print("\tGlobalSection(NestedProjects) = preSolution", file=F) + for p in projects: + if "entries" not in p: + continue + for e in p["entries"]: + print("\t\t{" + e[uuid] + "} = {" + p[uuid] + "}", file=F) + print("\tEndGlobalSection", file=F) + print("EndGlobal", file=F) + F.close() + +def write_project11_start(P, F): + print(bom + '', file=F) + print('', file=F) + print(' ', file=F) + for c in configs: + print(' ', file=F) + print(' ' + c.config() + '', file=F) + print(' ' + c.platform() + '', file=F) + print(' ', file=F) + print(' ', file=F) + print(' ', file=F) + if 'mex' in P["name"]: + print(' ' + P["name"] + '', file=F) + print(' {' + P["uuid11"] + '}', file=F) + if 'mex' in P["name"]: + print(' astraMatlab', file=F) + else: + print(' ' + P["name"] + '', file=F) + print(' ', file=F) + print(' ', file=F) + for c in configs: + print(''' ''' % (c.name(), ), file=F) + print(' DynamicLibrary', file=F) + if 'mex' not in P["name"]: + if c.debug: + print(' true', file=F) + else: + print(' false', file=F) + print(' v110', file=F) + if 'mex' not in P["name"]: + if not c.debug: + print(' true', file=F) + print(' MultiByte', file=F) + print(' ', file=F) + print(' ', file=F) + print(' ', file=F) + if "mex" not in P["name"]: + print(' ', file=F) + print(' ', file=F) + for c in configs: + print(''' ''' % (c.name(), ), file=F) + print(''' ''', file=F) + print(''' ''', file=F) + print(' ', file=F) + +def write_project11_end(P, F): + l = [ f for f in P["files"] if len(f) > 4 and f[-4:] == ".cpp" ] + if l: + print(' ', file=F) + for f in l: + if ("cuda" in f) or ("Cuda" in f): + print(' ', file=F) + for c in configs: + if not c.cuda: + print(''' true''' % (c.name(), ), file=F) + print(' ', file=F) + else: + print(' ', file=F) + print(' ', file=F) + l = [ f for f in P["files"] if len(f) > 2 and f[-2:] == ".h" ] + if l: + print(' ', file=F) + for f in l: + print(' ', file=F) + print(' ', file=F) + l = [ f for f in P["files"] if len(f) > 3 and f[-3:] == ".cu" ] + if l: + print(' ', file=F) + for f in l: + print(' ', file=F) + for c in configs: + if not c.cuda: + print(''' true''' % (c.name(), ), file=F) + print(' ', file=F) + print(' ', file=F) + l = [ f for f in P["files"] if len(f) > 4 and f[-4:] == ".inl" ] + if l: + print(' ', file=F) + for f in l: + print(' ', file=F) + print(' ', file=F) + print(' ', file=F) + print(' ', file=F) + if "mex" not in P["name"]: + print(' ', file=F) + print(' ', file=F) + print('', end="", file=F) + + +def write_main_project11(): + P = P_astra; + F = open(P["file11"], "w") + write_project11_start(P, F) + for c in configs: + print(''' ''' % (c.name(), ), file=F) + if c.cuda: + print(' $(CUDA_INC_PATH);$(IncludePath)', file=F) + print(' $(CUDA_LIB_PATH);$(LibraryPath)', file=F) + print(' $(SolutionDir)bin\\$(Platform)\\' + c.config() + '\\', file=F) + print(' $(OutDir)obj\\', file=F) + print(' .dll', file=F) + print(' ' + c.target() + '', file=F) + print(' true', file=F) + print(' ', file=F) + for c in configs: + print(''' ''' % (c.name(), ), file=F) + print(' ', file=F) + if c.debug: + print(' MultiThreadedDebugDLL', file=F) + else: + print(' MultiThreadedDLL', file=F) + print(' Level3', file=F) + print(' lib\include;include\;%(AdditionalIncludeDirectories)', file=F) + print(' true', file=F) + if not c.x64: # /arch:SSE2 is implicit on x64 + print(' StreamingSIMDExtensions2', file=F) + if c.debug: + print(' Disabled', file=F) + else: + print(' MaxSpeed', file=F) + print(' true', file=F) + print(' true', file=F) + print(' AnySuitable', file=F) + print(' Speed', file=F) + d=' ' + if c.cuda: + d+="ASTRA_CUDA;" + d+="__SSE2__;" + d+="DLL_EXPORTS;_CRT_SECURE_NO_WARNINGS;" + d+='%(PreprocessorDefinitions)' + print(d, file=F) + print(' true', file=F) + print(' true', file=F) + print(' ', file=F) + print(' ', file=F) + print(' true', file=F) + if not c.debug: + print(' true', file=F) + print(' true', file=F) + print(' bin\\' + c.platform() + '\\' + c.config() + '\\' + c.target() + '.dll', file=F) + if c.cuda: + print(' cudart.lib;cufft.lib;%(AdditionalDependencies)', file=F) + l = ' '; + if c.x64: + l += 'lib\\x64' + else: + l += 'lib\\win32' + l += ';%(AdditionalLibraryDirectories)' + if c.cuda: + l += ';$(CudaToolkitLibDir)' + l += '' + print(l, file=F) + print(' ', file=F) + if c.cuda: + print(' ', file=F) + if c.x64: + print(' 64', file=F) + else: + print(' 32', file=F) + print(' true', file=F) + print(' compute_20,sm_20;compute_30,sm_30;compute_30,sm_35;compute_30,compute_30', file=F) + print(' ', file=F) + print(' ', file=F) + write_project11_end(P, F) + F.close() + +def write_mex_project11(P): + F = open("matlab/mex/" + P["name"] + "_vc11.vcxproj", "w") + write_project11_start(P, F) + print(' ', file=F) + print(' <_ProjectFileVersion>11.0.60610.1', file=F) + print(' ', file=F) + for c in configs: + print(''' ''' % (c.name(), ), file=F) + print(' $(SolutionDir)bin\\$(Platform)\\$(Configuration)\\', file=F) + print(' $(OutDir)obj\\$(ProjectName)\\', file=F) + print(' $(ProjectName)_c', file=F) + if c.x64: + print(' .mexw64', file=F) + else: + print(' .mexw32', file=F) + print(' ', file=F) + for c in configs: + print(''' ''' % (c.name(), ), file=F) + print(' ', file=F) + if c.debug: + print(' MultiThreadedDebugDLL', file=F) + else: + print(' MultiThreadedDLL', file=F) +# print(' Level3', file=F) + #print(' $(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories)', file=F) + # FIXME: This CUDA_PATH shouldn't be necessary + print(' $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories)', file=F) + print(' true', file=F) + if not c.x64: # /arch:SSE2 is implicit on x64 + print(' StreamingSIMDExtensions2', file=F) + if c.debug: + print(' Disabled', file=F) + else: + print(' MaxSpeed', file=F) +# print(' true', file=F) +# print(' true', file=F) +# print(' AnySuitable', file=F) +# print(' Speed', file=F) + d=' ' + if c.cuda: + d+="ASTRA_CUDA;" + d+="__SSE2__;" +# d+="DLL_EXPORTS;_CRT_SECURE_NO_WARNINGS;" + d+='%(PreprocessorDefinitions)' + print(d, file=F) + print(' true', file=F) +# print(' true', file=F) +# if c.debug: +# EditAndContinue ?? + print(' ', file=F) + print(' ', file=F) +# if not c.debug: +# print(' true', file=F) +# print(' true', file=F) + if c.x64: + print(' $(OutDir)$(ProjectName)_c.mexw64', file=F) + else: + print(' $(OutDir)$(ProjectName)_c.mexw32', file=F) + print(' %s.lib;libmex.lib;libmx.lib;libut.lib;%%(AdditionalDependencies)' % (c.target(), ), file=F) + l = ' '; + if c.x64: + l += '..\\..\\lib\\x64\\;..\\..\\bin\\x64\\' + else: + l += '..\\..\\lib\\win32\\;..\\..\\bin\\win32\\' + l += c.config() + if c.x64: + l += ';$(MATLAB_ROOT)\extern\lib\win64\microsoft' + else: + l += ';$(MATLAB_ROOT)\extern\lib\win32\microsoft' + l += ';%(AdditionalLibraryDirectories)' + l += '' + print(l, file=F) + print(' mex.def', file=F) + print(' true', file=F) + print(' ', file=F) + print(' ', file=F) + write_project11_end(P, F) + F.close() + +def write_main_filters11(): + P = P_astra + F = open(P["name"] + ".vcxproj.filters", "w") + print(bom + '', file=F) + print('', file=F) + print(' ', file=F) + for Filter in P_astra["filter_names"]: + L = P_astra["filters"][Filter][1:] + l = [ f for f in L if len(f) > 3 and f[-3:] == ".cu" ] + for f in l: + print(' ', file=F) + print(' ' + Filter + '', file=F) + print(' ', file=F) + print(' ', file=F) + print(' ', file=F) + for Filter in P_astra["filter_names"]: + L = P_astra["filters"][Filter][1:] + l = [ f for f in L if len(f) > 4 and f[-4:] == ".cpp" ] + for f in l: + print(' ', file=F) + print(' ' + Filter + '', file=F) + print(' ', file=F) + print(' ', file=F) + print(' ', file=F) + for Filter in P_astra["filter_names"]: + L = P_astra["filters"][Filter][1:] + l = [ f for f in L if len(f) > 2 and f[-2:] == ".h" ] + for f in l: + print(' ', file=F) + print(' ' + Filter + '', file=F) + print(' ', file=F) + print(' ', file=F) + print(' ', file=F) + for Filter in P_astra["filter_names"]: + L = P_astra["filters"][Filter][1:] + l = [ f for f in L if len(f) > 4 and f[-4:] == ".inl" ] + for f in l: + print(' ', file=F) + print(' ' + Filter + '', file=F) + print(' ', file=F) + print(' ', file=F) + print(' ', file=F) + for f in P["filter_names"]: + print(' ', file=F) + print(' {' + P["filters"][f][0] + '}', file=F) + print(' ', file=F) + print(' ', file=F) + print('', end="", file=F) + F.close() + +def write_project09_start(P, F): + print('', file=F) + print('', file=F) + print(r''' + + + ''', file=F) + +def write_project09_unused_tools(F): + print(r''' + + + + + + + + + + + + + + ''', file=F) + + +def write_main_project09(): + P = P_astra; + F = open(P["file09"], "w") + write_project09_start(P, F) + print(r''' + + ''', file=F) + print('\t', file=F) + for c in configs: + print('\t\t''', file=F) + write_project09_unused_tools(F) + print('\t\t\t', file=F) + print('\t\t\t', file=F) + print('\t\t\t', file=F) + print('\t\t', file=F) + print('\t', file=F) + print('\t', file=F) + print('\t', file=F) + print('\t', file=F) + print(r''' + + + ''', file=F) + curgroup = None + for Filter in P["filter_names"]: + if "\\" not in Filter: + continue + # TODO + [ group, subgroup ] = Filter.split("\\") + if group != curgroup: + if curgroup != None: + print('\t\t', file=F) + print('\t\t', file=F) + curgroup = group + print('\t\t\t', file=F) + for f in P["filters"][Filter][1:]: + print('\t\t\t\t', file=F) + if (("Cuda" in f) or ("cuda" in f)) and not (f[-2:] == ".h"): + for c in configs: + if not c.cuda: + print('\t\t\t\t\t', file=F) + print('\t\t\t\t\t\t 3 and f[-3:] == ".cu": + print('\t\t\t\t\t\t\tName="Cudart Build Rule"', file=F) + else: + print('\t\t\t\t\t\t\tName="VCCLCompilerTool"', file=F) + print('\t\t\t\t\t\t/>', file=F) + print('\t\t\t\t\t', file=F) + print('\t\t\t\t', file=F) + print('\t\t\t', file=F) + print('\t\t', file=F) + print('\t', file=F) + print('\t', file=F) + print('\t', file=F) + print('', file=F) + F.close() + +def write_mex_project09(P): + F = open("matlab/mex/" + P["name"] + "_vc09.vcproj", "w") + write_project09_start(P, F) + print('\t', file=F) + print('\t', file=F) + print('\t', file=F) + for c in configs: + print('\t\t''', file=F) + write_project09_unused_tools(F) + print('\t\t\t', file=F) + print('\t\t\t', file=F) + print('\t\t', file=F) + print('\t', file=F) + print('\t', file=F) + print('\t', file=F) + print('\t', file=F) + for f in P["files"]: + print('\t\t', file=F) + print('\t\t', file=F) + print('\t', file=F) + print('\t', file=F) + print('\t', file=F) + print('', file=F) + +try: + open("../../src/AstraObjectManager.cpp", "r") +except IOError: + print("Run gen.py from the build/msvc directory", file=sys.stderr) + sys.exit(1) + +# Change directory to main dir +os.chdir("../..") + + +# HACK +P_astra["name"] = "astra_vc11" +write_sln(11) +write_main_project11() +write_main_filters11() +write_mex_project11(P0) +write_mex_project11(P1) +write_mex_project11(P2) +write_mex_project11(P3) +write_mex_project11(P4) +write_mex_project11(P5) +write_mex_project11(P6) + +# HACK +P_astra["name"] = "astra" + +write_sln(9) +write_main_project09() +write_mex_project09(P0) +write_mex_project09(P1) +write_mex_project09(P2) +write_mex_project09(P3) +write_mex_project09(P4) +write_mex_project09(P5) +write_mex_project09(P6) diff --git a/matlab/mex/astra_mex_algorithm_vc08.vcproj b/matlab/mex/astra_mex_algorithm_vc08.vcproj deleted file mode 100644 index baa4c44..0000000 --- a/matlab/mex/astra_mex_algorithm_vc08.vcproj +++ /dev/null @@ -1,593 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/matlab/mex/astra_mex_algorithm_vc09.vcproj b/matlab/mex/astra_mex_algorithm_vc09.vcproj new file mode 100644 index 0000000..40fcf62 --- /dev/null +++ b/matlab/mex/astra_mex_algorithm_vc09.vcproj @@ -0,0 +1,604 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/matlab/mex/astra_mex_algorithm_vc11.vcxproj b/matlab/mex/astra_mex_algorithm_vc11.vcxproj index bdbca46..a297e6d 100644 --- a/matlab/mex/astra_mex_algorithm_vc11.vcxproj +++ b/matlab/mex/astra_mex_algorithm_vc11.vcxproj @@ -40,19 +40,15 @@ astraMatlab - - DynamicLibrary - v110 - DynamicLibrary v110 - + DynamicLibrary v110 - + DynamicLibrary v110 @@ -60,7 +56,7 @@ DynamicLibrary v110 - + DynamicLibrary v110 @@ -68,6 +64,10 @@ DynamicLibrary v110 + + DynamicLibrary + v110 + DynamicLibrary v110 @@ -75,215 +75,228 @@ - + - + - + - + - + - + - + - + <_ProjectFileVersion>11.0.60610.1 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw32 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw64 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw32 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ - .mexw64 $(ProjectName)_c + .mexw64 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw32 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw64 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw32 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw64 - + - MaxSpeed - $(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) - MultiThreadedDLL + MultiThreadedDebugDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true + StreamingSIMDExtensions2 + Disabled + ASTRA_CUDA;__SSE2__;%(PreprocessorDefinitions) + true - Astra32.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw32 - ..\..\bin\win32;$(MATLAB_ROOT)\extern\lib\win32\microsoft;..\..\lib\win32;%(AdditionalLibraryDirectories) + AstraCuda32D.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\win32\;..\..\bin\win32\Debug_CUDA;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) mex.def true - + - MaxSpeed - $(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) - MultiThreadedDLL + MultiThreadedDebugDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true + Disabled + ASTRA_CUDA;__SSE2__;%(PreprocessorDefinitions) + true - Astra64.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw64 - ..\..\bin\x64;$(MATLAB_ROOT)\extern\lib\win64\microsoft;..\..\lib\x64;%(AdditionalLibraryDirectories) + AstraCuda64D.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\x64\;..\..\bin\x64\Debug_CUDA;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) mex.def + true - + - MaxSpeed - $(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) - ASTRA_CUDA;%(PreprocessorDefinitions) - MultiThreadedDLL + MultiThreadedDebugDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true + StreamingSIMDExtensions2 + Disabled + __SSE2__;%(PreprocessorDefinitions) + true - AstraCuda32.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw32 - ..\..\bin\win32;$(MATLAB_ROOT)\extern\lib\win32\microsoft;..\..\lib\win32;%(AdditionalLibraryDirectories) + Astra32D.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\win32\;..\..\bin\win32\Debug;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) mex.def - false + true - + - MaxSpeed - $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\lib\include\cuda;..\..\include\;%(AdditionalIncludeDirectories) - ASTRA_CUDA;%(PreprocessorDefinitions) - MultiThreadedDLL + MultiThreadedDebugDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true + Disabled + __SSE2__;%(PreprocessorDefinitions) + true - AstraCuda64.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw64 - ..\..\bin\x64\Release_CUDA;$(MATLAB_ROOT)\extern\lib\win64\microsoft;..\..\lib\x64;%(AdditionalLibraryDirectories) + Astra64D.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\x64\;..\..\bin\x64\Debug;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) mex.def + true - + - Disabled - $(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) - ASTRA_CUDA;%(PreprocessorDefinitions) - MultiThreadedDebugDLL + MultiThreadedDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true - EditAndContinue + StreamingSIMDExtensions2 + MaxSpeed + ASTRA_CUDA;__SSE2__;%(PreprocessorDefinitions) + true - AstraCuda32D.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw32 - ..\..\bin\win32;$(MATLAB_ROOT)\extern\lib\win32\microsoft;..\..\lib\win32;%(AdditionalLibraryDirectories) + AstraCuda32.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\win32\;..\..\bin\win32\Release_CUDA;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) mex.def true - - - X64 - + - Disabled - $(MATLAB_ROOT)\extern\include\;$(CUDA_INC_PATH);..\..\lib\include;..\..\lib\include\cuda;..\..\include\;%(AdditionalIncludeDirectories) - ASTRA_CUDA;%(PreprocessorDefinitions) - MultiThreadedDebugDLL + MultiThreadedDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true - true - EditAndContinue + MaxSpeed + ASTRA_CUDA;__SSE2__;%(PreprocessorDefinitions) + true - AstraCuda64D.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw64 - ..\..\bin\x64;$(MATLAB_ROOT)\extern\lib\win64\microsoft;..\..\lib\x64;%(AdditionalLibraryDirectories) + AstraCuda64.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\x64\;..\..\bin\x64\Release_CUDA;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) mex.def true - MachineX64 - + - Disabled - $(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) - MultiThreadedDebugDLL + MultiThreadedDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true - EditAndContinue + StreamingSIMDExtensions2 + MaxSpeed + __SSE2__;%(PreprocessorDefinitions) + true - Astra32D.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw32 - ..\..\bin\win32;$(MATLAB_ROOT)\extern\lib\win32\microsoft;..\..\lib\win32;%(AdditionalLibraryDirectories) + Astra32.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\win32\;..\..\bin\win32\Release;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) mex.def true - - - X64 - + - Disabled - $(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) - MultiThreadedDebugDLL + MultiThreadedDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true + MaxSpeed + __SSE2__;%(PreprocessorDefinitions) + true - Astra64D.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw64 - ..\..\bin\x64;$(MATLAB_ROOT)\extern\lib\win64\microsoft;..\..\lib\x64;%(AdditionalLibraryDirectories) + Astra64.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\x64\;..\..\bin\x64\Release;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) mex.def - MachineX64 + true - - true - - - - true - - diff --git a/matlab/mex/astra_mex_data2d_vc08.vcproj b/matlab/mex/astra_mex_data2d_vc08.vcproj deleted file mode 100644 index 8f1fc13..0000000 --- a/matlab/mex/astra_mex_data2d_vc08.vcproj +++ /dev/null @@ -1,591 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/matlab/mex/astra_mex_data2d_vc09.vcproj b/matlab/mex/astra_mex_data2d_vc09.vcproj new file mode 100644 index 0000000..5611ccc --- /dev/null +++ b/matlab/mex/astra_mex_data2d_vc09.vcproj @@ -0,0 +1,620 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/matlab/mex/astra_mex_data2d_vc11.vcxproj b/matlab/mex/astra_mex_data2d_vc11.vcxproj index eb09332..0ecc6ce 100644 --- a/matlab/mex/astra_mex_data2d_vc11.vcxproj +++ b/matlab/mex/astra_mex_data2d_vc11.vcxproj @@ -40,19 +40,15 @@ astraMatlab - - DynamicLibrary - v110 - DynamicLibrary v110 - + DynamicLibrary v110 - + DynamicLibrary v110 @@ -60,7 +56,7 @@ DynamicLibrary v110 - + DynamicLibrary v110 @@ -68,6 +64,10 @@ DynamicLibrary v110 + + DynamicLibrary + v110 + DynamicLibrary v110 @@ -75,212 +75,231 @@ - + - + - + - + - + - + - + - + <_ProjectFileVersion>11.0.60610.1 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw32 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw64 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw32 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ $(ProjectName)_c .mexw64 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw32 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw64 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw32 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw64 - + - MaxSpeed - $(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) - MultiThreadedDLL + MultiThreadedDebugDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true + StreamingSIMDExtensions2 + Disabled + ASTRA_CUDA;__SSE2__;%(PreprocessorDefinitions) + true - Astra32.lib;libmex.lib;libmx.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw32 - ..\..\bin\win32;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) + AstraCuda32D.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\win32\;..\..\bin\win32\Debug_CUDA;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) mex.def + true - + - MaxSpeed - $(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) - MultiThreadedDLL + MultiThreadedDebugDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true + Disabled + ASTRA_CUDA;__SSE2__;%(PreprocessorDefinitions) + true - Astra64.lib;libmex.lib;libmx.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw64 - ..\..\bin\x64;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) + AstraCuda64D.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\x64\;..\..\bin\x64\Debug_CUDA;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) mex.def + true - + - MaxSpeed - $(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) - ASTRA_CUDA;%(PreprocessorDefinitions) - MultiThreadedDLL + MultiThreadedDebugDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true + StreamingSIMDExtensions2 + Disabled + __SSE2__;%(PreprocessorDefinitions) + true - AstraCuda32.lib;libmex.lib;libmx.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw32 - ..\..\bin\win32;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) + Astra32D.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\win32\;..\..\bin\win32\Debug;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) mex.def + true - + - MaxSpeed - $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\lib\include\cuda;..\..\include\;%(AdditionalIncludeDirectories) - ASTRA_CUDA;%(PreprocessorDefinitions) - MultiThreadedDLL + MultiThreadedDebugDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true + Disabled + __SSE2__;%(PreprocessorDefinitions) + true - AstraCuda64.lib;libmex.lib;libmx.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw64 - ..\..\bin\x64\Release_CUDA;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) + Astra64D.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\x64\;..\..\bin\x64\Debug;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) mex.def + true - + - Disabled - $(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) - ASTRA_CUDA;%(PreprocessorDefinitions) - MultiThreadedDebugDLL + MultiThreadedDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true - EditAndContinue + StreamingSIMDExtensions2 + MaxSpeed + ASTRA_CUDA;__SSE2__;%(PreprocessorDefinitions) + true - AstraCuda32D.lib;libmex.lib;libmx.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw32 - ..\..\bin\win32;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) + AstraCuda32.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\win32\;..\..\bin\win32\Release_CUDA;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) mex.def true - - - X64 - + - Disabled - $(CUDA_INC_PATH);$(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) - ASTRA_CUDA;%(PreprocessorDefinitions) - MultiThreadedDebugDLL + MultiThreadedDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true - true - EditAndContinue + MaxSpeed + ASTRA_CUDA;__SSE2__;%(PreprocessorDefinitions) + true - AstraCuda64D.lib;libmex.lib;libmx.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw64 - ..\..\bin\x64;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) + AstraCuda64.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\x64\;..\..\bin\x64\Release_CUDA;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) mex.def true - MachineX64 - + - Disabled - $(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) - MultiThreadedDebugDLL + MultiThreadedDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true - EditAndContinue + StreamingSIMDExtensions2 + MaxSpeed + __SSE2__;%(PreprocessorDefinitions) + true - Astra32D.lib;libmex.lib;libmx.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw32 - ..\..\bin\win32;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) + Astra32.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\win32\;..\..\bin\win32\Release;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) mex.def true - - - X64 - + - Disabled - $(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) - MultiThreadedDebugDLL + MultiThreadedDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true + MaxSpeed + __SSE2__;%(PreprocessorDefinitions) + true - Astra64D.lib;libmex.lib;libmx.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw64 - ..\..\bin\x64;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) + Astra64.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\x64\;..\..\bin\x64\Release;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) mex.def - MachineX64 + true - - false - + - - false - + diff --git a/matlab/mex/astra_mex_data3d_vc08.vcproj b/matlab/mex/astra_mex_data3d_vc08.vcproj deleted file mode 100644 index 2e69c16..0000000 --- a/matlab/mex/astra_mex_data3d_vc08.vcproj +++ /dev/null @@ -1,588 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/matlab/mex/astra_mex_data3d_vc09.vcproj b/matlab/mex/astra_mex_data3d_vc09.vcproj new file mode 100644 index 0000000..74a35f4 --- /dev/null +++ b/matlab/mex/astra_mex_data3d_vc09.vcproj @@ -0,0 +1,620 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/matlab/mex/astra_mex_data3d_vc11.vcxproj b/matlab/mex/astra_mex_data3d_vc11.vcxproj index b85d90b..8ac6f7c 100644 --- a/matlab/mex/astra_mex_data3d_vc11.vcxproj +++ b/matlab/mex/astra_mex_data3d_vc11.vcxproj @@ -40,19 +40,15 @@ astraMatlab - - DynamicLibrary - v110 - DynamicLibrary v110 - + DynamicLibrary v110 - + DynamicLibrary v110 @@ -60,7 +56,7 @@ DynamicLibrary v110 - + DynamicLibrary v110 @@ -68,6 +64,10 @@ DynamicLibrary v110 + + DynamicLibrary + v110 + DynamicLibrary v110 @@ -75,217 +75,231 @@ - + - + - + - + - + - + - + - + <_ProjectFileVersion>11.0.60610.1 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw32 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw64 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw32 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ $(ProjectName)_c .mexw64 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw32 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw64 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw32 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw64 - + - MaxSpeed - $(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) - MultiThreadedDLL + MultiThreadedDebugDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true StreamingSIMDExtensions2 + Disabled + ASTRA_CUDA;__SSE2__;%(PreprocessorDefinitions) + true - Astra32.lib;libmex.lib;libmx.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw32 - ..\..\bin\win32;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) + AstraCuda32D.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\win32\;..\..\bin\win32\Debug_CUDA;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) mex.def + true - + - MaxSpeed - $(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) - MultiThreadedDLL + MultiThreadedDebugDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true - StreamingSIMDExtensions2 + Disabled + ASTRA_CUDA;__SSE2__;%(PreprocessorDefinitions) + true - Astra64.lib;libmex.lib;libmx.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw64 - ..\..\bin\x64;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) + AstraCuda64D.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\x64\;..\..\bin\x64\Debug_CUDA;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) mex.def + true - + - MaxSpeed - $(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) - ASTRA_CUDA;%(PreprocessorDefinitions) - MultiThreadedDLL + MultiThreadedDebugDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true StreamingSIMDExtensions2 + Disabled + __SSE2__;%(PreprocessorDefinitions) + true - AstraCuda32.lib;libmex.lib;libmx.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw32 - ..\..\bin\win32;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) + Astra32D.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\win32\;..\..\bin\win32\Debug;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) mex.def + true - + - MaxSpeed - $(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) - ASTRA_CUDA;%(PreprocessorDefinitions) - MultiThreadedDLL + MultiThreadedDebugDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true - StreamingSIMDExtensions2 + Disabled + __SSE2__;%(PreprocessorDefinitions) + true - AstraCuda64.lib;libmex.lib;libmx.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw64 - ..\..\bin\x64\Release_CUDA;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) + Astra64D.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\x64\;..\..\bin\x64\Debug;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) mex.def + true - + - Disabled - $(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) - ASTRA_CUDA;%(PreprocessorDefinitions) - MultiThreadedDebugDLL + MultiThreadedDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true - EditAndContinue StreamingSIMDExtensions2 + MaxSpeed + ASTRA_CUDA;__SSE2__;%(PreprocessorDefinitions) + true - AstraCuda32D.lib;libmex.lib;libmx.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw32 - ..\..\bin\win32;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) + AstraCuda32.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\win32\;..\..\bin\win32\Release_CUDA;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) mex.def true - - - X64 - + - Disabled - $(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) - ASTRA_CUDA;%(PreprocessorDefinitions) - MultiThreadedDebugDLL + MultiThreadedDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true - StreamingSIMDExtensions2 + MaxSpeed + ASTRA_CUDA;__SSE2__;%(PreprocessorDefinitions) + true - AstraCuda64D.lib;libmex.lib;libmx.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw64 - ..\..\bin\x64;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) + AstraCuda64.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\x64\;..\..\bin\x64\Release_CUDA;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) mex.def - MachineX64 + true - + - Disabled - $(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) - MultiThreadedDebugDLL + MultiThreadedDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true - EditAndContinue StreamingSIMDExtensions2 + MaxSpeed + __SSE2__;%(PreprocessorDefinitions) + true - Astra32D.lib;libmex.lib;libmx.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw32 - ..\..\bin\win32;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) + Astra32.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\win32\;..\..\bin\win32\Release;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) mex.def true - - - X64 - + - Disabled - $(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) - MultiThreadedDebugDLL + MultiThreadedDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true - StreamingSIMDExtensions2 + MaxSpeed + __SSE2__;%(PreprocessorDefinitions) + true - Astra64D.lib;libmex.lib;libmx.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw64 - ..\..\bin\x64;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) + Astra64.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\x64\;..\..\bin\x64\Release;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) mex.def - MachineX64 + true - - false - + - - false - + diff --git a/matlab/mex/astra_mex_matrix_vc08.vcproj b/matlab/mex/astra_mex_matrix_vc08.vcproj deleted file mode 100644 index 47509f6..0000000 --- a/matlab/mex/astra_mex_matrix_vc08.vcproj +++ /dev/null @@ -1,591 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/matlab/mex/astra_mex_matrix_vc09.vcproj b/matlab/mex/astra_mex_matrix_vc09.vcproj new file mode 100644 index 0000000..e4b57e9 --- /dev/null +++ b/matlab/mex/astra_mex_matrix_vc09.vcproj @@ -0,0 +1,604 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/matlab/mex/astra_mex_matrix_vc11.vcxproj b/matlab/mex/astra_mex_matrix_vc11.vcxproj index 12393bf..91e32bd 100644 --- a/matlab/mex/astra_mex_matrix_vc11.vcxproj +++ b/matlab/mex/astra_mex_matrix_vc11.vcxproj @@ -40,19 +40,15 @@ astraMatlab - - DynamicLibrary - v110 - DynamicLibrary v110 - + DynamicLibrary v110 - + DynamicLibrary v110 @@ -60,7 +56,7 @@ DynamicLibrary v110 - + DynamicLibrary v110 @@ -68,6 +64,10 @@ DynamicLibrary v110 + + DynamicLibrary + v110 + DynamicLibrary v110 @@ -75,213 +75,228 @@ - + - + - + - + - + - + - + - + <_ProjectFileVersion>11.0.60610.1 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw32 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw64 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw32 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ $(ProjectName)_c .mexw64 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw32 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw64 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw32 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw64 - + - MaxSpeed - $(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) - MultiThreadedDLL + MultiThreadedDebugDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true + StreamingSIMDExtensions2 + Disabled + ASTRA_CUDA;__SSE2__;%(PreprocessorDefinitions) + true - Astra32.lib;libmex.lib;libmx.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw32 - ..\..\bin\win32;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) + AstraCuda32D.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\win32\;..\..\bin\win32\Debug_CUDA;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) mex.def + true - + - MaxSpeed - $(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) - MultiThreadedDLL + MultiThreadedDebugDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true + Disabled + ASTRA_CUDA;__SSE2__;%(PreprocessorDefinitions) + true - Astra64.lib;libmex.lib;libmx.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw64 - ..\..\bin\x64;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) + AstraCuda64D.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\x64\;..\..\bin\x64\Debug_CUDA;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) mex.def + true - + - MaxSpeed - $(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) - ASTRA_CUDA;%(PreprocessorDefinitions) - MultiThreadedDLL + MultiThreadedDebugDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true + StreamingSIMDExtensions2 + Disabled + __SSE2__;%(PreprocessorDefinitions) + true - AstraCuda32.lib;libmex.lib;libmx.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw32 - ..\..\bin\win32;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) + Astra32D.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\win32\;..\..\bin\win32\Debug;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) mex.def + true - + - MaxSpeed - $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\lib\include\cuda;..\..\include\;%(AdditionalIncludeDirectories) - ASTRA_CUDA;%(PreprocessorDefinitions) - MultiThreadedDLL + MultiThreadedDebugDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true + Disabled + __SSE2__;%(PreprocessorDefinitions) + true - AstraCuda64.lib;libmex.lib;libmx.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw64 - ..\..\bin\x64\Release_CUDA;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) + Astra64D.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\x64\;..\..\bin\x64\Debug;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) mex.def + true - + - Disabled - $(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) - ASTRA_CUDA;%(PreprocessorDefinitions) - MultiThreadedDebugDLL + MultiThreadedDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true - EditAndContinue + StreamingSIMDExtensions2 + MaxSpeed + ASTRA_CUDA;__SSE2__;%(PreprocessorDefinitions) + true - AstraCuda32D.lib;libmex.lib;libmx.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw32 - ..\..\bin\win32;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) + AstraCuda32.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\win32\;..\..\bin\win32\Release_CUDA;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) mex.def true - - - X64 - + - Disabled - $(CUDA_INC_PATH);$(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) - ASTRA_CUDA;%(PreprocessorDefinitions) - MultiThreadedDebugDLL + MultiThreadedDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true - true - EditAndContinue + MaxSpeed + ASTRA_CUDA;__SSE2__;%(PreprocessorDefinitions) + true - AstraCuda64D.lib;libmex.lib;libmx.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw64 - ..\..\bin\x64;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) + AstraCuda64.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\x64\;..\..\bin\x64\Release_CUDA;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) mex.def true - MachineX64 - + - Disabled - $(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) - MultiThreadedDebugDLL + MultiThreadedDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true - EditAndContinue + StreamingSIMDExtensions2 + MaxSpeed + __SSE2__;%(PreprocessorDefinitions) + true - Astra32D.lib;libmex.lib;libmx.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw32 - ..\..\bin\win32;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) + Astra32.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\win32\;..\..\bin\win32\Release;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) mex.def true - - - X64 - + - Disabled - $(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) - MultiThreadedDebugDLL + MultiThreadedDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true + MaxSpeed + __SSE2__;%(PreprocessorDefinitions) + true - Astra64D.lib;libmex.lib;libmx.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw64 - ..\..\bin\x64;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) + Astra64.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\x64\;..\..\bin\x64\Release;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) mex.def - MachineX64 + true - - true - - - - true - - diff --git a/matlab/mex/astra_mex_projector3d_vc08.vcproj b/matlab/mex/astra_mex_projector3d_vc08.vcproj deleted file mode 100644 index bedc53b..0000000 --- a/matlab/mex/astra_mex_projector3d_vc08.vcproj +++ /dev/null @@ -1,588 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/matlab/mex/astra_mex_projector3d_vc09.vcproj b/matlab/mex/astra_mex_projector3d_vc09.vcproj new file mode 100644 index 0000000..09fa3c6 --- /dev/null +++ b/matlab/mex/astra_mex_projector3d_vc09.vcproj @@ -0,0 +1,604 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/matlab/mex/astra_mex_projector3d_vc11.vcxproj b/matlab/mex/astra_mex_projector3d_vc11.vcxproj index 7981806..b8e8001 100644 --- a/matlab/mex/astra_mex_projector3d_vc11.vcxproj +++ b/matlab/mex/astra_mex_projector3d_vc11.vcxproj @@ -40,19 +40,15 @@ astraMatlab - - DynamicLibrary - v110 - DynamicLibrary v110 - + DynamicLibrary v110 - + DynamicLibrary v110 @@ -60,7 +56,7 @@ DynamicLibrary v110 - + DynamicLibrary v110 @@ -68,6 +64,10 @@ DynamicLibrary v110 + + DynamicLibrary + v110 + DynamicLibrary v110 @@ -75,210 +75,228 @@ - + - + - + - + - + - + - + - + <_ProjectFileVersion>11.0.60610.1 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw32 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw64 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw32 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ $(ProjectName)_c .mexw64 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw32 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw64 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw32 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw64 - + - MaxSpeed - $(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) - MultiThreadedDLL + MultiThreadedDebugDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true + StreamingSIMDExtensions2 + Disabled + ASTRA_CUDA;__SSE2__;%(PreprocessorDefinitions) + true - Astra32.lib;libmex.lib;libmx.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw32 - ..\..\bin\win32;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) + AstraCuda32D.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\win32\;..\..\bin\win32\Debug_CUDA;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) mex.def + true - + - MaxSpeed - $(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) - MultiThreadedDLL + MultiThreadedDebugDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true + Disabled + ASTRA_CUDA;__SSE2__;%(PreprocessorDefinitions) + true - Astra64.lib;libmex.lib;libmx.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw64 - ..\..\bin\x64;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) + AstraCuda64D.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\x64\;..\..\bin\x64\Debug_CUDA;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) mex.def + true - + - MaxSpeed - $(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) - ASTRA_CUDA;%(PreprocessorDefinitions) - MultiThreadedDLL + MultiThreadedDebugDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true + StreamingSIMDExtensions2 + Disabled + __SSE2__;%(PreprocessorDefinitions) + true - AstraCuda32.lib;libmex.lib;libmx.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw32 - ..\..\bin\win32;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) + Astra32D.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\win32\;..\..\bin\win32\Debug;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) mex.def + true - + - MaxSpeed - $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\lib\include\cuda;..\..\include\;%(AdditionalIncludeDirectories) - ASTRA_CUDA;%(PreprocessorDefinitions) - MultiThreadedDLL + MultiThreadedDebugDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true + Disabled + __SSE2__;%(PreprocessorDefinitions) + true - AstraCuda64.lib;libmex.lib;libmx.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw64 - ..\..\bin\x64\Release_CUDA;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) + Astra64D.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\x64\;..\..\bin\x64\Debug;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) mex.def + true - + - Disabled - $(MATLAB_ROOT)\extern\include\;$(CUDA_INC_PATH);..\..\lib\include;..\..\lib\include\cuda;..\..\include\;%(AdditionalIncludeDirectories) - ASTRA_CUDA;%(PreprocessorDefinitions) - MultiThreadedDebugDLL + MultiThreadedDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true - EditAndContinue + StreamingSIMDExtensions2 + MaxSpeed + ASTRA_CUDA;__SSE2__;%(PreprocessorDefinitions) + true - AstraCuda32D.lib;libmex.lib;libmx.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw32 - ..\..\bin\win32;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) + AstraCuda32.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\win32\;..\..\bin\win32\Release_CUDA;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) mex.def true - - - X64 - + - Disabled - $(MATLAB_ROOT)\extern\include\;$(CUDA_INC_PATH);..\..\lib\include;..\..\lib\include\cuda;..\..\include\;%(AdditionalIncludeDirectories) - ASTRA_CUDA;%(PreprocessorDefinitions) - MultiThreadedDebugDLL + MultiThreadedDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true + MaxSpeed + ASTRA_CUDA;__SSE2__;%(PreprocessorDefinitions) + true - AstraCuda64D.lib;libmex.lib;libmx.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw64 - ..\..\bin\x64;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) + AstraCuda64.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\x64\;..\..\bin\x64\Release_CUDA;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) mex.def - MachineX64 + true - + - Disabled - $(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) - MultiThreadedDebugDLL + MultiThreadedDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true - EditAndContinue + StreamingSIMDExtensions2 + MaxSpeed + __SSE2__;%(PreprocessorDefinitions) + true - Astra32D.lib;libmex.lib;libmx.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw32 - ..\..\bin\win32;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) + Astra32.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\win32\;..\..\bin\win32\Release;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) mex.def true - - - X64 - + - Disabled - $(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) - MultiThreadedDebugDLL + MultiThreadedDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true + MaxSpeed + __SSE2__;%(PreprocessorDefinitions) + true - Astra64D.lib;libmex.lib;libmx.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw64 - ..\..\bin\x64;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) + Astra64.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\x64\;..\..\bin\x64\Release;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) mex.def - MachineX64 + true - - true - - - - true - - diff --git a/matlab/mex/astra_mex_projector_vc08.vcproj b/matlab/mex/astra_mex_projector_vc08.vcproj deleted file mode 100644 index 1380061..0000000 --- a/matlab/mex/astra_mex_projector_vc08.vcproj +++ /dev/null @@ -1,591 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/matlab/mex/astra_mex_projector_vc09.vcproj b/matlab/mex/astra_mex_projector_vc09.vcproj new file mode 100644 index 0000000..c0a5cd8 --- /dev/null +++ b/matlab/mex/astra_mex_projector_vc09.vcproj @@ -0,0 +1,604 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/matlab/mex/astra_mex_projector_vc11.vcxproj b/matlab/mex/astra_mex_projector_vc11.vcxproj index 3ab1806..03a574d 100644 --- a/matlab/mex/astra_mex_projector_vc11.vcxproj +++ b/matlab/mex/astra_mex_projector_vc11.vcxproj @@ -40,19 +40,15 @@ astraMatlab - - DynamicLibrary - v110 - DynamicLibrary v110 - + DynamicLibrary v110 - + DynamicLibrary v110 @@ -60,7 +56,7 @@ DynamicLibrary v110 - + DynamicLibrary v110 @@ -68,6 +64,10 @@ DynamicLibrary v110 + + DynamicLibrary + v110 + DynamicLibrary v110 @@ -75,213 +75,228 @@ - + - + - + - + - + - + - + - + <_ProjectFileVersion>11.0.60610.1 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw32 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw64 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw32 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ $(ProjectName)_c .mexw64 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw32 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw64 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw32 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw64 - + - MaxSpeed - $(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) - MultiThreadedDLL + MultiThreadedDebugDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true + StreamingSIMDExtensions2 + Disabled + ASTRA_CUDA;__SSE2__;%(PreprocessorDefinitions) + true - Astra32.lib;libmex.lib;libmx.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw32 - ..\..\bin\win32;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) + AstraCuda32D.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\win32\;..\..\bin\win32\Debug_CUDA;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) mex.def + true - + - MaxSpeed - $(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) - MultiThreadedDLL + MultiThreadedDebugDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true + Disabled + ASTRA_CUDA;__SSE2__;%(PreprocessorDefinitions) + true - Astra64.lib;libmex.lib;libmx.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw64 - ..\..\bin\x64;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) + AstraCuda64D.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\x64\;..\..\bin\x64\Debug_CUDA;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) mex.def + true - + - MaxSpeed - $(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) - ASTRA_CUDA;%(PreprocessorDefinitions) - MultiThreadedDLL + MultiThreadedDebugDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true + StreamingSIMDExtensions2 + Disabled + __SSE2__;%(PreprocessorDefinitions) + true - AstraCuda32.lib;libmex.lib;libmx.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw32 - ..\..\bin\win32;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) + Astra32D.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\win32\;..\..\bin\win32\Debug;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) mex.def + true - + - MaxSpeed - $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\lib\include\cuda;..\..\include\;%(AdditionalIncludeDirectories) - ASTRA_CUDA;%(PreprocessorDefinitions) - MultiThreadedDLL + MultiThreadedDebugDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true + Disabled + __SSE2__;%(PreprocessorDefinitions) + true - AstraCuda64.lib;libmex.lib;libmx.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw64 - ..\..\bin\x64\Release_CUDA;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) + Astra64D.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\x64\;..\..\bin\x64\Debug;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) mex.def + true - + - Disabled - $(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) - ASTRA_CUDA;%(PreprocessorDefinitions) - MultiThreadedDebugDLL + MultiThreadedDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true - EditAndContinue + StreamingSIMDExtensions2 + MaxSpeed + ASTRA_CUDA;__SSE2__;%(PreprocessorDefinitions) + true - AstraCuda32D.lib;libmex.lib;libmx.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw32 - ..\..\bin\win32;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) + AstraCuda32.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\win32\;..\..\bin\win32\Release_CUDA;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) mex.def true - - - X64 - + - Disabled - $(MATLAB_ROOT)\extern\include\;$(CUDA_INC_PATH);..\..\lib\include;..\..\lib\include\cuda;..\..\include\;%(AdditionalIncludeDirectories) - ASTRA_CUDA;%(PreprocessorDefinitions) - MultiThreadedDebugDLL + MultiThreadedDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true - true - EditAndContinue + MaxSpeed + ASTRA_CUDA;__SSE2__;%(PreprocessorDefinitions) + true - AstraCuda64D.lib;libmex.lib;libmx.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw64 - ..\..\bin\x64;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) + AstraCuda64.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\x64\;..\..\bin\x64\Release_CUDA;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) mex.def true - MachineX64 - + - Disabled - $(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) - MultiThreadedDebugDLL + MultiThreadedDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true - EditAndContinue + StreamingSIMDExtensions2 + MaxSpeed + __SSE2__;%(PreprocessorDefinitions) + true - Astra32D.lib;libmex.lib;libmx.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw32 - ..\..\bin\win32;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) + Astra32.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\win32\;..\..\bin\win32\Release;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) mex.def true - - - X64 - + - Disabled - $(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) - MultiThreadedDebugDLL + MultiThreadedDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true + MaxSpeed + __SSE2__;%(PreprocessorDefinitions) + true - Astra64D.lib;libmex.lib;libmx.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw64 - ..\..\bin\x64;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) + Astra64.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\x64\;..\..\bin\x64\Release;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) mex.def - MachineX64 + true - - true - - - - true - - diff --git a/matlab/mex/astra_mex_vc08.vcproj b/matlab/mex/astra_mex_vc08.vcproj deleted file mode 100644 index 58c1e0a..0000000 --- a/matlab/mex/astra_mex_vc08.vcproj +++ /dev/null @@ -1,591 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/matlab/mex/astra_mex_vc09.vcproj b/matlab/mex/astra_mex_vc09.vcproj new file mode 100644 index 0000000..9615f53 --- /dev/null +++ b/matlab/mex/astra_mex_vc09.vcproj @@ -0,0 +1,604 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/matlab/mex/astra_mex_vc11.vcxproj b/matlab/mex/astra_mex_vc11.vcxproj index 2e6857c..04df41c 100644 --- a/matlab/mex/astra_mex_vc11.vcxproj +++ b/matlab/mex/astra_mex_vc11.vcxproj @@ -40,19 +40,15 @@ astraMatlab - - DynamicLibrary - v110 - DynamicLibrary v110 - + DynamicLibrary v110 - + DynamicLibrary v110 @@ -60,7 +56,7 @@ DynamicLibrary v110 - + DynamicLibrary v110 @@ -68,6 +64,10 @@ DynamicLibrary v110 + + DynamicLibrary + v110 + DynamicLibrary v110 @@ -75,213 +75,228 @@ - + - + - + - + - + - + - + - + <_ProjectFileVersion>11.0.60610.1 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw32 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw64 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw32 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ $(ProjectName)_c .mexw64 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw32 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw64 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw32 - + $(SolutionDir)bin\$(Platform)\$(Configuration)\ $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw64 - + - MaxSpeed - $(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) - MultiThreadedDLL + MultiThreadedDebugDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true + StreamingSIMDExtensions2 + Disabled + ASTRA_CUDA;__SSE2__;%(PreprocessorDefinitions) + true - Astra32.lib;libmex.lib;libmx.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw32 - ..\..\bin\win32;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) + AstraCuda32D.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\win32\;..\..\bin\win32\Debug_CUDA;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) mex.def + true - + - MaxSpeed - $(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) - MultiThreadedDLL + MultiThreadedDebugDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true + Disabled + ASTRA_CUDA;__SSE2__;%(PreprocessorDefinitions) + true - Astra64.lib;libmex.lib;libmx.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw64 - ..\..\bin\x64;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) + AstraCuda64D.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\x64\;..\..\bin\x64\Debug_CUDA;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) mex.def + true - + - MaxSpeed - $(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) - ASTRA_CUDA;%(PreprocessorDefinitions) - MultiThreadedDLL + MultiThreadedDebugDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true + StreamingSIMDExtensions2 + Disabled + __SSE2__;%(PreprocessorDefinitions) + true - AstraCuda32.lib;libmex.lib;libmx.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw32 - ..\..\bin\win32;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) + Astra32D.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\win32\;..\..\bin\win32\Debug;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) mex.def + true - + - MaxSpeed - $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\lib\include\cuda;..\..\include\;%(AdditionalIncludeDirectories) - ASTRA_CUDA;%(PreprocessorDefinitions) - MultiThreadedDLL + MultiThreadedDebugDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true + Disabled + __SSE2__;%(PreprocessorDefinitions) + true - AstraCuda64.lib;libmex.lib;libmx.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw64 - ..\..\bin\x64\Release_CUDA;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) + Astra64D.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\x64\;..\..\bin\x64\Debug;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) mex.def + true - + - Disabled - $(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) - ASTRA_CUDA;%(PreprocessorDefinitions) - MultiThreadedDebugDLL + MultiThreadedDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true - EditAndContinue + StreamingSIMDExtensions2 + MaxSpeed + ASTRA_CUDA;__SSE2__;%(PreprocessorDefinitions) + true - AstraCuda32D.lib;libmex.lib;libmx.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw32 - ..\..\bin\win32;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) + AstraCuda32.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\win32\;..\..\bin\win32\Release_CUDA;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) mex.def true - - - X64 - + - Disabled - $(CUDA_INC_PATH);$(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) - ASTRA_CUDA;%(PreprocessorDefinitions) - MultiThreadedDebugDLL + MultiThreadedDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true - true - EditAndContinue + MaxSpeed + ASTRA_CUDA;__SSE2__;%(PreprocessorDefinitions) + true - AstraCuda64D.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw64 - ..\..\bin\x64;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) + AstraCuda64.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\x64\;..\..\bin\x64\Release_CUDA;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) mex.def true - MachineX64 - + - Disabled - $(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) - MultiThreadedDebugDLL + MultiThreadedDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true - EditAndContinue + StreamingSIMDExtensions2 + MaxSpeed + __SSE2__;%(PreprocessorDefinitions) + true - Astra32D.lib;libmex.lib;libmx.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw32 - ..\..\bin\win32;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) + Astra32.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\win32\;..\..\bin\win32\Release;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) mex.def true - - - X64 - + - Disabled - $(MATLAB_ROOT)\extern\include\;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) - MultiThreadedDebugDLL + MultiThreadedDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) true + MaxSpeed + __SSE2__;%(PreprocessorDefinitions) + true - Astra64D.lib;libmex.lib;libmx.lib;%(AdditionalDependencies) $(OutDir)$(ProjectName)_c.mexw64 - ..\..\bin\x64;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) + Astra64.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\x64\;..\..\bin\x64\Release;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) mex.def - MachineX64 + true - - true - - - - true - - -- cgit v1.2.3 From 7f39622c23001b975efb6f61359d380c1f3f7984 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Fri, 20 Mar 2015 11:06:34 +0100 Subject: Add command line option to generate vc09/vc11/all files --- build/msvc/gen.py | 57 ++++++++++++++++++++++++++++++++----------------------- 1 file changed, 33 insertions(+), 24 deletions(-) diff --git a/build/msvc/gen.py b/build/msvc/gen.py index 0eb306e..c770641 100644 --- a/build/msvc/gen.py +++ b/build/msvc/gen.py @@ -1051,6 +1051,14 @@ def write_mex_project09(P): print('\t', file=F) print('', file=F) + + +if (len(sys.argv) != 2) or (sys.argv[1] not in ["vc09", "vc11", "all"]): + print("Usage: python gen.py [vc09|vc11|all]", file=sys.stderr) + sys.exit(1) + + + try: open("../../src/AstraObjectManager.cpp", "r") except IOError: @@ -1060,29 +1068,30 @@ except IOError: # Change directory to main dir os.chdir("../..") +if sys.argv[1] in ["vc11", "all"]: + # HACK + P_astra["name"] = "astra_vc11" + write_sln(11) + write_main_project11() + write_main_filters11() + write_mex_project11(P0) + write_mex_project11(P1) + write_mex_project11(P2) + write_mex_project11(P3) + write_mex_project11(P4) + write_mex_project11(P5) + write_mex_project11(P6) -# HACK -P_astra["name"] = "astra_vc11" -write_sln(11) -write_main_project11() -write_main_filters11() -write_mex_project11(P0) -write_mex_project11(P1) -write_mex_project11(P2) -write_mex_project11(P3) -write_mex_project11(P4) -write_mex_project11(P5) -write_mex_project11(P6) - -# HACK -P_astra["name"] = "astra" +if sys.argv[1] in ["vc09", "all"]: + # HACK + P_astra["name"] = "astra" -write_sln(9) -write_main_project09() -write_mex_project09(P0) -write_mex_project09(P1) -write_mex_project09(P2) -write_mex_project09(P3) -write_mex_project09(P4) -write_mex_project09(P5) -write_mex_project09(P6) + write_sln(9) + write_main_project09() + write_mex_project09(P0) + write_mex_project09(P1) + write_mex_project09(P2) + write_mex_project09(P3) + write_mex_project09(P4) + write_mex_project09(P5) + write_mex_project09(P6) -- cgit v1.2.3 From dc391ca18771ad2e2270aeeb1c0a5ee14319a38a Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Thu, 19 Mar 2015 17:47:12 +0100 Subject: Add MSVC project files --- astra_vc09.sln | 22 + astra_vc09.vcproj | 8 +- astra_vc11.sln | 22 + astra_vc11.vcxproj | 5 +- astra_vc11.vcxproj.filters | 7 +- build/msvc/gen.py | 38 +- matlab/mex/astra_mex_algorithm_vc09.vcproj | 8 + matlab/mex/astra_mex_algorithm_vc11.vcxproj | 2 + matlab/mex/astra_mex_data2d_vc09.vcproj | 8 + matlab/mex/astra_mex_data2d_vc11.vcxproj | 2 + matlab/mex/astra_mex_data3d_vc09.vcproj | 8 + matlab/mex/astra_mex_data3d_vc11.vcxproj | 2 + matlab/mex/astra_mex_log_vc09.vcproj | 612 ++++++++++++++++++++++++++ matlab/mex/astra_mex_log_vc11.vcxproj | 306 +++++++++++++ matlab/mex/astra_mex_matrix_vc09.vcproj | 8 + matlab/mex/astra_mex_matrix_vc11.vcxproj | 2 + matlab/mex/astra_mex_projector3d_vc09.vcproj | 8 + matlab/mex/astra_mex_projector3d_vc11.vcxproj | 2 + matlab/mex/astra_mex_projector_vc09.vcproj | 8 + matlab/mex/astra_mex_projector_vc11.vcxproj | 2 + matlab/mex/astra_mex_vc09.vcproj | 8 + matlab/mex/astra_mex_vc11.vcxproj | 2 + 22 files changed, 1080 insertions(+), 10 deletions(-) create mode 100644 matlab/mex/astra_mex_log_vc09.vcproj create mode 100644 matlab/mex/astra_mex_log_vc11.vcxproj diff --git a/astra_vc09.sln b/astra_vc09.sln index 691ad91..9b93a0f 100644 --- a/astra_vc09.sln +++ b/astra_vc09.sln @@ -43,6 +43,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "astra_mex_projector3d", "ma {12926444-6723-46A8-B388-12E65E0577FA} = {12926444-6723-46A8-B388-12E65E0577FA} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "astra_mex_log", "matlab\mex\astra_mex_log_vc09.vcproj", "{CA2840B3-DA68-41B5-AC57-F5DFD20ED8F8}" + ProjectSection(ProjectDependencies) = postProject + {12926444-6723-46A8-B388-12E65E0577FA} = {12926444-6723-46A8-B388-12E65E0577FA} + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug_CUDA|Win32 = Debug_CUDA|Win32 @@ -183,6 +188,22 @@ Global {F94CCD79-AA11-42DF-AC8A-6C9D2238A883}.Release|Win32.Build.0 = Release|Win32 {F94CCD79-AA11-42DF-AC8A-6C9D2238A883}.Release|x64.ActiveCfg = Release|x64 {F94CCD79-AA11-42DF-AC8A-6C9D2238A883}.Release|x64.Build.0 = Release|x64 + {CA2840B3-DA68-41B5-AC57-F5DFD20ED8F8}.Debug_CUDA|Win32.ActiveCfg = Debug_CUDA|Win32 + {CA2840B3-DA68-41B5-AC57-F5DFD20ED8F8}.Debug_CUDA|Win32.Build.0 = Debug_CUDA|Win32 + {CA2840B3-DA68-41B5-AC57-F5DFD20ED8F8}.Debug_CUDA|x64.ActiveCfg = Debug_CUDA|x64 + {CA2840B3-DA68-41B5-AC57-F5DFD20ED8F8}.Debug_CUDA|x64.Build.0 = Debug_CUDA|x64 + {CA2840B3-DA68-41B5-AC57-F5DFD20ED8F8}.Debug|Win32.ActiveCfg = Debug|Win32 + {CA2840B3-DA68-41B5-AC57-F5DFD20ED8F8}.Debug|Win32.Build.0 = Debug|Win32 + {CA2840B3-DA68-41B5-AC57-F5DFD20ED8F8}.Debug|x64.ActiveCfg = Debug|x64 + {CA2840B3-DA68-41B5-AC57-F5DFD20ED8F8}.Debug|x64.Build.0 = Debug|x64 + {CA2840B3-DA68-41B5-AC57-F5DFD20ED8F8}.Release_CUDA|Win32.ActiveCfg = Release_CUDA|Win32 + {CA2840B3-DA68-41B5-AC57-F5DFD20ED8F8}.Release_CUDA|Win32.Build.0 = Release_CUDA|Win32 + {CA2840B3-DA68-41B5-AC57-F5DFD20ED8F8}.Release_CUDA|x64.ActiveCfg = Release_CUDA|x64 + {CA2840B3-DA68-41B5-AC57-F5DFD20ED8F8}.Release_CUDA|x64.Build.0 = Release_CUDA|x64 + {CA2840B3-DA68-41B5-AC57-F5DFD20ED8F8}.Release|Win32.ActiveCfg = Release|Win32 + {CA2840B3-DA68-41B5-AC57-F5DFD20ED8F8}.Release|Win32.Build.0 = Release|Win32 + {CA2840B3-DA68-41B5-AC57-F5DFD20ED8F8}.Release|x64.ActiveCfg = Release|x64 + {CA2840B3-DA68-41B5-AC57-F5DFD20ED8F8}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -195,5 +216,6 @@ Global {9D041710-2119-4230-BCF2-5FBE753FDE49} = {33EF0AC5-B475-40BF-BAE5-67075B204D10} {4DD6056F-8EEE-4C9A-B2A9-923F01A32E97} = {33EF0AC5-B475-40BF-BAE5-67075B204D10} {F94CCD79-AA11-42DF-AC8A-6C9D2238A883} = {33EF0AC5-B475-40BF-BAE5-67075B204D10} + {CA2840B3-DA68-41B5-AC57-F5DFD20ED8F8} = {33EF0AC5-B475-40BF-BAE5-67075B204D10} EndGlobalSection EndGlobal diff --git a/astra_vc09.vcproj b/astra_vc09.vcproj index f84eaaf..a56e4bc 100644 --- a/astra_vc09.vcproj +++ b/astra_vc09.vcproj @@ -920,6 +920,10 @@ RelativePath=".\include\astra\AstraObjectManager.h" > + + @@ -933,7 +937,7 @@ > - + @@ -640,7 +640,7 @@ - + @@ -669,6 +669,7 @@ + diff --git a/astra_vc11.vcxproj.filters b/astra_vc11.vcxproj.filters index c7e4db9..a597962 100644 --- a/astra_vc11.vcxproj.filters +++ b/astra_vc11.vcxproj.filters @@ -162,7 +162,7 @@ Global & Other\source - + Global & Other\source @@ -395,6 +395,9 @@ Global & Other\headers + + Global & Other\headers + Global & Other\headers @@ -404,7 +407,7 @@ Global & Other\headers - + Global & Other\headers diff --git a/build/msvc/gen.py b/build/msvc/gen.py index c770641..9f5e367 100644 --- a/build/msvc/gen.py +++ b/build/msvc/gen.py @@ -5,6 +5,10 @@ import os vcppguid = "8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942" # C++ project siguid = "2150E333-8FDC-42A3-9474-1A3956D46DE8" # project group +# to generate a new uuid: +# +# import uuid +# uuid.uuid4().__str__().upper() def create_mex_project(name, uuid11, uuid09): return { "type": vcppguid, "name": name, "file11": "matlab\\mex\\" + name + "_vc11.vcxproj", "file09": "matlab\\mex\\" + name + "_vc09.vcproj", "uuid11": uuid11, "uuid09": uuid09, "files": [] } @@ -19,6 +23,7 @@ P3 = create_mex_project("astra_mex_data3d", "0BEC029B-0929-4BF9-BD8B-9C9806A5206 P4 = create_mex_project("astra_mex_matrix", "9D041710-2119-4230-BCF2-5FBE753FDE49", "9D041710-2119-4230-BCF2-5FBE753FDE49") P5 = create_mex_project("astra_mex_projector", "4DD6056F-8EEE-4C9A-B2A9-923F01A32E97", "4DD6056F-8EEE-4C9A-B2A9-923F01A32E97") P6 = create_mex_project("astra_mex_projector3d", "F94CCD79-AA11-42DF-AC8A-6C9D2238A883", "F94CCD79-AA11-42DF-AC8A-6C9D2238A883") +P7 = create_mex_project("astra_mex_log", "03B833F5-4FD6-4FBE-AAF4-E3305CD56D2E", "CA2840B3-DA68-41B5-AC57-F5DFD20ED8F8") F_astra_mex = { "type": siguid, "name": "astra_mex", @@ -26,18 +31,22 @@ F_astra_mex = { "type": siguid, "file09": "astra_mex", "uuid11": "5E99A109-374E-4102-BE9B-99BA1FA8AA30", "uuid09": "33EF0AC5-B475-40BF-BAE5-67075B204D10", - "entries": [ P0, P1, P2, P3, P4, P5, P6 ] } + "entries": [ P0, P1, P2, P3, P4, P5, P6, P7 ] } P0["files"] = [ "astra_mex_c.cpp", "mexHelpFunctions.cpp", "mexHelpFunctions.h", +"mexInitFunctions.cpp", +"mexInitFunctions.h", ] P1["files"] = [ "astra_mex_algorithm_c.cpp", "mexHelpFunctions.cpp", "mexHelpFunctions.h", +"mexInitFunctions.cpp", +"mexInitFunctions.h", ] P2["files"] = [ "astra_mex_data2d_c.cpp", @@ -47,6 +56,8 @@ P2["files"] = [ "mexCopyDataHelpFunctions.h", "mexDataManagerHelpFunctions.cpp", "mexDataManagerHelpFunctions.h", +"mexInitFunctions.cpp", +"mexInitFunctions.h", ] P3["files"] = [ "astra_mex_data3d_c.cpp", @@ -56,22 +67,38 @@ P3["files"] = [ "mexCopyDataHelpFunctions.h", "mexDataManagerHelpFunctions.cpp", "mexDataManagerHelpFunctions.h", +"mexInitFunctions.cpp", +"mexInitFunctions.h", ] P4["files"] = [ "astra_mex_matrix_c.cpp", "mexHelpFunctions.cpp", "mexHelpFunctions.h", +"mexInitFunctions.cpp", +"mexInitFunctions.h", ] P5["files"] = [ "astra_mex_projector_c.cpp", "mexHelpFunctions.cpp", "mexHelpFunctions.h", +"mexInitFunctions.cpp", +"mexInitFunctions.h", ] P6["files"] = [ "astra_mex_projector3d_c.cpp", "mexHelpFunctions.cpp", "mexHelpFunctions.h", +"mexInitFunctions.cpp", +"mexInitFunctions.h", ] +P7["files"] = [ +"astra_mex_log_c.cpp", +"mexHelpFunctions.cpp", +"mexHelpFunctions.h", +"mexInitFunctions.cpp", +"mexInitFunctions.h", +] + P_astra["filter_names"] = [ @@ -168,7 +195,7 @@ P_astra["filters"]["Global & Other\\source"] = [ "src\\Config.cpp", "src\\Fourier.cpp", "src\\Globals.cpp", -"src\\Logger.cpp", +"src\\Logging.cpp", "src\\PlatformDepSystemCode.cpp", "src\\Utilities.cpp", "src\\XMLDocument.cpp", @@ -295,10 +322,11 @@ P_astra["filters"]["Global & Other\\headers"] = [ "1c52efc8-a77e-4c72-b9be-f6429a87e6d7", "include\\astra\\AstraObjectFactory.h", "include\\astra\\AstraObjectManager.h", +"include\\astra\\clog.h", "include\\astra\\Config.h", "include\\astra\\Fourier.h", "include\\astra\\Globals.h", -"include\\astra\\Logger.h", +"include\\astra\\Logging.h", "include\\astra\\PlatformDepSystemCode.h", "include\\astra\\Singleton.h", "include\\astra\\TypeList.h", @@ -379,7 +407,7 @@ for f in P_astra["filters"]: P_astra["files"].extend(P_astra["filters"][f][1:]) P_astra["files"].sort() -projects = [ P_astra, F_astra_mex, P0, P1, P2, P3, P4, P5, P6 ] +projects = [ P_astra, F_astra_mex, P0, P1, P2, P3, P4, P5, P6, P7 ] bom = "\xef\xbb\xbf" @@ -1081,6 +1109,7 @@ if sys.argv[1] in ["vc11", "all"]: write_mex_project11(P4) write_mex_project11(P5) write_mex_project11(P6) + write_mex_project11(P7) if sys.argv[1] in ["vc09", "all"]: # HACK @@ -1095,3 +1124,4 @@ if sys.argv[1] in ["vc09", "all"]: write_mex_project09(P4) write_mex_project09(P5) write_mex_project09(P6) + write_mex_project09(P7) diff --git a/matlab/mex/astra_mex_algorithm_vc09.vcproj b/matlab/mex/astra_mex_algorithm_vc09.vcproj index 40fcf62..d5cebc0 100644 --- a/matlab/mex/astra_mex_algorithm_vc09.vcproj +++ b/matlab/mex/astra_mex_algorithm_vc09.vcproj @@ -598,6 +598,14 @@ RelativePath=".\mexHelpFunctions.h" > + + + + diff --git a/matlab/mex/astra_mex_algorithm_vc11.vcxproj b/matlab/mex/astra_mex_algorithm_vc11.vcxproj index a297e6d..c133e26 100644 --- a/matlab/mex/astra_mex_algorithm_vc11.vcxproj +++ b/matlab/mex/astra_mex_algorithm_vc11.vcxproj @@ -294,9 +294,11 @@ + + diff --git a/matlab/mex/astra_mex_data2d_vc09.vcproj b/matlab/mex/astra_mex_data2d_vc09.vcproj index 5611ccc..2c8a63f 100644 --- a/matlab/mex/astra_mex_data2d_vc09.vcproj +++ b/matlab/mex/astra_mex_data2d_vc09.vcproj @@ -614,6 +614,14 @@ RelativePath=".\mexDataManagerHelpFunctions.h" > + + + + diff --git a/matlab/mex/astra_mex_data2d_vc11.vcxproj b/matlab/mex/astra_mex_data2d_vc11.vcxproj index 0ecc6ce..636780a 100644 --- a/matlab/mex/astra_mex_data2d_vc11.vcxproj +++ b/matlab/mex/astra_mex_data2d_vc11.vcxproj @@ -296,11 +296,13 @@ + + diff --git a/matlab/mex/astra_mex_data3d_vc09.vcproj b/matlab/mex/astra_mex_data3d_vc09.vcproj index 74a35f4..fd861a3 100644 --- a/matlab/mex/astra_mex_data3d_vc09.vcproj +++ b/matlab/mex/astra_mex_data3d_vc09.vcproj @@ -614,6 +614,14 @@ RelativePath=".\mexDataManagerHelpFunctions.h" > + + + + diff --git a/matlab/mex/astra_mex_data3d_vc11.vcxproj b/matlab/mex/astra_mex_data3d_vc11.vcxproj index 8ac6f7c..1c3c620 100644 --- a/matlab/mex/astra_mex_data3d_vc11.vcxproj +++ b/matlab/mex/astra_mex_data3d_vc11.vcxproj @@ -296,11 +296,13 @@ + + diff --git a/matlab/mex/astra_mex_log_vc09.vcproj b/matlab/mex/astra_mex_log_vc09.vcproj new file mode 100644 index 0000000..0e0d469 --- /dev/null +++ b/matlab/mex/astra_mex_log_vc09.vcproj @@ -0,0 +1,612 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/matlab/mex/astra_mex_log_vc11.vcxproj b/matlab/mex/astra_mex_log_vc11.vcxproj new file mode 100644 index 0000000..0a939cf --- /dev/null +++ b/matlab/mex/astra_mex_log_vc11.vcxproj @@ -0,0 +1,306 @@ + + + + + Debug_CUDA + Win32 + + + Debug_CUDA + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release_CUDA + Win32 + + + Release_CUDA + x64 + + + Release + Win32 + + + Release + x64 + + + + astra_mex_log + {03B833F5-4FD6-4FBE-AAF4-E3305CD56D2E} + astraMatlab + + + + DynamicLibrary + v110 + + + DynamicLibrary + v110 + + + DynamicLibrary + v110 + + + DynamicLibrary + v110 + + + DynamicLibrary + v110 + + + DynamicLibrary + v110 + + + DynamicLibrary + v110 + + + DynamicLibrary + v110 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>11.0.60610.1 + + + $(SolutionDir)bin\$(Platform)\$(Configuration)\ + $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw32 + + + $(SolutionDir)bin\$(Platform)\$(Configuration)\ + $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw64 + + + $(SolutionDir)bin\$(Platform)\$(Configuration)\ + $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw32 + + + $(SolutionDir)bin\$(Platform)\$(Configuration)\ + $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw64 + + + $(SolutionDir)bin\$(Platform)\$(Configuration)\ + $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw32 + + + $(SolutionDir)bin\$(Platform)\$(Configuration)\ + $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw64 + + + $(SolutionDir)bin\$(Platform)\$(Configuration)\ + $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw32 + + + $(SolutionDir)bin\$(Platform)\$(Configuration)\ + $(OutDir)obj\$(ProjectName)\ + $(ProjectName)_c + .mexw64 + + + + MultiThreadedDebugDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) + true + StreamingSIMDExtensions2 + Disabled + ASTRA_CUDA;__SSE2__;%(PreprocessorDefinitions) + true + + + $(OutDir)$(ProjectName)_c.mexw32 + AstraCuda32D.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\win32\;..\..\bin\win32\Debug_CUDA;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) + mex.def + true + + + + + MultiThreadedDebugDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) + true + Disabled + ASTRA_CUDA;__SSE2__;%(PreprocessorDefinitions) + true + + + $(OutDir)$(ProjectName)_c.mexw64 + AstraCuda64D.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\x64\;..\..\bin\x64\Debug_CUDA;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) + mex.def + true + + + + + MultiThreadedDebugDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) + true + StreamingSIMDExtensions2 + Disabled + __SSE2__;%(PreprocessorDefinitions) + true + + + $(OutDir)$(ProjectName)_c.mexw32 + Astra32D.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\win32\;..\..\bin\win32\Debug;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) + mex.def + true + + + + + MultiThreadedDebugDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) + true + Disabled + __SSE2__;%(PreprocessorDefinitions) + true + + + $(OutDir)$(ProjectName)_c.mexw64 + Astra64D.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\x64\;..\..\bin\x64\Debug;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) + mex.def + true + + + + + MultiThreadedDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) + true + StreamingSIMDExtensions2 + MaxSpeed + ASTRA_CUDA;__SSE2__;%(PreprocessorDefinitions) + true + + + $(OutDir)$(ProjectName)_c.mexw32 + AstraCuda32.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\win32\;..\..\bin\win32\Release_CUDA;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) + mex.def + true + + + + + MultiThreadedDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) + true + MaxSpeed + ASTRA_CUDA;__SSE2__;%(PreprocessorDefinitions) + true + + + $(OutDir)$(ProjectName)_c.mexw64 + AstraCuda64.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\x64\;..\..\bin\x64\Release_CUDA;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) + mex.def + true + + + + + MultiThreadedDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) + true + StreamingSIMDExtensions2 + MaxSpeed + __SSE2__;%(PreprocessorDefinitions) + true + + + $(OutDir)$(ProjectName)_c.mexw32 + Astra32.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\win32\;..\..\bin\win32\Release;$(MATLAB_ROOT)\extern\lib\win32\microsoft;%(AdditionalLibraryDirectories) + mex.def + true + + + + + MultiThreadedDLL + $(MATLAB_ROOT)\extern\include\;$(CUDA_PATH)\include;..\..\lib\include;..\..\include;%(AdditionalIncludeDirectories) + true + MaxSpeed + __SSE2__;%(PreprocessorDefinitions) + true + + + $(OutDir)$(ProjectName)_c.mexw64 + Astra64.lib;libmex.lib;libmx.lib;libut.lib;%(AdditionalDependencies) + ..\..\lib\x64\;..\..\bin\x64\Release;$(MATLAB_ROOT)\extern\lib\win64\microsoft;%(AdditionalLibraryDirectories) + mex.def + true + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/matlab/mex/astra_mex_matrix_vc09.vcproj b/matlab/mex/astra_mex_matrix_vc09.vcproj index e4b57e9..3aa17a5 100644 --- a/matlab/mex/astra_mex_matrix_vc09.vcproj +++ b/matlab/mex/astra_mex_matrix_vc09.vcproj @@ -598,6 +598,14 @@ RelativePath=".\mexHelpFunctions.h" > + + + + diff --git a/matlab/mex/astra_mex_matrix_vc11.vcxproj b/matlab/mex/astra_mex_matrix_vc11.vcxproj index 91e32bd..abf86a7 100644 --- a/matlab/mex/astra_mex_matrix_vc11.vcxproj +++ b/matlab/mex/astra_mex_matrix_vc11.vcxproj @@ -294,9 +294,11 @@ + + diff --git a/matlab/mex/astra_mex_projector3d_vc09.vcproj b/matlab/mex/astra_mex_projector3d_vc09.vcproj index 09fa3c6..b9464a2 100644 --- a/matlab/mex/astra_mex_projector3d_vc09.vcproj +++ b/matlab/mex/astra_mex_projector3d_vc09.vcproj @@ -598,6 +598,14 @@ RelativePath=".\mexHelpFunctions.h" > + + + + diff --git a/matlab/mex/astra_mex_projector3d_vc11.vcxproj b/matlab/mex/astra_mex_projector3d_vc11.vcxproj index b8e8001..42eb0f1 100644 --- a/matlab/mex/astra_mex_projector3d_vc11.vcxproj +++ b/matlab/mex/astra_mex_projector3d_vc11.vcxproj @@ -294,9 +294,11 @@ + + diff --git a/matlab/mex/astra_mex_projector_vc09.vcproj b/matlab/mex/astra_mex_projector_vc09.vcproj index c0a5cd8..05c207f 100644 --- a/matlab/mex/astra_mex_projector_vc09.vcproj +++ b/matlab/mex/astra_mex_projector_vc09.vcproj @@ -598,6 +598,14 @@ RelativePath=".\mexHelpFunctions.h" > + + + + diff --git a/matlab/mex/astra_mex_projector_vc11.vcxproj b/matlab/mex/astra_mex_projector_vc11.vcxproj index 03a574d..e944949 100644 --- a/matlab/mex/astra_mex_projector_vc11.vcxproj +++ b/matlab/mex/astra_mex_projector_vc11.vcxproj @@ -294,9 +294,11 @@ + + diff --git a/matlab/mex/astra_mex_vc09.vcproj b/matlab/mex/astra_mex_vc09.vcproj index 9615f53..e4d7d07 100644 --- a/matlab/mex/astra_mex_vc09.vcproj +++ b/matlab/mex/astra_mex_vc09.vcproj @@ -598,6 +598,14 @@ RelativePath=".\mexHelpFunctions.h" > + + + + diff --git a/matlab/mex/astra_mex_vc11.vcxproj b/matlab/mex/astra_mex_vc11.vcxproj index 04df41c..f1324b4 100644 --- a/matlab/mex/astra_mex_vc11.vcxproj +++ b/matlab/mex/astra_mex_vc11.vcxproj @@ -294,9 +294,11 @@ + + -- cgit v1.2.3 From 2929e3eb5c398819163727d94981105f0c979f58 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Fri, 20 Mar 2015 14:00:10 +0100 Subject: Fix comment --- matlab/mex/astra_mex_log_c.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/matlab/mex/astra_mex_log_c.cpp b/matlab/mex/astra_mex_log_c.cpp index 79fe3d5..71b8234 100644 --- a/matlab/mex/astra_mex_log_c.cpp +++ b/matlab/mex/astra_mex_log_c.cpp @@ -26,9 +26,9 @@ along with the ASTRA Toolbox. If not, see . $Id$ */ -/** \file astra_mex_algorithm_c.cpp +/** \file astra_mex_log_c.cpp * - * \brief Creates and manages algorithms (reconstruction,projection,...). + * \brief Manages astra logging */ #include #include "mexHelpFunctions.h" -- cgit v1.2.3 From 10d35e96221675fc62299ba0cfdb0d731c9c7531 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Fri, 20 Mar 2015 14:03:44 +0100 Subject: Fix indentation --- cuda/2d/fft.cu | 22 ++--- matlab/mex/astra_mex_log_c.cpp | 184 ++++++++++++++++++++--------------------- 2 files changed, 103 insertions(+), 103 deletions(-) diff --git a/cuda/2d/fft.cu b/cuda/2d/fft.cu index 49c696c..2bfd493 100644 --- a/cuda/2d/fft.cu +++ b/cuda/2d/fft.cu @@ -137,7 +137,7 @@ static bool invokeCudaFFT(int _iProjectionCount, int _iDetectorCount, result = cufftPlan1d(&plan, _iDetectorCount, CUFFT_R2C, _iProjectionCount); if(result != CUFFT_SUCCESS) { - ASTRA_ERROR("Failed to plan 1d r2c fft"); + ASTRA_ERROR("Failed to plan 1d r2c fft"); return false; } @@ -146,7 +146,7 @@ static bool invokeCudaFFT(int _iProjectionCount, int _iDetectorCount, if(result != CUFFT_SUCCESS) { - ASTRA_ERROR("Failed to exec 1d r2c fft"); + ASTRA_ERROR("Failed to exec 1d r2c fft"); return false; } @@ -163,18 +163,18 @@ static bool invokeCudaIFFT(int _iProjectionCount, int _iDetectorCount, result = cufftPlan1d(&plan, _iDetectorCount, CUFFT_C2R, _iProjectionCount); if(result != CUFFT_SUCCESS) { - ASTRA_ERROR("Failed to plan 1d c2r fft"); + ASTRA_ERROR("Failed to plan 1d c2r fft"); return false; } // todo: why do we have to get rid of the const qualifier? result = cufftExecC2R(plan, (cufftComplex *)_pDevSourceComplex, - (cufftReal *)_pfDevTarget); + (cufftReal *)_pfDevTarget); cufftDestroy(plan); if(result != CUFFT_SUCCESS) { - ASTRA_ERROR("Failed to exec 1d c2r fft"); + ASTRA_ERROR("Failed to exec 1d c2r fft"); return false; } @@ -254,7 +254,7 @@ bool runCudaIFFT(int _iProjectionCount, const cufftComplex* _pDevSourceComplex, } rescaleInverseFourier(_iProjectionCount, _iFFTRealDetectorCount, - pfDevRealFFTTarget); + pfDevRealFFTTarget); SAFE_CALL(cudaMemset(_pfRealTarget, 0, sizeof(float) * _iProjectionCount * _iTargetPitch)); @@ -630,7 +630,7 @@ void genFilter(E_FBPFILTER _eFilter, float _fD, int _iProjectionCount, } default: { - ASTRA_ERROR("Cannot serve requested filter"); + ASTRA_ERROR("Cannot serve requested filter"); } } @@ -764,13 +764,13 @@ void testCudaFFT() result = cufftPlan1d(&plan, iDetectorCount, CUFFT_R2C, iProjectionCount); if(result != CUFFT_SUCCESS) { - ASTRA_ERROR("Failed to plan 1d r2c fft"); + ASTRA_ERROR("Failed to plan 1d r2c fft"); } result = cufftExecR2C(plan, pfDevProj, pDevFourProj); if(result != CUFFT_SUCCESS) { - ASTRA_ERROR("Failed to exec 1d r2c fft"); + ASTRA_ERROR("Failed to exec 1d r2c fft"); } cufftDestroy(plan); @@ -794,13 +794,13 @@ void testCudaFFT() result = cufftPlan1d(&plan, iDetectorCount, CUFFT_C2R, iProjectionCount); if(result != CUFFT_SUCCESS) { - ASTRA_ERROR("Failed to plan 1d c2r fft"); + ASTRA_ERROR("Failed to plan 1d c2r fft"); } result = cufftExecC2R(plan, pDevFourProj, pfDevInFourProj); if(result != CUFFT_SUCCESS) { - ASTRA_ERROR("Failed to exec 1d c2r fft"); + ASTRA_ERROR("Failed to exec 1d c2r fft"); } cufftDestroy(plan); diff --git a/matlab/mex/astra_mex_log_c.cpp b/matlab/mex/astra_mex_log_c.cpp index 71b8234..ea4621e 100644 --- a/matlab/mex/astra_mex_log_c.cpp +++ b/matlab/mex/astra_mex_log_c.cpp @@ -52,10 +52,10 @@ void astra_mex_log_debug(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prh mexErrMsgTxt("Not enough arguments. See the help document for a detailed argument list. \n"); return; } - string filename = mexToString(prhs[1]); - int linenumber = (int)mxGetScalar(prhs[2]); - string message = mexToString(prhs[3]); - astra::CLogger::debug(filename.c_str(),linenumber,message.c_str()); + string filename = mexToString(prhs[1]); + int linenumber = (int)mxGetScalar(prhs[2]); + string message = mexToString(prhs[3]); + astra::CLogger::debug(filename.c_str(),linenumber,message.c_str()); } //----------------------------------------------------------------------------------------- @@ -72,10 +72,10 @@ void astra_mex_log_info(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs mexErrMsgTxt("Not enough arguments. See the help document for a detailed argument list. \n"); return; } - string filename = mexToString(prhs[1]); - int linenumber = (int)mxGetScalar(prhs[2]); - string message = mexToString(prhs[3]); - astra::CLogger::info(filename.c_str(),linenumber,message.c_str()); + string filename = mexToString(prhs[1]); + int linenumber = (int)mxGetScalar(prhs[2]); + string message = mexToString(prhs[3]); + astra::CLogger::info(filename.c_str(),linenumber,message.c_str()); } //----------------------------------------------------------------------------------------- @@ -92,10 +92,10 @@ void astra_mex_log_warn(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs mexErrMsgTxt("Not enough arguments. See the help document for a detailed argument list. \n"); return; } - string filename = mexToString(prhs[1]); - int linenumber = (int)mxGetScalar(prhs[2]); - string message = mexToString(prhs[3]); - astra::CLogger::warn(filename.c_str(),linenumber,message.c_str()); + string filename = mexToString(prhs[1]); + int linenumber = (int)mxGetScalar(prhs[2]); + string message = mexToString(prhs[3]); + astra::CLogger::warn(filename.c_str(),linenumber,message.c_str()); } //----------------------------------------------------------------------------------------- @@ -112,10 +112,10 @@ void astra_mex_log_error(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prh mexErrMsgTxt("Not enough arguments. See the help document for a detailed argument list. \n"); return; } - string filename = mexToString(prhs[1]); - int linenumber = (int)mxGetScalar(prhs[2]); - string message = mexToString(prhs[3]); - astra::CLogger::error(filename.c_str(),linenumber,message.c_str()); + string filename = mexToString(prhs[1]); + int linenumber = (int)mxGetScalar(prhs[2]); + string message = mexToString(prhs[3]); + astra::CLogger::error(filename.c_str(),linenumber,message.c_str()); } //----------------------------------------------------------------------------------------- @@ -130,15 +130,15 @@ void astra_mex_log_enable(int nlhs, mxArray* plhs[], int nrhs, const mxArray* pr mexErrMsgTxt("Not enough arguments. See the help document for a detailed argument list. \n"); return; } - string sType = mexToString(prhs[1]); - if(sType == "all"){ - astra::CLogger::enable(); - }else if(sType == "file"){ - astra::CLogger::enableFile(); - }else if(sType == "screen"){ - astra::CLogger::enableScreen(); - } else { - mexErrMsgTxt("Specify which output to enable ('all', 'file', or 'screen')"); + string sType = mexToString(prhs[1]); + if(sType == "all"){ + astra::CLogger::enable(); + }else if(sType == "file"){ + astra::CLogger::enableFile(); + }else if(sType == "screen"){ + astra::CLogger::enableScreen(); + } else { + mexErrMsgTxt("Specify which output to enable ('all', 'file', or 'screen')"); } } @@ -154,15 +154,15 @@ void astra_mex_log_disable(int nlhs, mxArray* plhs[], int nrhs, const mxArray* p mexErrMsgTxt("Not enough arguments. See the help document for a detailed argument list. \n"); return; } - string sType = mexToString(prhs[1]); - if(sType == "all"){ - astra::CLogger::disable(); - }else if(sType == "file"){ - astra::CLogger::disableFile(); - }else if(sType == "screen"){ - astra::CLogger::disableScreen(); - } else { - mexErrMsgTxt("Specify which output to disable ('all', 'file', or 'screen')"); + string sType = mexToString(prhs[1]); + if(sType == "all"){ + astra::CLogger::disable(); + }else if(sType == "file"){ + astra::CLogger::disableFile(); + }else if(sType == "screen"){ + astra::CLogger::disableScreen(); + } else { + mexErrMsgTxt("Specify which output to disable ('all', 'file', or 'screen')"); } } @@ -188,23 +188,23 @@ void astra_mex_log_format(int nlhs, mxArray* plhs[], int nrhs, const mxArray* pr mexErrMsgTxt("Not enough arguments. See the help document for a detailed argument list. \n"); return; } - string sType = mexToString(prhs[1]); - string sFormat = mexToString(prhs[2]); - if (!sFormat.empty()) - { - char lastChar = *sFormat.rbegin(); - if (lastChar!='\n'){ - sFormat += '\n'; - } - }else{ - sFormat += '\n'; - } - if(sType == "file"){ - astra::CLogger::setFormatFile(sFormat.c_str()); - }else if(sType == "screen"){ - astra::CLogger::setFormatScreen(sFormat.c_str()); - } else { - mexErrMsgTxt("Specify which output to format ('file' or 'screen')"); + string sType = mexToString(prhs[1]); + string sFormat = mexToString(prhs[2]); + if (!sFormat.empty()) + { + char lastChar = *sFormat.rbegin(); + if (lastChar!='\n'){ + sFormat += '\n'; + } + }else{ + sFormat += '\n'; + } + if(sType == "file"){ + astra::CLogger::setFormatFile(sFormat.c_str()); + }else if(sType == "screen"){ + astra::CLogger::setFormatScreen(sFormat.c_str()); + } else { + mexErrMsgTxt("Specify which output to format ('file' or 'screen')"); } } @@ -224,35 +224,35 @@ void astra_mex_log_output(int nlhs, mxArray* plhs[], int nrhs, const mxArray* pr mexErrMsgTxt("Not enough arguments. See the help document for a detailed argument list. \n"); return; } - string sType = mexToString(prhs[1]); - string sOutput = mexToString(prhs[2]); - string sLevel = mexToString(prhs[3]); - log_level eLevel; - if(sLevel == "debug"){ - eLevel = LOG_DEBUG; - }else if(sLevel == "info"){ - eLevel = LOG_INFO; - }else if(sLevel == "warn"){ - eLevel = LOG_WARN; - }else if(sLevel == "error"){ - eLevel = LOG_ERROR; - }else{ - mexErrMsgTxt("Specify which log level to use ('debug', 'info', 'warn', or 'error')"); - } - if(sType == "file"){ - astra::CLogger::setOutputFile(sOutput.c_str(),eLevel); - }else if(sType == "screen"){ - int fd; - if(sOutput == "stdout"){ - fd=1; - }else if(sOutput == "stderr"){ - fd=2; - }else{ - mexErrMsgTxt("Specify which screen to output to ('stdout' or 'stderr')"); - } - astra::CLogger::setOutputScreen(fd,eLevel); - } else { - mexErrMsgTxt("Specify which output to set ('file' or 'screen')"); + string sType = mexToString(prhs[1]); + string sOutput = mexToString(prhs[2]); + string sLevel = mexToString(prhs[3]); + log_level eLevel; + if(sLevel == "debug"){ + eLevel = LOG_DEBUG; + }else if(sLevel == "info"){ + eLevel = LOG_INFO; + }else if(sLevel == "warn"){ + eLevel = LOG_WARN; + }else if(sLevel == "error"){ + eLevel = LOG_ERROR; + }else{ + mexErrMsgTxt("Specify which log level to use ('debug', 'info', 'warn', or 'error')"); + } + if(sType == "file"){ + astra::CLogger::setOutputFile(sOutput.c_str(),eLevel); + }else if(sType == "screen"){ + int fd; + if(sOutput == "stdout"){ + fd=1; + }else if(sOutput == "stderr"){ + fd=2; + }else{ + mexErrMsgTxt("Specify which screen to output to ('stdout' or 'stderr')"); + } + astra::CLogger::setOutputScreen(fd,eLevel); + } else { + mexErrMsgTxt("Specify which output to set ('file' or 'screen')"); } } @@ -286,18 +286,18 @@ void mexFunction(int nlhs, mxArray* plhs[], astra_mex_log_debug(nlhs, plhs, nrhs, prhs); }else if (sMode == "info") { astra_mex_log_info(nlhs, plhs, nrhs, prhs); - }else if (sMode == "warn") { - astra_mex_log_warn(nlhs, plhs, nrhs, prhs); - }else if (sMode == "error") { - astra_mex_log_error(nlhs, plhs, nrhs, prhs); - }else if (sMode == "enable") { - astra_mex_log_enable(nlhs, plhs, nrhs, prhs); - }else if (sMode == "disable") { - astra_mex_log_disable(nlhs, plhs, nrhs, prhs); - }else if (sMode == "format") { - astra_mex_log_format(nlhs, plhs, nrhs, prhs); - }else if (sMode == "output") { - astra_mex_log_output(nlhs, plhs, nrhs, prhs); + }else if (sMode == "warn") { + astra_mex_log_warn(nlhs, plhs, nrhs, prhs); + }else if (sMode == "error") { + astra_mex_log_error(nlhs, plhs, nrhs, prhs); + }else if (sMode == "enable") { + astra_mex_log_enable(nlhs, plhs, nrhs, prhs); + }else if (sMode == "disable") { + astra_mex_log_disable(nlhs, plhs, nrhs, prhs); + }else if (sMode == "format") { + astra_mex_log_format(nlhs, plhs, nrhs, prhs); + }else if (sMode == "output") { + astra_mex_log_output(nlhs, plhs, nrhs, prhs); } else { printHelp(); } -- cgit v1.2.3 From 9ba78fcfa3dec88928df33be26821e3fd5a10727 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Fri, 20 Mar 2015 14:57:59 +0100 Subject: Use FlushFileBuffers in Windows --- include/astra/clog.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/astra/clog.h b/include/astra/clog.h index c0cbae4..6ffb660 100644 --- a/include/astra/clog.h +++ b/include/astra/clog.h @@ -74,6 +74,8 @@ #ifndef _MSC_VER #include #else +#define WIN32_LEAN_AND_MEAN +#include #include #define open _open #define close _close @@ -634,8 +636,13 @@ _clog_log(const char *sfile, int sline, enum clog_level level, free(dynbuf); } #ifndef _MSC_VER - // FIXME fsync(logger->fd); +#else + HANDLE h = (HANDLE) _get_osfhandle(logger->fd); + if (h != INVALID_HANDLE_VALUE) { + // This call will fail on a console fd, but that's ok. + FlushFileBuffers(h); + } #endif } } -- cgit v1.2.3 From 5968cf4b6cf6907808011e66597054106df2a00f Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Mon, 30 Mar 2015 15:34:07 +0200 Subject: Add missing error on wrong projgeom type in CProjector3D::initialize --- src/Projector3D.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Projector3D.cpp b/src/Projector3D.cpp index b546ee9..def5237 100644 --- a/src/Projector3D.cpp +++ b/src/Projector3D.cpp @@ -108,6 +108,7 @@ bool CProjector3D::initialize(const Config& _cfg) pProjGeometry = new CConeVecProjectionGeometry3D(); } else { // Invalid geometry type + ASTRA_CONFIG_CHECK(false, "Projector3D", "Invalid projection geometry type specified."); } pProjGeometry->initialize(Config(node)); // this deletes node m_pProjectionGeometry = pProjGeometry; -- cgit v1.2.3 From b70ed00ebdf2dc952e29daf4b335bc47fd7c2ea0 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Mon, 30 Mar 2015 15:35:01 +0200 Subject: Fix typo in error message --- src/Projector3D.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Projector3D.cpp b/src/Projector3D.cpp index def5237..14cb16a 100644 --- a/src/Projector3D.cpp +++ b/src/Projector3D.cpp @@ -120,7 +120,7 @@ bool CProjector3D::initialize(const Config& _cfg) CVolumeGeometry3D* pVolGeometry = new CVolumeGeometry3D(); pVolGeometry->initialize(Config(node)); // this deletes node m_pVolumeGeometry = pVolGeometry; - ASTRA_CONFIG_CHECK(m_pVolumeGeometry->isInitialized(), "Projector2D", "VolumeGeometry not initialized."); + ASTRA_CONFIG_CHECK(m_pVolumeGeometry->isInitialized(), "Projector3D", "VolumeGeometry not initialized."); CC.markNodeParsed("VolumeGeometry"); return true; -- cgit v1.2.3 From 3042b1369a96eef4798ea4280dd7aa1a8be2fcca Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Mon, 30 Mar 2015 17:17:54 +0200 Subject: Initialize variables to avoid warning These variables are never used when uninitialized, but Visual Studio complains about them. --- cuda/2d/par_fp.cu | 2 +- cuda/3d/cone_fp.cu | 2 +- cuda/3d/par3d_fp.cu | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cuda/2d/par_fp.cu b/cuda/2d/par_fp.cu index d0ca7ff..bb8b909 100644 --- a/cuda/2d/par_fp.cu +++ b/cuda/2d/par_fp.cu @@ -487,7 +487,7 @@ bool FP_simple_internal(float* D_volumeData, unsigned int volumePitch, unsigned int blockEnd = 0; bool blockVertical = false; for (unsigned int a = 0; a <= dims.iProjAngles; ++a) { - bool vertical; + bool vertical = false; // TODO: Having <= instead of < below causes a 5% speedup. // Maybe we should detect corner cases and put them in the optimal // group of angles. diff --git a/cuda/3d/cone_fp.cu b/cuda/3d/cone_fp.cu index bda71ba..b36d2bc 100644 --- a/cuda/3d/cone_fp.cu +++ b/cuda/3d/cone_fp.cu @@ -340,7 +340,7 @@ bool ConeFP_Array_internal(cudaPitchedPtr D_projData, // tic(t); for (unsigned int a = 0; a <= angleCount; ++a) { - int dir; + int dir = -1; if (a != angleCount) { float dX = fabsf(angles[a].fSrcX - (angles[a].fDetSX + dims.iProjU*angles[a].fDetUX*0.5f + dims.iProjV*angles[a].fDetVX*0.5f)); float dY = fabsf(angles[a].fSrcY - (angles[a].fDetSY + dims.iProjU*angles[a].fDetUY*0.5f + dims.iProjV*angles[a].fDetVY*0.5f)); diff --git a/cuda/3d/par3d_fp.cu b/cuda/3d/par3d_fp.cu index 8d44540..b14c494 100644 --- a/cuda/3d/par3d_fp.cu +++ b/cuda/3d/par3d_fp.cu @@ -440,7 +440,7 @@ bool Par3DFP_Array_internal(cudaPitchedPtr D_projData, // tic(t); for (unsigned int a = 0; a <= angleCount; ++a) { - int dir; + int dir = -1; if (a != dims.iProjAngles) { float dX = fabsf(angles[a].fRayX); float dY = fabsf(angles[a].fRayY); -- cgit v1.2.3 From 4bb0a8cfc636582daa8ad62fc2f957239556be81 Mon Sep 17 00:00:00 2001 From: Valerii Sokolov Date: Thu, 9 Apr 2015 13:14:01 +0200 Subject: Fixed a few CUDA 2D DART bugs. * Mixed width and height led to incorrect work on rectangular images. * Incorrect weight calculation in `devDartSmoothingRadius` (#47). --- cuda/2d/darthelper.cu | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/cuda/2d/darthelper.cu b/cuda/2d/darthelper.cu index 28ca557..1d10d49 100644 --- a/cuda/2d/darthelper.cu +++ b/cuda/2d/darthelper.cu @@ -57,7 +57,7 @@ void roiSelect(float* out, float radius, unsigned int width, unsigned int height // We abuse dims here... SDimensions dims; dims.iVolWidth = width; - dims.iVolHeight = width; + dims.iVolHeight = height; allocateVolumeData(D_data, pitch, dims); copyVolumeToDevice(out, width, dims, D_data, pitch); @@ -245,7 +245,7 @@ void dartMask(float* mask, const float* segmentation, unsigned int conn, unsigne // We abuse dims here... SDimensions dims; dims.iVolWidth = width; - dims.iVolHeight = width; + dims.iVolHeight = height; allocateVolumeData(D_segmentationData, pitch, dims); copyVolumeToDevice(segmentation, width, dims, D_segmentationData, pitch); @@ -278,7 +278,7 @@ __global__ void devDartSmoothingRadius(float* out, const float* in, float b, uns unsigned int x = threadIdx.x + 16*blockIdx.x; unsigned int y = threadIdx.y + 16*blockIdx.y; - // Sacrifice the border pixels to simplify the implementation. + // Sacrifice the border pixels to simplify the implementation. if (x > radius-1 && x < width - radius && y > radius-1 && y < height - radius) { float* d = (float*)in; @@ -286,9 +286,10 @@ __global__ void devDartSmoothingRadius(float* out, const float* in, float b, uns unsigned int o2 = y*pitch+x; int r = radius; + float count = 4*r*(r+1); float res = -d[o2]; - for (int row = -r; row < r; row++) + for (int row = -r; row <= r; row++) { unsigned int o1 = (y+row)*pitch+x; for (int col = -r; col <= r; col++) @@ -297,7 +298,7 @@ __global__ void devDartSmoothingRadius(float* out, const float* in, float b, uns } } - res *= b / 4*r*(r+1); + res *= b / count; res += (1.0f-b) * d[o2]; m[o2] = res; @@ -333,7 +334,7 @@ void dartSmoothing(float* out, const float* in, float b, unsigned int radius, un // We abuse dims here... SDimensions dims; dims.iVolWidth = width; - dims.iVolHeight = width; + dims.iVolHeight = height; allocateVolumeData(D_inData, pitch, dims); copyVolumeToDevice(in, width, dims, D_inData, pitch); -- cgit v1.2.3 From 1b32573046f33050b9300324e6c74e10abb6caaf Mon Sep 17 00:00:00 2001 From: "Daniel M. Pelt" Date: Thu, 9 Apr 2015 15:44:01 +0200 Subject: Add 'link' feature to Python (for 2D and 3D data) --- include/astra/Float32ProjectionData2D.h | 25 +++++++++++++++++++++++++ include/astra/Float32VolumeData2D.h | 25 +++++++++++++++++++++++++ python/astra/CFloat32CustomPython.h | 17 +++++++++++++++++ python/astra/PyIncludes.pxd | 8 ++++++++ python/astra/data2d.py | 21 +++++++++++++++++++++ python/astra/data2d_c.pyx | 21 +++++++++++++++++---- python/astra/data3d.py | 22 ++++++++++++++++++++++ python/astra/data3d_c.pyx | 27 ++++++++++++++++++++++----- src/Float32ProjectionData2D.cpp | 19 +++++++++++++++++++ src/Float32VolumeData2D.cpp | 20 ++++++++++++++++++++ 10 files changed, 196 insertions(+), 9 deletions(-) create mode 100644 python/astra/CFloat32CustomPython.h diff --git a/include/astra/Float32ProjectionData2D.h b/include/astra/Float32ProjectionData2D.h index 7461491..bb99f4b 100644 --- a/include/astra/Float32ProjectionData2D.h +++ b/include/astra/Float32ProjectionData2D.h @@ -101,6 +101,19 @@ public: * Copy constructor */ CFloat32ProjectionData2D(const CFloat32ProjectionData2D& _other); + + /** Constructor. Create an instance of the CFloat32ProjectionData2D class with pre-allocated memory. + * + * Creates an instance of the CFloat32ProjectionData2D class. Memory + * is pre-allocated and passed via the abstract CFloat32CustomMemory handle + * class. The handle will be deleted when the memory can be freed. + * You should override the destructor to provide custom behaviour on free. + * + * @param _pGeometry Projection Geometry object. This object will be HARDCOPIED into this class. + * @param _pCustomMemory custom memory handle + * + */ + CFloat32ProjectionData2D(CProjectionGeometry2D* _pGeometry, CFloat32CustomMemory* _pCustomMemory); /** * Assignment operator @@ -148,6 +161,18 @@ public: * @param _fScalar scalar value to be put at each index. */ bool initialize(CProjectionGeometry2D* _pGeometry, float32 _fScalar); + + /** Initialization. Initializes an instance of the CFloat32ProjectionData2D class with pre-allocated memory. + * + * Memory is pre-allocated and passed via the abstract CFloat32CustomMemory handle + * class. The handle will be deleted when the memory can be freed. + * You should override the destructor to provide custom behaviour on free. + * + * @param _pGeometry Projection Geometry object. This object will be HARDCOPIED into this class. + * @param _pCustomMemory custom memory handle + * + */ + bool initialize(CProjectionGeometry2D* _pGeometry, CFloat32CustomMemory* _pCustomMemory); /** Get the number of detectors. * diff --git a/include/astra/Float32VolumeData2D.h b/include/astra/Float32VolumeData2D.h index 4f44a8c..abecebf 100644 --- a/include/astra/Float32VolumeData2D.h +++ b/include/astra/Float32VolumeData2D.h @@ -92,6 +92,19 @@ public: * Copy constructor */ CFloat32VolumeData2D(const CFloat32VolumeData2D& _other); + + /** Constructor. Create an instance of the CFloat32VolumeData2D class with pre-allocated memory. + * + * Creates an instance of the CFloat32VolumeData2D class. Memory + * is pre-allocated and passed via the abstract CFloat32CustomMemory handle + * class. The handle will be deleted when the memory can be freed. + * You should override the destructor to provide custom behaviour on free. + * + * @param _pGeometry Volume Geometry object. This object will be HARDCOPIED into this class. + * @param _pCustomMemory custom memory handle + * + */ + CFloat32VolumeData2D(CVolumeGeometry2D* _pGeometry, CFloat32CustomMemory* _pCustomMemory); /** * Assignment operator @@ -132,6 +145,18 @@ public: * @param _fScalar scalar value to be put at each index. */ bool initialize(CVolumeGeometry2D* _pGeometry, float32 _fScalar); + + /** Initialization. Initializes an instance of the CFloat32VolumeData2D class with pre-allocated memory. + * + * Memory is pre-allocated and passed via the abstract CFloat32CustomMemory handle + * class. The handle will be deleted when the memory can be freed. + * You should override the destructor to provide custom behaviour on free. + * + * @param _pGeometry Volume Geometry object. This object will be HARDCOPIED into this class. + * @param _pCustomMemory custom memory handle + * + */ + bool initialize(CVolumeGeometry2D* _pGeometry, CFloat32CustomMemory* _pCustomMemory); /** Destructor. */ diff --git a/python/astra/CFloat32CustomPython.h b/python/astra/CFloat32CustomPython.h new file mode 100644 index 0000000..d8593fc --- /dev/null +++ b/python/astra/CFloat32CustomPython.h @@ -0,0 +1,17 @@ +class CFloat32CustomPython : public astra::CFloat32CustomMemory { +public: + CFloat32CustomPython(PyObject * arrIn) + { + arr = arrIn; + // Set pointer to numpy data pointer + m_fPtr = (float *)PyArray_DATA(arr); + // Increase reference count since ASTRA has a reference + Py_INCREF(arr); + } + virtual ~CFloat32CustomPython() { + // Decrease reference count since ASTRA object is destroyed + Py_DECREF(arr); + } +private: + PyObject* arr; +}; \ No newline at end of file diff --git a/python/astra/PyIncludes.pxd b/python/astra/PyIncludes.pxd index 7df02c5..13329d1 100644 --- a/python/astra/PyIncludes.pxd +++ b/python/astra/PyIncludes.pxd @@ -63,10 +63,14 @@ cdef extern from "astra/VolumeGeometry2D.h" namespace "astra": float32 getWindowMaxY() Config* getConfiguration() +cdef extern from "astra/Float32Data2D.h" namespace "astra": + cdef cppclass CFloat32CustomMemory: + pass cdef extern from "astra/Float32VolumeData2D.h" namespace "astra": cdef cppclass CFloat32VolumeData2D: CFloat32VolumeData2D(CVolumeGeometry2D*) + CFloat32VolumeData2D(CVolumeGeometry2D*, CFloat32CustomMemory*) CVolumeGeometry2D * getGeometry() int getWidth() int getHeight() @@ -130,6 +134,7 @@ cdef extern from "astra/ParallelProjectionGeometry2D.h" namespace "astra": cdef extern from "astra/Float32ProjectionData2D.h" namespace "astra": cdef cppclass CFloat32ProjectionData2D: CFloat32ProjectionData2D(CProjectionGeometry2D*) + CFloat32ProjectionData2D(CProjectionGeometry2D*, CFloat32CustomMemory*) CProjectionGeometry2D * getGeometry() void changeGeometry(CProjectionGeometry2D*) int getDetectorCount() @@ -207,6 +212,7 @@ cdef extern from "astra/ProjectionGeometry3D.h" namespace "astra": cdef extern from "astra/Float32VolumeData3DMemory.h" namespace "astra": cdef cppclass CFloat32VolumeData3DMemory: CFloat32VolumeData3DMemory(CVolumeGeometry3D*) + CFloat32VolumeData3DMemory(CVolumeGeometry3D*, CFloat32CustomMemory*) CVolumeGeometry3D* getGeometry() @@ -231,6 +237,8 @@ cdef extern from "astra/Float32ProjectionData3DMemory.h" namespace "astra": cdef cppclass CFloat32ProjectionData3DMemory: CFloat32ProjectionData3DMemory(CProjectionGeometry3D*) CFloat32ProjectionData3DMemory(CConeProjectionGeometry3D*) + CFloat32ProjectionData3DMemory(CProjectionGeometry3D*, CFloat32CustomMemory*) + CFloat32ProjectionData3DMemory(CConeProjectionGeometry3D*, CFloat32CustomMemory*) CProjectionGeometry3D* getGeometry() cdef extern from "astra/Float32Data3D.h" namespace "astra": diff --git a/python/astra/data2d.py b/python/astra/data2d.py index 8c4be03..f119f05 100644 --- a/python/astra/data2d.py +++ b/python/astra/data2d.py @@ -24,6 +24,7 @@ # #----------------------------------------------------------------------- from . import data2d_c as d +import numpy as np def clear(): """Clear all 2D data objects.""" @@ -52,6 +53,26 @@ def create(datatype, geometry, data=None): """ return d.create(datatype,geometry,data) +def link(datatype, geometry, data): + """Link a 2D numpy array with the toolbox. + + :param datatype: Data object type, '-vol' or '-sino'. + :type datatype: :class:`string` + :param geometry: Volume or projection geometry. + :type geometry: :class:`dict` + :param data: Numpy array to link + :type data: :class:`numpy.ndarray` + :returns: :class:`int` -- the ID of the constructed object. + + """ + if not isinstance(data,np.ndarray): + raise ValueError("Input should be a numpy array") + if not data.dtype==np.float32: + raise ValueError("Numpy array should be float32") + if not (data.flags['C_CONTIGUOUS'] and data.flags['ALIGNED']): + raise ValueError("Numpy array should be C_CONTIGUOUS and ALIGNED") + return d.create(datatype,geometry,data,True) + def store(i, data): """Fill existing 2D object with data. diff --git a/python/astra/data2d_c.pyx b/python/astra/data2d_c.pyx index b9c105e..ac54898 100644 --- a/python/astra/data2d_c.pyx +++ b/python/astra/data2d_c.pyx @@ -49,6 +49,10 @@ from .utils import wrap_from_bytes cdef CData2DManager * man2d = PyData2DManager.getSingletonPtr() +cdef extern from "CFloat32CustomPython.h": + cdef cppclass CFloat32CustomPython: + CFloat32CustomPython(arrIn) + def clear(): man2d.clear() @@ -61,11 +65,12 @@ def delete(ids): man2d.remove(ids) -def create(datatype, geometry, data=None): +def create(datatype, geometry, data=None, link=False): cdef Config *cfg cdef CVolumeGeometry2D * pGeometry cdef CProjectionGeometry2D * ppGeometry cdef CFloat32Data2D * pDataObject2D + cdef CFloat32CustomMemory * pCustom if datatype == '-vol': cfg = utils.dictToConfig(six.b('VolumeGeometry'), geometry) pGeometry = new CVolumeGeometry2D() @@ -73,7 +78,11 @@ def create(datatype, geometry, data=None): del cfg del pGeometry raise Exception('Geometry class not initialized.') - pDataObject2D = new CFloat32VolumeData2D(pGeometry) + if link: + pCustom = new CFloat32CustomPython(data) + pDataObject2D = new CFloat32VolumeData2D(pGeometry, pCustom) + else: + pDataObject2D = new CFloat32VolumeData2D(pGeometry) del cfg del pGeometry elif datatype == '-sino': @@ -91,7 +100,11 @@ def create(datatype, geometry, data=None): del cfg del ppGeometry raise Exception('Geometry class not initialized.') - pDataObject2D = new CFloat32ProjectionData2D(ppGeometry) + if link: + pCustom = new CFloat32CustomPython(data) + pDataObject2D = new CFloat32ProjectionData2D(ppGeometry, pCustom) + else: + pDataObject2D = new CFloat32ProjectionData2D(ppGeometry) del ppGeometry del cfg else: @@ -101,7 +114,7 @@ def create(datatype, geometry, data=None): del pDataObject2D raise Exception("Couldn't initialize data object.") - fillDataObject(pDataObject2D, data) + if not link: fillDataObject(pDataObject2D, data) return man2d.store(pDataObject2D) diff --git a/python/astra/data3d.py b/python/astra/data3d.py index a2e9201..4fdf9d7 100644 --- a/python/astra/data3d.py +++ b/python/astra/data3d.py @@ -24,6 +24,7 @@ # #----------------------------------------------------------------------- from . import data3d_c as d +import numpy as np def create(datatype,geometry,data=None): """Create a 3D object. @@ -39,6 +40,27 @@ def create(datatype,geometry,data=None): """ return d.create(datatype,geometry,data) +def link(datatype, geometry, data): + """Link a 3D numpy array with the toolbox. + + :param datatype: Data object type, '-vol' or '-sino'. + :type datatype: :class:`string` + :param geometry: Volume or projection geometry. + :type geometry: :class:`dict` + :param data: Numpy array to link + :type data: :class:`numpy.ndarray` + :returns: :class:`int` -- the ID of the constructed object. + + """ + if not isinstance(data,np.ndarray): + raise ValueError("Input should be a numpy array") + if not data.dtype==np.float32: + raise ValueError("Numpy array should be float32") + if not (data.flags['C_CONTIGUOUS'] and data.flags['ALIGNED']): + raise ValueError("Numpy array should be C_CONTIGUOUS and ALIGNED") + return d.create(datatype,geometry,data,True) + + def get(i): """Get a 3D object. diff --git a/python/astra/data3d_c.pyx b/python/astra/data3d_c.pyx index 4b069f7..f2c6e26 100644 --- a/python/astra/data3d_c.pyx +++ b/python/astra/data3d_c.pyx @@ -50,12 +50,17 @@ cdef CData3DManager * man3d = PyData3DManager.getSingletonPtr cdef extern from *: CFloat32Data3DMemory * dynamic_cast_mem "dynamic_cast" (CFloat32Data3D * ) except NULL -def create(datatype,geometry,data=None): +cdef extern from "CFloat32CustomPython.h": + cdef cppclass CFloat32CustomPython: + CFloat32CustomPython(arrIn) + +def create(datatype,geometry,data=None, link=False): cdef Config *cfg cdef CVolumeGeometry3D * pGeometry cdef CProjectionGeometry3D * ppGeometry cdef CFloat32Data3DMemory * pDataObject3D cdef CConeProjectionGeometry3D* pppGeometry + cdef CFloat32CustomMemory * pCustom if datatype == '-vol': cfg = utils.dictToConfig(six.b('VolumeGeometry'), geometry) pGeometry = new CVolumeGeometry3D() @@ -63,7 +68,11 @@ def create(datatype,geometry,data=None): del cfg del pGeometry raise Exception('Geometry class not initialized.') - pDataObject3D = new CFloat32VolumeData3DMemory(pGeometry) + if link: + pCustom = new CFloat32CustomPython(data) + pDataObject3D = new CFloat32VolumeData3DMemory(pGeometry, pCustom) + else: + pDataObject3D = new CFloat32VolumeData3DMemory(pGeometry) del cfg del pGeometry elif datatype == '-sino' or datatype == '-proj3d': @@ -84,7 +93,11 @@ def create(datatype,geometry,data=None): del cfg del ppGeometry raise Exception('Geometry class not initialized.') - pDataObject3D = new CFloat32ProjectionData3DMemory(ppGeometry) + if link: + pCustom = new CFloat32CustomPython(data) + pDataObject3D = new CFloat32ProjectionData3DMemory(ppGeometry, pCustom) + else: + pDataObject3D = new CFloat32ProjectionData3DMemory(ppGeometry) del ppGeometry del cfg elif datatype == "-sinocone": @@ -94,7 +107,11 @@ def create(datatype,geometry,data=None): del cfg del pppGeometry raise Exception('Geometry class not initialized.') - pDataObject3D = new CFloat32ProjectionData3DMemory(pppGeometry) + if link: + pCustom = new CFloat32CustomPython(data) + pDataObject3D = new CFloat32ProjectionData3DMemory(pppGeometry, pCustom) + else: + pDataObject3D = new CFloat32ProjectionData3DMemory(pppGeometry) else: raise Exception("Invalid datatype. Please specify '-vol' or '-proj3d'.") @@ -102,7 +119,7 @@ def create(datatype,geometry,data=None): del pDataObject3D raise Exception("Couldn't initialize data object.") - fillDataObject(pDataObject3D, data) + if not link: fillDataObject(pDataObject3D, data) pDataObject3D.updateStatistics() diff --git a/src/Float32ProjectionData2D.cpp b/src/Float32ProjectionData2D.cpp index 85e0cdd..f7f83e3 100644 --- a/src/Float32ProjectionData2D.cpp +++ b/src/Float32ProjectionData2D.cpp @@ -75,6 +75,16 @@ CFloat32ProjectionData2D::CFloat32ProjectionData2D(const CFloat32ProjectionData2 m_bInitialized = true; } +//---------------------------------------------------------------------------------------- +// Create an instance of the CFloat32ProjectionData2D class with pre-allocated data +CFloat32ProjectionData2D::CFloat32ProjectionData2D(CProjectionGeometry2D* _pGeometry, CFloat32CustomMemory* _pCustomMemory) +{ + m_bInitialized = false; + m_bInitialized = initialize(_pGeometry, _pCustomMemory); +} + + + // Assignment operator CFloat32ProjectionData2D& CFloat32ProjectionData2D::operator=(const CFloat32ProjectionData2D& _other) @@ -118,6 +128,15 @@ bool CFloat32ProjectionData2D::initialize(CProjectionGeometry2D* _pGeometry, flo return m_bInitialized; } +//---------------------------------------------------------------------------------------- +// Initialization +bool CFloat32ProjectionData2D::initialize(CProjectionGeometry2D* _pGeometry, CFloat32CustomMemory* _pCustomMemory) +{ + m_pGeometry = _pGeometry->clone(); + m_bInitialized = _initialize(m_pGeometry->getDetectorCount(), m_pGeometry->getProjectionAngleCount(), _pCustomMemory); + return m_bInitialized; +} + //---------------------------------------------------------------------------------------- // Destructor CFloat32ProjectionData2D::~CFloat32ProjectionData2D() diff --git a/src/Float32VolumeData2D.cpp b/src/Float32VolumeData2D.cpp index e11c4e4..c903c66 100644 --- a/src/Float32VolumeData2D.cpp +++ b/src/Float32VolumeData2D.cpp @@ -72,6 +72,15 @@ CFloat32VolumeData2D::CFloat32VolumeData2D(const CFloat32VolumeData2D& _other) : m_bInitialized = true; } +//---------------------------------------------------------------------------------------- +// Create an instance of the CFloat32VolumeData2D class with pre-allocated data +CFloat32VolumeData2D::CFloat32VolumeData2D(CVolumeGeometry2D* _pGeometry, CFloat32CustomMemory* _pCustomMemory) +{ + m_bInitialized = false; + m_bInitialized = initialize(_pGeometry, _pCustomMemory); +} + + // Assignment operator CFloat32VolumeData2D& CFloat32VolumeData2D::operator=(const CFloat32VolumeData2D& _other) @@ -122,6 +131,17 @@ bool CFloat32VolumeData2D::initialize(CVolumeGeometry2D* _pGeometry, float32 _fS m_bInitialized = _initialize(m_pGeometry->getGridColCount(), m_pGeometry->getGridRowCount(), _fScalar); return m_bInitialized; } + +//---------------------------------------------------------------------------------------- +// Initialization +bool CFloat32VolumeData2D::initialize(CVolumeGeometry2D* _pGeometry, CFloat32CustomMemory* _pCustomMemory) +{ + m_pGeometry = _pGeometry->clone(); + m_bInitialized = _initialize(m_pGeometry->getGridColCount(), m_pGeometry->getGridRowCount(), _pCustomMemory); + return m_bInitialized; +} + + //---------------------------------------------------------------------------------------- void CFloat32VolumeData2D::changeGeometry(CVolumeGeometry2D* _pGeometry) { -- cgit v1.2.3 From 306b3b5613ccb039122d38e8deb1e0ecc9e43403 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Fri, 10 Apr 2015 12:05:01 +0200 Subject: Check input to mex_data3d/link is single --- matlab/mex/astra_mex_data3d_c.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/matlab/mex/astra_mex_data3d_c.cpp b/matlab/mex/astra_mex_data3d_c.cpp index 32b0ba7..7efbdab 100644 --- a/matlab/mex/astra_mex_data3d_c.cpp +++ b/matlab/mex/astra_mex_data3d_c.cpp @@ -148,8 +148,8 @@ void astra_mex_data3d_link(int& nlhs, mxArray* plhs[], int& nrhs, const mxArray* return; } - if (data && !checkDataType(data)) { - mexErrMsgTxt("Data must be single or double."); + if (data && !mxIsSingle(data)) { + mexErrMsgTxt("Data must be single."); return; } -- cgit v1.2.3 From 7b55ee5f60c5f5865726cf48636b642cd9de111d Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Fri, 10 Apr 2015 12:29:22 +0200 Subject: Add changeGeometry function to Data3D classes --- include/astra/Float32ProjectionData3D.h | 5 +++++ include/astra/Float32VolumeData3D.h | 5 +++++ src/Float32ProjectionData3D.cpp | 9 +++++++++ src/Float32VolumeData3D.cpp | 9 +++++++++ 4 files changed, 28 insertions(+) diff --git a/include/astra/Float32ProjectionData3D.h b/include/astra/Float32ProjectionData3D.h index 79b762e..329c9a4 100644 --- a/include/astra/Float32ProjectionData3D.h +++ b/include/astra/Float32ProjectionData3D.h @@ -196,6 +196,11 @@ public: * @return pointer to projection geometry. */ virtual CProjectionGeometry3D* getGeometry() const; + + /** Change the projection geometry. + * Note that this can't change the dimensions of the data. + */ + virtual void changeGeometry(CProjectionGeometry3D* pGeometry); }; diff --git a/include/astra/Float32VolumeData3D.h b/include/astra/Float32VolumeData3D.h index d8f0ae9..07df78f 100644 --- a/include/astra/Float32VolumeData3D.h +++ b/include/astra/Float32VolumeData3D.h @@ -214,6 +214,11 @@ public: * @return The geometry describing the data stored in this volume */ virtual CVolumeGeometry3D* getGeometry() const; + + /** Change the projection geometry. + * Note that this can't change the dimensions of the data. + */ + virtual void changeGeometry(CVolumeGeometry3D* pGeometry); }; //---------------------------------------------------------------------------------------- diff --git a/src/Float32ProjectionData3D.cpp b/src/Float32ProjectionData3D.cpp index d039c83..2bd0447 100644 --- a/src/Float32ProjectionData3D.cpp +++ b/src/Float32ProjectionData3D.cpp @@ -270,4 +270,13 @@ CFloat32ProjectionData3D& CFloat32ProjectionData3D::operator-=(const float32& _f return *this; } +void CFloat32ProjectionData3D::changeGeometry(CProjectionGeometry3D* _pGeometry) +{ + if (!m_bInitialized) return; + + delete m_pGeometry; + m_pGeometry = _pGeometry->clone(); +} + + } // end namespace astra diff --git a/src/Float32VolumeData3D.cpp b/src/Float32VolumeData3D.cpp index ce00a10..bd78001 100644 --- a/src/Float32VolumeData3D.cpp +++ b/src/Float32VolumeData3D.cpp @@ -266,4 +266,13 @@ CFloat32VolumeData3D& CFloat32VolumeData3D::operator-=(const float32& _fScalar) return *this; } +void CFloat32VolumeData3D::changeGeometry(CVolumeGeometry3D* _pGeometry) +{ + if (!m_bInitialized) return; + + delete m_pGeometry; + m_pGeometry = _pGeometry->clone(); +} + + } // end namespace astra -- cgit v1.2.3 From 57625dc219e5987b09bb6d88fe4040144bb6def3 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Fri, 10 Apr 2015 13:29:20 +0200 Subject: Add astra_mex_data3d('change_geometry', ...) --- matlab/mex/astra_mex_data3d_c.cpp | 110 +++++++++++++++++++++++++++++++++++++- 1 file changed, 109 insertions(+), 1 deletion(-) diff --git a/matlab/mex/astra_mex_data3d_c.cpp b/matlab/mex/astra_mex_data3d_c.cpp index 7efbdab..6096adc 100644 --- a/matlab/mex/astra_mex_data3d_c.cpp +++ b/matlab/mex/astra_mex_data3d_c.cpp @@ -309,6 +309,112 @@ void astra_mex_data3d_get_geometry(int nlhs, mxArray* plhs[], int nrhs, const mx } +//----------------------------------------------------------------------------------------- +/** astra_mex_data3d('change_geometry', id, geom); + * + * Change the geometry of a 3d data object. + * id: identifier of the 3d data object as stored in the astra-library. + * geom: the new geometry struct, as created by astra_create_vol/proj_geom + */ +void astra_mex_data3d_change_geometry(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]) +{ + // parse input + if (nrhs < 3) { + mexErrMsgTxt("Not enough arguments. See the help document for a detailed argument list. \n"); + return; + } + + // get data object + CFloat32Data3DMemory* pDataObject = NULL; + if (!checkID(mxGetScalar(prhs[1]), pDataObject)) { + mexErrMsgTxt("Data object not found or not initialized properly.\n"); + return; + } + + const mxArray * const geometry = prhs[2]; + + if (!checkStructs(geometry)) { + mexErrMsgTxt("Argument 3 is not a valid MATLAB struct.\n"); + return; + } + + CFloat32ProjectionData3D* pProjData = dynamic_cast(pDataObject); + if (pProjData) { + // Projection data + + // Read geometry + astra::Config* cfg = structToConfig("ProjectionGeometry3D", geometry); + // FIXME: Change how the base class is created. (This is duplicated + // in Projector3D.cpp.) + std::string type = cfg->self->getAttribute("type"); + astra::CProjectionGeometry3D* pGeometry = 0; + if (type == "parallel3d") { + pGeometry = new astra::CParallelProjectionGeometry3D(); + } else if (type == "parallel3d_vec") { + pGeometry = new astra::CParallelVecProjectionGeometry3D(); + } else if (type == "cone") { + pGeometry = new astra::CConeProjectionGeometry3D(); + } else if (type == "cone_vec") { + pGeometry = new astra::CConeVecProjectionGeometry3D(); + } else { + mexErrMsgTxt("Invalid geometry type.\n"); + return; + } + + if (!pGeometry->initialize(*cfg)) { + mexErrMsgTxt("Geometry class not initialized. \n"); + delete pGeometry; + delete cfg; + return; + } + delete cfg; + + // Check dimensions + if (pGeometry->getDetectorColCount() != pProjData->getDetectorColCount() || + pGeometry->getProjectionCount() != pProjData->getAngleCount() || + pGeometry->getDetectorRowCount() != pProjData->getDetectorRowCount()) + { + mexErrMsgTxt("The dimensions of the data do not match those specified in the geometry. \n"); + delete pGeometry; + return; + } + + // If ok, change geometry + pProjData->changeGeometry(pGeometry); + delete pGeometry; + } else { + // Volume data + CFloat32VolumeData3D* pVolData = dynamic_cast(pDataObject); + assert(pVolData); + + // Read geometry + astra::Config* cfg = structToConfig("VolumeGeometry3D", geometry); + astra::CVolumeGeometry3D* pGeometry = new astra::CVolumeGeometry3D(); + if (!pGeometry->initialize(*cfg)) + { + mexErrMsgTxt("Geometry class not initialized. \n"); + delete pGeometry; + delete cfg; + return; + } + delete cfg; + + // Check dimensions + if (pGeometry->getGridColCount() != pVolData->getColCount() || + pGeometry->getGridRowCount() != pVolData->getRowCount() || + pGeometry->getGridSliceCount() != pVolData->getSliceCount()) + { + mexErrMsgTxt("The dimensions of the data do not match those specified in the geometry. \n"); + delete pGeometry; + return; + } + + // If ok, change geometry + pVolData->changeGeometry(pGeometry); + delete pGeometry; + } +} + //----------------------------------------------------------------------------------------- /** * astra_mex_data3d('delete', did1, did2, ...); @@ -351,7 +457,7 @@ static void printHelp() { mexPrintf("Please specify a mode of operation.\n"); mexPrintf("Valid modes: create, get, get_single, delete, clear, info\n"); - mexPrintf(" dimensions\n"); + mexPrintf(" dimensions, get_geometry, change_geometry\n"); } @@ -398,6 +504,8 @@ void mexFunction(int nlhs, mxArray* plhs[], astra_mex_data3d_dimensions(nlhs, plhs, nrhs, prhs); } else if (sMode == std::string("get_geometry")) { astra_mex_data3d_get_geometry(nlhs, plhs, nrhs, prhs); + } else if (sMode == std::string("change_geometry")) { + astra_mex_data3d_change_geometry(nlhs, plhs, nrhs, prhs); } else { printHelp(); } -- cgit v1.2.3 From e2c87a5e259c847772c733eefb1b291b2a5b1a6e Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Fri, 10 Apr 2015 14:29:27 +0200 Subject: Add python data3d.change_geometry --- python/astra/PyIncludes.pxd | 15 +++++++++++++ python/astra/data3d.py | 11 +++++++++ python/astra/data3d_c.pyx | 55 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 81 insertions(+) diff --git a/python/astra/PyIncludes.pxd b/python/astra/PyIncludes.pxd index 7df02c5..a581f88 100644 --- a/python/astra/PyIncludes.pxd +++ b/python/astra/PyIncludes.pxd @@ -196,18 +196,29 @@ cdef extern from "astra/VolumeGeometry3D.h" namespace "astra": CVolumeGeometry3D() bool initialize(Config) Config * getConfiguration() + int getGridColCount() + int getGridRowCount() + int getGridSliceCount() cdef extern from "astra/ProjectionGeometry3D.h" namespace "astra": cdef cppclass CProjectionGeometry3D: CProjectionGeometry3D() bool initialize(Config) Config * getConfiguration() + int getProjectionCount() + int getDetectorColCount() + int getDetectorRowCount() cdef extern from "astra/Float32VolumeData3DMemory.h" namespace "astra": cdef cppclass CFloat32VolumeData3DMemory: CFloat32VolumeData3DMemory(CVolumeGeometry3D*) CVolumeGeometry3D* getGeometry() + void changeGeometry(CVolumeGeometry3D*) + int getRowCount() + int getColCount() + int getSliceCount() + cdef extern from "astra/ParallelProjectionGeometry3D.h" namespace "astra": @@ -232,6 +243,10 @@ cdef extern from "astra/Float32ProjectionData3DMemory.h" namespace "astra": CFloat32ProjectionData3DMemory(CProjectionGeometry3D*) CFloat32ProjectionData3DMemory(CConeProjectionGeometry3D*) CProjectionGeometry3D* getGeometry() + void changeGeometry(CProjectionGeometry3D*) + int getDetectorColCount() + int getDetectorRowCount() + int getAngleCount() cdef extern from "astra/Float32Data3D.h" namespace "astra": cdef cppclass CFloat32Data3D: diff --git a/python/astra/data3d.py b/python/astra/data3d.py index a2e9201..4679489 100644 --- a/python/astra/data3d.py +++ b/python/astra/data3d.py @@ -90,6 +90,17 @@ def get_geometry(i): """ return d.get_geometry(i) +def change_geometry(i, geometry): + """Change the geometry of a 3D object. + + :param i: ID of object. + :type i: :class:`int` + :param geometry: Volume or projection geometry. + :type geometry: :class:`dict` + + """ + return d.change_geometry(i, geometry) + def dimensions(i): """Get dimensions of a 3D object. diff --git a/python/astra/data3d_c.pyx b/python/astra/data3d_c.pyx index 4b069f7..48af032 100644 --- a/python/astra/data3d_c.pyx +++ b/python/astra/data3d_c.pyx @@ -122,6 +122,61 @@ def get_geometry(i): raise Exception("Not a known data object") return geom +def change_geometry(i, geom): + cdef CFloat32Data3DMemory * pDataObject = dynamic_cast_mem(getObject(i)) + cdef CFloat32ProjectionData3DMemory * pDataObject2 + cdef CFloat32VolumeData3DMemory * pDataObject3 + if pDataObject.getType() == THREEPROJECTION: + pDataObject2 = pDataObject + # TODO: Reduce code duplication here + cfg = utils.dictToConfig(six.b('ProjectionGeometry'), geom) + tpe = wrap_from_bytes(cfg.self.getAttribute(six.b('type'))) + if (tpe == "parallel3d"): + ppGeometry = new CParallelProjectionGeometry3D(); + elif (tpe == "parallel3d_vec"): + ppGeometry = new CParallelVecProjectionGeometry3D(); + elif (tpe == "cone"): + ppGeometry = new CConeProjectionGeometry3D(); + elif (tpe == "cone_vec"): + ppGeometry = new CConeVecProjectionGeometry3D(); + else: + raise Exception("Invalid geometry type.") + if not ppGeometry.initialize(cfg[0]): + del cfg + del ppGeometry + raise Exception('Geometry class not initialized.') + del cfg + if (ppGeometry.getDetectorColCount() != pDataObject2.getDetectorColCount() or \ + ppGeometry.getProjectionCount() != pDataObject2.getAngleCount() or \ + ppGeometry.getDetectorRowCount() != pDataObject2.getDetectorRowCount()): + del ppGeometry + raise Exception( + "The dimensions of the data do not match those specified in the geometry.") + pDataObject2.changeGeometry(ppGeometry) + del ppGeometry + + elif pDataObject.getType() == THREEVOLUME: + pDataObject3 = pDataObject + cfg = utils.dictToConfig(six.b('VolumeGeometry'), geom) + pGeometry = new CVolumeGeometry3D() + if not pGeometry.initialize(cfg[0]): + del cfg + del pGeometry + raise Exception('Geometry class not initialized.') + del cfg + if (pGeometry.getGridColCount() != pDataObject3.getColCount() or \ + pGeometry.getGridRowCount() != pDataObject3.getRowCount() or \ + pGeometry.getGridSliceCount() != pDataObject3.getSliceCount()): + del pGeometry + raise Exception( + "The dimensions of the data do not match those specified in the geometry.") + pDataObject3.changeGeometry(pGeometry) + del pGeometry + + else: + raise Exception("Not a known data object") + + cdef fillDataObject(CFloat32Data3DMemory * obj, data): if data is None: fillDataObjectScalar(obj, 0) -- cgit v1.2.3 From 40475404d83d74d7b5db3f71ea1488a6de10ccc5 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Wed, 15 Apr 2015 11:03:12 +0200 Subject: Fix bug in astra_mex_data3d('create') zero-initialization --- matlab/mex/mexCopyDataHelpFunctions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/matlab/mex/mexCopyDataHelpFunctions.cpp b/matlab/mex/mexCopyDataHelpFunctions.cpp index 80fb834..4db6abd 100644 --- a/matlab/mex/mexCopyDataHelpFunctions.cpp +++ b/matlab/mex/mexCopyDataHelpFunctions.cpp @@ -263,7 +263,7 @@ copyMexToCFloat32Array(const mxArray * const in, #pragma omp parallel { // fill with scalar value - if (mexIsScalar(in)) { + if (mexIsScalar(in) || mxIsEmpty(in)) { astra::float32 fValue = 0.f; if (!mxIsEmpty(in)) { fValue = (astra::float32)mxGetScalar(in); -- cgit v1.2.3