18 #ifndef itkImageAdaptor_h
19 #define itkImageAdaptor_h
26 template <
typename TPixelType,
unsigned int VImageDimension >
class VectorImage;
54 template<
typename TImage,
typename TAccessor >
63 itkStaticConstMacro(ImageDimension,
unsigned int, TImage::ImageDimension);
83 typedef typename TAccessor::ExternalType
PixelType;
97 typedef typename InternalImageType::AccessorFunctorType::template Rebind< Self >::Type
AccessorFunctorType;
134 template <
typename UPixelType,
unsigned int UImageDimension = TImage::ImageDimension>
147 virtual void SetLargestPossibleRegion(
const RegionType & region) ITK_OVERRIDE;
152 virtual void SetBufferedRegion(
const RegionType & region) ITK_OVERRIDE;
171 virtual const RegionType & GetRequestedRegion() const ITK_OVERRIDE;
181 virtual const
RegionType & GetLargestPossibleRegion() const ITK_OVERRIDE;
188 virtual const
RegionType & GetBufferedRegion() const ITK_OVERRIDE;
191 virtual
void Allocate(
bool initialize = false) ITK_OVERRIDE;
199 { m_PixelAccessor.Set(m_Image->GetPixel(index), value); }
203 {
return m_PixelAccessor.Get( m_Image->GetPixel(index) ); }
207 {
return m_PixelAccessor.Get( m_Image->GetPixel(index) ); }
223 {
return m_Image->GetPixelContainer(); }
226 {
return m_Image->GetPixelContainer(); }
230 void SetPixelContainer(PixelContainer *container);
242 virtual void Graft(
const Self *imgData);
254 virtual void SetSpacing(
const SpacingType & values) ITK_OVERRIDE;
256 virtual void SetSpacing(
const double *values ) ITK_OVERRIDE;
258 virtual void SetSpacing(
const float *values ) ITK_OVERRIDE;
263 virtual const SpacingType & GetSpacing() const ITK_OVERRIDE;
268 virtual const
PointType & GetOrigin() const ITK_OVERRIDE;
271 virtual
void SetOrigin(const
PointType values) ITK_OVERRIDE;
273 virtual
void SetOrigin(const
double *values ) ITK_OVERRIDE;
275 virtual
void SetOrigin(const
float *values ) ITK_OVERRIDE;
278 virtual
void SetDirection(const
DirectionType & direction) ITK_OVERRIDE;
283 virtual const
DirectionType & GetDirection() const ITK_OVERRIDE;
286 virtual
void SetImage(TImage *);
289 virtual
void Modified() const ITK_OVERRIDE;
296 {
return m_PixelAccessor; }
300 {
return m_PixelAccessor; }
304 { m_PixelAccessor = accessor; }
307 virtual void Update() ITK_OVERRIDE;
327 template< typename TCoordRep >
328 bool TransformPhysicalPointToContinuousIndex(
329 const
Point< TCoordRep,
330 itkGetStaticConstMacro(ImageDimension) > & point,
332 itkGetStaticConstMacro(ImageDimension) > & index)
const
334 return m_Image->TransformPhysicalPointToContinuousIndex(point, index);
341 template<
typename TCoordRep >
343 const Point< TCoordRep,
344 itkGetStaticConstMacro(ImageDimension) > & point,
347 return m_Image->TransformPhysicalPointToIndex(point, index);
354 template<
typename TCoordRep >
357 itkGetStaticConstMacro(ImageDimension) > & index,
359 itkGetStaticConstMacro(ImageDimension) > & point)
const
361 m_Image->TransformContinuousIndexToPhysicalPoint(index, point);
369 template<
typename TCoordRep >
373 itkGetStaticConstMacro(ImageDimension) > & point)
const
375 m_Image->TransformIndexToPhysicalPoint(index, point);
378 template<
typename TCoordRep >
380 const FixedArray< TCoordRep, itkGetStaticConstMacro(ImageDimension) > & inputGradient,
381 FixedArray< TCoordRep, itkGetStaticConstMacro(ImageDimension) > & outputGradient)
const
383 m_Image->TransformLocalVectorToPhysicalVector(inputGradient, outputGradient);
386 template<
typename TCoordRep >
388 const FixedArray< TCoordRep, itkGetStaticConstMacro(ImageDimension) > & inputGradient,
389 FixedArray< TCoordRep, itkGetStaticConstMacro(ImageDimension) > & outputGradient)
const
391 m_Image->TransformPhysicalVectorToLocalVector(inputGradient, outputGradient);
408 template<
typename TPixelType >
409 void UpdateAccessor( typename ::itk::VectorImage< TPixelType, ImageDimension > * itkNotUsed( dummy ) )
411 this->m_PixelAccessor.SetVectorLength( this->m_Image->GetNumberOfComponentsPerPixel() );
427 #ifndef ITK_MANUAL_INSTANTIATION
428 #include "itkImageAdaptor.hxx"
virtual void CopyInformation(const DataObject *)
SizeType::SizeValueType SizeValueType
Superclass::RegionType RegionType
virtual void PrintSelf(std::ostream &os, Indent indent) const override
void TransformIndexToPhysicalPoint(const IndexType &index, Point< TCoordRep, itkGetStaticConstMacro(ImageDimension) > &point) const
itk::SizeValueType SizeValueType
const PixelContainer * GetPixelContainer() const
virtual void Initialize()
Superclass::SpacingType SpacingType
TImage::PixelContainer PixelContainer
signed long OffsetValueType
virtual void UpdateOutputInformation()
IndexType::IndexValueType IndexValueType
void TransformContinuousIndexToPhysicalPoint(const ContinuousIndex< TCoordRep, itkGetStaticConstMacro(ImageDimension) > &index, Point< TCoordRep, itkGetStaticConstMacro(ImageDimension) > &point) const
ImageBase< itkGetStaticConstMacro(ImageDimension) > Superclass
unsigned long ModifiedTimeType
InternalPixelType * InternalPixelPointerType
Image< UPixelType, UImageDimension > Type
An image region represents a structured region of data.
AccessorType m_PixelAccessor
Implements a weak reference to an object.
void UpdateAccessor(typename::itk::VectorImage< TPixelType, ImageDimension > *)
PixelType GetPixel(const IndexType &index) const
SmartPointer< Self > Pointer
Simulate a standard C array with copy semnatics.
SmartPointer< Self > Pointer
InternalImageType::AccessorFunctorType::template Rebind< Self >::Type AccessorFunctorType
const AccessorType & GetPixelAccessor(void) const
PixelContainerPointer GetPixelContainer()
WeakPointer< const Self > ConstWeakPointer
virtual void SetRequestedRegion(const DataObject *)
void SetPixelAccessor(const AccessorType &accessor)
TImage::PixelContainerConstPointer PixelContainerConstPointer
::itk::IndexValueType IndexValueType
TAccessor::InternalType InternalPixelType
TAccessor::ExternalType PixelType
Superclass::DirectionType DirectionType
virtual bool VerifyRequestedRegion()
virtual void SetRequestedRegionToLargestPossibleRegion()
Superclass::SizeType SizeType
PixelType operator[](const IndexType &index) const
Base class for all data objects in ITK.
virtual void Graft(const DataObject *)
void TransformLocalVectorToPhysicalVector(const FixedArray< TCoordRep, itkGetStaticConstMacro(ImageDimension) > &inputGradient, FixedArray< TCoordRep, itkGetStaticConstMacro(ImageDimension) > &outputGradient) const
virtual void PropagateRequestedRegion()
Base class for templated image classes.
A templated class holding a point in n-Dimensional image space.
Control indentation during Print() invocation.
OffsetType::OffsetValueType OffsetValueType
bool TransformPhysicalPointToIndex(const Point< TCoordRep, itkGetStaticConstMacro(ImageDimension) > &point, IndexType &index) const
Superclass::IndexType IndexType
Superclass::PointType PointType
TImage::PixelContainerPointer PixelContainerPointer
Give access to partial aspects of voxels from an Image.
itk::OffsetValueType OffsetValueType
Superclass::OffsetType OffsetType
void TransformPhysicalVectorToLocalVector(const FixedArray< TCoordRep, itkGetStaticConstMacro(ImageDimension) > &inputGradient, FixedArray< TCoordRep, itkGetStaticConstMacro(ImageDimension) > &outputGradient) const
SmartPointer< const Self > ConstPointer
Templated n-dimensional image class.
virtual void UpdateOutputData()