|
ITK
6.0.0
Insight Toolkit
|
Go to the documentation of this file.
18 #ifndef itkImageAdaptor_h
19 #define itkImageAdaptor_h
26 template <
typename TPixelType,
unsigned int VImageDimension>
55 template <
typename TImage,
typename TAccessor>
65 static constexpr
unsigned int ImageDimension = TImage::ImageDimension;
99 using AccessorFunctorType =
typename InternalImageType::AccessorFunctorType::template Rebind<Self>::Type;
110 using typename Superclass::OffsetType;
119 using typename Superclass::SpacingType;
137 template <
typename UPixelType,
unsigned int UImageDimension = TImage::ImageDimension>
143 template <
typename UPixelType,
unsigned int VUImageDimension = TImage::ImageDimension>
154 SetLargestPossibleRegion(
const RegionType & region)
override;
160 SetBufferedRegion(
const RegionType & region)
override;
166 SetRequestedRegion(
const RegionType & region)
override;
173 SetRequestedRegion(
const DataObject * data)
override;
182 GetRequestedRegion()
const override;
193 GetLargestPossibleRegion()
const override;
201 GetBufferedRegion()
const override;
205 Allocate(
bool initialize =
false)
override;
210 Initialize()
override;
216 m_PixelAccessor.Set(m_Image->GetPixel(index), value);
223 return m_PixelAccessor.Get(m_Image->GetPixel(index));
230 return m_PixelAccessor.Get(m_Image->GetPixel(index));
235 GetOffsetTable()
const;
251 return m_Image->GetPixelContainer();
254 const PixelContainer *
257 return m_Image->GetPixelContainer();
263 SetPixelContainer(PixelContainer * container);
276 Graft(
const Self * imgData);
278 #ifndef ITK_FUTURE_LEGACY_REMOVE
280 using InternalPixelPointerType [[deprecated(
"Please just use `InternalPixelType *` instead!")]] = InternalPixelType *;
288 const InternalPixelType *
289 GetBufferPointer()
const;
293 SetSpacing(
const SpacingType & spacing)
override;
296 SetSpacing(
const double * spacing )
override;
299 SetSpacing(
const float * spacing )
override;
305 GetSpacing()
const override;
311 GetOrigin()
const override;
315 SetOrigin(
const PointType origin)
override;
318 SetOrigin(
const double * origin )
override;
321 SetOrigin(
const float * origin )
override;
331 GetDirection()
const override;
339 Modified()
const override;
343 GetMTime()
const override;
349 return m_PixelAccessor;
356 return m_PixelAccessor;
363 m_PixelAccessor = accessor;
371 CopyInformation(
const DataObject * data)
override;
376 UpdateOutputInformation()
override;
379 SetRequestedRegionToLargestPossibleRegion()
override;
382 PropagateRequestedRegion()
override;
385 UpdateOutputData()
override;
388 VerifyRequestedRegion()
override;
391 template <
typename TIndexRep,
typename TCoordinate>
395 return m_Image->template TransformPhysicalPointToContinuousIndex<TIndexRep>(
point);
406 template <
typename TCoordinate>
407 ITK_NODISCARD(
"Call the overload which has the point as the only parameter and returns the index")
408 bool TransformPhysicalPointToContinuousIndex(const
Point<TCoordinate,
Self::ImageDimension> &
point,
411 return m_Image->TransformPhysicalPointToContinuousIndex(
point, index);
415 template <
typename TCoordinate>
419 return m_Image->TransformPhysicalPointToIndex(
point);
430 template <
typename TCoordinate>
431 ITK_NODISCARD(
"Call the overload which has the point as the only parameter and returns the index")
434 return m_Image->TransformPhysicalPointToIndex(
point, index);
441 template <
typename TCoordinate>
446 m_Image->TransformContinuousIndexToPhysicalPoint(index,
point);
450 template <
typename TCoordinate,
typename TIndexRep>
454 return m_Image->template TransformContinuousIndexToPhysicalPoint<TIndexRep>(index);
462 template <
typename TCoordinate>
466 m_Image->TransformIndexToPhysicalPoint(index,
point);
470 template <
typename TCoordinate>
474 return m_Image->template TransformIndexToPhysicalPoint<TCoordinate>(index);
477 template <
typename TCoordinate>
482 m_Image->TransformLocalVectorToPhysicalVector(inputGradient, outputGradient);
485 template <
typename TVector>
486 [[nodiscard]] TVector
489 TVector outputGradient;
490 TransformLocalVectorToPhysicalVector(inputGradient, outputGradient);
491 return outputGradient;
494 template <
typename TCoordinate>
499 m_Image->TransformPhysicalVectorToLocalVector(inputGradient, outputGradient);
502 template <
typename TVector>
503 [[nodiscard]] TVector
506 TVector outputGradient;
507 TransformPhysicalVectorToLocalVector(inputGradient, outputGradient);
508 return outputGradient;
515 PrintSelf(std::ostream & os,
Indent indent)
const override;
518 using Superclass::Graft;
523 template <
typename TPixelType>
527 this->m_PixelAccessor.SetVectorLength(this->m_Image->GetNumberOfComponentsPerPixel());
531 template <
typename T>
546 #ifndef ITK_MANUAL_INSTANTIATION
547 # include "itkImageAdaptor.hxx"
PixelType GetPixel(const IndexType &index) const
typename OffsetType::OffsetValueType OffsetValueType
typename TImage::PixelContainerConstPointer PixelContainerConstPointer
SmartPointer< Self > Pointer
ImageBaseType::DirectionType DirectionType
SizeValueType ModifiedTimeType
typename TImage::PixelContainer PixelContainer
void TransformContinuousIndexToPhysicalPoint(const ContinuousIndex< TCoordinate, Self::ImageDimension > &index, Point< TCoordinate, Self::ImageDimension > &point) const
IndexType TransformPhysicalPointToIndex(const Point< TCoordinate, Self::ImageDimension > &point) const
Base class for templated image classes.
An image region represents a structured region of data.
void TransformLocalVectorToPhysicalVector(const FixedArray< TCoordinate, Self::ImageDimension > &inputGradient, FixedArray< TCoordinate, Self::ImageDimension > &outputGradient) const
TVector TransformLocalVectorToPhysicalVector(const TVector &inputGradient) const
void TransformPhysicalVectorToLocalVector(const FixedArray< TCoordinate, Self::ImageDimension > &inputGradient, FixedArray< TCoordinate, Self::ImageDimension > &outputGradient) const
typename SizeType::SizeValueType SizeValueType
typename Accessor::AddPixelAccessor< TImage::PixelType > ::InternalType InternalPixelType
Templated n-dimensional vector image class.
ImageBaseType::PointType PointType
void TransformIndexToPhysicalPoint(const IndexType &index, Point< TCoordinate, Self::ImageDimension > &point) const
ImageBaseType::SizeType SizeType
Control indentation during Print() invocation.
const PixelContainer * GetPixelContainer() const
typename IndexType::IndexValueType IndexValueType
PixelType operator[](const IndexType &index) const
Give access to partial aspects of voxels from an Image.
ImageBaseType::IndexType IndexType
Point< TCoordinate, TImage::ImageDimension > TransformContinuousIndexToPhysicalPoint(const ContinuousIndex< TIndexRep, Self::ImageDimension > &index) const
void UpdateAccessor(typename itk::VectorImage< TPixelType, ImageDimension > *)
TVector TransformPhysicalVectorToLocalVector(const TVector &inputGradient) const
*par Constraints *The filter requires an image with at least two dimensions and a vector *length of at least The theory supports extension to scalar but *the implementation of the itk vector classes do not **The template parameter TRealType must be floating point(float or double) or *a user-defined "real" numerical type with arithmetic operations defined *sufficient to compute derivatives. **\par Performance *This filter will automatically multithread if run with *SetUsePrincipleComponents
ImageBaseType::RegionType RegionType
typename InternalImageType::AccessorFunctorType::template Rebind< Self >::Type AccessorFunctorType
void SetPixelAccessor(const AccessorType &accessor)
Simulate a standard C array with copy semantics.
ContinuousIndex< TIndexRep, TImage::ImageDimension > TransformPhysicalPointToContinuousIndex(const Point< TCoordinate, TImage::ImageDimension > &point) const
typename TImage::PixelContainerPointer PixelContainerPointer
typename Accessor::AddPixelAccessor< TImage::PixelType > ::ExternalType PixelType
Point< TCoordinate, Self::ImageDimension > TransformIndexToPhysicalPoint(const IndexType &index) const
Implements a weak reference to an object.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
A templated class holding a point in n-Dimensional image space.
Base class for most ITK classes.
void SetPixel(const IndexType &index, const PixelType &value)
A templated class holding a geometric point in n-Dimensional space.
Templated n-dimensional image class.
AccessorType & GetPixelAccessor()
const AccessorType & GetPixelAccessor() const
PixelContainerPointer GetPixelContainer()
unsigned long SizeValueType
Base class for all data objects in ITK.