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 ===========================================================================**/
19 #include "clitkImageCommon.h"
20 #include "clitkMemoryUsage.h"
22 //--------------------------------------------------------------------
23 template<class OptionType>
24 void clitk::FilterBase::VerboseOption(std::string name, OptionType value)
26 if (!this->GetVerboseOptionFlag()) return;
27 std::cout << "Set option '" << name << "' = " << value << std::endl;
29 //--------------------------------------------------------------------
32 //--------------------------------------------------------------------
33 template<class OptionType>
34 void clitk::FilterBase::VerboseOption(std::string name, int nb, OptionType value)
36 if (!this->GetVerboseOptionFlag()) return;
37 if (nb==0) std::cout << "Set option '" << name << "' not given" << std::endl;
39 std::cout << "Set option '" << name << "' = " << value << std::endl;
42 //--------------------------------------------------------------------
45 //--------------------------------------------------------------------
46 template<class OptionType>
47 void clitk::FilterBase::VerboseOptionV(std::string name, int nb, OptionType * value)
49 if (!this->GetVerboseOptionFlag()) return;
50 if (nb==0) std::cout << "Set option '" << name << "' not given" << std::endl;
52 std::cout << "Set option '" << name << "'[" << nb << "] ";
53 for(int i=0; i<nb; i++) std::cout << value[i] << " ";
54 std::cout << std::endl;
57 //--------------------------------------------------------------------
60 //--------------------------------------------------------------------
61 template<class TInternalImageType>
62 void clitk::FilterBase::StopCurrentStep(typename TInternalImageType::Pointer p)
65 if (m_WriteStepFlag) {
66 std::ostringstream name;
67 name << "step-" << GetCurrentStepId() << ".mhd";
68 clitk::writeImage<TInternalImageType>(p, name.str());
70 clitk::PrintMemory(GetVerboseMemoryFlag(), "End of step");
72 //--------------------------------------------------------------------