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

Matt McCormick matt.mccormick at kitware.com
Fri Apr 17 10:05:22 EDT 2015


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