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