[Insight-users] pipeline doesn't flush

Karthik Krishnan Karthik.Krishnan at kitware.com
Thu Sep 7 13:44:04 EDT 2006



Aditya Chandramouli wrote:

>Hi,
>Hi Karthik,
>
>Thanks! You're right, I do use iterators to modify the image data before 
>filtering. I'm not really sure about the modified time, but the workaround 
>I'm using now is to modify the code so that the output of my filter is fed 
>back to the input, on each iteration.
>  
>
Did you intend doing that (connecting the filter output to its input), 
Is that an iterative filter.. If you are doing such things, you need to 
disconnect the data object (myImage) for the pipeline before doing 
that.. using DisconnectPipeline.. However I don't think that's what you 
intend to do....  you can always have :

for (n iterations)
{
   // use iterators to modify the image
   myImage->Modified(); // reflect the modification by changing the 
MTime of the data object
   myFilter->SetInput(myImage)
   myFilter->Update();
}

>Cheers,
>
>aditya
>
>On Wednesday 06 September 2006 23:48, Karthik Krishnan wrote:
>>/ Aditya Chandramouli wrote:
>/>/ >Hi,
>/>/ >
>/>/ >I have the following (pseudo-)code:
>/>/ >
>/>/ >---------------------------------
>/>/ >myFilter::New();
>/>/ >myFilter->SetInput(myImage);
>/>/ >
>/>/ >for ( n iterations )
>/>/ >{
>/>/ >	perform operations on myImage;
>/>/ >
>/>/ >	myFilter->Update();
>/>/ >}
>/>/ >---------------------------------
>/>/ >
>/>/ >My problem is that the Update only seems to take place on the first
>/>/ > iteration of the loop.
>/>/ >
>/>/ >On subsequent iterations, the update doesn't seem to take place although
>/>/ >myImage undergoes changes on each iteration and I need to re-run the
>/>/ > filter on it.
>/>/
>/>/ Did you check the modified time of myImage to see if its MTime is
>/>/ changing ? If it is, the myFilter should update at each iteration..
>/>/
>/>/ I suspect in the "perform operations on myImage",  you are modifying
>/>/ your image using iterators etc.. Generally, most ITK inplace filters
>/>/ will change the modified time of their images. However if you used an
>/>/ image iterator to change the values manually or if you made SetPixel
>/>/ calls etc, for reasons of efficiency, the MTime is not changed.
>/>/
>/>/ Hope this helps.
>/>/
>/>/ >I've tried to reinsert the myFilter->SetInput(myImage) line within the
>/>/ > loop, with no effect.
>/>/ >
>/>/ >Any help or suggestions would be most appreciated.
>/>/ >
>/>/ >thanks.
>/>/ >
>/>/ >aditya
>/>/ >_______________________________________________
>/>/ >Insight-users mailing list
>/>/ >Insight-users at itk.org <http://www.itk.org/mailman/listinfo/insight-users>
>/>/ >http://www.itk.org/mailman/listinfo/insight-users
>/
>
>  
>


More information about the Insight-users mailing list