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);
00092
00094 virtual void SetInput( const InputImageType *image);
00095 virtual void SetInput( unsigned int, const TInputImage * image);
00096 const InputImageType * GetInput(void);
00097 const InputImageType * GetInput(unsigned int idx);
00098
00099
00100 protected:
00101 ImageToImageFilter();
00102 ~ImageToImageFilter();
00103
00104 virtual void PrintSelf(std::ostream& os, Indent indent) const;
00105
00130 virtual void GenerateInputRequestedRegion();
00131
00132
00135 typedef ImageToImageFilterDetail::ImageRegionCopier<itkGetStaticConstMacro(OutputImageDimension),
00136 itkGetStaticConstMacro(InputImageDimension)> InputToOutputRegionCopierType;
00137
00140 typedef ImageToImageFilterDetail::ImageRegionCopier<itkGetStaticConstMacro(InputImageDimension),
00141 itkGetStaticConstMacro(OutputImageDimension)> OutputToInputRegionCopierType;
00142
00178 virtual void CallCopyOutputRegionToInputRegion(InputImageRegionType &destRegion,
00179 const OutputImageRegionType &srcRegion);
00180
00211 virtual void CallCopyInputRegionToOutputRegion(OutputImageRegionType &destRegion,
00212 const InputImageRegionType &srcRegion);
00213
00214
00215 private:
00216 ImageToImageFilter(const Self&);
00217 void operator=(const Self&);
00218 };
00219
00220
00221 #ifdef ITK_EXPLICIT_INSTANTIATION
00222 export template class ImageToImageFilter<Image<float ,2>, Image<float ,2> >;
00223 export template class ImageToImageFilter<Image<double ,2>, Image<double ,2> >;
00224 export template class ImageToImageFilter<Image<unsigned char ,2>, Image<unsigned char ,2> >;
00225 export template class ImageToImageFilter<Image<unsigned short,2>, Image<unsigned short,2> >;
00226 export template class ImageToImageFilter<Image<signed char ,2>, Image<signed char ,2> >;
00227 export template class ImageToImageFilter<Image<signed short ,2>, Image<signed short ,2> >;
00228 export template class ImageToImageFilter<Image<signed int ,2>, Image<signed int ,2> >;
00229
00230 export template class ImageToImageFilter<Image<double ,2>, Image<float ,2> >;
00231 export template class ImageToImageFilter<Image<unsigned char ,2>, Image<float ,2> >;
00232 export template class ImageToImageFilter<Image<unsigned short,2>, Image<float ,2> >;
00233 export template class ImageToImageFilter<Image<signed char ,2>, Image<float ,2> >;
00234 export template class ImageToImageFilter<Image<signed short ,2>, Image<float ,2> >;
00235
00236 export template class ImageToImageFilter<Image<float ,2>, Image<double ,2> >;
00237 export template class ImageToImageFilter<Image<float ,2>, Image<unsigned char ,2> >;
00238 export template class ImageToImageFilter<Image<float ,2>, Image<unsigned short,2> >;
00239 export template class ImageToImageFilter<Image<float ,2>, Image<signed char ,2> >;
00240 export template class ImageToImageFilter<Image<float ,2>, Image<signed short ,2> >;
00241
00242 export template class ImageToImageFilter<Image<float ,3>, Image<float ,3> >;
00243 export template class ImageToImageFilter<Image<double ,3>, Image<double ,3> >;
00244 export template class ImageToImageFilter<Image<unsigned char ,3>, Image<unsigned char ,3> >;
00245 export template class ImageToImageFilter<Image<unsigned short,3>, Image<unsigned short,3> >;
00246 export template class ImageToImageFilter<Image<signed char ,3>, Image<signed char ,3> >;
00247 export template class ImageToImageFilter<Image<signed short ,3>, Image<signed short ,3> >;
00248 export template class ImageToImageFilter<Image<signed int ,3>, Image<signed int ,3> >;
00249
00250 export template class ImageToImageFilter<Image<double ,3>, Image<float ,3> >;
00251 export template class ImageToImageFilter<Image<unsigned char ,3>, Image<float ,3> >;
00252 export template class ImageToImageFilter<Image<unsigned short,3>, Image<float ,3> >;
00253 export template class ImageToImageFilter<Image<signed char ,3>, Image<float ,3> >;
00254 export template class ImageToImageFilter<Image<signed short ,3>, Image<float ,3> >;
00255
00256 export template class ImageToImageFilter<Image<float ,3>, Image<double ,3> >;
00257 export template class ImageToImageFilter<Image<float ,3>, Image<unsigned char ,3> >;
00258 export template class ImageToImageFilter<Image<float ,3>, Image<unsigned short,3> >;
00259 export template class ImageToImageFilter<Image<float ,3>, Image<signed char ,3> >;
00260 export template class ImageToImageFilter<Image<float ,3>, Image<signed short ,3> >;
00261 #endif
00262 }
00263
00264 #ifndef ITK_MANUAL_INSTANTIATION
00265 #include "itkImageToImageFilter.txx"
00266 #endif
00267
00268 #endif