]> Creatis software - clitk.git/blob - tools/clitkConeBeamProjectImageGenericFilter.cxx
*** empty log message ***
[clitk.git] / tools / clitkConeBeamProjectImageGenericFilter.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 CLITKCONEBEAMPROJECTIMAGEGENERICFILTER_CXX
19 #define CLITKCONEBEAMPROJECTIMAGEGENERICFILTER_CXX
20
21 /**
22  * @file   clitkConeBeamProjectImageGenericFilter.cxx
23  * @author Jef Vandemeulebroucke <jef@creatis.insa-lyon.fr>
24  * @date   Wed April 30  13:47:57 2008
25  * 
26  * @brief  
27  * 
28  * 
29  */
30
31 #include "clitkConeBeamProjectImageGenericFilter.h"
32
33 namespace clitk
34 {
35
36   //====================================================================
37   // Constructor
38   ConeBeamProjectImageGenericFilter::ConeBeamProjectImageGenericFilter()
39   {
40
41     m_Verbose=false;
42     m_InputFileName="";
43
44 //     mIsoCenter.resize(3);
45 //     for (unsigned int j=0; j < 3; j++) mIsoCenter[j]=128.;
46 //     mSourceToScreen=1536.;
47 //     mSourceToAxis=1000.;
48 //     mProjectionAngle=0.;
49
50 //     // set the rigid transform matrix to the identity
51 //     for (unsigned int i=0; i <4; i++)
52 //       for (unsigned int j=0; j <4; j++)
53 //      if (i==j)mRigidTransformMatrix[i][j]=1.;
54 //      else mRigidTransformMatrix[i][j]=0.;
55
56 //     //Padding value
57 //     mEdgePaddingValue=0.0;
58   }
59
60   //====================================================================
61   // Update
62   void ConeBeamProjectImageGenericFilter::Update()
63   {
64     //Read the PixelType and dimension of the input image
65     int Dimension;
66     std::string PixelType;
67     clitk::ReadImageDimensionAndPixelType(m_InputFileName, Dimension, PixelType);
68     if (Dimension == 3)
69       {
70         if (m_Verbose) std::cout  << "Input was detected to be "<< Dimension << "D and " << PixelType << "..." << std::endl;
71   
72         if(PixelType == "short"){  
73           if (m_Verbose) std::cout  << "Launching Projection in signed short..." << std::endl;
74           UpdateWithPixelType<signed short>(); 
75         }
76         
77 //      else if(PixelType == "unsigned_short"){  
78 //        if (m_Verbose) std::cout  << "Launching Projection in unsigned_short..." << std::endl;
79 //        UpdateWithPixelType<unsigned short>(); 
80 //      }
81         
82         else if (PixelType == "unsigned_char"){ 
83           if (m_Verbose) std::cout  << "Launching Projection in unsigned_char..." << std::endl;
84           UpdateWithPixelType<unsigned char>();
85         }
86         
87 //      else if (PixelType == "char"){ 
88 //        if (m_Verbose) std::cout  << "Launching Projection in signed_char..." << std::endl;
89 //        UpdateWithPixelType<signed char>();
90 //      }
91         else {
92           if (m_Verbose) std::cout  << "Launching Projection in float..." << std::endl;
93           UpdateWithPixelType<float>();
94         }
95       }
96     
97     else {itkExceptionMacro(<< "Input Image dimension is " << Dimension 
98                             << " but I can only work on 3D images.");
99     }
100   }
101
102
103   //====================================================================
104
105 }
106 #endif  //#define CLITKCONEBEAMPROJECTIMAGEGENERICFILTER_CXX