[Insight-users] how can I tell the pipeline that my filter needs to be re-executed?

Neuhaus Jochen j.neuhaus at dkfz-heidelberg.de
Wed Jan 7 11:40:00 EST 2009


Hi Luis,

Calling Modified() inside GenerateData() did not work.

Instead, I tried overloading UpdateOutputInformation():

void MyFilter::UpdateOutputInformation()
{
  this->Modified();  // make sure that we need to be updated
  Superclass::UpdateOutputInformation();
}

This seems to do the trick. Now, my filter always executes GenerateData(). Is this correct or could that lead to any side effects?

Thanks, 
 Jochen

> -----Ursprüngliche Nachricht-----
> Von: Luis Ibanez [mailto:luis.ibanez at kitware.com]
> Gesendet: Mittwoch, 7. Januar 2009 05:14
> An: Neuhaus Jochen
> Cc: insight-users at itk.org
> Betreff: Re: [Insight-users] how can I tell the pipeline that my filter
> needs to be re-executed?
> 
> 
> Hi Jochen,
> 
> You should call the "Modified()" method.
> 
> One possibility is that inside your GenerateData() method,
> you could call, at the end, the Modified() method.
> 
> 
> 
>     Regards,
> 
> 
>         Luis
> 
> 
> -------------------------
> Neuhaus Jochen wrote:
> > Hi all,
> >
> > I wrote my own filter class (derived from itk::ProcessObject) that
> > processes my own data objects (derived from itk::DataObject). My
> filter
> > is a source, it does not have any other data objects as input.
> > When I call myFilter->GetOutput()->Update() the first time,
> > GenerateData() is executed, as expected. If I call it a second time,
> the
> > update mechanism thinks that everything is unchanged and doesn't call
> > GenerateData() again. But in my special case, I need my filter to
> always
> > be modified and therefore always execute GenerateData() again. There
> is
> > no explicit state change in my filter objects, it is more that the
> time
> > has changed on the second call and GenerateData() will produce a
> > different output at a later time.
> >
> > I'm trying to understand the pipeline update process, but I'm a bit
> lost
> > to which method I should change. Any hints for me?


More information about the Insight-users mailing list