<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>I think I still did not understand your problem completely . Why you
want to store image in container ? Can you describe what exactly you
trying to do ?</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>Alex</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 7:15 PM</DIV>
<DIV><B>To:</B> <A title=alexdowson@hotmail.com
href="mailto:alexdowson@hotmail.com">alex Dowson</A> </DIV>
<DIV><B>Cc:</B> <A title=insight-users@itk.org
href="mailto:insight-users@itk.org">insight-users@itk.org</A> </DIV>
<DIV><B>Subject:</B> Re: [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>
<DIV class=gmail_extra>Hi Alex,<BR>first of all, many thanks for the
response.<BR><BR>I'm afraid that you haven't noticed that I did the same as
described in your link (it was the easy part) ...<BR>Actually my question was
about a vector of iterators to itk images.<BR>Please, read my attached code.
I'll be pleased to understand what have I
missed.<BR><BR>Regards,<BR>Hila<BR><BR><BR>
<DIV class=gmail_quote>On Mon, Apr 23, 2012 at 4:08 PM, alex Dowson <SPAN
dir=ltr><<A href="mailto:alexdowson@hotmail.com"
target=_blank>alexdowson@hotmail.com</A>></SPAN> wrote:<BR>
<BLOCKQUOTE
style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote>
<DIV dir=ltr>
<DIV dir=ltr>
<DIV style="FONT-FAMILY: 'Calibri'; 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"
target=_blank><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"
target=_blank><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'; FONT-SIZE: small; FONT-WEIGHT: normal; TEXT-DECORATION: none">
<DIV style="FONT: 10pt tahoma">
<DIV> </DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV><B>From:</B> <A title=hilahiler@gmail.com
href="mailto:hilahiler@gmail.com" target=_blank>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" target=_blank>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'; FONT-SIZE: small; FONT-WEIGHT: normal; TEXT-DECORATION: none">
<DIV>
<DIV class=h5>
<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></DIV></DIV>
<HR>
_____________________________________<BR>Powered by <A
href="http://www.kitware.com" target=_blank>www.kitware.com</A><BR><BR>Visit
other Kitware open-source projects at<BR><A
href="http://www.kitware.com/opensource/opensource.html"
target=_blank>http://www.kitware.com/opensource/opensource.html</A><BR><BR>Kitware
offers ITK Training Courses, for more information visit:<BR><A
href="http://www.kitware.com/products/protraining.php"
target=_blank>http://www.kitware.com/products/protraining.php</A><BR><BR>Please
keep messages on-topic and check the ITK FAQ at:<BR><A
href="http://www.itk.org/Wiki/ITK_FAQ"
target=_blank>http://www.itk.org/Wiki/ITK_FAQ</A><BR><BR>Follow this link to
subscribe/unsubscribe:<BR><A
href="http://www.itk.org/mailman/listinfo/insight-users"
target=_blank>http://www.itk.org/mailman/listinfo/insight-users</A><BR></DIV></DIV></DIV></DIV></BLOCKQUOTE></DIV>
<DIV> </DIV></DIV></DIV></DIV></DIV></DIV></BODY></HTML>