[Insight-users] Mean image

Cameron Burnett w_e_b_m_a_s_t_e_r_6_9 at hotmail.com
Mon May 26 11:18:57 EDT 2008


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.

reader1 > addition1 > addition2 > Image
reader2 > addition1 > addition2 > Image
reader3 > addition2 > Image

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 :).

What are you doing on this line? ImageType::Pointer Image1 =Image/3.0;
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.




> Date: Mon, 26 May 2008 17:01:33 +0200
> From: njiwa at biomed.ee.ethz.ch
> To: insight-users at itk.org
> Subject: [Insight-users] Mean image
> 
>  
> 
> Dear all,
> 
> 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?
> 
> Regards,
> 
> Josiane.
> 
>  
> 
>  
> 
> typedef itk::AddImageFilter< 
> 
> ImageType, 
> 
> ImageType, 
> 
> ImageType > AdditionFilterType;
> 
> AdditionFilterType::Pointer addition1 = AdditionFilterType::New();
> 
> AdditionFilterType::Pointer addition2 = AdditionFilterType::New();
> 
> addition1->SetInput1( reader1->GetOutput() );
> 
> addition1->SetInput2( reader2->GetOutput() );
> 
> addition2->SetInput1( reader3->GetOutput() );
> 
> addition2->SetInput2( addition1->GetOutput() );
> 
> ImageType::Pointer Image = addition2->GetOutput();
> 
> ImageType::Pointer Image1 =Image/3.0;
> 
> writer->SetFileName( argv[4] );
> 
> writer->SetInput( Image1 );
> 
> writer->Update();
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users

_________________________________________________________________
Be part of history. Take part in Australia's first e-mail archive with Email Australia.
http://emailaustralia.ninemsn.com.au
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20080527/98921bc9/attachment.htm>


More information about the Insight-users mailing list