[Insight-users] is there someone who has used the itkTimeStamp?

Luis Ibanez luis.ibanez at kitware.com
Tue Sep 13 09:06:24 EDT 2005


Hi Xianfen,

The itkTimeStamp is not the class that you want.
What you need is the itkTimeProbe.


http://www.itk.org/Insight/Doxygen/html/classitk_1_1TimeProbe.html



It is very easy to use the itkTimeProbe.

Just do this:


#include "itkTimeProbe.h"

int main()
{

//... more stuff here

   itk::TimeProbe tp;

   reader->Update();

   tp.Start();

   filter->Update(); // this triggers the execution
                     // of the pipeline.
   tp.Stop();

   std::cout << tp.GetMeanTime() << std::endl;

   writer->Update();
}


Note that I put the reader and writer Update()s outside
of the block where the TimeProbe is measuring time because
it is not fair to include the time of reading the input
image and writing the output image as part of the performance
of a segmentation filter.


If you need to monitor multiple sections, you will find useful
the itk::TimeProbesCollectorBase class

http://www.itk.org/Insight/Doxygen/html/classitk_1_1TimeProbesCollectorBase.html




   Regards,



     Luis




--------------------
diaoxianfen wrote:
> Hello every one,
>  I want to record the execution time of segmentation algorithm, but I 
> don't know how to do using the ITK class of itkTimeStamp.Is this class 
> for record time?
>  For example,
>   connectedThreshold->SetInput(  reader->GetOutput() );
>   caster->SetInput( connectedThreshold->GetOutput() );
>   writer->SetInput( caster->GetOutput() );
> in this progress, i only want to know the time for segmentation.
> If you know, tell me please.
> Thanks.
>  
> Xianfen Diao
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users



More information about the Insight-users mailing list