]> Creatis software - clitk.git/blob - registration/clitkExtractImageFilter.h
Add missing this->
[clitk.git] / registration / clitkExtractImageFilter.h
1 /*=========================================================================
2   Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
3
4   Authors belong to: 
5   - University of LYON              http://www.universite-lyon.fr/
6   - Léon Bérard cancer center       http://www.centreleonberard.fr
7   - CREATIS CNRS laboratory         http://www.creatis.insa-lyon.fr
8
9   This software is distributed WITHOUT ANY WARRANTY; without even
10   the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11   PURPOSE.  See the copyright notices for more information.
12
13   It is distributed under dual licence
14
15   - BSD        See included LICENSE.txt file
16   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ===========================================================================**/
18 #ifndef __clitkExtractImageFilter_h
19 #define __clitkExtractImageFilter_h
20 #include "itkImageToImageFilter.h"
21 #include "itkSmartPointer.h"
22 #include "itkExtractImageFilterRegionCopier.h"
23
24 namespace clitk
25 {
26
27 template <class TInputImage, class TOutputImage>
28 class ITK_EXPORT ExtractImageFilter:
29     public itk::ImageToImageFilter<TInputImage,TOutputImage>
30 {
31 public:
32   /** Standard class typedefs. */
33   typedef ExtractImageFilter         Self;
34   typedef itk::ImageToImageFilter<TInputImage,TOutputImage>  Superclass;
35   typedef itk::SmartPointer<Self>  Pointer;
36   typedef itk::SmartPointer<const Self>  ConstPointer;
37
38   /** Method for creation through the object factory. */
39   itkNewMacro(Self);  
40
41   /** Run-time type information (and related methods). */
42   itkTypeMacro(ExtractImageFilter, ImageToImageFilter);
43
44   /** Image type information. */
45   typedef TInputImage  InputImageType;
46   typedef TOutputImage OutputImageType;
47
48   /** Typedef to describe the output and input image region types. */
49   typedef typename TOutputImage::RegionType OutputImageRegionType;
50   typedef typename TInputImage::RegionType InputImageRegionType;
51
52   /** Typedef to describe the type of pixel. */
53   typedef typename TOutputImage::PixelType OutputImagePixelType;
54   typedef typename TInputImage::PixelType InputImagePixelType;
55
56   /** Typedef to describe the output and input image index and size types. */
57   typedef typename TOutputImage::IndexType OutputImageIndexType;
58   typedef typename TInputImage::IndexType InputImageIndexType;
59   typedef typename TOutputImage::SizeType OutputImageSizeType;
60   typedef typename TInputImage::SizeType InputImageSizeType;
61
62   /** ImageDimension enumeration */
63   itkStaticConstMacro(InputImageDimension, unsigned int,
64                       TInputImage::ImageDimension);
65   itkStaticConstMacro(OutputImageDimension, unsigned int,
66                       TOutputImage::ImageDimension);
67
68   typedef itk::ImageToImageFilterDetail::ExtractImageFilterRegionCopier<
69     itkGetStaticConstMacro(InputImageDimension), 
70     itkGetStaticConstMacro(OutputImageDimension)> ExtractImageFilterRegionCopierType;
71
72   void SetExtractionRegion(InputImageRegionType extractRegion);
73   itkGetMacro(ExtractionRegion, InputImageRegionType);
74
75 #ifdef ITK_USE_CONCEPT_CHECKING
76   /** Begin concept checking */
77   itkConceptMacro(InputCovertibleToOutputCheck,
78                   (itk::Concept::Convertible<InputImagePixelType, OutputImagePixelType>));
79   /** End concept checking */
80 #endif
81
82 protected:
83   ExtractImageFilter();
84   ~ExtractImageFilter() {};
85   void PrintSelf(std::ostream& os, itk::Indent indent) const;
86
87
88   virtual void GenerateOutputInformation();
89
90
91   virtual void CallCopyOutputRegionToInputRegion(InputImageRegionType &destRegion,
92                                                  const OutputImageRegionType &srcRegion);
93
94
95   void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
96                             int threadId );
97   InputImageRegionType m_ExtractionRegion;
98   OutputImageRegionType m_OutputImageRegion;
99
100 private:
101   ExtractImageFilter(const Self&); //purposely not implemented
102   void operator=(const Self&); //purposely not implemented
103   
104 };
105
106   
107 } // end namespace itk
108   
109 #ifndef ITK_MANUAL_INSTANTIATION
110 #include "clitkExtractImageFilter.txx"
111 #endif
112   
113 #endif