From 00089526df4e5d0d2cd1a3f76812acde71a7a6be Mon Sep 17 00:00:00 2001 From: Thomas Feuvrier <thomas.feuvrier@c-s.fr> Date: Tue, 20 Feb 2007 13:55:12 +0000 Subject: [PATCH] Ajout de typedef dans la class VectorImage. --- Code/IO/otbVectorImage.h | 58 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 54 insertions(+), 4 deletions(-) diff --git a/Code/IO/otbVectorImage.h b/Code/IO/otbVectorImage.h index 108b0bcd6c..98829fe09b 100644 --- a/Code/IO/otbVectorImage.h +++ b/Code/IO/otbVectorImage.h @@ -26,6 +26,7 @@ #include "otbImageBase.h" #include "itkDefaultVectorPixelAccessorFunctor.h" +#include "itkDefaultVectorPixelAccessor.h" #include "itkVectorImageNeighborhoodAccessorFunctor.h" #include <iostream> @@ -43,12 +44,9 @@ class ITK_EXPORT VectorImage : public itk::VectorImage<TPixel, VImageDimension>, { public: - typedef TPixel InputPixelType; - - /** Standard class typedefs. */ typedef VectorImage Self; - typedef itk::VectorImage<InputPixelType, VImageDimension> Superclass; + typedef itk::VectorImage<TPixel, VImageDimension> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; @@ -60,6 +58,25 @@ public: /** Run-time type information (and related methods). */ itkTypeMacro(VectorImage, itk::VectorImage); + /** Pixel typedef support. Used to declare pixel type in filters + * or other operations. */ + typedef typename Superclass::PixelType PixelType; + + /** Typedef alias for PixelType */ + typedef typename Superclass::ValueType ValueType; + + /** Internal Pixel representation. Used to maintain a uniform API + * with Image Adaptors and allow to keep a particular internal + * representation of data while showing a different external + * representation. */ + typedef typename Superclass::InternalPixelType InternalPixelType; + + typedef typename Superclass::IOPixelType IOPixelType; + + /** Accessor type that convert data between internal and external + * representations. */ + typedef itk::DefaultVectorPixelAccessor< InternalPixelType > AccessorType; + /** Functor to provide a common API between DefaultPixelAccessor and * DefaultVectorPixelAccessor */ typedef itk::DefaultVectorPixelAccessorFunctor< Self > AccessorFunctorType; @@ -68,6 +85,39 @@ public: typedef itk::VectorImageNeighborhoodAccessorFunctor< Self > NeighborhoodAccessorFunctorType; + /** Dimension of the image. This constant is used by functions that are + * templated over image type (as opposed to being templated over pixel type + * and dimension) when they need compile time access to the dimension of + * the image. */ + itkStaticConstMacro(ImageDimension, unsigned int, VImageDimension); + + /** Container used to store pixels in the image. */ + typedef typename Superclass::PixelContainer PixelContainer; + + /** Index typedef support. An index is used to access pixel values. */ + typedef typename Superclass::IndexType IndexType; + + /** Offset typedef support. An offset is used to access pixel values. */ + typedef typename Superclass::OffsetType OffsetType; + + /** Size typedef support. A size is used to define region bounds. */ + typedef typename Superclass::SizeType SizeType; + + /** Direction typedef support. A matrix of direction cosines. */ + typedef typename Superclass::DirectionType DirectionType; + + /** Region typedef support. A region is used to specify a subset of an image. */ + typedef typename Superclass::RegionType RegionType; + + /** Spacing typedef support. Spacing holds the size of a pixel. The + * spacing is the geometric distance between image samples. */ + typedef typename Superclass::SpacingType SpacingType; + + /** Origin typedef support. The origin is the geometric coordinates + * of the index (0,0). */ + typedef typename Superclass::PointType PointType; + + /** Get the projection coordinate system of the image. */ virtual std::string GetProjectionRef( void ); -- GitLab