00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkExtractImageFilter_h
00018 #define __itkExtractImageFilter_h
00019
00020 #include "itkImageToImageFilter.h"
00021 #include "itkSmartPointer.h"
00022 #include "itkExtractImageFilterRegionCopier.h"
00023
00024 namespace itk
00025 {
00026
00054 template <class TInputImage, class TOutputImage>
00055 class ITK_EXPORT ExtractImageFilter:
00056 public ImageToImageFilter<TInputImage,TOutputImage>
00057 {
00058 public:
00060 typedef ExtractImageFilter Self;
00061 typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00062 typedef SmartPointer<Self> Pointer;
00063 typedef SmartPointer<const Self> ConstPointer;
00064
00066 itkNewMacro(Self);
00067
00069 itkTypeMacro(ExtractImageFilter, ImageToImageFilter);
00070
00072 typedef typename TOutputImage::RegionType OutputImageRegionType;
00073 typedef typename TInputImage::RegionType InputImageRegionType;
00074
00076 typedef typename TOutputImage::PixelType OutputImagePixelType;
00077 typedef typename TInputImage::PixelType InputImagePixelType;
00078
00080 typedef typename TOutputImage::IndexType OutputImageIndexType;
00081 typedef typename TInputImage::IndexType InputImageIndexType;
00082 typedef typename TOutputImage::SizeType OutputImageSizeType;
00083 typedef typename TInputImage::SizeType InputImageSizeType;
00084
00086 itkStaticConstMacro(InputImageDimension, unsigned int,
00087 TInputImage::ImageDimension);
00088 itkStaticConstMacro(OutputImageDimension, unsigned int,
00089 TOutputImage::ImageDimension);
00090
00091 typedef
00092 ImageToImageFilterDetail::ExtractImageFilterRegionCopier<itkGetStaticConstMacro(InputImageDimension),
00093 itkGetStaticConstMacro(OutputImageDimension)> ExtractImageFilterRegionCopierType;
00094
00100 void SetExtractionRegion(InputImageRegionType extractRegion);
00101 itkGetMacro(ExtractionRegion, InputImageRegionType);
00102
00103
00110 virtual void GenerateOutputInformation();
00111
00112 virtual void CallCopyRegion(InputImageRegionType &destRegion,
00113 const OutputImageRegionType &srcRegion);
00114 protected:
00115 ExtractImageFilter();
00116 ~ExtractImageFilter() {};
00117 void PrintSelf(std::ostream& os, Indent indent) const;
00118
00128 void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00129 int threadId );
00130 InputImageRegionType m_ExtractionRegion;
00131 OutputImageRegionType m_OutputImageRegion;
00132
00133 private:
00134 ExtractImageFilter(const Self&);
00135 void operator=(const Self&);
00136
00137 };
00138
00139
00140 }
00141
00142 #ifndef ITK_MANUAL_INSTANTIATION
00143 #include "itkExtractImageFilter.txx"
00144 #endif
00145
00146 #endif