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("");
28 VerboseWarningOffOn(); // OffOn, it's cool no ?
30 m_IsCancelled = false;
32 //--------------------------------------------------------------------
35 //--------------------------------------------------------------------
36 void clitk::FilterBase::SetWarning(std::string e)
39 if (!GetVerboseWarningOff()) {
40 std::cout << GetWarning() << std::endl;
43 //--------------------------------------------------------------------
46 //--------------------------------------------------------------------
47 void clitk::FilterBase::StartNewStep(std::string s)
50 throw clitk::ExceptionObject("Filter is canceled.");
53 m_CurrentStepNumber++;
54 if (GetCurrentStepBaseId() != "") {
55 std::ostringstream oss;
56 oss << GetCurrentStepBaseId() << "." << m_CurrentStepNumber;
57 SetCurrentStepId(oss.str());
60 std::ostringstream oss;
61 oss << m_CurrentStepNumber;
62 SetCurrentStepId(oss.str());
65 m_CurrentStepName = "Step "+GetCurrentStepId()+" -- "+s;
67 std::cout << m_CurrentStepName << std::endl;
68 //"Step " << GetCurrentStepId() << " -- " << s << std::endl;
71 //--------------------------------------------------------------------
74 //--------------------------------------------------------------------
75 void clitk::FilterBase::StopCurrentStep()
79 //--------------------------------------------------------------------
82 //--------------------------------------------------------------------
83 void clitk::FilterBase::Cancel()
87 //--------------------------------------------------------------------
90 //--------------------------------------------------------------------
91 bool clitk::FilterBase::Cancelled()
95 //--------------------------------------------------------------------