]> Creatis software - clitk.git/blob - tools/clitkImageConvertGenericFilter.h
*** empty log message ***
[clitk.git] / tools / clitkImageConvertGenericFilter.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://oncora1.lyon.fnclcc.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 CLITKIMAGECONVERTGENERICFILTER_H
19 #define CLITKIMAGECONVERTGENERICFILTER_H
20 /**
21  ===================================================================
22  * @file   clitkImageConvertGenericFilter.h
23  * @author David Sarrut <David.Sarrut@creatis.insa-lyon.fr>
24  * @date   05 May 2008 10:40:24
25
26  * @brief  
27
28  ===================================================================*/
29
30 // clitk include
31 #include "clitkImageToImageGenericFilter.h"
32
33 // itk include
34 #include "itkCastImageFilter.h"
35
36 namespace clitk {
37   
38   class ImageConvertGenericFilter: 
39     public clitk::ImageToImageGenericFilter<ImageConvertGenericFilter> {
40     
41   public: 
42     // constructor - destructor
43     ImageConvertGenericFilter();
44
45     // Types
46     typedef ImageConvertGenericFilter     Self;
47     typedef itk::SmartPointer<Self>       Pointer;
48     typedef itk::SmartPointer<const Self> ConstPointer;
49
50     // New
51     itkNewMacro(Self);
52     
53     // Members functions
54     void SetOutputPixelType(std::string p) { mOutputPixelTypeName = p; }
55     bool IsWarningOccur() { return mWarningOccur; }
56     std::string & GetWarning() { return mWarning; }
57     void EnableDisplayWarning(bool b) { mDisplayWarning = b; }
58
59     //--------------------------------------------------------------------
60     // Main function called each time the filter is updated
61     template<class InputImageType>  
62     void UpdateWithInputImageType();
63
64   protected:
65     template<unsigned int Dim> void InitializeImageType();
66     std::string mOutputPixelTypeName;
67     std::string mWarning;
68     bool mWarningOccur;
69     bool mDisplayWarning;
70
71     template<class InputImageType, class OutputPixelType> void UpdateWithOutputType();
72
73   }; // end class ImageConvertGenericFilter
74
75   //#include "clitkImageConvertGenericFilter.txx"
76
77 } // end namespace
78
79 #endif /* end #define CLITKIMAGECONVERTGENERICFILTER_H */
80