From d753de051893698bfd1e107a2d03b1a38b55dd91 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Tue, 31 Oct 2017 17:10:56 +0100 Subject: Remove some unnecessary includes --- include/astra/CudaFilteredBackProjectionAlgorithm.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'include') diff --git a/include/astra/CudaFilteredBackProjectionAlgorithm.h b/include/astra/CudaFilteredBackProjectionAlgorithm.h index 057843e..164b51b 100644 --- a/include/astra/CudaFilteredBackProjectionAlgorithm.h +++ b/include/astra/CudaFilteredBackProjectionAlgorithm.h @@ -70,10 +70,6 @@ public: static int calcIdealRealFilterWidth(int _iDetectorCount); static int calcIdealFourierFilterWidth(int _iDetectorCount); - //debug - static void testGenFilter(E_FBPFILTER _eFilter, float _fD, int _iProjectionCount, cufftComplex * _pFilter, int _iFFTRealDetectorCount, int _iFFTFourierDetectorCount); - static int getGPUCount(); - /** Get a description of the class. * * @return description string -- cgit v1.2.3 From adda34cf902c246a75eb46800949dc15d5e84f37 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Wed, 1 Nov 2017 12:27:18 +0100 Subject: Remove unused code --- build/linux/Makefile.in | 3 +- include/astra/Globals.h | 102 ------------------------------------------------ include/astra/swrap.h | 40 ------------------- src/swrap.cpp | 46 ---------------------- 4 files changed, 1 insertion(+), 190 deletions(-) delete mode 100644 include/astra/swrap.h delete mode 100644 src/swrap.cpp (limited to 'include') diff --git a/build/linux/Makefile.in b/build/linux/Makefile.in index c83e9f0..7cff15e 100644 --- a/build/linux/Makefile.in +++ b/build/linux/Makefile.in @@ -179,8 +179,7 @@ BASE_OBJECTS=\ src/VolumeGeometry2D.lo \ src/VolumeGeometry3D.lo \ src/XMLDocument.lo \ - src/XMLNode.lo \ - src/swrap.lo + src/XMLNode.lo CUDA_CXX_OBJECTS=\ src/CudaProjector2D.lo \ diff --git a/include/astra/Globals.h b/include/astra/Globals.h index 8375726..7c1e9a8 100644 --- a/include/astra/Globals.h +++ b/include/astra/Globals.h @@ -120,21 +120,6 @@ namespace astra { //} //} -//---------------------------------------------------------------------------------------- -// errors -namespace astra { - -typedef enum {ASTRA_SUCCESS, - ASTRA_ERROR_NOT_INITIALIZED, - ASTRA_ERROR_INVALID_FILE, - ASTRA_ERROR_OUT_OF_RANGE, - ASTRA_ERROR_DIMENSION_MISMATCH, - ASTRA_ERROR_EXTERNAL_LIBRARY, - ASTRA_ERROR_ALLOCATION, - ASTRA_ERROR_NOT_IMPLEMENTED} AstraError; -} - - //---------------------------------------------------------------------------------------- // variables namespace astra { @@ -147,51 +132,6 @@ namespace astra { extern _AstraExport bool running_in_matlab; } -//---------------------------------------------------------------------------------------- -// math -namespace astra { - - inline float32 cos_73s(float32 x) - { - /* - const float32 c1 = 0.999999953464f; - const float32 c2 = -0.4999999053455f; - const float32 c3 = 0.0416635846769f; - const float32 c4 = -0.0013853704264f; - const float32 c5 = 0.000023233f; - */ - const float c1= (float)0.99940307; - const float c2= (float)-0.49558072; - const float c3= (float)0.03679168; - - float32 x2; - x2 = x * x; - //return (c1 + x2*(c2 + x2*(c3 + x2*(c4 + c5*x2)))); - return (c1 + x2*(c2 + c3 * x2)); - } - - inline float32 fast_cos(float32 x) - { - int quad; - - //x = fmod(x, 2*PI); // Get rid of values > 2* pi - if (x < 0) x = -x; // cos(-x) = cos(x) - quad = int(x/PIdiv2); // Get quadrant # (0 to 3) - switch (quad) { - case 0: return cos_73s(x); - case 1: return -cos_73s(PI-x); - case 2: return -cos_73s(x-PI); - case 3: return cos_73s(2*PI-x); - } - return 0.0f; - } - - inline float32 fast_sin(float32 x){ - return fast_cos(PIdiv2-x); - } - -} - //---------------------------------------------------------------------------------------- // structs namespace astra { @@ -226,47 +166,6 @@ namespace astra { }; } -//---------------------------------------------------------------------------------------- -// functions for testing -template -inline void writeArray(T*** arr, int dim1, int dim2, int dim3, const std::string& filename) -{ - std::ofstream out(filename.c_str()); - int i1, i2, i3; - for (i1 = 0; i1 < dim1; ++i1) { - for (i2 = 0; i2 < dim2; ++i2) { - for (i3 = 0; i3 < dim3; ++i3) { - out << arr[i1][i2][i3] << " "; - } - out << std::endl; - } - out << std::endl; - } - out.close(); -} - -template -inline void writeArray(T** arr, int dim1, int dim2, const std::string& filename) -{ - std::ofstream out(filename.c_str()); - for (int i1 = 0; i1 < dim1; i1++) { - for (int i2 = 0; i2 < dim2; i2++) { - out << arr[i1][i2] << " "; - } - out << std::endl; - } - out.close(); -} - -template -inline void writeArray(T* arr, int dim1, const std::string& filename) -{ - std::ofstream out(filename.c_str()); - for (int i1 = 0; i1 < dim1; i1++) { - out << arr[i1] << " "; - } - out.close(); -} namespace astra { _AstraExport inline int getVersion() { return ASTRA_TOOLBOXVERSION; } _AstraExport inline const char* getVersionString() { return ASTRA_TOOLBOXVERSION_STRING; } @@ -280,7 +179,6 @@ _AstraExport inline bool cudaEnabled() { return false; } // portability between MSVC and Linux/gcc #ifndef _MSC_VER -#include "swrap.h" #define EXPIMP_TEMPLATE #if !defined(FORCEINLINE) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) diff --git a/include/astra/swrap.h b/include/astra/swrap.h deleted file mode 100644 index cd479f3..0000000 --- a/include/astra/swrap.h +++ /dev/null @@ -1,40 +0,0 @@ -/* ------------------------------------------------------------------------ -Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp - 2014-2016, CWI, Amsterdam - -Contact: astra@uantwerpen.be -Website: http://www.astra-toolbox.com/ - -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 . - ------------------------------------------------------------------------ -*/ - -#ifndef _INC_ASTRA_SWRAP_H -#define _INC_ASTRA_SWRAP_H - -#ifndef _MSC_VER - -#include - -typedef int errno_t; -errno_t fopen_s(FILE** pFile, const char *filename, const char *mode); - -#endif - -#endif diff --git a/src/swrap.cpp b/src/swrap.cpp deleted file mode 100644 index c970ab5..0000000 --- a/src/swrap.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/* ------------------------------------------------------------------------ -Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp - 2014-2016, CWI, Amsterdam - -Contact: astra@uantwerpen.be -Website: http://www.astra-toolbox.com/ - -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 . - ------------------------------------------------------------------------ -*/ - -#ifndef _MSC_VER - -#include "astra/swrap.h" -#include - -errno_t fopen_s(FILE** pFile, const char* filename, const char* mode) -{ - if (!pFile) - return EINVAL; - - FILE* x = fopen(filename, mode); - if (!x) - return errno; - - *pFile = x; - return 0; -} - -#endif -- cgit v1.2.3 From bfceef4da377c32cd59d1e51efb9aa1a21c7f4bd Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Mon, 6 Nov 2017 14:40:01 +0100 Subject: Update version to 1.8.3 --- build/linux/configure.ac | 2 +- build/msvc/build_env.bat | 4 ++-- include/astra/Globals.h | 2 +- python/astra/__init__.py | 2 +- python/builder.py | 2 +- python/conda/astra-toolbox/meta.yaml | 8 ++++---- python/conda/libastra/meta.yaml | 4 ++-- 7 files changed, 12 insertions(+), 12 deletions(-) (limited to 'include') diff --git a/build/linux/configure.ac b/build/linux/configure.ac index b95d94f..0091388 100644 --- a/build/linux/configure.ac +++ b/build/linux/configure.ac @@ -23,7 +23,7 @@ dnl along with the ASTRA Toolbox. If not, see . dnl dnl ----------------------------------------------------------------------- -AC_INIT(astra, 1.8.0) +AC_INIT(astra, 1.8.3) AC_CONFIG_SRCDIR([Makefile.in]) LT_INIT([disable-static]) diff --git a/build/msvc/build_env.bat b/build/msvc/build_env.bat index 8cb7c96..56c811f 100644 --- a/build/msvc/build_env.bat +++ b/build/msvc/build_env.bat @@ -12,5 +12,5 @@ set B_VCREDIST=D:\wjp\vs2015u3_redist\vc_redist.x64.exe set B_README_WP27=C:\WinPython-64bit-%B_WP27%\python-%B_WP27:~0,-2%.amd64\Lib\site-packages set B_README_WP35=C:\WinPython-64bit-%B_WP35%\python-%B_WP35:~0,-2%.amd64\Lib\site-packages -set B_RELEASE_TAG=v1.8 -set B_RELEASE=1.8 +set B_RELEASE_TAG=v1.8.3 +set B_RELEASE=1.8.3 diff --git a/include/astra/Globals.h b/include/astra/Globals.h index 7c1e9a8..f447fd8 100644 --- a/include/astra/Globals.h +++ b/include/astra/Globals.h @@ -60,7 +60,7 @@ along with the ASTRA Toolbox. If not, see . #define ASTRA_TOOLBOXVERSION_MAJOR 1 #define ASTRA_TOOLBOXVERSION_MINOR 8 #define ASTRA_TOOLBOXVERSION ((ASTRA_TOOLBOXVERSION_MAJOR)*100 + (ASTRA_TOOLBOXVERSION_MINOR)) -#define ASTRA_TOOLBOXVERSION_STRING "1.8" +#define ASTRA_TOOLBOXVERSION_STRING "1.8.3" #define ASTRA_ASSERT(a) assert(a) diff --git a/python/astra/__init__.py b/python/astra/__init__.py index 8238a88..5e52a1c 100644 --- a/python/astra/__init__.py +++ b/python/astra/__init__.py @@ -41,7 +41,7 @@ from . import log from .optomo import OpTomo from .tests import test_noCUDA, test_CUDA -__version__ = '1.8' +__version__ = '1.8.3' import os diff --git a/python/builder.py b/python/builder.py index ec0bd23..01f4203 100644 --- a/python/builder.py +++ b/python/builder.py @@ -71,7 +71,7 @@ for m in ext_modules: 'PythonPluginAlgorithm.cpp')) setup(name='astra-toolbox', - version='1.8', + version='1.8.3', description='Python interface to the ASTRA Toolbox', author='D.M. Pelt', author_email='D.M.Pelt@cwi.nl', diff --git a/python/conda/astra-toolbox/meta.yaml b/python/conda/astra-toolbox/meta.yaml index 2b25c44..88a9172 100644 --- a/python/conda/astra-toolbox/meta.yaml +++ b/python/conda/astra-toolbox/meta.yaml @@ -1,10 +1,10 @@ package: name: astra-toolbox - version: '1.8' + version: '1.8.3' source: git_url: https://github.com/astra-toolbox/astra-toolbox.git - git_tag: v1.8 + git_tag: v1.8.3 build: number: 0 @@ -28,14 +28,14 @@ requirements: - numpy {{ numpy }} - scipy - six - - libastra ==1.8 + - libastra ==1.8.3 run: - python - {{ pin_compatible('numpy', max_pin='x.x') }} - scipy - six - - libastra ==1.8 + - libastra ==1.8.3 about: diff --git a/python/conda/libastra/meta.yaml b/python/conda/libastra/meta.yaml index 6176f30..e4622b7 100644 --- a/python/conda/libastra/meta.yaml +++ b/python/conda/libastra/meta.yaml @@ -1,10 +1,10 @@ package: name: libastra - version: '1.8' + version: '1.8.3' source: git_url: https://github.com/astra-toolbox/astra-toolbox.git - git_tag: v1.8 + git_tag: v1.8.3 build: number: 0 -- cgit v1.2.3 From bd2798bed2fddfe00dac006013a9fb1363417f20 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Tue, 14 Nov 2017 14:56:02 +0100 Subject: Remove unused code --- include/astra/Float32Data3DMemory.h | 33 ++------------------------------- python/astra/PyIncludes.pxd | 1 - python/astra/data3d_c.pyx | 6 +++--- src/Float32Data3DMemory.cpp | 33 --------------------------------- 4 files changed, 5 insertions(+), 68 deletions(-) (limited to 'include') diff --git a/include/astra/Float32Data3DMemory.h b/include/astra/Float32Data3DMemory.h index 876aa37..4ebe60b 100644 --- a/include/astra/Float32Data3DMemory.h +++ b/include/astra/Float32Data3DMemory.h @@ -52,22 +52,10 @@ protected: */ float32* m_pfData; - /** Array of float32 pointers, each pointing to a single row - * in the m_pfData memory block. - * To access element (ix, iy, iz) internally, use m_ppfDataRowInd[iz * m_iHeight + iy][ix] - */ - float32** m_ppfDataRowInd; - - /** Array of float32 pointers, each pointing to a single slice - * in the m_pfData memory block. - * To access element (ix, iy, iz) internally, use m_pppfDataSliceInd[iz][iy][ix] - */ - float32*** m_pppfDataSliceInd; - float32 m_fGlobalMin; ///< minimum value of the data float32 m_fGlobalMax; ///< maximum value of the data - /** Allocate memory for m_pfData, m_ppfDataRowInd and m_pppfDataSliceInd arrays. + /** Allocate memory for m_pfData. * * The allocated block consists of m_iSize float32s. The block is * not cleared after allocation and its contents is undefined. @@ -75,7 +63,7 @@ protected: */ void _allocateData(); - /** Free memory for m_pfData, m_ppfDataRowInd and m_pppfDataSliceInd arrays. + /** Free memory for m_pfData. * * This function may ONLY be called if the memory for both blocks has been * allocated before. @@ -299,23 +287,6 @@ inline const float32* CFloat32Data3DMemory::getDataConst() const return (const float32*)m_pfData; } -//---------------------------------------------------------------------------------------- -// Get a float32** to the data block, represented as a 3-dimensional array of float32 values. -inline float32*** CFloat32Data3DMemory::getData3D() -{ - ASTRA_ASSERT(m_bInitialized); - return m_pppfDataSliceInd; -} - -//---------------------------------------------------------------------------------------- -// Get a const float32** to the data block, represented as a 3-dimensional array of float32 values. -inline const float32*** CFloat32Data3DMemory::getData3DConst() const -{ - ASTRA_ASSERT(m_bInitialized); - return (const float32***)m_pppfDataSliceInd; -} -//---------------------------------------------------------------------------------------- - } // end namespace astra #endif // _INC_ASTRA_FLOAT32DATA2D diff --git a/python/astra/PyIncludes.pxd b/python/astra/PyIncludes.pxd index 512b82f..ec37d0a 100644 --- a/python/astra/PyIncludes.pxd +++ b/python/astra/PyIncludes.pxd @@ -211,7 +211,6 @@ cdef extern from "astra/Float32Data3DMemory.h" namespace "astra": CFloat32Data3DMemory() void updateStatistics() float32 *getData() - float32 ***getData3D() THREEEDataType getType() diff --git a/python/astra/data3d_c.pyx b/python/astra/data3d_c.pyx index 0717ca0..897634b 100644 --- a/python/astra/data3d_c.pyx +++ b/python/astra/data3d_c.pyx @@ -254,7 +254,7 @@ cdef fillDataObjectScalar(CFloat32Data3DMemory * obj, float s): @cython.boundscheck(False) @cython.wraparound(False) cdef fillDataObjectArray(CFloat32Data3DMemory * obj, float [:,:,::1] data): - cdef float [:,:,::1] cView = obj.getData3D()[0][0] + cdef float [:,:,::1] cView = obj.getData() cView[:] = data cdef CFloat32Data3D * getObject(i) except NULL: @@ -271,7 +271,7 @@ def get(i): cdef CFloat32Data3DMemory * pDataObject = dynamic_cast_mem_safe(getObject(i)) outArr = np.empty((pDataObject.getDepth(),pDataObject.getHeight(), pDataObject.getWidth()),dtype=np.float32,order='C') cdef float [:,:,::1] mView = outArr - cdef float [:,:,::1] cView = pDataObject.getData3D()[0][0] + cdef float [:,:,::1] cView = pDataObject.getData() mView[:] = cView return outArr @@ -282,7 +282,7 @@ def get_shared(i): shape[0] = pDataObject.getDepth() shape[1] = pDataObject.getHeight() shape[2] = pDataObject.getWidth() - return np.PyArray_SimpleNewFromData(3,shape,np.NPY_FLOAT32,pDataObject.getData3D()[0][0]) + return np.PyArray_SimpleNewFromData(3,shape,np.NPY_FLOAT32,pDataObject.getData()) def get_single(i): raise NotImplementedError("Not yet implemented") diff --git a/src/Float32Data3DMemory.cpp b/src/Float32Data3DMemory.cpp index 5c5c310..017625b 100644 --- a/src/Float32Data3DMemory.cpp +++ b/src/Float32Data3DMemory.cpp @@ -71,8 +71,6 @@ bool CFloat32Data3DMemory::_initialize(int _iWidth, int _iHeight, int _iDepth) // allocate memory for the data, but do not fill it m_pfData = NULL; - m_ppfDataRowInd = NULL; - m_pppfDataSliceInd = NULL; m_pCustomMemory = 0; _allocateData(); @@ -103,8 +101,6 @@ bool CFloat32Data3DMemory::_initialize(int _iWidth, int _iHeight, int _iDepth, c // allocate memory for the data, but do not fill it m_pfData = NULL; - m_ppfDataRowInd = NULL; - m_pppfDataSliceInd = NULL; m_pCustomMemory = 0; _allocateData(); @@ -140,8 +136,6 @@ bool CFloat32Data3DMemory::_initialize(int _iWidth, int _iHeight, int _iDepth, f // allocate memory for the data, but do not fill it m_pfData = NULL; - m_ppfDataRowInd = NULL; - m_pppfDataSliceInd = NULL; m_pCustomMemory = 0; _allocateData(); @@ -178,8 +172,6 @@ bool CFloat32Data3DMemory::_initialize(int _iWidth, int _iHeight, int _iDepth, C // allocate memory for the data, but do not fill it m_pCustomMemory = _pCustomMemory; m_pfData = NULL; - m_ppfDataRowInd = NULL; - m_pppfDataSliceInd = NULL; _allocateData(); // initialization complete @@ -198,8 +190,6 @@ void CFloat32Data3DMemory::_allocateData() ASTRA_ASSERT(m_iSize > 0); ASTRA_ASSERT(m_iSize == (size_t)m_iWidth * m_iHeight * m_iDepth); ASTRA_ASSERT(m_pfData == NULL); - ASTRA_ASSERT(m_ppfDataRowInd == NULL); - ASTRA_ASSERT(m_pppfDataSliceInd == NULL); if (!m_pCustomMemory) { // allocate contiguous block @@ -213,20 +203,6 @@ void CFloat32Data3DMemory::_allocateData() } else { m_pfData = m_pCustomMemory->m_fPtr; } - - // create array of pointers to each row of the data block - m_ppfDataRowInd = new float32*[m_iHeight*m_iDepth]; - for (int iy = 0; iy < m_iHeight*m_iDepth; iy++) - { - m_ppfDataRowInd[iy] = &(m_pfData[iy * m_iWidth]); - } - - // create array of pointers to each row of the data block - m_pppfDataSliceInd = new float32**[m_iDepth]; - for (int iy = 0; iy < m_iDepth; iy++) - { - m_pppfDataSliceInd[iy] = &(m_ppfDataRowInd[iy * m_iHeight]); - } } //---------------------------------------------------------------------------------------- @@ -235,13 +211,6 @@ void CFloat32Data3DMemory::_freeData() { // basic checks ASTRA_ASSERT(m_pfData != NULL); - ASTRA_ASSERT(m_ppfDataRowInd != NULL); - ASTRA_ASSERT(m_pppfDataSliceInd != NULL); - - // free memory for index table - delete[] m_pppfDataSliceInd; - // free memory for index table - delete[] m_ppfDataRowInd; if (!m_pCustomMemory) { // free memory for data block @@ -266,8 +235,6 @@ void CFloat32Data3DMemory::_clear() m_iSize = 0; m_pfData = NULL; - m_ppfDataRowInd = NULL; - m_pppfDataSliceInd = NULL; m_pCustomMemory = NULL; } -- cgit v1.2.3