18 #ifndef __itkImageAdaptor_h
19 #define __itkImageAdaptor_h
26 template <
typename TPixelType,
unsigned int VImageDimension >
class VectorImage;
54 template<
class TImage,
class 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 <class UPixelType, unsigned int UImageDimension = ::itk::GetImageDimension< TImage >::ImageDimension>
147 virtual void SetLargestPossibleRegion(
const RegionType & region);
152 virtual void SetBufferedRegion(
const RegionType & region);
157 virtual void SetRequestedRegion(
const RegionType & region);
163 virtual void SetRequestedRegion(
const DataObject *data);
171 virtual const RegionType & GetRequestedRegion()
const;
181 virtual const RegionType & GetLargestPossibleRegion()
const;
188 virtual const RegionType & GetBufferedRegion()
const;
191 inline void Allocate()
198 virtual void Initialize();
202 { m_PixelAccessor.Set(m_Image->GetPixel(index), value); }
206 {
return m_PixelAccessor.Get( m_Image->GetPixel(index) ); }
210 {
return m_PixelAccessor.Get( m_Image->GetPixel(index) ); }
226 {
return m_Image->GetPixelContainer(); }
229 {
return m_Image->GetPixelContainer(); }
233 void SetPixelContainer(PixelContainer *container);
257 virtual void SetSpacing(
const SpacingType & values);
259 virtual void SetSpacing(
const double *values );
261 virtual void SetSpacing(
const float *values );
271 virtual const PointType & GetOrigin()
const;
274 virtual void SetOrigin(
const PointType values);
276 virtual void SetOrigin(
const double *values );
278 virtual void SetOrigin(
const float *values );
289 virtual void SetImage(TImage *);
292 virtual void Modified()
const;
295 virtual unsigned long GetMTime()
const;
299 {
return m_PixelAccessor; }
303 {
return m_PixelAccessor; }
307 { m_PixelAccessor = accessor; }
310 virtual void Update();
312 virtual void CopyInformation(
const DataObject *data);
316 virtual void UpdateOutputInformation();
318 virtual void SetRequestedRegionToLargestPossibleRegion();
320 virtual void PropagateRequestedRegion()
323 virtual
void UpdateOutputData();
325 virtual
bool VerifyRequestedRegion();
331 template< class TCoordRep >
332 bool TransformPhysicalPointToContinuousIndex(
333 const
Point< TCoordRep,
334 itkGetStaticConstMacro(ImageDimension) > & point,
336 itkGetStaticConstMacro(ImageDimension) > & index)
const
338 return m_Image->TransformPhysicalPointToContinuousIndex(point, index);
345 template<
class TCoordRep >
346 bool TransformPhysicalPointToIndex(
347 const Point< TCoordRep,
348 itkGetStaticConstMacro(ImageDimension) > & point,
351 return m_Image->TransformPhysicalPointToIndex(point, index);
358 template<
class TCoordRep >
359 void TransformContinuousIndexToPhysicalPoint(
361 itkGetStaticConstMacro(ImageDimension) > & index,
363 itkGetStaticConstMacro(ImageDimension) > & point)
const
365 m_Image->TransformContinuousIndexToPhysicalPoint(index, point);
373 template<
class TCoordRep >
374 void TransformIndexToPhysicalPoint(
377 itkGetStaticConstMacro(ImageDimension) > & point)
const
379 m_Image->TransformIndexToPhysicalPoint(index, point);
382 template<
class TCoordRep >
383 void TransformLocalVectorToPhysicalVector(
384 const FixedArray< TCoordRep, itkGetStaticConstMacro(ImageDimension) > & inputGradient,
385 FixedArray< TCoordRep, itkGetStaticConstMacro(ImageDimension) > & outputGradient)
const
387 m_Image->TransformLocalVectorToPhysicalVector(inputGradient, outputGradient);
390 template<
class TCoordRep >
391 void TransformPhysicalVectorToLocalVector(
392 const FixedArray< TCoordRep, itkGetStaticConstMacro(ImageDimension) > & inputGradient,
393 FixedArray< TCoordRep, itkGetStaticConstMacro(ImageDimension) > & outputGradient)
const
395 m_Image->TransformPhysicalVectorToLocalVector(inputGradient, outputGradient);
402 void PrintSelf(std::ostream & os,
Indent indent)
const;
407 void operator=(
const Self &);
411 template<
class TPixelType >
414 this->m_PixelAccessor.SetVectorLength( this->m_Image->GetNumberOfComponentsPerPixel() );
430 #ifndef ITK_MANUAL_INSTANTIATION
431 #include "itkImageAdaptor.hxx"