Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkOrientImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003 Program:   Insight Segmentation & Registration Toolkit
00004 Module:    $RCSfile: itkOrientImageFilter.h,v $
00005 Language:  C++
00006 Date:      $Date: 2004/10/29 14:22:15 $
00007 Version:   $Revision: 1.3 $
00008 
00009 Copyright (c) Insight Software Consortium. All rights reserved.
00010 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012 This software is distributed WITHOUT ANY WARRANTY; without even
00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00014 PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 #ifndef __itkOrientImageFilter_h
00018 #define __itkOrientImageFilter_h
00019 
00020 #include "itkImageToImageFilter.h"
00021 #include "itkIOCommon.h"
00022 #include "itkPermuteAxesImageFilter.h"
00023 #include "itkFlipImageFilter.h"
00024 #include "itkSpatialOrientation.h"
00025 
00026 namespace itk {
00027 
00105 template<class TInputImage, class TOutputImage>
00106 class ITK_EXPORT OrientImageFilter :
00107     public ImageToImageFilter<TInputImage, TOutputImage>
00108 {
00109 public:
00111   typedef OrientImageFilter Self;
00112   typedef ImageToImageFilter<TInputImage, TOutputImage>
00113   Superclass;
00114   typedef SmartPointer<Self>        Pointer;
00115   typedef SmartPointer<const Self>  ConstPointer;
00116 
00118   typedef TInputImage InputImageType;
00119   typedef TOutputImage OutputImageType;
00120   typedef typename InputImageType::Pointer         InputImagePointer;
00121   typedef typename InputImageType::ConstPointer    InputImageConstPointer;
00122   typedef typename InputImageType::RegionType      InputImageRegionType;
00123   typedef typename InputImageType::PixelType       InputImagePixelType;
00124   typedef typename OutputImageType::Pointer        OutputImagePointer;
00125   typedef typename OutputImageType::ConstPointer   OutputImageConstPointer;
00126   typedef typename OutputImageType::RegionType     OutputImageRegionType;
00127   typedef typename OutputImageType::PixelType      OutputImagePixelType;
00128   typedef SpatialOrientation::ValidCoordinateOrientationFlags
00129   CoordinateOrientationCode;
00131   typedef PermuteAxesImageFilter< TInputImage > PermuterType;
00132   typedef typename PermuterType::PermuteOrderArrayType PermuteOrderArrayType;
00133 
00135   typedef FlipImageFilter< TInputImage > FlipperType;
00136   typedef typename FlipperType::FlipAxesArrayType  FlipAxesArrayType;
00137 
00138   
00140   itkStaticConstMacro(InputImageDimension, unsigned int,
00141                       TInputImage::ImageDimension);
00142   itkStaticConstMacro(OutputImageDimension, unsigned int,
00143                       TOutputImage::ImageDimension);
00144 
00147   itkConceptMacro(SameDimension,
00148     (Concept::SameDimension<itkGetStaticConstMacro(InputImageDimension),itkGetStaticConstMacro(OutputImageDimension)>));
00149 
00151   itkConceptMacro(DimensionShouldBe3,
00152     (Concept::SameDimension<itkGetStaticConstMacro(InputImageDimension),3>));
00153 
00155   itkNewMacro(Self);
00156 
00158   itkTypeMacro(OrientImageFilter, ImageToImageFilter);
00159 
00161   itkGetMacro(GivenCoordinateOrientation, CoordinateOrientationCode);
00162   void SetGivenCoordinateOrientation(CoordinateOrientationCode newCode);
00163   itkGetMacro(DesiredCoordinateOrientation, CoordinateOrientationCode);
00164   void SetDesiredCoordinateOrientation(CoordinateOrientationCode newCode);
00165 
00167   itkGetConstReferenceMacro( PermuteOrder, PermuteOrderArrayType );
00168 
00170   itkGetConstReferenceMacro( FlipAxes, FlipAxesArrayType );
00171 
00179   virtual void GenerateOutputInformation();
00180 
00181 protected:
00182   OrientImageFilter();
00183   ~OrientImageFilter() {};
00184   void PrintSelf(std::ostream& os, Indent indent) const;
00185 
00189   void GenerateInputRequestedRegion() ;
00190 
00192   void EnlargeOutputRequestedRegion(DataObject *itkNotUsed(output));
00193 
00194   /*** Member functions used by GenerateData: */
00195   void DeterminePermutationsAndFlips(const SpatialOrientation::ValidCoordinateOrientationFlags fixed_orient, const SpatialOrientation::ValidCoordinateOrientationFlags moving_orient);
00196   bool NeedToPermute();
00197   bool NeedToFlip();
00198 
00199 
00202   void GenerateData();
00203 
00204 
00205 private:
00206   OrientImageFilter(const Self&); //purposely not implemented
00207   void operator=(const Self&); //purposely not implemented
00208 
00209   CoordinateOrientationCode     m_GivenCoordinateOrientation;
00210   CoordinateOrientationCode     m_DesiredCoordinateOrientation;
00211 
00212   PermuteOrderArrayType              m_PermuteOrder;
00213   FlipAxesArrayType                  m_FlipAxes;
00214 } ; // end of class
00215 
00216 } // end namespace itk
00217 
00218 #ifndef ITK_MANUAL_INSTANTIATION
00219 #include "itkOrientImageFilter.txx"
00220 #endif
00221 
00222 #endif
00223 
00224 

Generated at Wed Mar 30 00:06:33 2005 for ITK by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2000