<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;">The mean of what exactly? The first time you were dividing the pointer by 3, and with the GetOutput thing I'm not even sure what that's doing... it was just a suggestion.<br><br>Do you just want the program to take 3 images then create an image that is a mix of all 3? For example, 3 poor images that combine to make 1 good image?<br><br>Whatever you're doing I don't think its that simple. Maybe there is a filter that does what you want. Like the Addition filter that you used.<br></div><br><div></div><br><br><hr id="stopSpelling">> Subject: RE : [Insight-users] Mean image<br>> Date: Mon, 26 May 2008 17:33:29 +0200<br>> From: njiwa@biomed.ee.ethz.ch<br>> To: w_e_b_m_a_s_t_e_r_6_9@hotmail.com<br>> CC: insight-users@itk.org<br>> <br>> Hi Cameron,<br>> <br>> Thanks a lot for your answer, but i think my problem occured when i try to perfom division. Here is my complete code. I don't exactly how i can enter this division part in my pipeline. Do you have any idea?<br>> <br>> Regards,<br>> <br>> Josiane.<br>> <br>> <br>> <br>> <br>> <br>> typedef float PixelType;<br>> <br>> typedef itk::Image< PixelType, 3 > ImageType;<br>> <br>> typedef itk::ImageFileReader< ImageType > ReaderType;<br>> <br>> typedef itk::ImageFileWriter< ImageType > WriterType;<br>> <br>> ReaderType::Pointer reader1 = ReaderType::New();<br>> <br>> ReaderType::Pointer reader2 = ReaderType::New();<br>> <br>> ReaderType::Pointer reader3 = ReaderType::New();<br>> <br>> WriterType::Pointer writer = WriterType::New();<br>> <br>> reader1->SetFileName( argv[1] );<br>> <br>> reader2->SetFileName( argv[2] );<br>> <br>> reader3->SetFileName( argv[3] );<br>> <br>> writer->SetFileName( argv[4] );<br>> <br>> reader1->Update();<br>> <br>> reader2->Update();<br>> <br>> reader3->Update();<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>> writer->SetFileName( argv[4] );<br>> <br>> writer->SetInput( addition2->GetOutput()/3.0 );// I would like here to compute the mean between the three images<br>> <br>> writer->Update();<br>> <br>> return EXIT_SUCCESS;<br>> <br>> <br>> ________________________________<br>> <br>> De: Cameron Burnett [mailto:w_e_b_m_a_s_t_e_r_6_9@hotmail.com]<br>> Date: lun. 26/05/2008 17:18<br>> À: Yankam Njiwa Josiane Adrienne<br>> Cc: insight-users@itk.org<br>> Objet : RE: [Insight-users] Mean image<br>> <br>> <br>> 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>> <br>> <br>> <br>> <br>> ________________________________<br>> <br>> > 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>> <br>> ________________________________<br>> <br>> Email Australia. Be part of history. Take part in Australia's first e-mail archive with <http://emailaustralia.ninemsn.com.au/> <br><br /><hr />at CarPoint.com.au <a href='http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fsecure%2Dau%2Eimrworldwide%2Ecom%2Fcgi%2Dbin%2Fa%2Fci%5F450304%2Fet%5F2%2Fcg%5F801459%2Fpi%5F1004813%2Fai%5F859641&_t=762955845&_r=tig_OCT07&_m=EXT' target='_new'>It's simple! Sell your car for just $30 </a></body>
</html>