diff options
Diffstat (limited to 'include/astra')
-rw-r--r-- | include/astra/Float32Data3DMemory.h | 33 | ||||
-rw-r--r-- | include/astra/Globals.h | 104 | ||||
-rw-r--r-- | include/astra/swrap.h | 40 |
3 files changed, 3 insertions, 174 deletions
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/include/astra/Globals.h b/include/astra/Globals.h index 0adc3e5..2ae1f78 100644 --- a/include/astra/Globals.h +++ b/include/astra/Globals.h @@ -60,7 +60,7 @@ along with the ASTRA Toolbox. If not, see <http://www.gnu.org/licenses/>. #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) @@ -121,21 +121,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 { const float32 PI = 3.14159265358979323846264338328f; @@ -148,51 +133,6 @@ namespace astra { } //---------------------------------------------------------------------------------------- -// 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<typename T> -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<typename T> -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<typename T> -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 <http://www.gnu.org/licenses/>. - ------------------------------------------------------------------------ -*/ - -#ifndef _INC_ASTRA_SWRAP_H -#define _INC_ASTRA_SWRAP_H - -#ifndef _MSC_VER - -#include <cstdio> - -typedef int errno_t; -errno_t fopen_s(FILE** pFile, const char *filename, const char *mode); - -#endif - -#endif |