00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __itkImageToImageFilter_h
00021 #define __itkImageToImageFilter_h
00022
00023 #include "itkImage.h"
00024 #include "itkImageSource.h"
00025 #include "itkConceptChecking.h"
00026 #include "itkImageToImageFilterDetail.h"
00027
00028 namespace itk
00029 {
00030
00063 template <class TInputImage, class TOutputImage>
00064 class ITK_EXPORT ImageToImageFilter : public ImageSource<TOutputImage>
00065 {
00066 public:
00068 typedef ImageToImageFilter Self;
00069 typedef ImageSource<TOutputImage> Superclass;
00070 typedef SmartPointer<Self> Pointer;
00071 typedef SmartPointer<const Self> ConstPointer;
00072
00073
00075 itkTypeMacro(ImageToImageFilter,ImageSource);
00076
00078 typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
00079 typedef typename Superclass::OutputImagePixelType OutputImagePixelType;
00080
00082 typedef TInputImage InputImageType;
00083 typedef typename InputImageType::Pointer InputImagePointer;
00084 typedef typename InputImageType::ConstPointer InputImageConstPointer;
00085 typedef typename InputImageType::RegionType InputImageRegionType;
00086 typedef typename InputImageType::PixelType InputImagePixelType;
00087
00089 itkStaticConstMacro(InputImageDimension, unsigned int,
00090 TInputImage::ImageDimension);
00091 itkStaticConstMacro(OutputImageDimension, unsigned int,
00092 TOutputImage::ImageDimension);
00094
00096 virtual void SetInput( const InputImageType *image);
00097 virtual void SetInput( unsigned int, const TInputImage * image);
00098 const InputImageType * GetInput(void);
00099 const InputImageType * GetInput(unsigned int idx);
00101
00121 virtual void PushBackInput( const InputImageType *image);
00122 virtual void PopBackInput();
00123 virtual void PushFrontInput( const InputImageType *image);
00124 virtual void PopFrontInput();
00126
00127
00128 protected:
00129 ImageToImageFilter();
00130 ~ImageToImageFilter();
00131
00132 virtual void PrintSelf(std::ostream& os, Indent indent) const;
00133
00158 virtual void GenerateInputRequestedRegion();
00159
00160
00163 typedef ImageToImageFilterDetail::ImageRegionCopier<itkGetStaticConstMacro(OutputImageDimension),
00164 itkGetStaticConstMacro(InputImageDimension)> InputToOutputRegionCopierType;
00165
00168 typedef ImageToImageFilterDetail::ImageRegionCopier<itkGetStaticConstMacro(InputImageDimension),
00169 itkGetStaticConstMacro(OutputImageDimension)> OutputToInputRegionCopierType;
00170
00206 virtual void CallCopyOutputRegionToInputRegion(InputImageRegionType &destRegion,
00207 const OutputImageRegionType &srcRegion);
00208
00239 virtual void CallCopyInputRegionToOutputRegion(OutputImageRegionType &destRegion,
00240 const InputImageRegionType &srcRegion);
00241
00242
00251 void PushBackInput(const DataObject *input)
00252 { Superclass::PushBackInput(input); }
00253 void PushFrontInput(const DataObject *input)
00254 { Superclass::PushFrontInput(input); }
00256
00257 private:
00258 ImageToImageFilter(const Self&);
00259 void operator=(const Self&);
00260 };
00261
00262 }
00263
00264
00265 #define ITK_TEMPLATE_ImageToImageFilter(_, EXPORT, x, y) namespace itk { \
00266 _(2(class EXPORT ImageToImageFilter< ITK_TEMPLATE_2 x >)) \
00267 namespace Templates { typedef ImageToImageFilter< ITK_TEMPLATE_2 x > ImageToImageFilter##y; } \
00268 }
00269
00270 #if ITK_TEMPLATE_EXPLICIT
00271 # include "Templates/itkImageToImageFilter+-.h"
00272 #endif
00273
00274 #if ITK_TEMPLATE_TXX
00275 # include "itkImageToImageFilter.txx"
00276 #endif
00277
00278 #endif
00279