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()
26 SetVerboseOption(false);
27 SetCurrentStepNumber(0);
28 SetCurrentStepBaseId("");
31 VerboseWarningOffOn(); // OffOn, it's cool not ?
34 //--------------------------------------------------------------------
37 //--------------------------------------------------------------------
38 void clitk::FilterBase::ResetLastError()
42 //--------------------------------------------------------------------
45 //--------------------------------------------------------------------
46 void clitk::FilterBase::SetLastError(std::string e)
49 if (GetStopOnError()) {
50 std::cerr << GetLastError() << std::endl;
54 //--------------------------------------------------------------------
57 //--------------------------------------------------------------------
58 void clitk::FilterBase::SetWarning(std::string e)
61 if (!GetVerboseWarningOff()) {
62 std::cout << GetWarning() << std::endl;
65 //--------------------------------------------------------------------
68 //--------------------------------------------------------------------
69 void clitk::FilterBase::StartNewStep(std::string s)
71 m_CurrentStepNumber++;
72 if (GetCurrentStepBaseId() != "") {
73 std::ostringstream oss;
74 oss << GetCurrentStepBaseId() << "." << m_CurrentStepNumber;
75 SetCurrentStepId(oss.str());
78 std::ostringstream oss;
79 oss << m_CurrentStepNumber;
80 SetCurrentStepId(oss.str());
83 m_CurrentStepName = "Step "+GetCurrentStepId()+" -- "+s;
85 std::cout << m_CurrentStepName << std::endl;
86 //"Step " << GetCurrentStepId() << " -- " << s << std::endl;
89 //--------------------------------------------------------------------
92 //--------------------------------------------------------------------
93 void clitk::FilterBase::StopCurrentStep()
97 //--------------------------------------------------------------------
100 //--------------------------------------------------------------------
101 void clitk::FilterBase::MustStop()
105 //--------------------------------------------------------------------