1 /*=========================================================================
2 Program: vv http://www.creatis.insa-lyon.fr/rio/vv
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
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.
13 It is distributed under dual licence
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"
27 template <class TInputImage, class TOutputImage>
28 class ITK_EXPORT ExtractImageFilter:
29 public itk::ImageToImageFilter<TInputImage,TOutputImage>
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;
38 /** Method for creation through the object factory. */
41 /** Run-time type information (and related methods). */
42 itkTypeMacro(ExtractImageFilter, ImageToImageFilter);
44 /** Image type information. */
45 typedef TInputImage InputImageType;
46 typedef TOutputImage OutputImageType;
48 /** Typedef to describe the output and input image region types. */
49 typedef typename TOutputImage::RegionType OutputImageRegionType;
50 typedef typename TInputImage::RegionType InputImageRegionType;
52 /** Typedef to describe the type of pixel. */
53 typedef typename TOutputImage::PixelType OutputImagePixelType;
54 typedef typename TInputImage::PixelType InputImagePixelType;
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;
62 /** ImageDimension enumeration */
63 itkStaticConstMacro(InputImageDimension, unsigned int,
64 TInputImage::ImageDimension);
65 itkStaticConstMacro(OutputImageDimension, unsigned int,
66 TOutputImage::ImageDimension);
68 typedef itk::ImageToImageFilterDetail::ExtractImageFilterRegionCopier<
69 itkGetStaticConstMacro(InputImageDimension),
70 itkGetStaticConstMacro(OutputImageDimension)> ExtractImageFilterRegionCopierType;
72 void SetExtractionRegion(InputImageRegionType extractRegion);
73 itkGetMacro(ExtractionRegion, InputImageRegionType);
75 #ifdef ITK_USE_CONCEPT_CHECKING
76 /** Begin concept checking */
77 itkConceptMacro(InputCovertibleToOutputCheck,
78 (itk::Concept::Convertible<InputImagePixelType, OutputImagePixelType>));
79 /** End concept checking */
84 ~ExtractImageFilter() {};
85 void PrintSelf(std::ostream& os, itk::Indent indent) const;
88 virtual void GenerateOutputInformation();
91 virtual void CallCopyOutputRegionToInputRegion(InputImageRegionType &destRegion,
92 const OutputImageRegionType &srcRegion);
95 void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
97 InputImageRegionType m_ExtractionRegion;
98 OutputImageRegionType m_OutputImageRegion;
101 ExtractImageFilter(const Self&); //purposely not implemented
102 void operator=(const Self&); //purposely not implemented
107 } // end namespace itk
109 #ifndef ITK_MANUAL_INSTANTIATION
110 #include "clitkExtractImageFilter.txx"