Medical Imaging Interaction Toolkit
2024.06.00
Medical Imaging Interaction Toolkit
|
Go to the documentation of this file.
13 #ifndef mitkImagePixelWriteAccessor_h
14 #define mitkImagePixelWriteAccessor_h
29 template <
class TPixel,
unsigned int VDimension = 3>
57 :
ImagePixelAccessor<TPixel, VDimension>(iP.GetPointer(), iDI), m_WriteAccessor(iP, iDI, OptionFlags)
76 TPixel *targetAddress = ((TPixel *)m_WriteAccessor.
m_AddressBegin) + offset;
80 *targetAddress = value;
87 mitkThrow() <<
"ImageAccessor Overflow: image access exceeds the requested image area at " << idx <<
".";
106 TPixel *targetAddress = ((TPixel *)m_WriteAccessor.
m_AddressBegin) + offset;
110 mitkThrow() <<
"ImageAccessor Overflow: image access exceeds the requested image area at " << idx <<
".";
113 return *targetAddress;
121 itk::Index<3> itkIndex;
virtual TPixel * GetData() const
Gives full data access.
const Image * GetImage() const override
unsigned int GetOffset(const IndexType &idx) const
ImageWriteAccessor class to get locked write-access for a particular image part.
Internal class for managing references on sub-images.
void SetPixelByIndex(const itk::Index< VDimension > &idx, const TPixel &value)
Sets a pixel value at given index.
Image class for storing images.
const TPixel & GetPixelByIndexSafe(const itk::Index< VDimension > &idx) const
ImagePixelWriteAccessor(ImagePointer iP, const ImageDataItem *iDI=nullptr, int OptionFlags=ImageAccessorBase::DefaultBehavior)
Instantiates a mitk::ImageWriteAccessor (see its doxygen page for more details)
void SetPixelByWorldCoordinates(const mitk::Point3D &, const TPixel &value, unsigned int timestep=0)
Find image slices visible on a given plane.
itk::SmartPointer< mitk::Image > ImagePointer
Provides templated image access for all inheriting classes.
void SetPixelByIndexSafe(const itk::Index< VDimension > &idx, const TPixel &value)
Gives locked and index-based write access for a particular image part. The class provides several set...
const TPixel & GetPixelByWorldCoordinates(mitk::Point3D position)
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.
ImagePixelAccessor< TPixel, VDimension > ImagePixelAccessorType
const TPixel & GetPixelByIndex(const itk::Index< VDimension > &idx) const
~ImagePixelWriteAccessor() override