|
Medical Imaging Interaction Toolkit
2026.06.00
Medical Imaging Interaction Toolkit
|
Internal container for image data used by mitk::Image. More...
#include <mitkImageDataItem.h>


Public Types | |
| typedef itk::SmartPointer< mitk::Image > | ImagePointer |
| Smart pointer to Image. More... | |
| typedef itk::SmartPointer< const mitk::Image > | ImageConstPointer |
| Smart pointer to const Image. More... | |
Public Member Functions | |
| 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. More... | |
| ~ImageDataItem () override | |
| Destructor. Frees managed memory and VTK resources. More... | |
| ImageDataItem (const mitk::ImageDescriptor::Pointer desc, int timestep, void *data, bool manageMemory) | |
| Construct a top-level data item from an image descriptor. More... | |
| 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. More... | |
| ImageDataItem (const ImageDataItem &other)=delete | |
| ImageDataItem & | operator= (const ImageDataItem &other)=delete |
| bool | IsComplete () const |
| Check whether all sub-items of this data item have been filled. More... | |
| void | SetComplete (bool complete) |
| Set the completion status of this data item. More... | |
| int | GetOffset () const |
| Get the byte offset of this item within its parent's buffer. More... | |
| PixelType | GetPixelType () const |
| Get the pixel type of this data item. More... | |
| void | SetTimestep (int t) |
| Set the time step index for this data item. More... | |
| void | SetManageMemory (bool b) |
| Set whether this item owns (and will delete) its data buffer. More... | |
| int | GetDimension () const |
| Get the number of spatial dimensions. More... | |
| int | GetDimension (int i) const |
| Get the size along a specific dimension. More... | |
| ImageDataItem::ConstPointer | GetParent () const |
| Get the parent data item, if any. More... | |
| ImageVtkReadAccessor * | GetVtkImageAccessor (ImageConstPointer iP) const |
| Get or create a VTK read accessor for this data item. More... | |
| ImageVtkWriteAccessor * | GetVtkImageAccessor (ImagePointer iP) |
| Get or create a VTK write accessor for this data item. More... | |
| bool | GetManageMemory () const |
| Query whether this item will delete its data buffer on destruction. More... | |
| virtual void | ConstructVtkImageData (ImageConstPointer iP) const |
| Build a vtkImageData representation from the raw pixel buffer. More... | |
| size_t | GetSize () const |
| Get the total size of this data item in bytes. More... | |
| virtual void | Modified () const |
| Mark the internal vtkImageData as modified. More... | |
Protected Member Functions | |
| void * | GetData () const |
Protected Attributes | |
| unsigned char * | m_Data |
| PixelType * | m_PixelType |
| bool | m_ManageMemory |
| vtkImageData * | m_VtkImageData |
| ImageVtkReadAccessor * | m_VtkImageReadAccessor |
| ImageVtkWriteAccessor * | m_VtkImageWriteAccessor |
| int | m_Offset |
| bool | m_IsComplete |
| size_t | m_Size |
Internal container for image data used by mitk::Image.
ImageDataItem manages raw pixel buffers and bridges between MITK's Image representation and VTK's vtkImageData. It is primarily used to represent sub-images (e.g. individual slices or volumes of a time series) inside mitk::Image.
This class is an implementation detail; it should not be used directly outside of mitk::Image and its accessor classes.
Definition at line 44 of file mitkImageDataItem.h.
| typedef itk::SmartPointer<const mitk::Image> mitk::ImageDataItem::ImageConstPointer |
Smart pointer to const Image.
Definition at line 60 of file mitkImageDataItem.h.
Smart pointer to Image.
Definition at line 59 of file mitkImageDataItem.h.
| mitk::ImageDataItem::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.
The child shares the parent's data buffer at the given offset.
| [in] | aParent | The parent ImageDataItem whose buffer is shared. |
| [in] | desc | Image descriptor providing dimension information. |
| [in] | timestep | Time step index associated with this item. |
| [in] | dimension | Number of dimensions for this sub-image. |
| [in] | data | Optional external data pointer. If non-null and different from the computed parent offset, data is memcpy'd. |
| [in] | manageMemory | If true and data is provided, the external buffer is deleted after copying. |
| [in] | offset | Byte offset into the parent's data buffer. |
|
override |
Destructor. Frees managed memory and VTK resources.
| mitk::ImageDataItem::ImageDataItem | ( | const mitk::ImageDescriptor::Pointer | desc, |
| int | timestep, | ||
| void * | data, | ||
| bool | manageMemory | ||
| ) |
Construct a top-level data item from an image descriptor.
Allocates a new data buffer if data is nullptr.
| [in] | desc | Image descriptor providing pixel type and dimensions. |
| [in] | timestep | Time step index associated with this item. |
| [in] | data | Optional external data buffer. |
| [in] | manageMemory | If true, the provided buffer will be deleted on destruction. |
| mitk::ImageDataItem::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.
Allocates a new data buffer if data is nullptr.
| [in] | type | The pixel type. |
| [in] | timestep | Time step index. |
| [in] | dimension | Number of spatial dimensions. |
| [in] | dimensions | Array of dimension sizes (must have at least dimension elements). |
| [in] | data | Optional external data buffer. |
| [in] | manageMemory | If true, the provided buffer will be deleted on destruction. |
|
delete |
|
virtual |
Build a vtkImageData representation from the raw pixel buffer.
Sets up dimensions, spacing, origin, and scalar arrays matching the pixel type and dimension information of this item.
| [in] | iP | Smart pointer to the owning Image (used for spacing). |
|
inlineprotected |
Helper function to allow friend classes to access m_Data without changing their code. Moved to protected visibility because only friends are allowed to access m_Data directly. Other classes should used ImageWriteAccessor::GetData() or ImageReadAccessor::GetData() to get access.
Definition at line 242 of file mitkImageDataItem.h.
|
inline |
Get the number of spatial dimensions.
Definition at line 164 of file mitkImageDataItem.h.
Referenced by mitk::ImagePixelAccessor< TPixel, VDimension >::CheckData(), and mitk::ImagePixelAccessor< TPixel, VDimension >::GetDimension().
|
inline |
Get the size along a specific dimension.
| [in] | i | The dimension index (0-based). |
i, or 0 if i >= GetDimension(). Definition at line 171 of file mitkImageDataItem.h.
|
inline |
Query whether this item will delete its data buffer on destruction.
Definition at line 211 of file mitkImageDataItem.h.
|
inline |
Get the byte offset of this item within its parent's buffer.
Definition at line 140 of file mitkImageDataItem.h.
|
inline |
Get the parent data item, if any.
Definition at line 186 of file mitkImageDataItem.h.
|
inline |
Get the pixel type of this data item.
Definition at line 146 of file mitkImageDataItem.h.
|
inline |
Get the total size of this data item in bytes.
Definition at line 227 of file mitkImageDataItem.h.
| ImageVtkReadAccessor* mitk::ImageDataItem::GetVtkImageAccessor | ( | ImageConstPointer | iP | ) | const |
Get or create a VTK read accessor for this data item.
If no vtkImageData has been constructed yet, one is created via ConstructVtkImageData(). For 3D images the VTK origin is set to (0, 0, 0) for historical compatibility (see MITK bug 5050).
| [in] | iP | Smart pointer to the owning Image (used for geometry queries). |
| ImageVtkWriteAccessor* mitk::ImageDataItem::GetVtkImageAccessor | ( | ImagePointer | iP | ) |
Get or create a VTK write accessor for this data item.
| [in] | iP | Smart pointer to the owning Image. |
|
inline |
Check whether all sub-items of this data item have been filled.
Definition at line 128 of file mitkImageDataItem.h.
| mitk::ImageDataItem::mitkClassMacroItkParent | ( | ImageDataItem | , |
| itk::LightObject | |||
| ) |
|
virtual |
Mark the internal vtkImageData as modified.
Call this after changing the raw data buffer so that VTK pipelines recognize the update.
|
delete |
|
inline |
Set the completion status of this data item.
| [in] | complete | True if all data has been loaded. |
Definition at line 134 of file mitkImageDataItem.h.
|
inline |
Set whether this item owns (and will delete) its data buffer.
| [in] | b | True if this item should manage the memory. |
Definition at line 158 of file mitkImageDataItem.h.
|
inline |
Set the time step index for this data item.
| [in] | t | The time step index. |
Definition at line 152 of file mitkImageDataItem.h.
|
protected |
Definition at line 244 of file mitkImageDataItem.h.
|
protected |
Definition at line 255 of file mitkImageDataItem.h.
|
protected |
Definition at line 248 of file mitkImageDataItem.h.
|
protected |
Definition at line 253 of file mitkImageDataItem.h.
|
protected |
Definition at line 246 of file mitkImageDataItem.h.
|
protected |
Definition at line 257 of file mitkImageDataItem.h.
|
mutableprotected |
Definition at line 250 of file mitkImageDataItem.h.
|
mutableprotected |
Definition at line 251 of file mitkImageDataItem.h.
|
protected |
Definition at line 252 of file mitkImageDataItem.h.