[Insight-users] problem with ImageDuplicator

Miller, James V (Research) millerjv at crd.ge.com
Mon, 23 Feb 2004 11:01:57 -0500


Sergio, 

I checked in some changes to ImageDuplicator.  Can you try the new version?

I am not happy with this class.  It gives the user the impression that is in
the pipeline but it is not a pipeline object. It requires the input be up to
date 
prior to running the Duplicator.  Plus, everytime the Duplicator runs, it
creates
a NEW output object, so you need to call GetOutput() on the Duplicator after
each call to Update().


I may remove it in favor of an actual filter or a DeepCopy method on Image.



-----Original Message-----
From: Miller, James V (Research) [mailto:millerjv at crd.ge.com]
Sent: Monday, February 23, 2004 8:55 AM
To: 'Sergio Andres'; insight-users at itk.org
Subject: RE: [Insight-users] problem with ImageDuplicator


Sergio, 

The ImageDuplicator filter does not adhere to the pipeline mechanism and
relies on the modified times of DataObjects to do what it needs to do.
However, a DataObject's modified time is usually not altered when the bulk
data is generated.
So the duplicator is probably not executing the second time it is used.

I am not sure where the Duplicator is being used, if you would like, I can
try to fix it to adhere to the pipeline semantics.

Jim



-----Original Message-----
From: Sergio Andres [mailto:sergio at unizar.es]
Sent: Monday, February 23, 2004 8:09 AM
To: insight-users at itk.org
Subject: [Insight-users] problem with ImageDuplicator



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.

_______________________________________________
Insight-users mailing list
Insight-users at itk.org
http://www.itk.org/mailman/listinfo/insight-users
_______________________________________________
Insight-users mailing list
Insight-users at itk.org
http://www.itk.org/mailman/listinfo/insight-users