[Insight-developers] ImageIterator

Miller, James V (CRD) millerjv at crd.ge.com
Thu Sep 14 15:51:23 EDT 2000


You should be able to say

it = it.Begin();

which will reset the current iterator to its beginning.


-----Original Message-----
From: ASHES D GANGULY [mailto:ashes at email.unc.edu]
Sent: Thursday, September 14, 2000 2:48 PM
To: insight-developers at public.kitware.com
Subject: [Insight-developers] ImageIterator



 The Begin() method in ImageIterator returns a new iterator which points
to the beginning of the region or image, and does not change itself. If I
am not mistaken, this means an iterator can be used only once to iterate
over a region/image, after which it becomes useless.

 It would be nice if in the Begin() method the iterator resets itself to
the beginning of the region/image and thus can be used again, instead of
creating a new iterator.

 What that means is instead of doing
-------
ImageRegionIterator it;

it.Begin()
while(!it.IsAtEnd())
{
}

ImageRegionIterator it2 = it.Begin();
while(!it2.IsAtEnd())
{
}
-------

we do

-------
it.Begin();
while(!it.IsAtEnd())
{
}

it.Begin();
while(!it.IsAtEnd())
{
}
------

Regards,
    Ashes





_______________________________________________
Insight-developers mailing list
Insight-developers at public.kitware.com
http://public.kitware.com/mailman/listinfo/insight-developers




More information about the Insight-developers mailing list