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/01/09 00:41:24 $
00007 Version:   $Revision: 1.2 $
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 
00139   itkStaticConstMacro(InputImageDimension, unsigned int,
00140                       TInputImage::ImageDimension);
00141   itkStaticConstMacro(OutputImageDimension, unsigned int,
00142                       TOutputImage::ImageDimension);
00143 
00145   itkNewMacro(Self);
00146 
00148   itkTypeMacro(OrientImageFilter, ImageToImageFilter);
00149 
00151   itkGetMacro(GivenCoordinateOrientation, CoordinateOrientationCode);
00152   void SetGivenCoordinateOrientation(CoordinateOrientationCode newCode);
00153   itkGetMacro(DesiredCoordinateOrientation, CoordinateOrientationCode);
00154   void SetDesiredCoordinateOrientation(CoordinateOrientationCode newCode);
00155 
00157   itkGetConstReferenceMacro( PermuteOrder, PermuteOrderArrayType );
00158 
00160   itkGetConstReferenceMacro( FlipAxes, FlipAxesArrayType );
00161 
00169   virtual void GenerateOutputInformation();
00170 
00171 protected:
00172   OrientImageFilter();
00173   ~OrientImageFilter() {};
00174   void PrintSelf(std::ostream& os, Indent indent) const;
00175 
00179   void GenerateInputRequestedRegion() ;
00180 
00182   void EnlargeOutputRequestedRegion(DataObject *itkNotUsed(output));
00183 
00184   /*** Member functions used by GenerateData: */
00185   void DeterminePermutationsAndFlips(const SpatialOrientation::ValidCoordinateOrientationFlags fixed_orient, const SpatialOrientation::ValidCoordinateOrientationFlags moving_orient);
00186   bool NeedToPermute();
00187   bool NeedToFlip();
00188 
00189 
00192   void GenerateData();
00193 
00194 
00195 private:
00196   OrientImageFilter(const Self&); //purposely not implemented
00197   void operator=(const Self&); //purposely not implemented
00198 
00199   CoordinateOrientationCode     m_GivenCoordinateOrientation;
00200   CoordinateOrientationCode     m_DesiredCoordinateOrientation;
00201 
00202   PermuteOrderArrayType              m_PermuteOrder;
00203   FlipAxesArrayType                  m_FlipAxes;
00204 } ; // end of class
00205 
00206 } // end namespace itk
00207 
00208 #ifndef ITK_MANUAL_INSTANTIATION
00209 #include "itkOrientImageFilter.txx"
00210 #endif
00211 
00212 #endif
00213 
00214 

Generated at Sun Jan 25 13:19:42 2004 for ITK by doxygen 1.3.3 written by Dimitri van Heesch, © 1997-2000