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

itkChangeInformationImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkChangeInformationImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2005-04-18 18:14:58 $
00007   Version:   $Revision: 1.9 $
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 __itkChangeInformationImageFilter_h
00018 #define __itkChangeInformationImageFilter_h
00019 
00020 #include "itkImageToImageFilter.h"
00021 #include "itkFixedArray.h"
00022 
00023 namespace itk
00024 {
00025 
00047 template <class TInputImage>
00048 class ITK_EXPORT ChangeInformationImageFilter:
00049     public ImageToImageFilter<TInputImage,TInputImage>
00050 {
00051 public:
00053   typedef ChangeInformationImageFilter         Self;
00054   typedef ImageToImageFilter<TInputImage,TInputImage>  Superclass;
00055   typedef SmartPointer<Self>  Pointer;
00056   typedef SmartPointer<const Self>  ConstPointer;
00057 
00059   itkNewMacro(Self);  
00060 
00062   typedef typename TInputImage::RegionType OutputImageRegionType;
00063   typedef typename TInputImage::RegionType InputImageRegionType;
00064 
00066   typedef typename TInputImage::Pointer InputImagePointer;
00067 
00069   typedef typename TInputImage::PixelType OutputImagePixelType;
00070   typedef typename TInputImage::PixelType InputImagePixelType;
00071 
00073   typedef typename TInputImage::IndexType OutputImageIndexType;
00074   typedef typename TInputImage::IndexType InputImageIndexType;
00075   typedef typename TInputImage::SizeType OutputImageSizeType;
00076   typedef typename TInputImage::SizeType InputImageSizeType;
00077   typedef typename TInputImage::OffsetType OutputImageOffsetType;
00078   typedef typename TInputImage::OffsetType InputImageOffsetType;
00079   typedef typename TInputImage::DirectionType OutputImageDirectionType;
00080   typedef typename TInputImage::DirectionType InputImageDirectionType;
00081 
00083   itkStaticConstMacro(ImageDimension, unsigned int,
00084                       TInputImage::ImageDimension);
00085 
00087   typedef typename TInputImage::SpacingType SpacingType;
00088   typedef typename TInputImage::PointType   PointType;
00089   typedef typename TInputImage::DirectionType DirectionType;
00090 
00092   itkTypeMacro(ChangeInformationImageFilter, ImageToImageFilter);
00093 
00096   void SetReferenceImage (TInputImage *image)
00097   {
00098     if (image != m_ReferenceImage)
00099       {
00100       m_ReferenceImage = image;
00101       this->ProcessObject::SetNthInput(1, image);
00102       this->Modified();
00103       }
00104   }
00105   itkGetObjectMacro(ReferenceImage, TInputImage);
00107 
00108   itkSetMacro(UseReferenceImage, bool);
00109   itkBooleanMacro(UseReferenceImage);
00110   itkGetMacro(UseReferenceImage, bool);
00111 
00115   itkSetMacro(OutputSpacing, SpacingType);
00116   itkGetConstReferenceMacro(OutputSpacing, SpacingType);
00118 
00122   itkSetMacro(OutputOrigin, PointType);
00123   itkGetConstReferenceMacro(OutputOrigin, PointType);
00125 
00129   itkSetMacro(OutputDirection, DirectionType);
00130   itkGetConstReferenceMacro(OutputDirection, DirectionType);
00132 
00141   itkSetVectorMacro(OutputOffset, long, ImageDimension);
00142   itkGetVectorMacro(OutputOffset, const long, ImageDimension);
00144 
00146   void ChangeAll()
00147   {
00148     this->ChangeSpacingOn();
00149     this->ChangeOriginOn();
00150     this->ChangeDirectionOn();
00151     this->ChangeRegionOn();
00152   }
00154 
00157   void ChangeNone()
00158   {
00159     this->ChangeSpacingOff();
00160     this->ChangeOriginOff();
00161     this->ChangeDirectionOff();
00162     this->ChangeRegionOff();
00163   }
00165 
00172   itkSetMacro(ChangeSpacing, bool);
00173   itkBooleanMacro(ChangeSpacing);
00174   itkGetMacro(ChangeSpacing, bool);
00175 
00182   itkSetMacro(ChangeOrigin, bool);
00183   itkBooleanMacro(ChangeOrigin);
00184   itkGetMacro(ChangeOrigin, bool);
00185 
00192   itkSetMacro(ChangeDirection, bool);
00193   itkBooleanMacro(ChangeDirection);
00194   itkGetMacro(ChangeDirection, bool);
00195 
00198   itkSetMacro(ChangeRegion, bool);
00199   itkBooleanMacro(ChangeRegion);
00200   itkGetMacro(ChangeRegion, bool);
00201 
00205   itkSetMacro(CenterImage, bool);
00206   itkBooleanMacro(CenterImage);
00207   itkGetMacro(CenterImage, bool);
00209 
00211   virtual void GenerateOutputInformation();
00212 
00214   virtual void GenerateInputRequestedRegion();
00215 
00217   void GenerateData();
00218 
00219 protected:
00220   ChangeInformationImageFilter();
00221   ~ChangeInformationImageFilter() {};
00222   void PrintSelf(std::ostream& os, Indent indent) const;
00223 
00224 private:
00225   ChangeInformationImageFilter(const Self&); //purposely not implemented
00226   void operator=(const Self&); //purposely not implemented
00227 
00228   InputImagePointer m_ReferenceImage;
00229 
00230   bool m_CenterImage;
00231   bool m_ChangeSpacing;
00232   bool m_ChangeOrigin;
00233   bool m_ChangeDirection;
00234   bool m_ChangeRegion;
00235   bool m_UseReferenceImage;
00236   
00237   SpacingType m_OutputSpacing;
00238   PointType m_OutputOrigin;
00239   DirectionType m_OutputDirection;
00240 
00241   long m_OutputOffset[ImageDimension];
00242   OutputImageOffsetType m_Shift;
00243 };
00244 
00245   
00246 } // end namespace itk
00247   
00248 #ifndef ITK_MANUAL_INSTANTIATION
00249 #include "itkChangeInformationImageFilter.txx"
00250 #endif
00251   
00252 #endif
00253 

Generated at Mon Apr 14 11:57:54 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000