17 #ifndef MITKIMAGEPIXELACCESSOR_H
18 #define MITKIMAGEPIXELACCESSOR_H
31 template <
class TPixel,
unsigned int VDimension = 3>
63 mitkThrow() <<
"Invalid ImageAccessor: The Dimensions of ImageAccessor and Image are not equal. They have to "
64 "be equal if an entire image is requested";
71 mitkThrow() <<
"Invalid ImageAccessor: The Dimensions of ImageAccessor and ImageDataItem are not equal.";
76 if (!(image->
GetPixelType() == mitk::MakePixelType<itk::Image<TPixel, VDimension>>() ||
80 mitkThrow() <<
"Invalid ImageAccessor: PixelTypes of Image and ImageAccessor are not equal";
111 const unsigned int *imageDims = m_ImageDataItem->m_Dimensions;
117 offset += idx[3] * imageDims[0] * imageDims[1] * imageDims[2];
119 offset += idx[2] * imageDims[0] * imageDims[1];
121 offset += idx[0] + idx[1] * imageDims[0];
129 #endif // MITKIMAGEACCESSOR_H
ImagePixelAccessor< TPixel, VDimension > ImagePixelAccessorType
int m_Options
Stores all extended properties of an ImageAccessor. The different flags in mitk::ImageAccessorBase::O...
Provides templated image access for all inheriting classes.
DataCollection - Class to facilitate loading/accessing structured data.
BaseGeometry::Pointer m_Geometry
Pointer to the used Geometry. Since Geometry can be different to the Image (if memory was forced to b...
itk::Index< VDimension > IndexType
Image class for storing images.
void CheckData(const Image *image)
const mitk::PixelType GetPixelType(int n=0) const
Returns the PixelType of channel n.
itk::ImageRegion< VDimension > * m_SubRegion
A Subregion defines an arbitrary area within the image. If no SubRegion is defined, the whole ImageDataItem or Image is regarded. A subregion (e.g. subvolume) can lead to non-coherent memory access where every dimension has a start- and end-offset.
int GetDimension(int i) const
Image::ConstPointer ImageConstPointer
const ImageDataItem * m_ImageDataItem
unsigned int GetOffset(const IndexType &idx) const
vcl_size_t GetNumberOfComponents() const
Get the number of components of which each element consists.
virtual ~ImagePixelAccessor()
Internal class for managing references on sub-images.
unsigned int GetDimension() const
Get dimension of the image.
ImagePixelAccessor(ImageConstPointer iP, const mitk::ImageDataItem *iDI)