<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'><div style="text-align: left;">I'm not sure what the 'red' line is because I can't see any colour. Maybe the problem is that you haven't called Update() on your pipeline.<br><br>reader1 > addition1 > addition2 > Image<br>reader2 > addition1 > addition2 > Image<br>reader3 > addition2 > Image<br><br>Plugging in GetOutput() will set the links like above. EG: Reader3 goes to addition2 then to Image. If you do an Image->Update() then that will update everything thats linked to Image that is before it (all the links I typed above). Then you can actually use the image :).<br><br>What are you doing on this line? ImageType::Pointer Image1 =Image/3.0;<br>It seems like you're dividing the pointer by 3, and I'm fairly sure you don't want to do that. Maybe ImageType::Pointer Image1 =Image->GetOutput()/3.0; might do something?? In that case I think writer->Update() WILL update your whole pipeline, and that previous problem will be fixed also.<br><br></div><br><div></div><br><br><hr id="stopSpelling">> Date: Mon, 26 May 2008 17:01:33 +0200<br>> From: njiwa@biomed.ee.ethz.ch<br>> To: insight-users@itk.org<br>> Subject: [Insight-users] Mean image<br>> <br>> <br>> <br>> Dear all,<br>> <br>> I would like to compute the mean between 3 images. I used the code bollow but the line in red seems to be false and i don't understand why. Could somebody help me please?<br>> <br>> Regards,<br>> <br>> Josiane.<br>> <br>> <br>> <br>> <br>> <br>> typedef itk::AddImageFilter< <br>> <br>> ImageType, <br>> <br>> ImageType, <br>> <br>> ImageType > AdditionFilterType;<br>> <br>> AdditionFilterType::Pointer addition1 = AdditionFilterType::New();<br>> <br>> AdditionFilterType::Pointer addition2 = AdditionFilterType::New();<br>> <br>> addition1->SetInput1( reader1->GetOutput() );<br>> <br>> addition1->SetInput2( reader2->GetOutput() );<br>> <br>> addition2->SetInput1( reader3->GetOutput() );<br>> <br>> addition2->SetInput2( addition1->GetOutput() );<br>> <br>> ImageType::Pointer Image = addition2->GetOutput();<br>> <br>> ImageType::Pointer Image1 =Image/3.0;<br>> <br>> writer->SetFileName( argv[4] );<br>> <br>> writer->SetInput( Image1 );<br>> <br>> writer->Update();<br>> <br>> _______________________________________________<br>> Insight-users mailing list<br>> Insight-users@itk.org<br>> http://www.itk.org/mailman/listinfo/insight-users<br><br /><hr />Email Australia. <a href='http://emailaustralia.ninemsn.com.au' target='_new'>Be part of history. Take part in Australia's first e-mail archive with </a></body>
</html>