|
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]);
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();
278 SetPixelContainer(PixelContainer * container);
291 Graft(
const Self * image);
308 NeighborhoodAccessorFunctorType
315 const NeighborhoodAccessorFunctorType
322 GetNumberOfComponentsPerPixel()
const override;
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);
380 PrintSelf(std::ostream & os,
Indent indent)
const override;
384 ~
Image()
override =
default;
392 ComputeIndexToPhysicalPointMatrices()
override;
393 using Superclass::Graft;
401 #ifndef ITK_MANUAL_INSTANTIATION
402 # 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.