[Insight-users] Mean image

Bill Lorensen bill.lorensen at gmail.com
Mon May 26 16:16:00 EDT 2008


You can add "N" images with itkNaryAddImageFilter, then divide by 3
with itkShiftScaleImageFilter.

On Mon, May 26, 2008 at 11:01 AM, Yankam Njiwa  Josiane Adrienne
<njiwa at biomed.ee.ethz.ch> wrote:
>
>
> 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
>


More information about the Insight-users mailing list