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 TInputImage InputImageType;
00073 typedef TOutputImage OutputImageType;
00074
00076 typedef typename TOutputImage::RegionType OutputImageRegionType;
00077 typedef typename TInputImage::RegionType InputImageRegionType;
00078
00080 typedef typename TOutputImage::PixelType OutputImagePixelType;
00081 typedef typename TInputImage::PixelType InputImagePixelType;
00082
00084 typedef typename TOutputImage::IndexType OutputImageIndexType;
00085 typedef typename TInputImage::IndexType InputImageIndexType;
00086 typedef typename TOutputImage::SizeType OutputImageSizeType;
00087 typedef typename TInputImage::SizeType InputImageSizeType;
00088
00090 itkStaticConstMacro(InputImageDimension, unsigned int,
00091 TInputImage::ImageDimension);
00092 itkStaticConstMacro(OutputImageDimension, unsigned int,
00093 TOutputImage::ImageDimension);
00094
00095 typedef
00096 ImageToImageFilterDetail::ExtractImageFilterRegionCopier<itkGetStaticConstMacro(InputImageDimension),
00097 itkGetStaticConstMacro(OutputImageDimension)> ExtractImageFilterRegionCopierType;
00098
00104 void SetExtractionRegion(InputImageRegionType extractRegion);
00105 itkGetMacro(ExtractionRegion, InputImageRegionType);
00106
00107 protected:
00108 ExtractImageFilter();
00109 ~ExtractImageFilter() {};
00110 void PrintSelf(std::ostream& os, Indent indent) const;
00111
00120 virtual void GenerateOutputInformation();
00121
00132 virtual void CallCopyOutputRegionToInputRegion(InputImageRegionType &destRegion,
00133 const OutputImageRegionType &srcRegion);
00134
00144 void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00145 int threadId );
00146 InputImageRegionType m_ExtractionRegion;
00147 OutputImageRegionType m_OutputImageRegion;
00148
00149 private:
00150 ExtractImageFilter(const Self&);
00151 void operator=(const Self&);
00152
00153 };
00154
00155
00156 }
00157
00158 #ifndef ITK_MANUAL_INSTANTIATION
00159 #include "itkExtractImageFilter.txx"
00160 #endif
00161
00162 #endif