From 01e94c82d907b8d6aa155affc01160396e794b31 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Tue, 22 Apr 2014 14:16:06 +0000 Subject: Add mxarray/link functionality for 3d volumes --- include/astra/Float32Data3DMemory.h | 22 ++++++++++++++++++++++ include/astra/Float32ProjectionData3DMemory.h | 27 +++++++++++++++++++++++++++ include/astra/Float32VolumeData3DMemory.h | 25 +++++++++++++++++++++++++ 3 files changed, 74 insertions(+) (limited to 'include/astra') diff --git a/include/astra/Float32Data3DMemory.h b/include/astra/Float32Data3DMemory.h index 3a445b6..f72e0ee 100644 --- a/include/astra/Float32Data3DMemory.h +++ b/include/astra/Float32Data3DMemory.h @@ -147,6 +147,25 @@ protected: */ bool _initialize(int _iWidth, int _iHeight, int _iDepth, float32 _fScalar); + /** Initialization. Initializes an instance of the CFloat32Data3DMemory class with pre-allocated memory. + * Can only be called by derived classes. + * + * Initializes an instance of the CFloat32Data3DMemory 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. + * If the object has been initialized before, the + * 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 _pCustomMemory the custom memory handle + */ + + bool _initialize(int _iWidth, int _iHeight, int _iDepth, CFloat32CustomMemory* _pCustomMemory); + public: /** Default constructor. Sets all numeric member variables to 0 and all pointer member variables to NULL. @@ -270,6 +289,9 @@ public: * @return l-value */ virtual CFloat32Data3D& clampMax(float32& _fMax); + +private: + CFloat32CustomMemory* m_pCustomMemory; }; diff --git a/include/astra/Float32ProjectionData3DMemory.h b/include/astra/Float32ProjectionData3DMemory.h index 8b61d45..fb54425 100644 --- a/include/astra/Float32ProjectionData3DMemory.h +++ b/include/astra/Float32ProjectionData3DMemory.h @@ -98,6 +98,19 @@ public: */ CFloat32ProjectionData3DMemory(CProjectionGeometry3D* _pGeometry, float32 _fScalar); + /** Constructor. Create an instance of the CFloat32ProjectionData3DMemory class with pre-allocated memory. + * + * Creates an instance of the CFloat32ProjectionData3DMemory 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 + * + */ + CFloat32ProjectionData3DMemory(CProjectionGeometry3D* _pGeometry, CFloat32CustomMemory* _pCustomMemory); + /** * Destructor. */ @@ -140,6 +153,20 @@ public: */ bool initialize(CProjectionGeometry3D* _pGeometry, const float32* _pfData); + /** Initialization. Initializes an instance of the CFloat32ProjectionData3DMemory 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(CProjectionGeometry3D* _pGeometry, CFloat32CustomMemory* _pCustomMemory); + + + /** 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'. * diff --git a/include/astra/Float32VolumeData3DMemory.h b/include/astra/Float32VolumeData3DMemory.h index 51df93e..b3f3891 100644 --- a/include/astra/Float32VolumeData3DMemory.h +++ b/include/astra/Float32VolumeData3DMemory.h @@ -84,6 +84,19 @@ public: */ CFloat32VolumeData3DMemory(CVolumeGeometry3D* _pGeometry, float32 _fScalar); + /** Constructor. Create an instance of the CFloat32VolumeData3DMemory class with pre-allocated memory. + * + * Creates an instance of the CFloat32VolumeData3DMemory 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 + * + */ + CFloat32VolumeData3DMemory(CVolumeGeometry3D* _pGeometry, CFloat32CustomMemory* _pCustomMemory); + /** Destructor. */ virtual ~CFloat32VolumeData3DMemory(); @@ -122,6 +135,18 @@ public: */ bool initialize(CVolumeGeometry3D* _pGeometry, float32 _fScalar); + /** Initialization. Initializes an instance of the CFloat32VolumeData3DMemory 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(CVolumeGeometry3D* _pGeometry, CFloat32CustomMemory* _pCustomMemory); + /** Which type is this class? * * @return DataType: VOLUME -- cgit v1.2.3