<div dir="ltr">Hi all,<br>
<br>
The process below describes my algorithm that generates an output image that<br>
looks spacious (output image is attached).<br>
<br>
* note that all the input images have the same size<br>
- manipulate on each input image the DanielssonDistanceMapImageFilt<div id=":8a">er<br>
- on each pixel&#39;s output image set the addition of the corresponding pixel&#39;s<br>
value from the distance maps images<br>
<br>
The problem is the spacing of the output image, although I maintained the<br>
spacing at the initializing stage.<br>
<br>
The code:<br>
<br>//manipulate  DanielssonDistanceMapImageFilt
<div id=":8a">er on im1, im2<br></div><br>
        typedef itk::ImageRegionIterator                &lt;ImageType&gt;     iteratorType;<br>
        typedef itk::ImageRegionConstIterator   &lt;ImageType&gt;     constIteratorType;<br>
<br>
        //maintain origin<br>
        //----------------<br>
        const ImageType::PointType&amp; inputOrigin = im1-&gt;GetOrigin();<br>
        double outputOrigin[ 3 ];<br>
        for(unsigned int i=0; i&lt; 3; i++)<br>
        {<br>
                outputOrigin[i] = inputOrigin[i];<br>
        }<br>
<br>
        //generating output Image<br>
        //------------------------<br>
        ImageType::Pointer outputImage = ImageType::New();<br>
        outputImage-&gt;SetOrigin(outputOrigin);<br>
        outputImage-&gt;SetSpacing(im1-&gt;GetSpacing());<br>
        outputImage-&gt;SetRegions(im1-&gt;GetLargestPossibleRegion());<br>
        outputImage-&gt;CopyInformation(im1);<br>
        outputImage-&gt;Allocate();<br>
        outputImage-&gt;FillBuffer(0);<br>
        outputImage-&gt;Update();<br>
<br>
        // generate iterators<br>
        constIteratorType im1_iterator (im1, im1-&gt; GetLargestPossibleRegion());<br>
        constIteratorType im2_iterator (im2, im2-&gt;GetLargestPossibleRegion());<br>
<br>
        // generate writeable output iterator<br>
        iteratorType output_iterator (outputImage,<br>
outputImage-&gt;GetLargestPossibleRegion());<br>
<br>
        //add values from disMap images im1 and im2 in order to set in the output<br>
image<br>
        for(im1_iterator.GoToBegin(), im2_iterator.GoToBegin();<br>
                !im1_iterator.IsAtEnd();<br>
            im1_iterator ++, im2_iterator ++, output_iterator ++)<br>
        {<br>
                outputPix_value = im1_iterator.Get() + im2_iterator.Get();<br>
                //set this pixel to outputImage<br>
                output_iterator.Set(outputPix_value);<br>
        }//for<br>
        outputImage-&gt;Update();</div><span onmouseout="cancel = false; window.setTimeout(WRCHideContent, 1000); clearTimeout(showTimer);" onmouseover=" var self = this; showTimer = window.setTimeout(function(){WRCShowContent({&#39;rating&#39;:{&#39;value&#39;:-1,&#39;weight&#39;:-1},&#39;flags&#39;:{},&#39;single&#39;:false,&#39;ttl&#39;:7200,&#39;expireTime&#39;:&#39;20111231233516&#39;}, self.className)},600);" class="wrc0" style="padding-right:16px;width:16px;height:16px"></span></div>