Finally, I think that "itkAddImageFilter" is not what I need.<br><br>Which function can I use to create a program that takes multiple 3D images.mhd as input and create as output one 3D image.mhd containing the average(mean) of the multiple images ?<br>
<br>Any help is appreciated...<br><br><br>Thank you !<br><br><br><br>Stéphane<br><br><br><br><br><div class="gmail_quote">2008/10/22 Stéphane CALANDE <span dir="ltr"><<a href="mailto:scalande@gmail.com">scalande@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">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't want a program that "sums" 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 "grey-level", the image I want is an other "grey-level" one (but now the problem is that the output image is black and white, probably because of the SUM, isn't it?)<br>
<br><br>Luis, I'd like to know if the program you gave me (just under this mail) can resolve that problem ?<br><br>I'm trying to compile it but the variable "adder" is undeclared... What is the type of "adder" ? 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"><<a href="mailto:luis.ibanez@kitware.com" target="_blank">luis.ibanez@kitware.com</a>></span><div>
<div></div><div class="Wj3C7c"><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>
"name" and do the following:<br>
<br>
<br>
reader->SetFileName( name[0] );<br>
reader->Update();<br>
ImageType::Pointer inputImage1 = reader->GetOutput();<br>
adder->SetInput1( inputImage1 );<br>
<br>
for( int i=0; i<numberOfFiles; i++)<br>
{<br>
reader->SetFileName( name[i] );<br>
reader->Update();<br>
ImageType::Pointer inputImage2 = reader->GetOutput();<br>
inputImage2->DisconnectPipeline();<br>
adder->SetInput2( inputImage2 );<br>
adder->Update();<br>
ImageType::Pointer sumImage = adder->GetOutput();<br>
sumImage->DisconnectPipeline();<br>
adder->SetInput1( sumImage );<br>
}<br>
<br>
// Here 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>
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>
Hi,<br>
<br>
<br>
I'm a newbie in ITK and I'm looking for a example of program that takes, as input, several 3D metaheader image (.mhd) having the same spacing, size,... and that "sums" these images to create one "total_Image.mhd" 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><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></div></div><br>
</blockquote></div><br>