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
00081 typedef TInputImage InputImageType;
00082 typedef typename InputImageType::Pointer InputImagePointer;
00083 typedef typename InputImageType::ConstPointer InputImageConstPointer;
00084 typedef typename InputImageType::RegionType InputImageRegionType;
00085 typedef typename InputImageType::PixelType InputImagePixelType;
00086
00088 itkStaticConstMacro(InputImageDimension, unsigned int,
00089 TInputImage::ImageDimension);
00090 itkStaticConstMacro(OutputImageDimension, unsigned int,
00091 TOutputImage::ImageDimension);
00093
00095 virtual void SetInput( const InputImageType *image);
00096 virtual void SetInput( unsigned int, const TInputImage * image);
00097 const InputImageType * GetInput(void);
00098 const InputImageType * GetInput(unsigned int idx);
00100
00120 virtual void PushBackInput( const InputImageType *image);
00121 virtual void PopBackInput();
00122 virtual void PushFrontInput( const InputImageType *image);
00123 virtual void PopFrontInput();
00125
00126
00127 protected:
00128 ImageToImageFilter();
00129 ~ImageToImageFilter();
00130
00131 virtual void PrintSelf(std::ostream& os, Indent indent) const;
00132
00157 virtual void GenerateInputRequestedRegion();
00158
00159
00162 typedef ImageToImageFilterDetail::ImageRegionCopier<itkGetStaticConstMacro(OutputImageDimension),
00163 itkGetStaticConstMacro(InputImageDimension)> InputToOutputRegionCopierType;
00164
00167 typedef ImageToImageFilterDetail::ImageRegionCopier<itkGetStaticConstMacro(InputImageDimension),
00168 itkGetStaticConstMacro(OutputImageDimension)> OutputToInputRegionCopierType;
00169
00205 virtual void CallCopyOutputRegionToInputRegion(InputImageRegionType &destRegion,
00206 const OutputImageRegionType &srcRegion);
00207
00238 virtual void CallCopyInputRegionToOutputRegion(OutputImageRegionType &destRegion,
00239 const InputImageRegionType &srcRegion);
00240
00241
00250 void PushBackInput(const DataObject *input)
00251 { Superclass::PushBackInput(input); }
00252 void PushFrontInput(const DataObject *input)
00253 { Superclass::PushFrontInput(input); }
00255
00256 private:
00257 ImageToImageFilter(const Self&);
00258 void operator=(const Self&);
00259 };
00260
00261 }
00262
00263
00264 #define ITK_TEMPLATE_ImageToImageFilter(_, EXPORT, x, y) namespace itk { \
00265 _(2(class EXPORT ImageToImageFilter< ITK_TEMPLATE_2 x >)) \
00266 namespace Templates { typedef ImageToImageFilter< ITK_TEMPLATE_2 x > ImageToImageFilter##y; } \
00267 }
00268
00269 #if ITK_TEMPLATE_EXPLICIT
00270 # include "Templates/itkImageToImageFilter+-.h"
00271 #endif
00272
00273 #if ITK_TEMPLATE_TXX
00274 # include "itkImageToImageFilter.txx"
00275 #endif
00276
00277 #endif
00278