<HTML><HEAD></HEAD>
<BODY dir=ltr>
<DIV dir=ltr>
<DIV style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: 12pt">
<DIV>Hi</DIV>
<DIV> </DIV>
<DIV>Look at this examples</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV><A
href="http://www.itk.org/Wiki/ITK/Examples/Iterators/ImageRegionConstIterator"><FONT
face="Times New Roman">http://www.itk.org/Wiki/ITK/Examples/Iterators/ImageRegionConstIterator</FONT></A><FONT
face="Times New Roman"> </FONT></DIV>
<DIV><A
href="http://www.itk.org/Wiki/ITK/Examples/Iterators/ImageRegionIterator"><FONT
face="Times New Roman">http://www.itk.org/Wiki/ITK/Examples/Iterators/ImageRegionIterator</FONT></A><FONT
face="Times New Roman"> </FONT></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV
style="FONT-STYLE: normal; DISPLAY: inline; FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: small; FONT-WEIGHT: normal; TEXT-DECORATION: none">
<DIV style="FONT: 10pt tahoma">
<DIV> </DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A title=hilahiler@gmail.com
href="mailto:hilahiler@gmail.com">Hila Hiler</A> </DIV>
<DIV><B>Sent:</B> Monday, April 23, 2012 5:57 PM</DIV>
<DIV><B>To:</B> <A title=insight-users@itk.org
href="mailto:insight-users@itk.org">insight-users@itk.org</A> </DIV>
<DIV><B>Subject:</B> [Insight-users] container for iterators of
images</DIV></DIV></DIV>
<DIV> </DIV></DIV>
<DIV
style="FONT-STYLE: normal; DISPLAY: inline; FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: small; FONT-WEIGHT: normal; TEXT-DECORATION: none">
<DIV dir=ltr>Hi All,<BR><BR>I'd like to generate a new image by summarizing some
other images in the same dimensions.<BR>So I generated a new image and a
std::list for the images iterators. (actually, I thought that this dynamic
container is the best way to mange an unknown number of images)<BR><BR>For now,
it isn't working because I don't know how to forward the image's iterator from
that vector. in other words, how do I do the same as: output_it++ from a
vector?<BR><BR>Here is my code:<BR><BR> typedef
itk::ImageRegionIterator
<ImageType>
iteratorType;<BR> typedef
itk::ImageRegionConstIterator
<ImageType>
constIteratorType;<BR><BR> constIteratorType
first_it (first_img, first_img->GetRequestedRegion());
<BR>
iteratorType
output_it (output_img, output_img->
GetRequestedRegion());<BR><BR>
std::list<constIteratorType> list;<BR>
std::list<constIteratorType>::iterator it;<BR><BR>
list.push_back(first_it);<BR><BR> if
(second_img.IsNotNull())<BR>
{<BR> constIteratorType second_it
(second_img, second_img->GetRequestedRegion());
<BR> list.push_back
(second_it);<BR> }<BR><BR> //initialize all
the iterators at the begin of input images<BR> for(it =
list.begin(); it < list.end(); it++)<BR>
{<BR>
it->GoToBegin();<BR> }<BR><BR>
for(output_it.GoToBegin(); !output_it.IsAtEnd();
++output_it)<BR>
{<BR> for(it = list.begin(); it <
list.end(); it++)//move on the images and get at each iteration the pixel value
and insert to the new image<BR>
{<BR>
output_val = it->Get() + output_val; //get values from each image and
insert in the output
image<BR> //
How do I forward the image's iterator from here
?????<BR>
}<BR>
<BR>
output_it.Set(output_val);<BR><BR> }<BR><BR><BR><BR>Any
thoughts would be very welcome ...<BR>Hila<BR></DIV>
<P>
<HR>
_____________________________________<BR>Powered by www.kitware.com<BR><BR>Visit
other Kitware open-source projects
at<BR>http://www.kitware.com/opensource/opensource.html<BR><BR>Kitware offers
ITK Training Courses, for more information
visit:<BR>http://www.kitware.com/products/protraining.php<BR><BR>Please keep
messages on-topic and check the ITK FAQ
at:<BR>http://www.itk.org/Wiki/ITK_FAQ<BR><BR>Follow this link to
subscribe/unsubscribe:<BR>http://www.itk.org/mailman/listinfo/insight-users<BR></DIV></DIV></DIV></BODY></HTML>