13 #ifndef MITKIMAGEPIXELACCESSOR_H 14 #define MITKIMAGEPIXELACCESSOR_H 29 template <
class TPixel,
unsigned int VDimension = 3>
64 mitkThrow() <<
"Invalid ImageAccessor: The Dimensions of ImageAccessor and Image are not equal." 65 <<
" They have to be equal if an entire image is requested." 66 <<
" image->GetDimension(): " << image->
GetDimension() <<
" , VDimension: " << VDimension;
73 mitkThrow() <<
"Invalid ImageAccessor: The Dimensions of ImageAccessor and ImageDataItem are not equal." 78 if (!( image->
GetPixelType() == mitk::MakePixelType< itk::Image< TPixel, VDimension > >() ||
79 image->
GetPixelType() == mitk::MakePixelType< itk::VectorImage< TPixel, VDimension > >
83 mitkThrow() <<
"Invalid ImageAccessor: PixelTypes of Image and ImageAccessor are not equal." 84 <<
" image->GetPixelType(): " <<
typeid(image->
GetPixelType()).name()
86 <<
" , VDimension: " << VDimension
87 <<
" , TPixel: " <<
typeid(TPixel).name()
116 const unsigned int *imageDims = m_ImageDataItem->m_Dimensions;
122 offset += idx[3] * imageDims[0] * imageDims[1] * imageDims[2];
125 offset += idx[2] * imageDims[0] * imageDims[1];
128 offset += idx[0] + idx[1] * imageDims[0];
138 #endif // MITKIMAGEACCESSOR_H
ImagePixelAccessor< TPixel, VDimension > ImagePixelAccessorType
const mitk::PixelType GetPixelType(int n=0) const
Returns the PixelType of channel n.
vcl_size_t GetNumberOfComponents() const
Get the number of components of which each element consists.
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...
unsigned int GetDimension() const
Get dimension of the image.
itk::Index< VDimension > IndexType
Image class for storing images.
unsigned int GetOffset(const IndexType &idx) const
void CheckData(const Image *image)
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.
mitk::Image::Pointer image
Image::ConstPointer ImageConstPointer
const ImageDataItem * m_ImageDataItem
int GetDimension(int i) const
virtual ~ImagePixelAccessor()
Internal class for managing references on sub-images.
ImagePixelAccessor(ImageConstPointer iP, const mitk::ImageDataItem *iDI)