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

itkInterpolateImagePointsFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkInterpolateImagePointsFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2006-03-29 14:53:40 $
00007   Version:   $Revision: 1.10 $
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   Portions of this code are covered under the VTK copyright.
00013   See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm for details.
00014 
00015      This software is distributed WITHOUT ANY WARRANTY; without even 
00016      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00017      PURPOSE.  See the above copyright notices for more information.
00018 
00019 =========================================================================*/
00020 
00021 #ifndef __itkInterpolateImagePointsFilter_h
00022 #define __itkInterpolateImagePointsFilter_h
00023 
00024 #include "itkBSplineInterpolateImageFunction.h"
00025 #include "itkImageToImageFilter.h"
00026 #include "itkImageToImageFilterDetail.h"
00027 #include "itkImageRegionIterator.h"
00028 #include "itkImageRegionConstIterator.h"
00029 
00030 namespace itk
00031 {
00070 template <class TInputImage, 
00071           class TOutputImage, 
00072           class TCoordType = ITK_TYPENAME TInputImage::PixelType, 
00073           class InterpolatorType = BSplineInterpolateImageFunction<TInputImage, TCoordType> > 
00074 class ITK_EXPORT InterpolateImagePointsFilter : 
00075     public ImageToImageFilter<TInputImage, TOutputImage>
00076 {
00077 public:
00079   typedef InterpolateImagePointsFilter       Self;
00080   typedef ImageToImageFilter<TInputImage, TOutputImage> Superclass;
00081   typedef SmartPointer<Self>                 Pointer;
00082   typedef SmartPointer<const Self>           ConstPointer;
00083 
00085   itkTypeMacro(InterpolateImagePointsFilter, ImageToImageFilter);
00086 
00087  
00089   itkNewMacro( Self );
00090 
00092   itkStaticConstMacro(ImageDimension, unsigned int, TInputImage::ImageDimension );
00093 
00095   typedef typename Superclass::InputImageType InputImageType;
00096   typedef typename Superclass::OutputImageType OutputImageType;
00097   typedef typename Superclass::InputImagePointer InputImagePointer;
00098 
00100   typedef typename TOutputImage::Pointer OutputImagePointer;
00101   typedef ImageRegionIterator<InputImageType> OutputImageIterator;
00102   typedef typename OutputImageType::RegionType             OutputImageRegionType;
00103 
00105   typedef typename TOutputImage::PixelType   PixelType;
00106 
00107 
00108 
00110   typedef typename InterpolatorType::Pointer InterpolatorPointer;
00111   typedef typename InterpolatorType::ContinuousIndexType    ContinuousIndexType;
00112 
00114   typedef Image< TCoordType, itkGetStaticConstMacro(ImageDimension) > CoordImageType;
00115 
00117   typedef ImageToImageFilterDetail::ImageRegionCopier<itkGetStaticConstMacro(ImageDimension),itkGetStaticConstMacro(ImageDimension)>     RegionCopierType; 
00118 
00123   void SetInputImage (const TInputImage * inputImage);
00124 
00127   void SetInterpolationCoordinate (const CoordImageType * coordinate, unsigned int setDimension);
00128 
00130   itkSetMacro(DefaultPixelValue,PixelType);
00131 
00133   itkGetMacro(DefaultPixelValue,PixelType);
00134 
00136   InterpolatorPointer GetInterpolator()
00137   {  return m_Interpolator;  }
00138 
00141   void GenerateOutputInformation();
00142 
00144   void GenerateInputRequestedRegion();
00145 
00146 #ifdef ITK_USE_CONCEPT_CHECKING
00147 
00148   itkConceptMacro(InputHasNumericTraitsCheck,
00149     (Concept::HasNumericTraits<typename TInputImage::PixelType>));
00150 
00152 #endif
00153 
00154 protected:
00157 //  void EvaluateAtContinuousIndex( OutputImagePointer );
00158 
00161   void ThreadedGenerateData( const OutputImageRegionType& outputRegionForThread,
00162                              int threadId );
00163   void BeforeThreadedGenerateData();
00165 
00166   InterpolateImagePointsFilter();
00167   ~InterpolateImagePointsFilter(){};
00168   void PrintSelf(std::ostream& os, Indent indent) const;
00169     
00170 private:
00171 
00173   typedef typename CoordImageType::Pointer CoordImageTypePointer;
00174   typedef ImageRegionConstIterator<CoordImageType>   CoordImageIterator;
00175   typedef typename CoordImageType::RegionType              CoordImageRegionType;
00176 
00177   InterpolateImagePointsFilter( const Self& ); //purposely not implemented
00178   void operator=( const Self& ); //purposely not implemented
00179 
00180   InterpolatorPointer      m_Interpolator;
00181   PixelType                m_DefaultPixelValue; // default pixel value if the
00182                                                 // point is outside the image
00183 };
00184 
00185 } // namespace itk
00186 
00187 #ifndef ITK_MANUAL_INSTANTIATION
00188 #include "itkInterpolateImagePointsFilter.txx"
00189 #endif
00190 
00191 #endif
00192 

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