13 #ifndef mitkImagePixelAccessor_h
14 #define mitkImagePixelAccessor_h
33 template <
class TPixel,
unsigned int VDimension = 3>
87 mitkThrow() <<
"Invalid ImageAccessor: The Dimensions of ImageAccessor and Image are not equal."
88 <<
" They have to be equal if an entire image is requested."
89 <<
" image->GetDimension(): " << image->
GetDimension() <<
" , VDimension: " << VDimension;
96 mitkThrow() <<
"Invalid ImageAccessor: The Dimensions of ImageAccessor and ImageDataItem are not equal."
106 mitkThrow() <<
"Invalid ImageAccessor: PixelTypes of Image and ImageAccessor are not equal."
107 <<
" image->GetPixelType(): " <<
typeid(image->
GetPixelType()).name()
109 <<
" , VDimension: " << VDimension
110 <<
" , TPixel: " <<
typeid(TPixel).name()
146 unsigned int offset = 0;
150 offset += idx[3] * imageDims[0] * imageDims[1] * imageDims[2];
153 offset += idx[2] * imageDims[0] * imageDims[1];
156 offset += idx[0] + idx[1] * imageDims[0];
Internal container for image data used by mitk::Image.
int GetDimension() const
Get the number of spatial dimensions.
Provides templated image access for all inheriting classes.
ImagePixelAccessor(ImageConstPointer iP, const mitk::ImageDataItem *iDI)
Construct the accessor from an image and an optional ImageDataItem.
int GetDimension(int i) const
Get the size of the specified dimension from the underlying ImageDataItem.
virtual ~ImagePixelAccessor()
Destructor.
unsigned int GetOffset(const IndexType &idx) const
Compute the linear memory offset for a given multi-dimensional image index.
int m_Options
Stores all extended properties of an ImageAccessor. The different flags in mitk::ImageAccessorBase::O...
itk::Index< VDimension > IndexType
void CheckData(const Image *image)
Validate that the accessor dimensions and pixel type match the image.
itk::ImageRegion< VDimension > * m_SubRegion
A Subregion defines an arbitrary area within the image. If no SubRegion is defined,...
BaseGeometry::Pointer m_Geometry
Pointer to the used Geometry. Since Geometry can be different to the Image (if memory was forced to b...
const ImageDataItem * m_ImageDataItem
Holds the specified ImageDataItem for pixel data access.
Image::ConstPointer ImageConstPointer
ImagePixelAccessor< TPixel, VDimension > ImagePixelAccessorType
Image class for storing multi-dimensional medical image data.
unsigned int GetDimension() const
Get the number of dimensions of the image.
const mitk::PixelType GetPixelType(int n=0) const
Returns the PixelType of channel n.
size_t GetNumberOfComponents() const
Get the number of components per pixel.
#define mitkThrow()
Throw a generic mitk::Exception with source location information.
Find image slices visible on a given plane.
MITKCORE_EXPORT mitk::PixelType MakePixelType(vtkImageData *vtkimagedata)
Deduce and create a PixelType from a vtkImageData object.