17 #ifndef MITKIMAGEPIXELREADACCESSOR_H
18 #define MITKIMAGEPIXELREADACCESSOR_H
35 template <
class TPixel,
unsigned int VDimension = 3>
60 :
ImagePixelAccessor<TPixel, VDimension>(iP, iDI), m_ReadAccessor(iP, iDI, OptionFlags)
67 :
ImagePixelAccessor<TPixel, VDimension>(iP.GetPointer(), iDI), m_ReadAccessor(iP, iDI, OptionFlags)
81 :
ImagePixelAccessor<TPixel, VDimension>(iP, iDI), m_ReadAccessor(iP, iDI, OptionFlags)
96 int nrComponents)
const
115 mitkThrow() <<
"ImageAccessor Overflow: image access exceeds the requested image area at " << idx <<
".";
118 return *targetAddress;
144 for (
int i = 0; i < 3; ++i)
145 itk4Index[i] = itkIndex[i];
147 itk4Index[3] = timestep;
167 template <
class TPixel>
181 #endif // MITKIMAGEPIXELREADACCESSOR_H
mitk::ScalarType FastSinglePixelAccess(mitk::PixelType, mitk::Image::Pointer im, ImageDataItem *item, itk::Index< 3 > idx, mitk::ScalarType &val, int component=0)
virtual const Image * GetImage() const override
ImagePixelReadAccessor(Image *iP, const ImageDataItem *iDI=nullptr, int OptionFlags=ImageAccessorBase::DefaultBehavior)
const TPixel & GetPixelByIndexSafe(const itk::Index< VDimension > &idx) const
Gives locked and index-based read access for a particular image part. The class provides several set-...
const TPixel & GetPixelByIndex(const itk::Index< VDimension > &idx) const
ImagePixelReadAccessor(ImagePointer iP, const ImageDataItem *iDI=nullptr, int OptionFlags=ImageAccessorBase::DefaultBehavior)
Provides templated image access for all inheriting classes.
DataCollection - Class to facilitate loading/accessing structured data.
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...
itk::VariableLengthVector< TPixel > GetConsecutivePixelsAsVector(const itk::Index< VDimension > &idx, int nrComponents) const
itk::SmartPointer< mitk::Image > ImagePointer
itk::SmartPointer< const mitk::Image > ImageConstPointer
Image class for storing images.
ImagePixelAccessor< TPixel, VDimension > ImagePixelAccessorType
const mitk::PixelType GetPixelType(int n=0) const
Returns the PixelType of channel n.
const TPixel & GetPixelByWorldCoordinates(mitk::Point3D position, unsigned int timestep)
const TPixel * GetData() const
Gives const access to the data.
ImagePixelReadAccessor(ImageConstPointer iP, const ImageDataItem *iDI=nullptr, int OptionFlags=ImageAccessorBase::DefaultBehavior)
Instantiates a mitk::ImageReadAccessor (see its doxygen page for more details)
ImagePixelReadAccessor(const Image *iP, const ImageDataItem *iDI=nullptr, int OptionFlags=ImageAccessorBase::DefaultBehavior)
unsigned int GetOffset(const IndexType &idx) const
vcl_size_t GetNumberOfComponents() const
Get the number of components of which each element consists.
Internal class for managing references on sub-images.
ImageReadAccessor class to get locked read access for a particular image part.
mitk::BaseGeometry * GetGeometry(int t=0) const
Return the geometry, which is a TimeGeometry, of the data as non-const pointer.
Class for defining the data type of pixels.
virtual ~ImagePixelReadAccessor()
const TPixel & GetPixelByWorldCoordinates(mitk::Point3D position)
void WorldToIndex(const mitk::Point3D &pt_mm, mitk::Point3D &pt_units) const
Convert world coordinates (in mm) of a point to (continuous!) index coordinates.