From 27a964cb66f3a78ca27cc5a5befbdd3f405ccee4 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Fri, 28 Oct 2016 09:24:25 +0200 Subject: Remove unused function --- include/astra/Globals.h | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'include') diff --git a/include/astra/Globals.h b/include/astra/Globals.h index dec978d..44a77b0 100644 --- a/include/astra/Globals.h +++ b/include/astra/Globals.h @@ -53,8 +53,6 @@ along with the ASTRA Toolbox. If not, see . #include #include #include -#include -#include //---------------------------------------------------------------------------------------- // macro's @@ -227,16 +225,6 @@ namespace astra { int m_iSliceIndex; }; } -//---------------------------------------------------------------------------------------- -// some toys - -// safe reinterpret cast -template -To safe_reinterpret_cast(From from) -{ - BOOST_STATIC_ASSERT(sizeof(From) <= sizeof(To)); - return reinterpret_cast(from); -} //---------------------------------------------------------------------------------------- // functions for testing -- cgit v1.2.3 From e8f6dd643fc04588cb8a8eaa8453c0eb6d40e236 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Fri, 28 Oct 2016 09:35:21 +0200 Subject: Remove unused data3d functions --- include/astra/Float32ProjectionData3D.h | 49 -------------------- include/astra/Float32ProjectionData3DMemory.h | 49 -------------------- include/astra/Float32VolumeData3D.h | 66 --------------------------- include/astra/Float32VolumeData3DMemory.h | 49 -------------------- 4 files changed, 213 deletions(-) (limited to 'include') diff --git a/include/astra/Float32ProjectionData3D.h b/include/astra/Float32ProjectionData3D.h index ae0664b..1634eeb 100644 --- a/include/astra/Float32ProjectionData3D.h +++ b/include/astra/Float32ProjectionData3D.h @@ -85,55 +85,6 @@ public: */ virtual CFloat32Data3D::EDataType getType() const; - /** Fetch a COPY of a projection of the data. Note that if you update the 2D data slice, the data in the - * 3d data object will remain unaltered. To copy the data back in the 3D-volume you must return the data by calling 'returnProjection'. - * - * @param _iProjectionNr projection number - * @return Volume data object - */ - virtual CFloat32VolumeData2D* fetchProjection(int _iProjectionNr) const = 0; - - /** Return a projection slice to the 3d data. The data will be deleted. If the slice was fetched with - * 'fetchProjection', the data will be stored first. - * - * @param _iProjectionNr projection number - * @param _pProjection 2D Projection Data - */ - virtual void returnProjection(int _iProjectionNr, CFloat32VolumeData2D* _pProjection) = 0; - - /** Fetch a COPY of a sinogram slice of the data. Note that if you update the 2D data slice, the data in the - * 3d data object will remain unaltered. To copy the data back in the 3D-volume you must return the data by calling 'returnSlice'. - * - * @param _iSliceNr slice number - * @return Sinogram data object - */ - virtual CFloat32ProjectionData2D* fetchSinogram(int _iSliceNr) const = 0; - - /** Return a sinogram slice to the 3d data. The data will be stored in the 3D Data object. - * - * @param _iSliceNr slice number - * @param _pSinogram2D 2D Sinogram Object. - */ - virtual void returnSinogram(int _iSliceNr, CFloat32ProjectionData2D* _pSinogram2D) = 0; - - /** This SLOW function returns a detector value stored a specific index in the array. - * Reading values in this way might cause a lot of unnecessar__y memory operations, don't - * use it in time-critical code. - * - * @param _iIndex Index in the array if the data were stored completely in main memory - * @return The value the location specified by _iIndex - */ - virtual float32 getDetectorValue(int _iIndex) = 0; - - /** This SLOW function stores a detector value at a specific index in the array. - * Writing values in this way might cause a lot of unnecessary memory operations, don't - * use it in time-critical code. - * - * @param _iIndex Index in the array if the data were stored completely in main memory - * @param _fValue The value to be stored at the location specified by _iIndex - */ - virtual void setDetectorValue(int _iIndex, float32 _fValue) = 0; - /** * Overloaded Operator: data += data (pointwise) * diff --git a/include/astra/Float32ProjectionData3DMemory.h b/include/astra/Float32ProjectionData3DMemory.h index 14bae36..732c31a 100644 --- a/include/astra/Float32ProjectionData3DMemory.h +++ b/include/astra/Float32ProjectionData3DMemory.h @@ -166,55 +166,6 @@ public: - /** Fetch a COPY of a projection of the data. Note that if you update the 2D data slice, the data in the - * 3D data object will remain unaltered. To copy the data back in the 3D-volume you must return the data by calling 'returnProjection'. - * - * @param _iProjectionNr projection number - * @return Volume data object - */ - virtual CFloat32VolumeData2D* fetchProjection(int _iProjectionNr) const; - - /** Return a projection slice to the 3D data. The data will be deleted. If the slice was fetched with - * 'fetchProjection', the data will be stored first. - * - * @param _iProjectionNr projection number - * @param _pProjection 2D Projection image - */ - virtual void returnProjection(int _iProjectionNr, CFloat32VolumeData2D* _pProjection); - - /** Fetch a COPY of a sinogram slice of the data. Note that if you update the 2D data slice, the data in the - * 3D data object will remain unaltered. To copy the data back in the 3D-volume you must return the data by calling 'returnSlice'. - * - * @param _iSliceNr slice number - * @return Sinogram data object - */ - virtual CFloat32ProjectionData2D* fetchSinogram(int _iSliceNr) const; - - /** This SLOW function returns a detector value stored a specific index in the array. - * Reading values in this way might cause a lot of unnecessary memory operations, don't - * use it in time-critical code. - * - * @param _iIndex Index in the array if the data were stored completely in main memory - * @return The value the location specified by _iIndex - */ - virtual float32 getDetectorValue(int _iIndex); - - /** This SLOW function stores a detector value at a specific index in the array. - * Writing values in this way might cause a lot of unnecessary memory operations, don't - * use it in time-critical code. - * - * @param _iIndex Index in the array if the data were stored completely in main memory - * @param _fValue The value to be stored at the location specified by _iIndex - */ - virtual void setDetectorValue(int _iIndex, float32 _fValue); - - /** Return a sinogram slice to the 3d data. The data will be stored in the 3D Data object. - * - * @param _iSliceNr slice number - * @param _pSinogram2D 2D Sinogram Object. - */ - virtual void returnSinogram(int _iSliceNr, CFloat32ProjectionData2D* _pSinogram2D); - /** Which type is this class? * * @return DataType: PROJECTION diff --git a/include/astra/Float32VolumeData3D.h b/include/astra/Float32VolumeData3D.h index 7a32efe..535e960 100644 --- a/include/astra/Float32VolumeData3D.h +++ b/include/astra/Float32VolumeData3D.h @@ -85,72 +85,6 @@ public: */ virtual CFloat32Data3D::EDataType getType() const; - /** Fetch a slice from the data in the x direction. Note that if you update the 2D data slice, the data in the - * 3d data object will remain unaltered. To copy the data you must return the data by calling 'returnSliceX'. - * You should not delete data fetched with this function yourself, instead call the 'returnSliceX' function. - * - * @param _iColumnIndex slice number - * @return Volume data object - */ - virtual CFloat32VolumeData2D* fetchSliceX(int _iColumnIndex) const = 0; - - /** Fetch a slice from the data in the y direction. Note that if you update the 2D data slice, the data in the - * 3d data object will remain unaltered. To copy the data you must return the data by calling 'returnSliceY'. - * You should not delete data fetched with this function yourself, instead call the 'returnSliceY' function. - * - * @param _iRowIndex slice number - * @return Volume data object - */ - virtual CFloat32VolumeData2D* fetchSliceY(int _iRowIndex) const = 0; - - /** Fetch a slice from the data in the z direction. Note that if you update the 2D data slice, the data in the - * 3d data object will remain unaltered. To copy the data you must return the data by calling 'returnSliceZ'. - * You should not delete data fetched with this function yourself, instead call the 'returnSliceZ' function. - * - * @param _iSliceIndex slice number - * @return Volume data object - */ - virtual CFloat32VolumeData2D* fetchSliceZ(int _iSliceIndex) const = 0; - - /** Return a slice from the data in the x direction to the 3d data. The data will be deleted. If the slice was - * fetched with 'fetchSliceX', the data will be stored first. - * - * @param _iColumnIndex slice number - */ - virtual void returnSliceX(int _iColumnIndex, CFloat32VolumeData2D * _pSlice) = 0; - - /** Return a slice from the data in the y direction to the 3d data. The data will be deleted. If the slice was - * fetched with 'fetchSliceY', the data will be stored first. - * - * @param _iRowIndex slice number - */ - virtual void returnSliceY(int _iRowIndex, CFloat32VolumeData2D * _pSlice) = 0; - - /** Return a slice from the data in the z direction to the 3d data. The data will be deleted. If the slice was - * fetched with 'fetchSliceZ', the data will be stored first. - * - * @param _iSliceIndex slice number - */ - virtual void returnSliceZ(int _iSliceIndex, CFloat32VolumeData2D * _pSlice) = 0; - - /** This SLOW function returns a voxel value stored at a specific index in the array. - * Reading values in this way might cause a lot of unnecessary memory operations, don't - * use it in time-critical code. - * - * @param _iIndex Index in the array if the data were stored completely in main memory - * @return The value stored at the location specified by _iIndex - */ - virtual float32 getVoxelValue(int _iIndex) = 0; - - /** This SLOW function stores a voxel value at a specific index in the array. - * Writing values in this way might cause a lot of unnecessary memory operations, don't - * use it in time-critical code. - * - * @param _iIndex Index in the array if the data were stored completely in main memory - * @param _fValue The value to be stored at the location specified by _iIndex - */ - virtual void setVoxelValue(int _iIndex, float32 _fValue) = 0; - /** * Overloaded Operator: data += data (pointwise) * diff --git a/include/astra/Float32VolumeData3DMemory.h b/include/astra/Float32VolumeData3DMemory.h index 70f0939..4a70f65 100644 --- a/include/astra/Float32VolumeData3DMemory.h +++ b/include/astra/Float32VolumeData3DMemory.h @@ -158,55 +158,6 @@ public: */ CVolumeGeometry3D* getGeometry() const; - /** - * Gets a slice, containing all voxels with a given x (= column) index. - */ - CFloat32VolumeData2D * fetchSliceX(int _iColumnIndex) const; - - /** - * Gets a slice, containing all voxels with a given y (= row) index. - */ - CFloat32VolumeData2D * fetchSliceY(int _iRowIndex) const; - - /** - * Gets a slice, containing all voxels with a given z (= slice) index. - */ - CFloat32VolumeData2D * fetchSliceZ(int _iSliceIndex) const; - - /** - * Gets a slice, containing all voxels with a given x (= column) index. - */ - void returnSliceX(int _iColumnIndex, CFloat32VolumeData2D * _pSliceData); - - /** - * Gets a slice, containing all voxels with a given y (= row) index. - */ - void returnSliceY(int _iRowIndex, CFloat32VolumeData2D * _pSliceData); - - /** - * Copies data from a 2D slice containing all voxels with a given z (= slice) index to the - * 3D memory stored in this class. - */ - void returnSliceZ(int _iSliceIndex, CFloat32VolumeData2D * _pSliceData); - - /** This SLOW function returns a volume value stored a specific index in the array. - * Reading values in this way might cause a lot of unnecessary memory operations, don't - * use it in time-critical code. - * - * @param _iIndex Index in the array if the data were stored completely in main memory - * @return The value the location specified by _iIndex - */ - virtual float32 getVoxelValue(int _iIndex); - - /** This SLOW function stores a voxel value at a specific index in the array. - * Writing values in this way might cause a lot of unnecessary memory operations, don't - * use it in time-critical code. - * - * @param _iIndex Index in the array if the data were stored completely in main memory - * @param _fValue The value to be stored at the location specified by _iIndex - */ - virtual void setVoxelValue(int _iIndex, float32 _fValue); - /** * Overloaded Operator: data = data (pointwise) * -- cgit v1.2.3 From 1d851f0a8fa093e044c7264569cc6f88df39a16e Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Thu, 26 Jan 2017 14:57:42 +0100 Subject: Remove unused 3d global min/max --- include/astra/Float32Data3D.h | 16 -------------- include/astra/Float32Data3DMemory.h | 42 ++----------------------------------- 2 files changed, 2 insertions(+), 56 deletions(-) (limited to 'include') diff --git a/include/astra/Float32Data3D.h b/include/astra/Float32Data3D.h index 1cd9c20..2b3b88e 100644 --- a/include/astra/Float32Data3D.h +++ b/include/astra/Float32Data3D.h @@ -107,22 +107,6 @@ public: */ int getDimensionCount() const; - /** - * Clamp data to minimum value - * - * @param _fMin minimum value - * @return l-value - */ - virtual CFloat32Data3D& clampMin(float32& _fMin) = 0; - - /** - * Clamp data to maximum value - * - * @param _fMax maximum value - * @return l-value - */ - virtual CFloat32Data3D& clampMax(float32& _fMax) = 0; - /** get a description of the class * * @return description string diff --git a/include/astra/Float32Data3DMemory.h b/include/astra/Float32Data3DMemory.h index d885101..e0c04a0 100644 --- a/include/astra/Float32Data3DMemory.h +++ b/include/astra/Float32Data3DMemory.h @@ -237,35 +237,11 @@ public: * After the call p = getData3D(), use p[iy][ix] to access element (ix, iy, iz). * The data memory and pointer array are still "owned" by the CFloat32Data3DMemory * instance; this memory may NEVER be freed by the caller of this function. - * If changes are made to this data, the function updateStatistics() - * should be called after completion of all changes. * * @return pointer to the 3-dimensional 32-bit floating point data block */ const float32*** getData3DConst() const; - /** Update data statistics, such as minimum and maximum value, after the data has been modified. - */ - virtual void updateStatistics(); - - /** Get the minimum value in the data block. - * If the data has been changed after construction, the function - * updateStatistics() must be called at least once before - * a query can be made on this value. - * - * @return minimum value in the data block - */ - virtual float32 getGlobalMin() const; - - /** Get the maximum value in the data block - * If the data has been changed after construction, the function - * updateStatistics() must be called at least once before - * a query can be made on this value. - * - * @return maximum value in the data block - */ - virtual float32 getGlobalMax() const; - /** which type is this class? * * @return DataType: ASTRA_DATATYPE_FLOAT32_PROJECTION or @@ -305,27 +281,12 @@ inline CFloat32Data3DMemory::EDataType CFloat32Data3DMemory::getType() const return BASE; } -//---------------------------------------------------------------------------------------- -// Get the minimum value in the data block. -inline float32 CFloat32Data3DMemory::getGlobalMin() const -{ - ASTRA_ASSERT(m_bInitialized); - return m_fGlobalMin; -} - -//---------------------------------------------------------------------------------------- -// Get the maximum value in the data block -inline float32 CFloat32Data3DMemory::getGlobalMax() const -{ - ASTRA_ASSERT(m_bInitialized); - return m_fGlobalMax; -} - //---------------------------------------------------------------------------------------- // Get a pointer to the data block, represented as a 1-dimensional array of float32 values. inline float32* CFloat32Data3DMemory::getData() { ASTRA_ASSERT(m_bInitialized); + return m_pfData; } @@ -334,6 +295,7 @@ inline float32* CFloat32Data3DMemory::getData() inline const float32* CFloat32Data3DMemory::getDataConst() const { ASTRA_ASSERT(m_bInitialized); + return (const float32*)m_pfData; } -- cgit v1.2.3 From d85a660f064e8130b27e11c7fd762221c754c315 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Thu, 26 Jan 2017 14:57:57 +0100 Subject: Start work on CFloat32Data3DGPU to allow persistent/external GPU memory --- include/astra/CompositeGeometryManager.h | 43 ++++----- include/astra/CudaBackProjectionAlgorithm3D.h | 8 +- include/astra/CudaFDKAlgorithm3D.h | 8 +- include/astra/CudaForwardProjectionAlgorithm3D.h | 8 +- include/astra/Float32Data3D.h | 2 + include/astra/Float32Data3DGPU.h | 108 +++++++++++++++++++++++ include/astra/Float32ProjectionData3DGPU.h | 92 +++++++++++++++++++ include/astra/Float32VolumeData3DGPU.h | 92 +++++++++++++++++++ 8 files changed, 329 insertions(+), 32 deletions(-) create mode 100644 include/astra/Float32Data3DGPU.h create mode 100644 include/astra/Float32ProjectionData3DGPU.h create mode 100644 include/astra/Float32VolumeData3DGPU.h (limited to 'include') diff --git a/include/astra/CompositeGeometryManager.h b/include/astra/CompositeGeometryManager.h index c0acf4f..08eb7af 100644 --- a/include/astra/CompositeGeometryManager.h +++ b/include/astra/CompositeGeometryManager.h @@ -42,9 +42,9 @@ namespace astra { class CCompositeVolume; class CCompositeProjections; -class CFloat32Data3DMemory; -class CFloat32ProjectionData3DMemory; -class CFloat32VolumeData3DMemory; +class CFloat32Data3D; +class CFloat32ProjectionData3D; +class CFloat32VolumeData3D; class CVolumeGeometry3D; class CProjectionGeometry3D; class CProjector3D; @@ -77,7 +77,7 @@ public: PART_VOL, PART_PROJ } eType; - CFloat32Data3DMemory* pData; + CFloat32Data3D* pData; unsigned int subX; unsigned int subY; unsigned int subZ; @@ -88,8 +88,11 @@ public: virtual void splitY(TPartList& out, size_t maxSize, size_t maxDim, int div) = 0; virtual void splitZ(TPartList& out, size_t maxSize, size_t maxDim, int div) = 0; virtual CPart* reduce(const CPart *other) = 0; - virtual void getDims(size_t &x, size_t &y, size_t &z) = 0; - size_t getSize(); + virtual void getDims(size_t &x, size_t &y, size_t &z) const = 0; + size_t getSize() const; + + bool canSplitAndReduce() const; + bool isFull() const; }; class CVolumePart : public CPart { @@ -104,7 +107,7 @@ public: virtual void splitY(TPartList& out, size_t maxSize, size_t maxDim, int div); virtual void splitZ(TPartList& out, size_t maxSize, size_t maxDim, int div); virtual CPart* reduce(const CPart *other); - virtual void getDims(size_t &x, size_t &y, size_t &z); + virtual void getDims(size_t &x, size_t &y, size_t &z) const; CVolumePart* clone() const; }; @@ -120,7 +123,7 @@ public: virtual void splitY(TPartList& out, size_t maxSize, size_t maxDim, int div); virtual void splitZ(TPartList& out, size_t maxSize, size_t maxDim, int div); virtual CPart* reduce(const CPart *other); - virtual void getDims(size_t &x, size_t &y, size_t &z); + virtual void getDims(size_t &x, size_t &y, size_t &z) const; CProjectionPart* clone() const; }; @@ -150,23 +153,23 @@ public: bool doJobs(TJobList &jobs); SJob createJobFP(CProjector3D *pProjector, - CFloat32VolumeData3DMemory *pVolData, - CFloat32ProjectionData3DMemory *pProjData); + CFloat32VolumeData3D *pVolData, + CFloat32ProjectionData3D *pProjData); SJob createJobBP(CProjector3D *pProjector, - CFloat32VolumeData3DMemory *pVolData, - CFloat32ProjectionData3DMemory *pProjData); + CFloat32VolumeData3D *pVolData, + CFloat32ProjectionData3D *pProjData); // Convenience functions for creating and running a single FP or BP job - bool doFP(CProjector3D *pProjector, CFloat32VolumeData3DMemory *pVolData, - CFloat32ProjectionData3DMemory *pProjData); - bool doBP(CProjector3D *pProjector, CFloat32VolumeData3DMemory *pVolData, - CFloat32ProjectionData3DMemory *pProjData); - bool doFDK(CProjector3D *pProjector, CFloat32VolumeData3DMemory *pVolData, - CFloat32ProjectionData3DMemory *pProjData, bool bShortScan, + bool doFP(CProjector3D *pProjector, CFloat32VolumeData3D *pVolData, + CFloat32ProjectionData3D *pProjData); + bool doBP(CProjector3D *pProjector, CFloat32VolumeData3D *pVolData, + CFloat32ProjectionData3D *pProjData); + bool doFDK(CProjector3D *pProjector, CFloat32VolumeData3D *pVolData, + CFloat32ProjectionData3D *pProjData, bool bShortScan, const float *pfFilter = 0); - bool doFP(CProjector3D *pProjector, const std::vector& volData, const std::vector& projData); - bool doBP(CProjector3D *pProjector, const std::vector& volData, const std::vector& projData); + bool doFP(CProjector3D *pProjector, const std::vector& volData, const std::vector& projData); + bool doBP(CProjector3D *pProjector, const std::vector& volData, const std::vector& projData); void setGPUIndices(const std::vector& GPUIndices); diff --git a/include/astra/CudaBackProjectionAlgorithm3D.h b/include/astra/CudaBackProjectionAlgorithm3D.h index 6738988..114d6f3 100644 --- a/include/astra/CudaBackProjectionAlgorithm3D.h +++ b/include/astra/CudaBackProjectionAlgorithm3D.h @@ -69,8 +69,8 @@ public: * @param _pReconstruction VolumeData3D object for storing the reconstructed volume. */ CCudaBackProjectionAlgorithm3D(CProjector3D* _pProjector, - CFloat32ProjectionData3DMemory* _pProjectionData, - CFloat32VolumeData3DMemory* _pReconstruction); + CFloat32ProjectionData3D* _pProjectionData, + CFloat32VolumeData3D* _pReconstruction); /** Copy constructor. */ @@ -99,8 +99,8 @@ public: * @return initialization successful? */ bool initialize(CProjector3D* _pProjector, - CFloat32ProjectionData3DMemory* _pSinogram, - CFloat32VolumeData3DMemory* _pReconstruction); + CFloat32ProjectionData3D* _pSinogram, + CFloat32VolumeData3D* _pReconstruction); /** Get all information parameters * diff --git a/include/astra/CudaFDKAlgorithm3D.h b/include/astra/CudaFDKAlgorithm3D.h index 386129e..1c4c622 100644 --- a/include/astra/CudaFDKAlgorithm3D.h +++ b/include/astra/CudaFDKAlgorithm3D.h @@ -81,8 +81,8 @@ public: * @param _pReconstruction VolumeData3D object for storing the reconstructed volume. */ CCudaFDKAlgorithm3D(CProjector3D* _pProjector, - CFloat32ProjectionData3DMemory* _pProjectionData, - CFloat32VolumeData3DMemory* _pReconstruction); + CFloat32ProjectionData3D* _pProjectionData, + CFloat32VolumeData3D* _pReconstruction); /** Copy constructor. */ @@ -111,8 +111,8 @@ public: * @return initialization successful? */ bool initialize(CProjector3D* _pProjector, - CFloat32ProjectionData3DMemory* _pSinogram, - CFloat32VolumeData3DMemory* _pReconstruction); + CFloat32ProjectionData3D* _pSinogram, + CFloat32VolumeData3D* _pReconstruction); /** Get all information parameters * diff --git a/include/astra/CudaForwardProjectionAlgorithm3D.h b/include/astra/CudaForwardProjectionAlgorithm3D.h index 95af73a..9dc889e 100644 --- a/include/astra/CudaForwardProjectionAlgorithm3D.h +++ b/include/astra/CudaForwardProjectionAlgorithm3D.h @@ -71,8 +71,8 @@ public: * @return initialization successful? */ bool initialize(CProjector3D* _pProjector, - CFloat32ProjectionData3DMemory* _pSinogram, - CFloat32VolumeData3DMemory* _pReconstruction, + CFloat32ProjectionData3D* _pSinogram, + CFloat32VolumeData3D* _pReconstruction, int _iGPUindex = -1, int _iDetectorSuperSampling = 1); @@ -116,8 +116,8 @@ public: protected: CProjector3D* m_pProjector; - CFloat32ProjectionData3DMemory* m_pProjections; - CFloat32VolumeData3DMemory* m_pVolume; + CFloat32ProjectionData3D* m_pProjections; + CFloat32VolumeData3D* m_pVolume; int m_iGPUIndex; int m_iDetectorSuperSampling; diff --git a/include/astra/Float32Data3D.h b/include/astra/Float32Data3D.h index 2b3b88e..aca82ab 100644 --- a/include/astra/Float32Data3D.h +++ b/include/astra/Float32Data3D.h @@ -32,6 +32,8 @@ along with the ASTRA Toolbox. If not, see . #include "Float32Data.h" #include "Float32Data2D.h" +#include "../../cuda/3d/mem3d.h" + namespace astra { /** diff --git a/include/astra/Float32Data3DGPU.h b/include/astra/Float32Data3DGPU.h new file mode 100644 index 0000000..0802105 --- /dev/null +++ b/include/astra/Float32Data3DGPU.h @@ -0,0 +1,108 @@ +/* +----------------------------------------------------------------------- +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_FLOAT32DATA3DGPU +#define _INC_ASTRA_FLOAT32DATA3DGPU + +#ifdef ASTRA_CUDA + +#include "Globals.h" +#include "Float32Data3D.h" + +#include "../../cuda/3d/mem3d.h" + +namespace astra { + + +astraCUDA3d::MemHandle3D wrapHandle(float *D_ptr, unsigned int x, unsigned int y, unsigned int z, unsigned int pitch); + + +/** + * This class represents a three-dimensional block of float32ing point data. + * The data block is stored on a GPU, and owned by external code. + * + * TODO: Store/remember which GPU the data is stored on + */ +class _AstraExport CFloat32Data3DGPU : public virtual CFloat32Data3D { + +protected: + /** Handle for the memory block */ + astraCUDA3d::MemHandle3D m_hnd; + + /** Clear all member variables, setting all numeric variables to 0 and all pointers to NULL. + */ + void _clear(); + + /** Un-initialize the object, bringing it back in the unitialized state. + */ + void _unInit(); + + /** Initialization. Initializes an instance of the CFloat32Data3DGPU class. + * Can only be called by derived classes. + * + * This function does not set m_bInitialized to true if everything is ok. + * + * @param _iWidth width of the 2D data (x-axis), must be > 0 + * @param _iHeight height of the 2D data (y-axis), must be > 0 + * @param _iDepth depth of the 2D data (z-axis), must be > 0 + * @param _hnd the CUDA memory handle + */ + + bool _initialize(int _iWidth, int _iHeight, int _iDepth, astraCUDA3d::MemHandle3D _hnd); + +public: + + /** Default constructor. Sets all numeric member variables to 0 and all pointer member variables to NULL. + * + * If an object is constructed using this default constructor, it must always be followed by a call + * to one of the initialize() methods before the object can be used. Any use before calling init() is not allowed, + * except calling the member function isInitialized(). + * + */ + CFloat32Data3DGPU(); + + /** Destructor. + */ + virtual ~CFloat32Data3DGPU(); + + /** which type is this class? + * + * @return DataType: ASTRA_DATATYPE_FLOAT32_PROJECTION or + * ASTRA_DATATYPE_FLOAT32_VOLUME + */ + virtual EDataType getType() const { return BASE; } + + astraCUDA3d::MemHandle3D getHandle() const { return m_hnd; } + +}; + +} // end namespace astra + +#endif + +#endif // _INC_ASTRA_FLOAT32DATA3DGPU diff --git a/include/astra/Float32ProjectionData3DGPU.h b/include/astra/Float32ProjectionData3DGPU.h new file mode 100644 index 0000000..135c718 --- /dev/null +++ b/include/astra/Float32ProjectionData3DGPU.h @@ -0,0 +1,92 @@ +/* +----------------------------------------------------------------------- +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_FLOAT32PROJECTIONDATA3DGPU +#define _INC_ASTRA_FLOAT32PROJECTIONDATA3DGPU + +#include "Float32Data3DGPU.h" +#include "ProjectionGeometry3D.h" +#include "Float32ProjectionData3D.h" + +#ifdef ASTRA_CUDA + +namespace astra { + +/** + * This class represents three-dimensional Projection Data where the entire data block is stored in GPU memory. + */ +class _AstraExport CFloat32ProjectionData3DGPU : public CFloat32Data3DGPU, public CFloat32ProjectionData3D +{ +public: + + /** Default constructor. Sets all numeric member variables to 0 and all pointer member variables to NULL. + * + * If an object is constructed using this default constructor, it must always be followed by a call + * to one of the init() methods before the object can be used. Any use before calling init() is not allowed, + * except calling the member function isInitialized(). + * + */ + CFloat32ProjectionData3DGPU(); + + /** Construction. + * + * @param _pGeometry 3D volume geometry + * @param _hnd the CUDA memory handle + */ + + CFloat32ProjectionData3DGPU(CProjectionGeometry3D* _pGeometry, astraCUDA3d::MemHandle3D _hnd); + + virtual ~CFloat32ProjectionData3DGPU(); + + /** Initialization. + * + * @param _pGeometry 3D volume geometry + * @param _hnd the CUDA memory handle + */ + + bool initialize(CProjectionGeometry3D* _pGeometry, astraCUDA3d::MemHandle3D _hnd); + + /** Which type is this class? + * + * @return DataType: PROJECTION + */ + virtual CFloat32Data3D::EDataType getType() const { return PROJECTION; } + + /** Get the volume geometry. + * + * @return pointer to volume geometry. + */ + CProjectionGeometry3D* getGeometry() const { ASTRA_ASSERT(m_bInitialized); return m_pGeometry; } + +}; + +} // end namesProjection astra + +#endif + +#endif // _INC_ASTRA_FLOAT32PROJECTIONDATA3DGPU diff --git a/include/astra/Float32VolumeData3DGPU.h b/include/astra/Float32VolumeData3DGPU.h new file mode 100644 index 0000000..377ed75 --- /dev/null +++ b/include/astra/Float32VolumeData3DGPU.h @@ -0,0 +1,92 @@ +/* +----------------------------------------------------------------------- +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_FLOAT32VOLUMEDATA3DGPU +#define _INC_ASTRA_FLOAT32VOLUMEDATA3DGPU + +#include "Float32Data3DGPU.h" +#include "VolumeGeometry3D.h" +#include "Float32VolumeData3D.h" + +#ifdef ASTRA_CUDA + +namespace astra { + +/** + * This class represents three-dimensional Volume Data where the entire data block is stored in GPU memory. + */ +class _AstraExport CFloat32VolumeData3DGPU : public CFloat32Data3DGPU, public CFloat32VolumeData3D +{ +public: + + /** Default constructor. Sets all numeric member variables to 0 and all pointer member variables to NULL. + * + * If an object is constructed using this default constructor, it must always be followed by a call + * to one of the init() methods before the object can be used. Any use before calling init() is not allowed, + * except calling the member function isInitialized(). + * + */ + CFloat32VolumeData3DGPU(); + + /** Construction. + * + * @param _pGeometry 3D volume geometry + * @param _hnd the CUDA memory handle + */ + + CFloat32VolumeData3DGPU(CVolumeGeometry3D* _pGeometry, astraCUDA3d::MemHandle3D _hnd); + + virtual ~CFloat32VolumeData3DGPU(); + + /** Initialization. + * + * @param _pGeometry 3D volume geometry + * @param _hnd the CUDA memory handle + */ + + bool initialize(CVolumeGeometry3D* _pGeometry, astraCUDA3d::MemHandle3D _hnd); + + /** Which type is this class? + * + * @return DataType: VOLUME + */ + virtual CFloat32Data3D::EDataType getType() const { return VOLUME; } + + /** Get the volume geometry. + * + * @return pointer to volume geometry. + */ + CVolumeGeometry3D* getGeometry() const { ASTRA_ASSERT(m_bInitialized); return m_pGeometry; } + +}; + +} // end namespace astra + +#endif + +#endif // _INC_ASTRA_FLOAT32VOLUMEDATA3DGPU -- cgit v1.2.3 From b0d9810a4caffef1c85cbdb30430591d99936345 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Wed, 8 Feb 2017 10:34:46 +0100 Subject: Update comments --- include/astra/Float32Data2D.h | 2 +- include/astra/Float32Data3D.h | 2 +- include/astra/Float32Data3DGPU.h | 15 +++++++-------- include/astra/Float32Data3DMemory.h | 24 ++++++++++++------------ include/astra/Float32ProjectionData3DGPU.h | 7 +++---- include/astra/Float32VolumeData3DGPU.h | 7 +++---- 6 files changed, 27 insertions(+), 30 deletions(-) (limited to 'include') diff --git a/include/astra/Float32Data2D.h b/include/astra/Float32Data2D.h index b33bcd0..1524683 100644 --- a/include/astra/Float32Data2D.h +++ b/include/astra/Float32Data2D.h @@ -41,7 +41,7 @@ public: }; /** - * This class represents a two-dimensional block of float32ing point data. + * This class represents a 2-dimensional block of 32-bit floating point data. * It contains member functions for accessing this data and for performing * elementary computations on the data. * The data block is "owned" by the class, meaning that the class is diff --git a/include/astra/Float32Data3D.h b/include/astra/Float32Data3D.h index aca82ab..226689e 100644 --- a/include/astra/Float32Data3D.h +++ b/include/astra/Float32Data3D.h @@ -37,7 +37,7 @@ along with the ASTRA Toolbox. If not, see . namespace astra { /** - * This class represents a three-dimensional block of float32ing point data. + * This class represents a 3-dimensional block of 32-bit floating point data. */ class _AstraExport CFloat32Data3D : public CFloat32Data { diff --git a/include/astra/Float32Data3DGPU.h b/include/astra/Float32Data3DGPU.h index 0802105..1247e65 100644 --- a/include/astra/Float32Data3DGPU.h +++ b/include/astra/Float32Data3DGPU.h @@ -1,10 +1,10 @@ /* ----------------------------------------------------------------------- -Copyright: 2010-2015, iMinds-Vision Lab, University of Antwerp - 2014-2015, CWI, Amsterdam +Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp + 2014-2016, CWI, Amsterdam Contact: astra@uantwerpen.be -Website: http://sf.net/projects/astra-toolbox +Website: http://www.astra-toolbox.com/ This file is part of the ASTRA Toolbox. @@ -23,7 +23,6 @@ You should have received a copy of the GNU General Public License along with the ASTRA Toolbox. If not, see . ----------------------------------------------------------------------- -$Id$ */ #ifndef _INC_ASTRA_FLOAT32DATA3DGPU @@ -43,7 +42,7 @@ astraCUDA3d::MemHandle3D wrapHandle(float *D_ptr, unsigned int x, unsigned int y /** - * This class represents a three-dimensional block of float32ing point data. + * This class represents a 3-dimensional block of 32-bit floating point data. * The data block is stored on a GPU, and owned by external code. * * TODO: Store/remember which GPU the data is stored on @@ -67,9 +66,9 @@ protected: * * This function does not set m_bInitialized to true if everything is ok. * - * @param _iWidth width of the 2D data (x-axis), must be > 0 - * @param _iHeight height of the 2D data (y-axis), must be > 0 - * @param _iDepth depth of the 2D data (z-axis), must be > 0 + * @param _iWidth width of the 3D data (x-axis), must be > 0 + * @param _iHeight height of the 3D data (y-axis), must be > 0 + * @param _iDepth depth of the 3D data (z-axis), must be > 0 * @param _hnd the CUDA memory handle */ diff --git a/include/astra/Float32Data3DMemory.h b/include/astra/Float32Data3DMemory.h index e0c04a0..876aa37 100644 --- a/include/astra/Float32Data3DMemory.h +++ b/include/astra/Float32Data3DMemory.h @@ -34,7 +34,7 @@ along with the ASTRA Toolbox. If not, see . namespace astra { /** - * This class represents a three-dimensional block of float32ing point data. + * This class represents a 3-dimensional block of 32-bit floating point data. * It contains member functions for accessing this data and for performing * elementary computations on the data. * The data block is "owned" by the class, meaning that the class is @@ -106,8 +106,8 @@ protected: * This function does not set m_bInitialized to true if everything is ok. * * @param _iWidth width of the 3D data (x-axis), must be > 0 - * @param _iHeight height of the 3D data (y-axis), must be > 0 - * @param _iDepth depth of the 3D data (z-axis), must be > 0 + * @param _iHeight height of the 3D data (y-axis), must be > 0 + * @param _iDepth depth of the 3D data (z-axis), must be > 0 * @return initialization of the base class successfull */ bool _initialize(int _iWidth, int _iHeight, int _iDepth); @@ -121,9 +121,9 @@ protected: * object is reinitialized and memory is freed and reallocated if necessary. * This function does not set m_bInitialized to true if everything is ok. * - * @param _iWidth width of the 2D data (x-axis), must be > 0 - * @param _iHeight height of the 2D data (y-axis), must be > 0 - * @param _iDepth depth of the 2D data (z-axis), must be > 0 + * @param _iWidth width of the 3D data (x-axis), must be > 0 + * @param _iHeight height of the 3D data (y-axis), must be > 0 + * @param _iDepth depth of the 3D data (z-axis), must be > 0 * @param _pfData pointer to a one-dimensional float32 data block * @return initialization of the base class successfull */ @@ -138,9 +138,9 @@ protected: * object is reinitialized and memory is freed and reallocated if necessary. * This function does not set m_bInitialized to true if everything is ok. * - * @param _iWidth width of the 2D data (x-axis), must be > 0 - * @param _iHeight height of the 2D data (y-axis), must be > 0 - * @param _iDepth depth of the 2D data (z-axis), must be > 0 + * @param _iWidth width of the 3D data (x-axis), must be > 0 + * @param _iHeight height of the 3D data (y-axis), must be > 0 + * @param _iDepth depth of the 3D data (z-axis), must be > 0 * @param _fScalar scalar value to fill the data * @return initialization of the base class successfull */ @@ -157,9 +157,9 @@ protected: * object is reinitialized and memory is freed and reallocated if necessary. * This function does not set m_bInitialized to true if everything is ok. * - * @param _iWidth width of the 2D data (x-axis), must be > 0 - * @param _iHeight height of the 2D data (y-axis), must be > 0 - * @param _iDepth depth of the 2D data (z-axis), must be > 0 + * @param _iWidth width of the 3D data (x-axis), must be > 0 + * @param _iHeight height of the 3D data (y-axis), must be > 0 + * @param _iDepth depth of the 3D data (z-axis), must be > 0 * @param _pCustomMemory the custom memory handle */ diff --git a/include/astra/Float32ProjectionData3DGPU.h b/include/astra/Float32ProjectionData3DGPU.h index 135c718..cbf9b6f 100644 --- a/include/astra/Float32ProjectionData3DGPU.h +++ b/include/astra/Float32ProjectionData3DGPU.h @@ -1,10 +1,10 @@ /* ----------------------------------------------------------------------- -Copyright: 2010-2015, iMinds-Vision Lab, University of Antwerp - 2014-2015, CWI, Amsterdam +Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp + 2014-2016, CWI, Amsterdam Contact: astra@uantwerpen.be -Website: http://sf.net/projects/astra-toolbox +Website: http://www.astra-toolbox.com/ This file is part of the ASTRA Toolbox. @@ -23,7 +23,6 @@ You should have received a copy of the GNU General Public License along with the ASTRA Toolbox. If not, see . ----------------------------------------------------------------------- -$Id$ */ #ifndef _INC_ASTRA_FLOAT32PROJECTIONDATA3DGPU diff --git a/include/astra/Float32VolumeData3DGPU.h b/include/astra/Float32VolumeData3DGPU.h index 377ed75..ddeb469 100644 --- a/include/astra/Float32VolumeData3DGPU.h +++ b/include/astra/Float32VolumeData3DGPU.h @@ -1,10 +1,10 @@ /* ----------------------------------------------------------------------- -Copyright: 2010-2015, iMinds-Vision Lab, University of Antwerp - 2014-2015, CWI, Amsterdam +Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp + 2014-2016, CWI, Amsterdam Contact: astra@uantwerpen.be -Website: http://sf.net/projects/astra-toolbox +Website: http://www.astra-toolbox.com/ This file is part of the ASTRA Toolbox. @@ -23,7 +23,6 @@ You should have received a copy of the GNU General Public License along with the ASTRA Toolbox. If not, see . ----------------------------------------------------------------------- -$Id$ */ #ifndef _INC_ASTRA_FLOAT32VOLUMEDATA3DGPU -- cgit v1.2.3