<div dir="ltr">Hi All,<br><br>I&#39;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&#39;t working because I don&#39;t know how to forward the image&#39;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            &lt;ImageType&gt;            iteratorType;<br>
    typedef itk::ImageRegionConstIterator    &lt;ImageType&gt;            constIteratorType;<br><br>    constIteratorType    first_it    (first_img, first_img-&gt;GetRequestedRegion()); <br>    iteratorType            output_it (output_img, output_img-&gt; GetRequestedRegion());<br>
<br>    std::list&lt;constIteratorType&gt; list;<br>    std::list&lt;constIteratorType&gt;::iterator it;<br><br>    list.push_back(first_it);<br><br>    if (second_img.IsNotNull())<br>    {<br>        constIteratorType second_it (second_img, second_img-&gt;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 &lt; list.end(); it++)<br>    {<br>        it-&gt;GoToBegin();<br>    }<br>
<br>    for(output_it.GoToBegin(); !output_it.IsAtEnd(); ++output_it)<br>    {<br>        for(it = list.begin(); it &lt; 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-&gt;Get() + output_val;  //get values from each image and insert in the output image<br>            // How do I forward the image&#39;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>