87template <
typename TPixel,
unsigned int VImageDimension = 2>
91 ITK_DISALLOW_COPY_AND_MOVE(
Image);
104 itkOverrideGetNameOfClassMacro(
Image);
131 using typename Superclass::ImageDimensionType;
138 using typename Superclass::OffsetType;
156 using typename Superclass::SpacingType;
157 using typename Superclass::SpacingValueType;
176 template <
typename UPixelType,
unsigned int VUImageDimension = VImageDimension>
183 template <
typename UPixelType,
unsigned int VUImageDimension = VImageDimension>
211 (*m_Buffer)[offset] = value;
222 return ((*m_Buffer)[offset]);
233 return ((*m_Buffer)[offset]);
253 return m_Buffer ? m_Buffer->GetBufferPointer() :
nullptr;
255 virtual const TPixel *
258 return m_Buffer ? m_Buffer->GetBufferPointer() :
nullptr;
266 return m_Buffer.GetPointer();
269 const PixelContainer *
272 return m_Buffer.GetPointer();
308 NeighborhoodAccessorFunctorType
315 const NeighborhoodAccessorFunctorType
329 template <
typename TEqualityComparable>
330 friend std::enable_if_t<std::is_same_v<TEqualityComparable, TPixel>,
bool>
354 const auto bufferSize = lhsBuffer.Size();
356 if (bufferSize != rhsBuffer.Size())
361 const TEqualityComparable *
const lhsBufferPointer = lhsBuffer.GetBufferPointer();
362 const TEqualityComparable *
const rhsBufferPointer = rhsBuffer.GetBufferPointer();
364 return ((lhsBufferPointer == rhsBufferPointer) ||
365 std::equal(lhsBufferPointer, lhsBufferPointer + bufferSize, rhsBufferPointer));
369 template <
typename TEqualityComparable>
370 friend std::enable_if_t<std::is_same_v<TEqualityComparable, TPixel>,
bool>
374 return !(lhs == rhs);
393 using Superclass::Graft;
401#ifndef ITK_MANUAL_INSTANTIATION
402# include "itkImage.hxx"
Base class for all data objects in ITK.
Provides a common API for pixel accessors for Image and VectorImage.
Give access to partial aspects a type.
Base class for templated image classes.
virtual const RegionType & GetBufferedRegion() const
DirectionType m_Direction
typename OffsetType::OffsetValueType OffsetValueType
DirectionType m_InverseDirection
Templated n-dimensional image class.
void PrintSelf(std::ostream &os, Indent indent) const override
const AccessorType GetPixelAccessor() const
PixelContainerPointer m_Buffer
unsigned int GetNumberOfComponentsPerPixel() const override
AccessorType GetPixelAccessor()
friend std::enable_if_t< std::is_same_v< TEqualityComparable, TPixel >, bool > operator==(const Image< TEqualityComparable, VImageDimension > &lhs, const Image< TEqualityComparable, VImageDimension > &rhs)
virtual void Graft(const Self *image)
const PixelContainer * GetPixelContainer() const
friend std::enable_if_t< std::is_same_v< TEqualityComparable, TPixel >, bool > operator!=(const Image< TEqualityComparable, VImageDimension > &lhs, const Image< TEqualityComparable, VImageDimension > &rhs)
const TPixel & operator[](const IndexType &index) const
Access a pixel. This version can only be an rvalue.
void SetPixel(const IndexType &index, const TPixel &value)
Set a pixel value.
TPixel & GetPixel(const IndexType &index)
Get a reference to a pixel (e.g. for editing).
virtual const TPixel * GetBufferPointer() const
virtual TPixel * GetBufferPointer()
void Graft(const DataObject *data) override
void SetPixelContainer(PixelContainer *container)
typename PixelContainer::ConstPointer PixelContainerConstPointer
const NeighborhoodAccessorFunctorType GetNeighborhoodAccessor() const
void Allocate(bool initializePixels=false) override
void FillBuffer(const TPixel &value)
typename PixelContainer::Pointer PixelContainerPointer
NeighborhoodAccessorFunctorType GetNeighborhoodAccessor()
void Initialize() override
~Image() override=default
PixelContainer * GetPixelContainer()
const TPixel & GetPixel(const IndexType &index) const
Get a pixel (read only version).
void ComputeIndexToPhysicalPointMatrices() override
TPixel & operator[](const IndexType &index)
Access a pixel. This version can be an lvalue.
Defines an itk::Image front-end to a standard C-array.
Control indentation during Print() invocation.
Provides accessor interfaces to Get pixels and is meant to be used on pointers contained within Neigh...
Base class for most ITK classes.
Implements a weak reference to an object.
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
ImageBaseType::DirectionType DirectionType
ImageBaseType::RegionType RegionType
ImageBaseType::IndexType IndexType
ImageBaseType::PointType PointType
ImageBaseType::SizeType SizeType
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned long SizeValueType