[Insight-developers] Set methods in iterator

Miller, James V (GE, Research) millerjv at crd.ge.com
Fri Feb 17 12:44:34 EST 2006


The intention of the iterator design is that if you wanted two iterate over two different regions in an image you would create two different iterators.  Alternatively you can "redefine" an iterator using the operator=
 
ImageRegionIteration<ImageType> it(image, region1);
 
while (!it.IsAtEnd()) 
  {
  /// something
  ++it;
  }
 
// walk another region
it = ImageRegionIterator<ImageType>(image, region2);
while (!it.IsAtEnd())
   {
   // something
   ++it;
   }
 
 
The variables m_BeginOffset(), etc. are implementation details that should not be exposed to the user.
 

-----Original Message-----
From: insight-developers-bounces+millerjv=crd.ge.com at itk.org [mailto:insight-developers-bounces+millerjv=crd.ge.com at itk.org]On Behalf Of gavin adler
Sent: Friday, February 17, 2006 9:23 AM
To: Insight-developers at itk.org
Subject: [Insight-developers] Set methods in iterator


Hi all: 
 
    I find that all image iterators don't have functions to set regions or m_BeginOffset or m_SpanBeginOffset or m_BeginIndex ... As a result, If we want to iterate the same image with different region, we have to declare a new iterator point it. What the reason that no definition of such functions for iterator it is?
 By the way , I want to know how the lib orders in TARGET_LINK_LIBRARIES() should be? I find sometime the orders will result in failure of building a program.  
 
 
wanlin

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.itk.org/mailman/private/insight-developers/attachments/20060217/a7ba19d0/attachment.html


More information about the Insight-developers mailing list