]> Creatis software - clitk.git/blob - tools/clitkCombineImageGenericFilter.cxx
76f40b55bd40da2d7cab8c44eb46cbd7ac57e8b8
[clitk.git] / tools / clitkCombineImageGenericFilter.cxx
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 clitkCombineImageGenericFilter_cxx
19 #define clitkCombineImageGenericFilter_cxx
20
21 /* =================================================
22  * @file   clitkCombineImageGenericFilter.cxx
23  * @author 
24  * @date   
25  * 
26  * @brief 
27  * 
28  ===================================================*/
29
30 #include "clitkCombineImageGenericFilter.h"
31
32
33 namespace clitk
34 {
35
36
37   //-----------------------------------------------------------
38   // Constructor
39   //-----------------------------------------------------------
40   CombineImageGenericFilter::CombineImageGenericFilter()
41   {
42     m_Verbose=false;
43     m_InputFileName="";
44   }
45
46
47   //-----------------------------------------------------------
48   // Update
49   //-----------------------------------------------------------
50   void CombineImageGenericFilter::Update()
51   {
52     // Read the Dimension and PixelType
53     int Dimension, Components;
54     std::string PixelType;
55     ReadImageDimensionAndPixelType(m_InputFileName, Dimension, PixelType, Components);
56
57     
58     // Call UpdateWithDim
59     if(Dimension==2) UpdateWithDim<2>(PixelType, Components);
60     else if(Dimension==3) UpdateWithDim<3>(PixelType, Components);
61     else if (Dimension==4)UpdateWithDim<4>(PixelType, Components); 
62     else 
63       {
64         std::cout<<"Error, Only for 2, 3 or 4  Dimensions!!!"<<std::endl ;
65         return;
66       }
67   }
68
69
70 } //end clitk
71
72 #endif  //#define clitkCombineImageGenericFilter_cxx