[Insight-developers] question for itk pipeline expert

Gaetan Lehmann gaetan.lehmann at jouy.inra.fr
Thu Dec 8 11:19:12 EST 2005


I have patched ProcessObject to get the time passed into the  
GenerateData() method. The patch is attached.

The result are more and more strange:

#F      concave conc2   vrmin   vrmin2  rmin    rmin2
0       17.7792 17.7792 2.48019 2.48017 1.76706 1.76704
1       21.0116 21.0115 3.49446 3.49444 2.77631 2.77629


each column which ends with a 2 is the same time than the column without  
the 2, but measured with the new feature of ProcessObject. The columns  
without the 2 are the time measured as before (time.Start();  
filter->Update(); time.Stop();).

The execution times are nearly the same !
So where all that time is spent ?

If I replace the h-concave filter by another one (here, a  
ShiftScaleImageFilter), we don't have that effect, and the execution time  
seems good:

#F      concave conc2   vrmin   vrmin2  rmin    rmin2
0       0.16509 0.16507 1.72182 1.72181 1.80997 1.80996
1       0.16578 0.16576 2.78018 2.78016 2.86321 2.8632

I must say that I'm lost
And I still have no sure method to get the execution time of a filter :-/

Gaetan


On Thu, 08 Dec 2005 13:26:39 +0100, Luis Ibanez <luis.ibanez at kitware.com>  
wrote:

>
> Hi Gaetan,
>
>
>      Gaetan Lehmann wrote:
>
>      > how can I evaluate the performance of the
>      > filters in that situation ?
>
>
>
>     Enjoy the Power of Open Source !
>
>
>
>     Go to the source code of the filter that you
>     want to profile and add a TimeProbe as a member
>     variable.
>
>     If the filter is not threaded, simply Start the
>     TimeProbe at the beginning of the GenerateData()
>     method, and Stop it at the end of the same method.
>
>     If the filer is threaded, Start() the TimeProbe in
>     the "BeforeThreadedGenerateData()" method and
>     Stop() the TimeProbe in the "AfterThreadedGenerateData()"
>     method.
>
>
>
>     If you want to force the filters to re-execute,
>     multiple times in order to have better statistics,
>     then you can invoke the "Modified()" method on them
>     before calling "Update()".
>
>
>     Add a Get method to the filter in order to gain
>     access to the probe, so when you are done running
>     the filters you can invoke from outside the filter
>     the report of the Time Probe.  At that point, pay
>     particular attention at the report on "Number of
>     Starts" and "Number of Stops", since that will
>     tell you how many times the "Generate Data" method
>     was executed.
>
>
>        Regards
>
>
>
>         Luis
>
>
> ----------------------
> Gaetan Lehmann wrote:
>>  Hi Bill,
>>  No, there is no ReleaseDataFlagOn() in the filters used.
>> I have displayed the progress of all the filters to verify that they  
>> are  not reexecuted if they shouldn't, and everything looks nice (but  
>> the  timing are still not what they should).
>> It's a major problem for me: how can I evaluate the performance of the   
>> filters in that situation ?
>>  Gaetan
>>  On Wed, 07 Dec 2005 21:12:55 +0100, Bill Lorensen  
>> <wlorens1 at nycap.rr.com>  wrote:
>>
>>> Are you using ReleaseDataFlagOn in any of your filters. Perhaps   
>>> something is re-executing.
>>>
>>> Bill
>>>
>>> At 07:42 AM 12/7/2005, Gaetan Lehmann wrote:
>>>
>>>> Hi,
>>>>
>>>> I'm trying to measure the execution time of a new filter.
>>>> It's done with
>>>> http://voxel.jouy.inra.fr/darcs/contrib-itk/regionalExtrema/perf3D.cxx
>>>> Here are the results I get:
>>>>
>>>> [glehmann at marvin build]$ ./perf3D ../ESCells.img
>>>> #F      concave vrmin   rmin
>>>> 0       17.874  2.592   1.74
>>>> 1       21.022  3.613   2.799
>>>>
>>>> There is a problem: rmin is a sequence of filters which include  
>>>> vrmin,  and
>>>> so rmin should take more time than vrmin.
>>>> Now, if I comment rmin measure and update, I get
>>>>
>>>> [glehmann at marvin build]$ ./perf3D ../ESCells.img
>>>> #F      concave vrmin   rmin
>>>> 0       17.578  0       2.614
>>>> 1       21.276  0       3.722
>>>>
>>>> Again, there is something wrong: I should get the same value than  
>>>> before
>>>> for rmin if vrmin is not updated.
>>>>
>>>> I think there is something hidden in the execution of the pipeline,  
>>>> but  I
>>>> can't get what.
>>>> Can someone look at the code above and tell me what I'm doing wrong ?
>>>>
>>>> I'm using ITK 2.4.1, cmake 2.2.2 and gcc 4.0.1
>>>>
>>>> Thanks,
>>>>
>>>> Gaetan
>>>>
>>>> -- Gaëtan Lehmann
>>>> Biologie du Développement et de la Reproduction
>>>> INRA de Jouy-en-Josas (France)
>>>> tel: +33 1 34 65 29 66    fax: 01 34 65 29 09
>>>> http://voxel.jouy.inra.fr
>>>> _______________________________________________
>>>> Insight-developers mailing list
>>>> Insight-developers at itk.org
>>>> http://www.itk.org/mailman/listinfo/insight-developers
>>>
>>>
>>
>



-- 
Gaëtan Lehmann
Biologie du Développement et de la Reproduction
INRA de Jouy-en-Josas (France)
tel: +33 1 34 65 29 66    fax: 01 34 65 29 09
http://voxel.jouy.inra.fr
-------------- next part --------------
A non-text attachment was scrubbed...
Name: time.patch
Type: application/octet-stream
Size: 2923 bytes
Desc: not available
Url : http://www.itk.org/mailman/private/insight-developers/attachments/20051208/ee48a6cd/time.obj


More information about the Insight-developers mailing list