itkGetConstMacro(VerboseMemoryFlag, bool);
itkBooleanMacro(VerboseMemoryFlag);
+ // Verbose ImageSize
+ itkSetMacro(VerboseImageSizeFlag, bool);
+ itkGetConstMacro(VerboseImageSizeFlag, bool);
+ itkBooleanMacro(VerboseImageSizeFlag);
+
// Steps management
itkSetMacro(NumberOfSteps, int);
itkGetConstMacro(NumberOfSteps, int);
virtual ~FilterBase() {}
void StartNewStep(std::string s);
template<class TInternalImageType>
- void StopCurrentStep(typename TInternalImageType::Pointer p);
+ void StopCurrentStep(typename TInternalImageType::Pointer p, std::string txt="");
void StopCurrentStep();
bool m_VerboseFlag;
bool m_VerboseOptionFlag;
bool m_VerboseStepFlag;
bool m_VerboseMemoryFlag;
+ bool m_VerboseImageSizeFlag;
bool m_WriteStepFlag;
int m_CurrentStepNumber;
int m_NumberOfSteps;
//--------------------------------------------------------------------
template<class TInternalImageType>
-void clitk::FilterBase::StopCurrentStep(typename TInternalImageType::Pointer p)
+void clitk::FilterBase::StopCurrentStep(typename TInternalImageType::Pointer p, std::string txt)
{
StopCurrentStep();
if (m_WriteStepFlag) {
clitk::writeImage<TInternalImageType>(p, name.str());
}
clitk::PrintMemory(GetVerboseMemoryFlag(), "End of step");
+ if (GetVerboseImageSizeFlag()) {
+ std::ostream & os = std::cout;
+ int dim = p->GetImageDimension();
+ int nb = 1;
+ os << txt << " size = ";
+ for(unsigned int i=0; i<dim-1; i++) {
+ os << p->GetLargestPossibleRegion().GetSize()[i] << "x";
+ nb *= p->GetLargestPossibleRegion().GetSize()[i];
+ }
+ os << p->GetLargestPossibleRegion().GetSize()[dim-1] << " ";
+ nb *= p->GetLargestPossibleRegion().GetSize()[dim-1];
+ os << " pixels = " << nb << std::endl;
+ }
}
//--------------------------------------------------------------------