2 #ifndef __clitkExtractImageFilter_h
3 #define __clitkExtractImageFilter_h
5 #include "itkImageToImageFilter.h"
6 #include "itkSmartPointer.h"
7 #include "itkExtractImageFilterRegionCopier.h"
12 template <class TInputImage, class TOutputImage>
13 class ITK_EXPORT ExtractImageFilter:
14 public itk::ImageToImageFilter<TInputImage,TOutputImage>
17 /** Standard class typedefs. */
18 typedef ExtractImageFilter Self;
19 typedef itk::ImageToImageFilter<TInputImage,TOutputImage> Superclass;
20 typedef itk::SmartPointer<Self> Pointer;
21 typedef itk::SmartPointer<const Self> ConstPointer;
23 /** Method for creation through the object factory. */
26 /** Run-time type information (and related methods). */
27 itkTypeMacro(ExtractImageFilter, ImageToImageFilter);
29 /** Image type information. */
30 typedef TInputImage InputImageType;
31 typedef TOutputImage OutputImageType;
33 /** Typedef to describe the output and input image region types. */
34 typedef typename TOutputImage::RegionType OutputImageRegionType;
35 typedef typename TInputImage::RegionType InputImageRegionType;
37 /** Typedef to describe the type of pixel. */
38 typedef typename TOutputImage::PixelType OutputImagePixelType;
39 typedef typename TInputImage::PixelType InputImagePixelType;
41 /** Typedef to describe the output and input image index and size types. */
42 typedef typename TOutputImage::IndexType OutputImageIndexType;
43 typedef typename TInputImage::IndexType InputImageIndexType;
44 typedef typename TOutputImage::SizeType OutputImageSizeType;
45 typedef typename TInputImage::SizeType InputImageSizeType;
47 /** ImageDimension enumeration */
48 itkStaticConstMacro(InputImageDimension, unsigned int,
49 TInputImage::ImageDimension);
50 itkStaticConstMacro(OutputImageDimension, unsigned int,
51 TOutputImage::ImageDimension);
53 typedef itk::ImageToImageFilterDetail::ExtractImageFilterRegionCopier<
54 itkGetStaticConstMacro(InputImageDimension),
55 itkGetStaticConstMacro(OutputImageDimension)> ExtractImageFilterRegionCopierType;
57 void SetExtractionRegion(InputImageRegionType extractRegion);
58 itkGetMacro(ExtractionRegion, InputImageRegionType);
60 #ifdef ITK_USE_CONCEPT_CHECKING
61 /** Begin concept checking */
62 itkConceptMacro(InputCovertibleToOutputCheck,
63 (itk::Concept::Convertible<InputImagePixelType, OutputImagePixelType>));
64 /** End concept checking */
69 ~ExtractImageFilter() {};
70 void PrintSelf(std::ostream& os, itk::Indent indent) const;
73 virtual void GenerateOutputInformation();
76 virtual void CallCopyOutputRegionToInputRegion(InputImageRegionType &destRegion,
77 const OutputImageRegionType &srcRegion);
80 void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
82 InputImageRegionType m_ExtractionRegion;
83 OutputImageRegionType m_OutputImageRegion;
86 ExtractImageFilter(const Self&); //purposely not implemented
87 void operator=(const Self&); //purposely not implemented
92 } // end namespace itk
94 #ifndef ITK_MANUAL_INSTANTIATION
95 #include "clitkExtractImageFilter.txx"