Medical Imaging Interaction Toolkit
2024.12.99-0da743f6
Medical Imaging Interaction Toolkit
|
Go to the documentation of this file.
13 #ifndef mitkImagePixelReadAccessor_h
14 #define mitkImagePixelReadAccessor_h
31 template <
class TPixel,
unsigned int VDimension = 3>
56 :
ImagePixelAccessor<TPixel, VDimension>(iP, iDI), m_ReadAccessor(iP, iDI, OptionFlags)
63 :
ImagePixelAccessor<TPixel, VDimension>(iP.GetPointer(), iDI), m_ReadAccessor(iP, iDI, OptionFlags)
77 :
ImagePixelAccessor<TPixel, VDimension>(iP, iDI), m_ReadAccessor(iP, iDI, OptionFlags)
92 int nrComponents)
const
107 TPixel *targetAddress = ((TPixel *)m_ReadAccessor.
m_AddressBegin) + offset;
111 mitkThrow() <<
"ImageAccessor Overflow: image access exceeds the requested image area at " << idx <<
".";
114 return *targetAddress;
122 itk::Index<3> itkIndex;
133 itk::Index<3> itkIndex;
139 itk::Index<4> itk4Index;
140 for (
int i = 0; i < 3; ++i)
141 itk4Index[i] = itkIndex[i];
143 itk4Index[3] = timestep;
163 template <
class TPixel>
177 template <
class TPixel>
itk::SmartPointer< mitk::Image > ImagePointer
itk::SmartPointer< const mitk::Image > ImageConstPointer
unsigned int GetOffset(const IndexType &idx) const
Internal class for managing references on sub-images.
const TPixel * GetData() const
Gives const access to the data.
const TPixel & GetPixelByWorldCoordinates(mitk::Point3D position, unsigned int timestep)
Image class for storing images.
const Image * GetImage() const override
ImagePixelAccessor< TPixel, VDimension > ImagePixelAccessorType
mitk::ScalarType FastSinglePixelAccess(mitk::PixelType, mitk::Image::Pointer im, ImageDataItem *item, itk::Index< 3 > idx, mitk::ScalarType &val, int component=0)
size_t GetNumberOfComponents() const
Get the number of components of which each element consists.
Gives locked and index-based read access for a particular image part. The class provides several set-...
ImagePixelReadAccessor(const Image *iP, const ImageDataItem *iDI=nullptr, int OptionFlags=ImageAccessorBase::DefaultBehavior)
Find image slices visible on a given plane.
ImageReadAccessor class to get locked read access for a particular image part.
const mitk::PixelType GetPixelType(int n=0) const
Returns the PixelType of channel n.
ImagePixelReadAccessor(ImagePointer iP, const ImageDataItem *iDI=nullptr, int OptionFlags=ImageAccessorBase::DefaultBehavior)
const TPixel & GetPixelByIndex(const itk::Index< VDimension > &idx) const
const TPixel & GetPixelByWorldCoordinates(mitk::Point3D position)
~ImagePixelReadAccessor() override
unsigned int GetTimeSteps() const
Get the number of time steps from the TimeGeometry As the base data has not a data vector given by it...
Provides templated image access for all inheriting classes.
Class for defining the data type of pixels.
ImagePixelReadAccessor(Image *iP, const ImageDataItem *iDI=nullptr, int OptionFlags=ImageAccessorBase::DefaultBehavior)
itk::VariableLengthVector< TPixel > GetConsecutivePixelsAsVector(const itk::Index< VDimension > &idx, int nrComponents) const
mitk::BaseGeometry * GetGeometry(int t=0) const
Return the geometry, which is a TimeGeometry, of the data as non-const pointer.
void WorldToIndex(const mitk::Point3D &pt_mm, mitk::Point3D &pt_units) const
Convert world coordinates (in mm) of a point to (continuous!) index coordinates.
const TPixel & GetPixelByIndexSafe(const itk::Index< VDimension > &idx) const
ImagePixelReadAccessor(ImageConstPointer iP, const ImageDataItem *iDI=nullptr, int OptionFlags=ImageAccessorBase::DefaultBehavior)
Instantiates a mitk::ImageReadAccessor (see its doxygen page for more details)