18#ifndef itkSimpleFilterWatcher_h
19#define itkSimpleFilterWatcher_h
94 return (m_Process ? m_Process->GetNameOfClass() :
"None");
132 return m_Process.GetPointer();
196 const std::lock_guard<std::mutex> lockGuard(m_ProgressOutput);
200 std::cout <<
" | " << m_Process->GetProgress() << std::flush;
201 if ((m_Steps % 10) == 0)
203 std::cout << std::endl;
208 if (m_Process->GetProgress() > .03)
210 m_Process->AbortGenerateDataOn();
233 std::cout << std::endl <<
"-------Aborted" << std::endl << std::flush;
240 std::cout <<
" #" << std::flush;
251 std::cout <<
"-------- Start " << (m_Process.GetPointer() ? m_Process->GetNameOfClass() :
"None") <<
" \""
252 << m_Comment <<
"\" ";
257 std::cout << m_Process;
264 std::cout << (m_Quiet ?
"Progress Quiet " :
"Progress ") << std::flush;
273 std::cout << std::endl
274 <<
"Filter took " << m_TimeProbe.GetMean() <<
" seconds." << std::endl
275 <<
"-------- End " << (m_Process.GetPointer() ? m_Process->GetNameOfClass() :
"None") <<
" \""
276 << m_Comment <<
"\" " << std::endl;
281 std::cout << m_Process;
287 std::cout << std::flush;
291 itkExceptionMacro(
"Filter does not have progress.");
299 int m_Iterations{ 0 };
300 bool m_Quiet{
false };
301 bool m_TestAbort{
false };
302 std::string m_Comment{};
304 std::mutex m_ProgressOutput{};
313 unsigned long m_StartTag{ 0 };
314 unsigned long m_EndTag{ 0 };
315 unsigned long m_ProgressTag{ 0 };
316 unsigned long m_IterationTag{ 0 };
317 unsigned long m_AbortTag{ 0 };
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Simple mechanism for monitoring the pipeline events of a filter and reporting these events to std::co...
virtual void StartFilter()
ProcessObject * GetProcess()
void SetIterations(int val)
virtual ~SimpleFilterWatcher()
void DeepCopy(const SimpleFilterWatcher &watch)
TimeProbe & GetTimeProbe()
SimpleFilterWatcher(const SimpleFilterWatcher &)
virtual void ShowProgress()
const char * GetNameOfClass()
int GetIterations() const
SimpleFilterWatcher(itk::ProcessObject *o, const char *comment="")
SimpleFilterWatcher & operator=(const SimpleFilterWatcher &)
virtual void ShowIteration()
A Command subclass that calls a pointer to a member function.
Computes the time passed between two points in code.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....