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 clitkDVHGenericFilter_cxx
19 #define clitkDVHGenericFilter_cxx
21 #include "clitkDVHGenericFilter.h"
26 //-----------------------------------------------------------
28 //-----------------------------------------------------------
29 DVHGenericFilter::DVHGenericFilter()
34 //-----------------------------------------------------------
36 //-----------------------------------------------------------
38 //-----------------------------------------------------------
39 void DVHGenericFilter::Update()
41 // Read the Dimension and PixelType
42 int Dimension, Components;
43 std::string PixelType;
44 ReadImageDimensionAndPixelType(m_InputFileName, Dimension, PixelType, Components);
46 if (m_ArgsInfo.channel_arg < -1 || m_ArgsInfo.channel_arg >= Components) {
47 std::cout << "Invalid image channel" << std::endl;
51 if (m_ArgsInfo.mask_given) {
52 int maskDimension, maskComponents;
53 std::string maskPixelType;
54 ReadImageDimensionAndPixelType(m_ArgsInfo.mask_arg, maskDimension, maskPixelType, maskComponents);
55 if (!(maskDimension == Dimension || maskDimension == (Dimension - 1))) {
56 std::cout << "Dimension of label mask must be equal to the (d)imension of the input image or d-1." << std::endl;
66 UpdateWithDim<2,1>(PixelType);
69 UpdateWithDim<2,2>(PixelType);
72 UpdateWithDim<2,3>(PixelType);
75 std::cout << "Unsupported number of channels" << std::endl;
79 else if (Dimension==3) {
82 UpdateWithDim<3,1>(PixelType);
85 UpdateWithDim<3,2>(PixelType);
88 UpdateWithDim<3,3>(PixelType);
91 std::cout << "Unsupported number of channels" << std::endl;
95 else if (Dimension==4) {
98 UpdateWithDim<4,1>(PixelType);
101 UpdateWithDim<4,2>(PixelType);
104 UpdateWithDim<4,3>(PixelType);
107 std::cout << "Unsupported number of channels" << std::endl;
112 std::cout<<"Error, Only for 2 or 3 Dimensions!!!"<<std::endl ;
120 #endif //#define clitkDVHGenericFilter_cxx