18 #ifndef itkImageAdaptor_h
19 #define itkImageAdaptor_h
26 template <
typename TPixelType,
unsigned int VImageDimension >
class VectorImage;
54 template<
typename TImage,
typename TAccessor >
64 static constexpr
unsigned int ImageDimension = TImage::ImageDimension;
98 using AccessorFunctorType =
typename InternalImageType::AccessorFunctorType::template Rebind< Self >::Type;
136 template <
typename UPixelType,
unsigned int UImageDimension = TImage::ImageDimension>
142 template <
typename UPixelType,
unsigned int NUImageDimension = TImage::ImageDimension>
152 void SetLargestPossibleRegion(
const RegionType & region)
override;
157 void SetBufferedRegion(
const RegionType & region)
override;
162 void SetRequestedRegion(
const RegionType & region)
override;
168 void SetRequestedRegion(
const DataObject *data)
override;
176 const RegionType & GetRequestedRegion()
const override;
186 const RegionType & GetLargestPossibleRegion()
const override;
193 const RegionType & GetBufferedRegion()
const override;
196 void Allocate(
bool initialize =
false)
override;
200 void Initialize()
override;
204 { m_PixelAccessor.Set(m_Image->GetPixel(index), value); }
208 {
return m_PixelAccessor.Get( m_Image->GetPixel(index) ); }
212 {
return m_PixelAccessor.Get( m_Image->GetPixel(index) ); }
228 {
return m_Image->GetPixelContainer(); }
231 {
return m_Image->GetPixelContainer(); }
235 void SetPixelContainer(PixelContainer *container);
247 virtual void Graft(
const Self *imgData);
259 void SetSpacing(
const SpacingType & values)
override;
261 void SetSpacing(
const double *values )
override;
263 void SetSpacing(
const float *values )
override;
273 const PointType & GetOrigin()
const override;
276 void SetOrigin(
const PointType values)
override;
278 void SetOrigin(
const double *values )
override;
280 void SetOrigin(
const float *values )
override;
291 virtual void SetImage(TImage *);
294 void Modified()
const override;
301 {
return m_PixelAccessor; }
305 {
return m_PixelAccessor; }
309 { m_PixelAccessor = accessor; }
312 void Update()
override;
314 void CopyInformation(
const DataObject *data)
override;
318 void UpdateOutputInformation()
override;
320 void SetRequestedRegionToLargestPossibleRegion()
override;
322 void PropagateRequestedRegion()
override;
324 void UpdateOutputData()
override;
326 bool VerifyRequestedRegion()
override;
332 template<
typename TCoordRep >
334 const Point< TCoordRep,
335 Self::ImageDimension > & point,
337 Self::ImageDimension > & index)
const
339 return m_Image->TransformPhysicalPointToContinuousIndex(point, index);
346 template<
typename TCoordRep >
348 const Point< TCoordRep,
349 Self::ImageDimension > & point,
352 return m_Image->TransformPhysicalPointToIndex(point, index);
359 template<
typename TCoordRep >
362 Self::ImageDimension > & index,
364 Self::ImageDimension > & point)
const
366 m_Image->TransformContinuousIndexToPhysicalPoint(index, point);
374 template<
typename TCoordRep >
378 Self::ImageDimension > & point)
const
380 m_Image->TransformIndexToPhysicalPoint(index, point);
383 template<
typename TCoordRep >
388 m_Image->TransformLocalVectorToPhysicalVector(inputGradient, outputGradient);
391 template<
typename TCoordRep >
396 m_Image->TransformPhysicalVectorToLocalVector(inputGradient, outputGradient);
403 void PrintSelf(std::ostream & os,
Indent indent)
const override;
405 using Superclass::Graft;
411 template<
typename TPixelType >
412 void UpdateAccessor( typename ::itk::VectorImage< TPixelType, ImageDimension > * itkNotUsed( dummy ) )
414 this->m_PixelAccessor.SetVectorLength( this->m_Image->GetNumberOfComponentsPerPixel() );
430 #ifndef ITK_MANUAL_INSTANTIATION
431 #include "itkImageAdaptor.hxx"
void TransformPhysicalVectorToLocalVector(const FixedArray< TCoordRep, Self::ImageDimension > &inputGradient, FixedArray< TCoordRep, Self::ImageDimension > &outputGradient) const
void TransformIndexToPhysicalPoint(const IndexType &index, Point< TCoordRep, Self::ImageDimension > &point) const
const PixelContainer * GetPixelContainer() const
unsigned long SizeValueType
InternalPixelType * InternalPixelPointerType
typename TImage::PixelContainer PixelContainer
An image region represents a structured region of data.
AccessorType m_PixelAccessor
Implements a weak reference to an object.
const AccessorType & GetPixelAccessor() const
bool TransformPhysicalPointToContinuousIndex(const Point< TCoordRep, Self::ImageDimension > &point, ContinuousIndex< TCoordRep, Self::ImageDimension > &index) const
Get the continuous index from a physical point.
void UpdateAccessor(typename::itk::VectorImage< TPixelType, ImageDimension > *)
PixelType GetPixel(const IndexType &index) const
Simulate a standard C array with copy semnatics.
PixelContainerPointer GetPixelContainer()
void SetPixelAccessor(const AccessorType &accessor)
typename InternalImageType::AccessorFunctorType::template Rebind< Self >::Type AccessorFunctorType
typename Accessor::AddPixelAccessor< TImage::PixelType >::ExternalType PixelType
ImageBaseType::SizeType SizeType
ImageBaseType::DirectionType DirectionType
ImageBaseType::IndexType IndexType
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...
void TransformContinuousIndexToPhysicalPoint(const ContinuousIndex< TCoordRep, Self::ImageDimension > &index, Point< TCoordRep, Self::ImageDimension > &point) const
typename SizeType::SizeValueType SizeValueType
unsigned long ModifiedTimeType
void SetPixel(const IndexType &index, const PixelType &value)
typename OffsetType::OffsetValueType OffsetValueType
PixelType operator[](const IndexType &index) const
bool TransformPhysicalPointToIndex(const Point< TCoordRep, Self::ImageDimension > &point, IndexType &index) const
Base class for templated image classes.
A templated class holding a point in n-Dimensional image space.
typename TImage::PixelContainerPointer PixelContainerPointer
Control indentation during Print() invocation.
ImageBaseType::PointType PointType
AccessorType & GetPixelAccessor()
Give access to partial aspects of voxels from an Image.
Base class for most ITK classes.
ImageBaseType::RegionType RegionType
typename IndexType::IndexValueType IndexValueType
typename Accessor::AddPixelAccessor< TImage::PixelType >::InternalType InternalPixelType
signed long OffsetValueType
typename TImage::PixelContainerConstPointer PixelContainerConstPointer
Base class for all data objects in ITK.
Templated n-dimensional image class.
void TransformLocalVectorToPhysicalVector(const FixedArray< TCoordRep, Self::ImageDimension > &inputGradient, FixedArray< TCoordRep, Self::ImageDimension > &outputGradient) const