[ITK-users] Scan line iterators, region iterators and indexes

Bradley Lowekamp blowekamp at mail.nih.gov
Fri Apr 17 10:24:08 EDT 2015


I forgot to mention the other SIGNIFICANT source of performance improvement!

The progress reporting was moved a per pixel basis to a per scanline [1]. Its important to spend more time computing compared to reporting :)

Brad

[1] https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Core/Common/include/itkUnaryFunctorImageFilter.hxx#L189

On Apr 17, 2015, at 10:05 AM, Matt McCormick <matt.mccormick at kitware.com> wrote:

> Hi Olivier,
> 
>> I have recently discovered that many ITK filters have switched to scan line iterators, apparently for speed reasons. I was therefore wondering about switching to them as well in our local code, but I have a few questions regarding them.
> 
> Yes, switching to the scanline iterators can result in a good speed-up.
> 
> 
>> First, I looked at the code and it seems to me that both region and scan line iterators explore regions in the exact same way (apart from the fact that you manually need to switch to the next line in the scan line iterator). I think the answer is yes, but does that mean that if I explore a corresponding sub region of a 4D and a 3D image, the pixel exploration order will be the same (e.g. exploring a 3D sub image of a 4d volume and an other 3d image)?
> 
> Correct -- the traversal is the same.
> 
> 
>> Then, there is no scan line iterator with index. Is that something that would be doable and if yes, is it something planned or not ? I have the feeling that If no the most efficient (in a filter with access to the index at each pixel), region iterator with index would be more efficient.
> 
> Bradley may know offhand whether this would be possible.
> 
> Patches are welcome :-).
> 
> Thanks,
> Matt



More information about the Insight-users mailing list