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
00055 template <class TInputImage, class TOutputImage>
00056 class ITK_EXPORT ExtractImageFilter:
00057 public ImageToImageFilter<TInputImage,TOutputImage>
00058 {
00059 public:
00061 typedef ExtractImageFilter Self;
00062 typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00063 typedef SmartPointer<Self> Pointer;
00064 typedef SmartPointer<const Self> ConstPointer;
00065
00067 itkNewMacro(Self);
00068
00070 itkTypeMacro(ExtractImageFilter, ImageToImageFilter);
00071
00073 typedef TInputImage InputImageType;
00074 typedef TOutputImage OutputImageType;
00075
00077 typedef typename TOutputImage::RegionType OutputImageRegionType;
00078 typedef typename TInputImage::RegionType InputImageRegionType;
00079
00081 typedef typename TOutputImage::PixelType OutputImagePixelType;
00082 typedef typename TInputImage::PixelType InputImagePixelType;
00083
00085 typedef typename TOutputImage::IndexType OutputImageIndexType;
00086 typedef typename TInputImage::IndexType InputImageIndexType;
00087 typedef typename TOutputImage::SizeType OutputImageSizeType;
00088 typedef typename TInputImage::SizeType InputImageSizeType;
00089
00091 itkStaticConstMacro(InputImageDimension, unsigned int,
00092 TInputImage::ImageDimension);
00093 itkStaticConstMacro(OutputImageDimension, unsigned int,
00094 TOutputImage::ImageDimension);
00096
00097 typedef ImageToImageFilterDetail::ExtractImageFilterRegionCopier<
00098 itkGetStaticConstMacro(InputImageDimension),
00099 itkGetStaticConstMacro(OutputImageDimension)> ExtractImageFilterRegionCopierType;
00100
00106 void SetExtractionRegion(InputImageRegionType extractRegion);
00107 itkGetMacro(ExtractionRegion, InputImageRegionType);
00109
00110 #ifdef ITK_USE_CONCEPT_CHECKING
00111
00112 itkConceptMacro(InputCovertibleToOutputCheck,
00113 (Concept::Convertible<InputImagePixelType, OutputImagePixelType>));
00114
00116 #endif
00117
00118 protected:
00119 ExtractImageFilter();
00120 ~ExtractImageFilter() {};
00121 void PrintSelf(std::ostream& os, Indent indent) const;
00122
00131 virtual void GenerateOutputInformation();
00132
00143 virtual void CallCopyOutputRegionToInputRegion(InputImageRegionType &destRegion,
00144 const OutputImageRegionType &srcRegion);
00145
00155 void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00156 int threadId );
00157 InputImageRegionType m_ExtractionRegion;
00158 OutputImageRegionType m_OutputImageRegion;
00160
00161 private:
00162 ExtractImageFilter(const Self&);
00163 void operator=(const Self&);
00164
00165 };
00166
00167
00168 }
00169
00170 #ifndef ITK_MANUAL_INSTANTIATION
00171 #include "itkExtractImageFilter.txx"
00172 #endif
00173
00174 #endif
00175