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
00062 template <class TInputImage, class TOutputImage>
00063 class ITK_EXPORT ExtractImageFilter:
00064 public ImageToImageFilter<TInputImage,TOutputImage>
00065 {
00066 public:
00068 typedef ExtractImageFilter Self;
00069 typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00070 typedef SmartPointer<Self> Pointer;
00071 typedef SmartPointer<const Self> ConstPointer;
00072
00074 itkNewMacro(Self);
00075
00077 itkTypeMacro(ExtractImageFilter, ImageToImageFilter);
00078
00080 typedef TInputImage InputImageType;
00081 typedef TOutputImage OutputImageType;
00082
00084 typedef typename TOutputImage::RegionType OutputImageRegionType;
00085 typedef typename TInputImage::RegionType InputImageRegionType;
00086
00088 typedef typename TOutputImage::PixelType OutputImagePixelType;
00089 typedef typename TInputImage::PixelType InputImagePixelType;
00090
00092 typedef typename TOutputImage::IndexType OutputImageIndexType;
00093 typedef typename TInputImage::IndexType InputImageIndexType;
00094 typedef typename TOutputImage::SizeType OutputImageSizeType;
00095 typedef typename TInputImage::SizeType InputImageSizeType;
00096
00098 itkStaticConstMacro(InputImageDimension, unsigned int,
00099 TInputImage::ImageDimension);
00100 itkStaticConstMacro(OutputImageDimension, unsigned int,
00101 TOutputImage::ImageDimension);
00103
00104 typedef ImageToImageFilterDetail::ExtractImageFilterRegionCopier<
00105 itkGetStaticConstMacro(InputImageDimension),
00106 itkGetStaticConstMacro(OutputImageDimension)> ExtractImageFilterRegionCopierType;
00107
00113 void SetExtractionRegion(InputImageRegionType extractRegion);
00114 itkGetMacro(ExtractionRegion, InputImageRegionType);
00116
00117 #ifdef ITK_USE_CONCEPT_CHECKING
00118
00119 itkConceptMacro(InputCovertibleToOutputCheck,
00120 (Concept::Convertible<InputImagePixelType, OutputImagePixelType>));
00121
00123 #endif
00124
00125 protected:
00126 ExtractImageFilter();
00127 ~ExtractImageFilter() {};
00128 void PrintSelf(std::ostream& os, Indent indent) const;
00129
00138 virtual void GenerateOutputInformation();
00139
00150 virtual void CallCopyOutputRegionToInputRegion(InputImageRegionType &destRegion,
00151 const OutputImageRegionType &srcRegion);
00152
00162 void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00163 int threadId );
00164 InputImageRegionType m_ExtractionRegion;
00165 OutputImageRegionType m_OutputImageRegion;
00167
00168 private:
00169 ExtractImageFilter(const Self&);
00170 void operator=(const Self&);
00171
00172 };
00173
00174
00175 }
00176
00177 #ifndef ITK_MANUAL_INSTANTIATION
00178 #include "itkExtractImageFilter.txx"
00179 #endif
00180
00181 #endif
00182