]> Creatis software - clitk.git/blob - tools/clitkGetSpacingGenericFilter.cxx
GateAsciiImageIO is now cross-platform using itksys::RegularExpression
[clitk.git] / tools / clitkGetSpacingGenericFilter.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://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 clitkGetSpacingGenericFilter_cxx
19 #define clitkGetSpacingGenericFilter_cxx
20
21 #include "clitkGetSpacingGenericFilter.h"
22
23 namespace clitk
24 {
25
26   //-----------------------------------------------------------
27   // Constructor
28   //-----------------------------------------------------------
29   GetSpacingGenericFilter::GetSpacingGenericFilter()
30   {
31     m_Verbose=false;
32     m_InputFileName="";
33   }
34
35
36   //-----------------------------------------------------------
37   // Update
38   //-----------------------------------------------------------
39   void GetSpacingGenericFilter::Update()
40   {
41     // Read the Dimension and PixelType
42     int Dimension;
43     std::string PixelType;
44     ReadImageDimensionAndPixelType(m_InputFileName, Dimension, PixelType);
45
46     
47     // Call UpdateWithDim
48     if(Dimension==2) UpdateWithDim<2>(PixelType);
49     else if(Dimension==3) UpdateWithDim<3>(PixelType);
50     else if (Dimension==4)UpdateWithDim<4>(PixelType); 
51     else 
52       {
53         std::cout<<"Error, Only for 2 or 3 or 4 Dimensions!!!"<<std::endl ;
54         return;
55       }
56   }
57
58
59 } //end clitk
60
61 #endif  //#define clitkGetSpacingGenericFilter_cxx