|
ITK
6.0.0
Insight Toolkit
|
Go to the documentation of this file.
30 #include <type_traits>
87 template <
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>
190 Allocate(
bool initializePixels =
false)
override;
195 Initialize()
override;
200 FillBuffer(
const TPixel & value);
211 (*m_Buffer)[offset] = value;
222 return ((*m_Buffer)[offset]);
233 return ((*m_Buffer)[offset]);
243 return this->GetPixel(index);
253 return this->GetPixel(index);
261 return m_Buffer ? m_Buffer->GetBufferPointer() :
nullptr;
263 virtual const TPixel *
266 return m_Buffer ? m_Buffer->GetBufferPointer() :
nullptr;
274 return m_Buffer.GetPointer();
277 const PixelContainer *
280 return m_Buffer.GetPointer();
286 SetPixelContainer(PixelContainer * container);
299 Graft(
const Self * image);
316 NeighborhoodAccessorFunctorType
323 const NeighborhoodAccessorFunctorType
330 GetNumberOfComponentsPerPixel()
const override;
337 template <
typename TEqualityComparable>
338 friend std::enable_if_t<std::is_same_v<TEqualityComparable, TPixel>,
bool>
362 const auto bufferSize = lhsBuffer.Size();
364 if (bufferSize != rhsBuffer.Size())
369 const TEqualityComparable *
const lhsBufferPointer = lhsBuffer.GetBufferPointer();
370 const TEqualityComparable *
const rhsBufferPointer = rhsBuffer.GetBufferPointer();
372 return ((lhsBufferPointer == rhsBufferPointer) ||
373 std::equal(lhsBufferPointer, lhsBufferPointer + bufferSize, rhsBufferPointer));
377 template <
typename TEqualityComparable>
378 friend std::enable_if_t<std::is_same_v<TEqualityComparable, TPixel>,
bool>
382 return !(lhs == rhs);
388 PrintSelf(std::ostream & os,
Indent indent)
const override;
392 ~
Image()
override =
default;
400 ComputeIndexToPhysicalPointMatrices()
override;
401 using Superclass::Graft;
409 #ifndef ITK_MANUAL_INSTANTIATION
410 # include "itkImage.hxx"
typename OffsetType::OffsetValueType OffsetValueType
SmartPointer< Self > Pointer
NeighborhoodAccessorFunctorType GetNeighborhoodAccessor()
virtual const RegionType & GetBufferedRegion() const
const AccessorType GetPixelAccessor() const
SmartPointer< const Self > ConstPointer
ImageBaseType::DirectionType DirectionType
PixelContainerPointer m_Buffer
Base class for templated image classes.
ImageBaseType::PointType PointType
const TPixel & GetPixel(const IndexType &index) const
Get a pixel (read only version).
ImageBaseType::SizeType SizeType
friend std::enable_if_t< std::is_same_v< TEqualityComparable, TPixel >, bool > operator!=(const Image< TEqualityComparable, VImageDimension > &lhs, const Image< TEqualityComparable, VImageDimension > &rhs)
Give access to partial aspects a type.
Control indentation during Print() invocation.
virtual const TPixel * GetBufferPointer() const
Provides accessor interfaces to Get pixels and is meant to be used on pointers contained within Neigh...
friend std::enable_if_t< std::is_same_v< TEqualityComparable, TPixel >, bool > operator==(const Image< TEqualityComparable, VImageDimension > &lhs, const Image< TEqualityComparable, VImageDimension > &rhs)
AccessorType GetPixelAccessor()
ImageBaseType::IndexType IndexType
Provides a common API for pixel accessors for Image and VectorImage.
ImageBaseType::RegionType RegionType
void SetPixel(const IndexType &index, const TPixel &value)
Set a pixel value.
TNode * InternalPixelType
TPixel & GetPixel(const IndexType &index)
Get a reference to a pixel (e.g. for editing).
Defines an itk::Image front-end to a standard C-array.
Implements a weak reference to an object.
const PixelContainer * GetPixelContainer() const
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
typename PixelContainer::ConstPointer PixelContainerConstPointer
const TPixel & operator[](const IndexType &index) const
Access a pixel. This version can only be an rvalue.
const NeighborhoodAccessorFunctorType GetNeighborhoodAccessor() const
Base class for most ITK classes.
Templated n-dimensional image class.
virtual TPixel * GetBufferPointer()
TPixel & operator[](const IndexType &index)
Access a pixel. This version can be an lvalue.
typename PixelContainer::Pointer PixelContainerPointer
PixelContainer * GetPixelContainer()
DirectionType m_InverseDirection
DirectionType m_Direction
unsigned long SizeValueType
Base class for all data objects in ITK.