[Insight-users] problem with ImageDuplicator

Sergio Andres sergio at unizar.es
Mon, 23 Feb 2004 14:08:39 +0100


Hi all,

I'm using several ITK filters such as :
-RecursiveGaussianImageFilter,
-AddImageFilter,
-MultiplyImageFilter
-and ImageDuplicator


I got surprised when the results weren't as I expected..

My code is like this:

            // auxImage = LxLxLxx + LyLyLyy
            addFilter->SetInput1(imageLxLxLxx);
            addFilter->SetInput2(imageLyLyLyy);
            addFilter->Update();

            duplicatorFilter->SetInputImage(addFilter->GetOutput());
            duplicatorFilter->Update();
            auxImage = duplicatorFilter->GetOutput();

            // outputImage = LxLxLxx + LyLyLyy + 2LxLxyLy
            addFilter->SetInput1(auxImage);
            addFilter->SetInput2(image2LxLyLxy);
            addFilter->Update();

            duplicatorFilter->SetInputImage(addFilter->GetOutput());
            duplicatorFilter->Update();
            outputImage = duplicatorFilter->GetOutput();

           
            diffFilter->SetValidInput(addFilter->GetOutput());
            diffFilter->SetTestInput(outputImage);
            diffFilter->Update();

As you can see above, I use addFilter to calculate = LxLxLxx + LyLyLyy + 
2LxLyLxy, and store it in outputImage.
But then, when I compared the output from addFilter and outputImage ... 
I see that there is an important difference
between its values (mean difference about 68.00), when they should have 
the same values...

addFilter is an AddImageFilter object
diffFilter is an DifferenceImageFilter object

outputImage, auxImage, LxLxLxx and so .. are Image<double,2> objects


I will appreciate your answer..

Thanks!

Sergio.