[Insight-developers] testing modified times of process objects

Will Schroeder will.schroeder at kitware.com
Thu Sep 21 15:12:18 EDT 2000


Hi Josh-

I think that you've touched another important issue that we've overlooked. That is, when an filter is asked GetMTime(), what is the right answer? There are two contributors to modification: direct modifications to the filter and modifications to the data flow stream. What I think of by GetMTime() is direct modifications to the filter, not due to changes in the data flow. (The execution process to a large extent figures out modification due to changes in the data flow.)

Where this gets weird is when you have a class A that depends on class B, but class B is not a participant in data flow (i.e., not a filter or data object). In this case the GetMTime() method (which is virtual) should be overloaded to check the mtime of itself (class A) plus the mtime of class B, taking the greater value of the two.

Will


At 04:59 PM 9/20/00 -0400, Josh Cates wrote:
>Hi Will,
>
>My question is a little more specific:  It seems that there are at least
>two conditions that will cause Execute() to be invoked.  (1) A filter's
>inputs (data) have changed.  (2) A filter's member variables (parameters)
>have changed.  Given (1) but not (2), I am looking for a way to avoid the
>penalty of re-initializing the filter (calculating coefficients, for
>example) before executing.
>
>Josh.
>
>
>At 03:44 PM 9/20/00 -0400, Will Schroeder wrote:
> >Hi Josh-
> >
> >The way it's supposed to work is that the filter superclasses will take 
> >care of all of that for you, and only invoke Execute() when the filter is 
> >out of date. For this to work properly, it's very important to use
> >Set/Get 
> >macros which take care of sending a Modified() to the filter if something 
> >changes (or of course you can do that yourself).
>
> >Will
>
>At 03:07 PM 9/20/00 -0400, Josh Cates wrote:
> >Hello folks,
> >
> >How can I test a filter to see if it has been modified since its
>Execute()
> >method was last called?
> >
> >For example say I want to do something like:
> >
> >  MyFilterClass::Execute()
> >  {
> >    if ( this->HasBeenModifiedSinceLastExecuteCall() )
> >    {
> >      this->RecalculateSomeFilterParameters();
> >    }
> >
> >    Filter();
> >  }
>
>+--+--+--+--+--+--+--+--+--+--+--+--
>  Josh Cates                     
>  Dept. of Electrical Engineering        
>  University of Tennessee, Knoxville
>  Email: jecates at utk.edu
>  Phone: (865) 974-0694
>  URL:   www.cs.utk.edu/~cates
>--+--+--+--+--+--+--+--+--+--+--+---





More information about the Insight-developers mailing list