Hi Luis, hi everybody...<br><br><br>I have little problems with the program I created to add my images (see former mail) : in fact I badly expressed myself.<br>I don&#39;t want a program that &quot;sums&quot; my 3D metaheaders images, but I want a program that give, as output, a file containing a MEAN of the images. <br>
<br>If I have 10 images represented by different &quot;grey-level&quot;, the image I want is an other &quot;grey-level&quot; one (but now the problem is that the output image is black and white, probably because of the SUM, isn&#39;t it?)<br>
<br><br>Luis, I&#39;d like to know if the program you gave me (just under this mail) can resolve that problem ?<br><br>I&#39;m trying to compile it but the variable &quot;adder&quot; is undeclared... What is the type of &quot;adder&quot; ? Can you help me ? <br>
<br><br>Thank you very much !!<br><br><br><br>Stéphane<br><br><br><div class="gmail_quote">2008/10/16 Luis Ibanez <span dir="ltr">&lt;<a href="mailto:luis.ibanez@kitware.com">luis.ibanez@kitware.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Hi Stéphane<br>
<br>
It should be relatively straight forward to implement this.<br>
<br>
Put the list of filenames in an array of std::strings called<br>
&quot;name&quot; and do the following:<br>
<br>
<br>
 &nbsp; &nbsp;reader-&gt;SetFileName( name[0] );<br>
 &nbsp; &nbsp;reader-&gt;Update();<br>
 &nbsp; &nbsp;ImageType::Pointer inputImage1 = reader-&gt;GetOutput();<br>
 &nbsp; &nbsp;adder-&gt;SetInput1( inputImage1 );<br>
<br>
 &nbsp; &nbsp;for( int i=0; i&lt;numberOfFiles; i++)<br>
 &nbsp; &nbsp; &nbsp;{<br>
 &nbsp; &nbsp; &nbsp;reader-&gt;SetFileName( name[i] );<br>
 &nbsp; &nbsp; &nbsp;reader-&gt;Update();<br>
 &nbsp; &nbsp; &nbsp;ImageType::Pointer inputImage2 = reader-&gt;GetOutput();<br>
 &nbsp; &nbsp; &nbsp;inputImage2-&gt;DisconnectPipeline();<br>
 &nbsp; &nbsp; &nbsp;adder-&gt;SetInput2( inputImage2 );<br>
 &nbsp; &nbsp; &nbsp;adder-&gt;Update();<br>
 &nbsp; &nbsp; &nbsp;ImageType::Pointer sumImage = adder-&gt;GetOutput();<br>
 &nbsp; &nbsp; &nbsp;sumImage-&gt;DisconnectPipeline();<br>
 &nbsp; &nbsp; &nbsp;adder-&gt;SetInput1( sumImage );<br>
 &nbsp; &nbsp; &nbsp;}<br>
<br>
 &nbsp; // Here &nbsp;sumImage has the output.<br>
<br>
<br>
Note the use of the DisconnectPipeline() method, that<br>
makes possible to reuse the reader and the adder filter.<br>
<br>
<br>
<br>
Regards,<br>
<br>
<br>
 &nbsp; Luis<br>
<br>
<br>
-------------------------<br>
Stéphane CALANDE wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="Wj3C7c">
Hi,<br>
<br>
<br>
I&#39;m a newbie in ITK and I&#39;m looking for a example of program that takes, as input, several 3D metaheader image (.mhd) having the same spacing, size,... and that &quot;sums&quot; these images to create one &quot;total_Image.mhd&quot; having the same size, spacing,... than the input ones.<br>

<br>
<br>
Does it exist ?<br>
<br>
<br>
Thank you very much.<br>
<br>
<br>
<br>
<br>
Regards,<br>
<br>
<br>
Stéphane<br>
<br>
<br></div></div>
------------------------------------------------------------------------<div class="Ih2E3d"><br>
<br>
_______________________________________________<br>
Insight-users mailing list<br>
<a href="mailto:Insight-users@itk.org" target="_blank">Insight-users@itk.org</a><br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
</div></blockquote>
</blockquote></div><br>