]> Creatis software - clitk.git/blobdiff - common/clitkFilterBase.txx
add option to display memory usage if statgrab is installed
[clitk.git] / common / clitkFilterBase.txx
index baee5700ac909d5176e97b281c2e4a18969c7ffb..064f3bea8c9ef647190860dacf006d2f09e0be93 100644 (file)
   ======================================================================-====*/
 
 #include "clitkImageCommon.h"
+#include "clitkMemoryUsage.h"
 
 //--------------------------------------------------------------------
 template<class OptionType>
 void clitk::FilterBase::VerboseOption(std::string name, OptionType value) 
 {
-  if (!this->GetVerboseOption()) return;
+  if (!this->GetVerboseOptionFlag()) return;
   std::cout << "Set option '" << name << "' = " << value << std::endl;
 }
 //--------------------------------------------------------------------
@@ -32,7 +33,7 @@ void clitk::FilterBase::VerboseOption(std::string name, OptionType value)
 template<class OptionType>
 void clitk::FilterBase::VerboseOption(std::string name, int nb, OptionType value) 
 {
-  if (!this->GetVerboseOption()) return;
+  if (!this->GetVerboseOptionFlag()) return;
   if (nb==0) std::cout << "Set option '" << name << "' not given" << std::endl;
   else {
     std::cout << "Set option '" << name << "' = " << value << std::endl;
@@ -45,7 +46,7 @@ void clitk::FilterBase::VerboseOption(std::string name, int nb, OptionType value
 template<class OptionType>
 void clitk::FilterBase::VerboseOptionV(std::string name, int nb, OptionType * value) 
 {
-  if (!this->GetVerboseOption()) return;
+  if (!this->GetVerboseOptionFlag()) return;
   if (nb==0) std::cout << "Set option '" << name << "' not given" << std::endl;
   else {
     std::cout << "Set option '" << name << "'[" << nb << "] ";
@@ -61,11 +62,12 @@ template<class TInternalImageType>
 void clitk::FilterBase::StopCurrentStep(typename TInternalImageType::Pointer p) 
 {
   StopCurrentStep();
-  if (m_WriteStep) {
+  if (m_WriteStepFlag) {
     std::ostringstream name;
     name << "step-" << GetCurrentStepId() << ".mhd";
     clitk::writeImage<TInternalImageType>(p, name.str());
   }
+  clitk::PrintMemory(GetVerboseMemoryFlag(), "End of step"); 
 }
 //--------------------------------------------------------------------