|
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));
231 GetOffsetTable()
const;
247 return m_Image->GetPixelContainer();
250 const PixelContainer *
253 return m_Image->GetPixelContainer();
259 SetPixelContainer(PixelContainer * container);
272 Graft(
const Self * imgData);
274 #ifndef ITK_FUTURE_LEGACY_REMOVE
276 using InternalPixelPointerType [[deprecated(
"Please just use `InternalPixelType *` instead!")]] = InternalPixelType *;
284 const InternalPixelType *
285 GetBufferPointer()
const;
289 SetSpacing(
const SpacingType & spacing)
override;
292 SetSpacing(
const double * spacing )
override;
295 SetSpacing(
const float * spacing )
override;
301 GetSpacing()
const override;
307 GetOrigin()
const override;
311 SetOrigin(
const PointType origin)
override;
314 SetOrigin(
const double * origin )
override;
317 SetOrigin(
const float * origin )
override;
327 GetDirection()
const override;
335 Modified()
const override;
339 GetMTime()
const override;
345 return m_PixelAccessor;
352 return m_PixelAccessor;
359 m_PixelAccessor = accessor;
367 CopyInformation(
const DataObject * data)
override;
372 UpdateOutputInformation()
override;
375 SetRequestedRegionToLargestPossibleRegion()
override;
378 PropagateRequestedRegion()
override;
381 UpdateOutputData()
override;
384 VerifyRequestedRegion()
override;
387 template <
typename TIndexRep,
typename TCoordRep>
391 return m_Image->template TransformPhysicalPointToContinuousIndex<TIndexRep>(
point);
402 template <
typename TCoordRep>
403 ITK_NODISCARD(
"Call the overload which has the point as the only parameter and returns the index")
404 bool TransformPhysicalPointToContinuousIndex(const
Point<TCoordRep,
Self::ImageDimension> &
point,
407 return m_Image->TransformPhysicalPointToContinuousIndex(
point, index);
411 template <
typename TCoordRep>
415 return m_Image->TransformPhysicalPointToIndex(
point);
426 template <
typename TCoordRep>
427 ITK_NODISCARD(
"Call the overload which has the point as the only parameter and returns the index")
430 return m_Image->TransformPhysicalPointToIndex(
point, index);
437 template <
typename TCoordRep>
442 m_Image->TransformContinuousIndexToPhysicalPoint(index,
point);
446 template <
typename TCoordRep,
typename TIndexRep>
450 return m_Image->template TransformContinuousIndexToPhysicalPoint<TIndexRep>(index);
458 template <
typename TCoordRep>
462 m_Image->TransformIndexToPhysicalPoint(index,
point);
466 template <
typename TCoordRep>
470 return m_Image->template TransformIndexToPhysicalPoint<TCoordRep>(index);
473 template <
typename TCoordRep>
478 m_Image->TransformLocalVectorToPhysicalVector(inputGradient, outputGradient);
481 template <
typename TVector>
482 [[nodiscard]] TVector
485 TVector outputGradient;
486 TransformLocalVectorToPhysicalVector(inputGradient, outputGradient);
487 return outputGradient;
490 template <
typename TCoordRep>
495 m_Image->TransformPhysicalVectorToLocalVector(inputGradient, outputGradient);
498 template <
typename TVector>
499 [[nodiscard]] TVector
502 TVector outputGradient;
503 TransformPhysicalVectorToLocalVector(inputGradient, outputGradient);
504 return outputGradient;
511 PrintSelf(std::ostream & os,
Indent indent)
const override;
514 using Superclass::Graft;
519 template <
typename TPixelType>
523 this->m_PixelAccessor.SetVectorLength(this->m_Image->GetNumberOfComponentsPerPixel());
527 template <
typename T>
542 #ifndef ITK_MANUAL_INSTANTIATION
543 # 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
Base class for templated image classes.
An image region represents a structured region of data.
TVector TransformLocalVectorToPhysicalVector(const TVector &inputGradient) const
typename SizeType::SizeValueType SizeValueType
typename Accessor::AddPixelAccessor< TImage::PixelType > ::InternalType InternalPixelType
Templated n-dimensional vector image class.
ImageBaseType::PointType PointType
ImageBaseType::SizeType SizeType
void TransformLocalVectorToPhysicalVector(const FixedArray< TCoordRep, Self::ImageDimension > &inputGradient, FixedArray< TCoordRep, Self::ImageDimension > &outputGradient) const
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
ContinuousIndex< TIndexRep, TImage::ImageDimension > TransformPhysicalPointToContinuousIndex(const Point< TCoordRep, TImage::ImageDimension > &point) const
IndexType TransformPhysicalPointToIndex(const Point< TCoordRep, Self::ImageDimension > &point) 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)
void TransformIndexToPhysicalPoint(const IndexType &index, Point< TCoordRep, Self::ImageDimension > &point) const
Simulate a standard C array with copy semantics.
typename TImage::PixelContainerPointer PixelContainerPointer
typename Accessor::AddPixelAccessor< TImage::PixelType > ::ExternalType PixelType
void TransformPhysicalVectorToLocalVector(const FixedArray< TCoordRep, Self::ImageDimension > &inputGradient, FixedArray< TCoordRep, Self::ImageDimension > &outputGradient) const
Implements a weak reference to an object.
Point< TCoordRep, Self::ImageDimension > TransformIndexToPhysicalPoint(const IndexType &index) const
void TransformContinuousIndexToPhysicalPoint(const ContinuousIndex< TCoordRep, Self::ImageDimension > &index, Point< TCoordRep, Self::ImageDimension > &point) const
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.
Point< TCoordRep, TImage::ImageDimension > TransformContinuousIndexToPhysicalPoint(const ContinuousIndex< TIndexRep, Self::ImageDimension > &index) const