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://oncora1.lyon.fnclcc.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 ======================================================================-====*/
20 #include "clitkFilterBase.h"
22 //--------------------------------------------------------------------
23 clitk::FilterBase::FilterBase()
25 SetVerboseOption(false);
26 SetCurrentStepNumber(0);
27 SetCurrentStepBaseId("");
30 VerboseWarningOffOn(); // OffOn, it's cool not ?
33 //--------------------------------------------------------------------
36 //--------------------------------------------------------------------
37 void clitk::FilterBase::ResetLastError()
41 //--------------------------------------------------------------------
44 //--------------------------------------------------------------------
45 void clitk::FilterBase::SetLastError(std::string e)
48 if (GetStopOnError()) {
49 std::cerr << GetLastError() << std::endl;
53 //--------------------------------------------------------------------
56 //--------------------------------------------------------------------
57 void clitk::FilterBase::SetWarning(std::string e)
60 if (!GetVerboseWarningOff()) {
61 std::cout << GetWarning() << std::endl;
64 //--------------------------------------------------------------------
67 //--------------------------------------------------------------------
68 void clitk::FilterBase::StartNewStep(std::string s)
70 m_CurrentStepNumber++;
71 if (GetCurrentStepBaseId() != "") {
72 std::ostringstream oss;
73 oss << GetCurrentStepBaseId() << "." << m_CurrentStepNumber;
74 SetCurrentStepId(oss.str());
77 std::ostringstream oss;
78 oss << m_CurrentStepNumber;
79 SetCurrentStepId(oss.str());
83 std::cout << "Step " << GetCurrentStepId() << " -- " << s << std::endl;
86 //--------------------------------------------------------------------
89 //--------------------------------------------------------------------
90 void clitk::FilterBase::StopCurrentStep()
94 //--------------------------------------------------------------------