13 #ifndef mitkImageDataItem_h
14 #define mitkImageDataItem_h
25 class ImageVtkReadAccessor;
26 class ImageVtkWriteAccessor;
50 template <
class TPixel,
unsigned int VDimension>
80 const mitk::ImageDescriptor::Pointer desc,
82 unsigned int dimension,
84 bool manageMemory =
false,
100 ImageDataItem(
const mitk::ImageDescriptor::Pointer desc,
int timestep,
void *data,
bool manageMemory);
116 unsigned int dimension,
117 unsigned int *dimensions,
176 if (i < (
int)m_Dimension)
177 returnValue = m_Dimensions[i];
186 ImageDataItem::ConstPointer
GetParent()
const {
return m_Parent; }
260 void ComputeItemSize(
const unsigned int *dimensions,
unsigned int dimension);
262 ImageDataItem::ConstPointer m_Parent;
264 unsigned int m_Dimension;
Internal container for image data used by mitk::Image.
ImageVtkWriteAccessor * GetVtkImageAccessor(ImagePointer iP)
Get or create a VTK write accessor for this data item.
~ImageDataItem() override
Destructor. Frees managed memory and VTK resources.
int GetDimension() const
Get the number of spatial dimensions.
vtkImageData * m_VtkImageData
itk::SmartPointer< mitk::Image > ImagePointer
Smart pointer to Image.
bool GetManageMemory() const
Query whether this item will delete its data buffer on destruction.
ImageDataItem(const ImageDataItem &other)=delete
void SetComplete(bool complete)
Set the completion status of this data item.
ImageDataItem(const mitk::PixelType &type, int timestep, unsigned int dimension, unsigned int *dimensions, void *data, bool manageMemory)
Construct a data item from explicit pixel type and dimension information.
virtual void ConstructVtkImageData(ImageConstPointer iP) const
Build a vtkImageData representation from the raw pixel buffer.
int GetOffset() const
Get the byte offset of this item within its parent's buffer.
void SetManageMemory(bool b)
Set whether this item owns (and will delete) its data buffer.
int GetDimension(int i) const
Get the size along a specific dimension.
bool IsComplete() const
Check whether all sub-items of this data item have been filled.
ImageDataItem::ConstPointer GetParent() const
Get the parent data item, if any.
PixelType GetPixelType() const
Get the pixel type of this data item.
size_t GetSize() const
Get the total size of this data item in bytes.
ImageDataItem & operator=(const ImageDataItem &other)=delete
mitkClassMacroItkParent(ImageDataItem, itk::LightObject)
ImageDataItem(const ImageDataItem &aParent, const mitk::ImageDescriptor::Pointer desc, int timestep, unsigned int dimension, void *data=nullptr, bool manageMemory=false, size_t offset=0)
Construct a sub-image data item as a child of an existing item.
ImageVtkReadAccessor * m_VtkImageReadAccessor
ImageDataItem(const mitk::ImageDescriptor::Pointer desc, int timestep, void *data, bool manageMemory)
Construct a top-level data item from an image descriptor.
itk::SmartPointer< const mitk::Image > ImageConstPointer
Smart pointer to const Image.
void SetTimestep(int t)
Set the time step index for this data item.
ImageVtkReadAccessor * GetVtkImageAccessor(ImageConstPointer iP) const
Get or create a VTK read accessor for this data item.
ImageVtkWriteAccessor * m_VtkImageWriteAccessor
virtual void Modified() const
Mark the internal vtkImageData as modified.
Provides templated image access for all inheriting classes.
Provides locked read-only access to a particular region of image data.
Provides read access to image data in the form required by VTK methods.
Provides write access to image data in the form required by VTK methods.
Provides locked write access to a particular region of image data.
Image class for storing multi-dimensional medical image data.
Describes the data type of image pixels.
#define MAX_IMAGE_DIMENSIONS
Maximum number of dimensions supported per image channel.
Find image slices visible on a given plane.