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;
157 virtual void SetRequestedRegion(
const RegionType & region) ITK_OVERRIDE;
163 virtual void SetRequestedRegion(
const DataObject *data) 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;
195 virtual
void Initialize() 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;
309 virtual
void CopyInformation(const
DataObject *data) ITK_OVERRIDE;
313 virtual
void UpdateOutputInformation() ITK_OVERRIDE;
315 virtual
void SetRequestedRegionToLargestPossibleRegion() ITK_OVERRIDE;
317 virtual
void PropagateRequestedRegion() ITK_OVERRIDE;
319 virtual
void UpdateOutputData() ITK_OVERRIDE;
321 virtual
bool VerifyRequestedRegion() 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);
398 void PrintSelf(std::ostream & os,
Indent indent) const ITK_OVERRIDE;
399 virtual
void Graft(const
DataObject *data) ITK_OVERRIDE;
400 using Superclass::Graft;
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"
SizeType::SizeValueType SizeValueType
Superclass::RegionType RegionType
void TransformIndexToPhysicalPoint(const IndexType &index, Point< TCoordRep, itkGetStaticConstMacro(ImageDimension) > &point) const
itk::SizeValueType SizeValueType
const PixelContainer * GetPixelContainer() const
Superclass::SpacingType SpacingType
TImage::PixelContainer PixelContainer
signed long OffsetValueType
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
AccessorType m_PixelAccessor
Templated n-dimensional vector image class.
Implements a weak reference to an object.
PixelType GetPixel(const IndexType &index) const
SmartPointer< Self > Pointer
Simulate a standard C array with copy semnatics.
InternalImageType::AccessorFunctorType::template Rebind< Self >::Type AccessorFunctorType
const AccessorType & GetPixelAccessor(void) const
PixelContainerPointer GetPixelContainer()
WeakPointer< const Self > ConstWeakPointer
ImageBaseType::DirectionType DirectionType
void SetPixelAccessor(const AccessorType &accessor)
TImage::PixelContainerConstPointer PixelContainerConstPointer
::itk::IndexValueType IndexValueType
TAccessor::InternalType InternalPixelType
TAccessor::ExternalType PixelType
Superclass::DirectionType DirectionType
ImageBaseType::PointType PointType
Superclass::SizeType SizeType
PixelType operator[](const IndexType &index) const
void TransformLocalVectorToPhysicalVector(const FixedArray< TCoordRep, itkGetStaticConstMacro(ImageDimension) > &inputGradient, FixedArray< TCoordRep, itkGetStaticConstMacro(ImageDimension) > &outputGradient) const
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
ImageBaseType::SizeType SizeType
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
Base class for all data objects in ITK.
Templated n-dimensional image class.
ImageBaseType::IndexType IndexType