X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=common%2FclitkFilterBase.cxx;h=32dd9b46cfbeb49fe75cf1e87097f729a9f3d213;hb=e45a45ee23c57b4875d349f7210fbcdb24e375e1;hp=0f7e85250340819448094c119239bff56918e771;hpb=c7f6f682ddc01d2a41740bbdb806f9ef967b57d5;p=clitk.git diff --git a/common/clitkFilterBase.cxx b/common/clitkFilterBase.cxx index 0f7e852..32dd9b4 100644 --- a/common/clitkFilterBase.cxx +++ b/common/clitkFilterBase.cxx @@ -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,19 +14,24 @@ - BSD See included LICENSE.txt file - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html - ======================================================================-====*/ + ===========================================================================**/ // clitk #include "clitkFilterBase.h" +#include "clitkCommon.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; } //-------------------------------------------------------------------- @@ -36,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; } } @@ -63,7 +68,7 @@ void clitk::FilterBase::StartNewStep(std::string s) } m_CurrentStepName = "Step "+GetCurrentStepId()+" -- "+s; - if (m_VerboseStep) { + if (GetVerboseStepFlag()) { std::cout << m_CurrentStepName << std::endl; //"Step " << GetCurrentStepId() << " -- " << s << std::endl; } @@ -88,9 +93,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(""); +}