]> Creatis software - clitk.git/blobdiff - common/clitkFilterBase.cxx
Merge branch 'master' into GammaIndex3D
[clitk.git] / common / clitkFilterBase.cxx
index 09797d886c750959c84dfa4e6a4db0eb236563e4..f6bebad101072e7d8ed40fe62b710f962e802f1f 100644 (file)
@@ -3,7 +3,7 @@
 
   Authors belong to: 
   - University of LYON              http://www.universite-lyon.fr/
-  - Léon Bérard cancer center       http://oncora1.lyon.fnclcc.fr
+  - Léon Bérard cancer center       http://www.centreleonberard.fr
   - CREATIS CNRS laboratory         http://www.creatis.insa-lyon.fr
 
   This software is distributed WITHOUT ANY WARRANTY; without even
@@ -14,7 +14,7 @@
 
   - BSD        See included LICENSE.txt file
   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-  ======================================================================-====*/
+  ===========================================================================**/
 
 // clitk
 #include "clitkFilterBase.h"
 //--------------------------------------------------------------------
 clitk::FilterBase::FilterBase() 
 {
-  SetVerboseOption(false);
+  SetVerboseOptionFlag(false);
   SetCurrentStepNumber(0);
   SetCurrentStepBaseId("");
-  VerboseWarningOffOn(); // OffOn, it's cool no ?
+  VerboseWarningFlagOn();
+  VerboseWarningFlagOff();
+  VerboseMemoryFlagOff();
+  VerboseImageSizeFlagOff();
   SetWarning("");
+  VerboseWarningFlagOn();
   m_IsCancelled = false;
 }
 //--------------------------------------------------------------------
@@ -37,7 +41,7 @@ clitk::FilterBase::FilterBase()
 void clitk::FilterBase::SetWarning(std::string e)
 {
   m_Warning = e;
-  if (!GetVerboseWarningOff()) {
+  if (GetVerboseWarningFlag()) {
     std::cout << GetWarning() << std::endl;
   }
 }
@@ -45,7 +49,7 @@ void clitk::FilterBase::SetWarning(std::string e)
 
 
 //--------------------------------------------------------------------
-void clitk::FilterBase::StartNewStep(std::string s) 
+void clitk::FilterBase::StartNewStep(std::string s, bool endl
 {
   if (Cancelled()) {
     throw clitk::ExceptionObject("Filter is canceled.");
@@ -64,8 +68,9 @@ void clitk::FilterBase::StartNewStep(std::string s)
   }
 
   m_CurrentStepName = "Step "+GetCurrentStepId()+" -- "+s;
-  if (m_VerboseStep) {
-    std::cout << m_CurrentStepName << std::endl;
+  if (GetVerboseStepFlag()) {
+    std::cout << m_CurrentStepName;
+    if (endl) std::cout << std::endl;
     //"Step " << GetCurrentStepId() << " -- " << s << std::endl;
   }
 }
@@ -89,9 +94,30 @@ void clitk::FilterBase::Cancel()
 
 
 //--------------------------------------------------------------------
- bool clitk::FilterBase::Cancelled()
- {
-   return m_IsCancelled;
- }
+bool clitk::FilterBase::Cancelled()
+{
+  return m_IsCancelled;
+}
+//--------------------------------------------------------------------
+
+
 //--------------------------------------------------------------------
+void clitk::FilterBase::StartSubStep() {
+  m_SubstepNumbers.push_back(GetCurrentStepNumber());
+  m_SubstepID.push_back(GetCurrentStepId());
+  SetCurrentStepBaseId(GetCurrentStepId());
+  SetCurrentStepNumber(0);;
+}
+//--------------------------------------------------------------------
+
 
+//--------------------------------------------------------------------
+void clitk::FilterBase::StopSubStep() {
+  int s = m_SubstepNumbers.back();
+  m_SubstepNumbers.pop_back();
+  SetCurrentStepNumber(s);
+  m_SubstepID.pop_back();
+  if (m_SubstepID.size() != 0) {
+    SetCurrentStepBaseId(m_SubstepID.back());  }
+  else SetCurrentStepBaseId("");
+}