18 #ifndef itkVectorImage_h
19 #define itkVectorImage_h
80 template<
typename TPixel,
unsigned int VImageDimension = 3 >
81 class ITK_TEMPLATE_EXPORT VectorImage:
85 ITK_DISALLOW_COPY_AND_ASSIGN(VectorImage);
132 static constexpr
unsigned int ImageDimension = VImageDimension;
187 template <
typename UPixelType,
unsigned int NUImageDimension = VImageDimension>
194 template <
typename UElementType,
unsigned int NUImageDimension>
201 template <
typename UPixelType,
unsigned int NUImageDimension = VImageDimension>
206 void Allocate(
bool UseDefaultConstructor =
false)
override;
210 void Initialize()
override;
214 void FillBuffer(
const PixelType & value);
223 OffsetValueType offset = m_VectorLength * this->FastComputeOffset(index);
227 ( *m_Buffer )[offset + i] = value[i];
238 OffsetValueType offset = m_VectorLength * this->FastComputeOffset(index);
242 return PixelType(&( ( *m_Buffer )[offset] ), m_VectorLength);
256 OffsetValueType offset = m_VectorLength * this->FastComputeOffset(index);
260 return PixelType(&( ( *m_Buffer )[offset] ), m_VectorLength);
284 return m_Buffer ? m_Buffer->GetBufferPointer() :
nullptr;
288 return m_Buffer ? m_Buffer->GetBufferPointer() :
nullptr;
300 void SetPixelContainer(PixelContainer *container);
312 virtual void Graft(
const Self *data);
333 itkSetMacro(VectorLength, VectorLengthType);
334 itkGetConstReferenceMacro(VectorLength, VectorLengthType);
338 unsigned int GetNumberOfComponentsPerPixel()
const override;
340 void SetNumberOfComponentsPerPixel(
unsigned int n)
override;
344 void PrintSelf(std::ostream & os,
Indent indent)
const override;
348 using Superclass::Graft;
358 #ifndef ITK_MANUAL_INSTANTIATION
359 #include "itkVectorImage.hxx"
const InternalPixelType * GetBufferPointer() const
typename Rebind< UPixelType, NUImageDimension >::Type RebindImageType
typename PixelContainer::ConstPointer PixelContainerConstPointer
PixelContainer * GetPixelContainer()
PixelType GetPixel(const IndexType &index)
Get a "reference" to a pixel. This result cannot be used as an lvalue because the pixel is converted ...
An image region represents a structured region of data.
Templated n-dimensional vector image class.
Implements a weak reference to an object.
A structure which enable changing any image class' pixel type to another.
InternalPixelType IOPixelType
const AccessorType GetPixelAccessor() const
NeighborhoodAccessorFunctorType GetNeighborhoodAccessor()
Give access to partial aspects of a type.
This class provides a common API for pixel accessors for Image and VectorImage. (between the DefaultV...
typename PixelContainer::Pointer PixelContainerPointer
Represents an array whose length can be defined at run-time.
ImageBaseType::SizeType SizeType
ImageBaseType::DirectionType DirectionType
ImageBaseType::IndexType IndexType
InternalPixelType * GetBufferPointer()
signed long IndexValueType
Represent a n-dimensional size (bounds) of a n-dimensional image.
Represent a n-dimensional offset between two n-dimensional indexes of n-dimensional image...
unsigned int VectorLengthType
AccessorType GetPixelAccessor()
typename OffsetType::OffsetValueType OffsetValueType
class ITK_TEMPLATE_EXPORT ImageBase
Base class for templated image classes.
void SetPixel(const IndexType &index, const PixelType &value)
Set a pixel value.
const PixelType GetPixel(const IndexType &index) const
Get a pixel (read only version).
Control indentation during Print() invocation.
ImageBaseType::PointType PointType
PixelContainerPointer m_Buffer
const PixelType operator[](const IndexType &index) const
Access a pixel.
Base class for most ITK classes.
ImageBaseType::RegionType RegionType
PixelType operator[](const IndexType &index)
Access a pixel. This result cannot be used as an lvalue because the pixel is converted on the fly to ...
typename IndexType::IndexValueType IndexValueType
const NeighborhoodAccessorFunctorType GetNeighborhoodAccessor() const
signed long OffsetValueType
const PixelContainer * GetPixelContainer() const
Base class for all data objects in ITK.
Provides accessor interfaces to Access pixels and is meant to be used on pointers to pixels held by t...
Defines an itk::Image front-end to a standard C-array.