[Insight-users] forcing pipeline to update

Zachary Pincus zpincus at stanford.edu
Tue Jun 28 14:05:21 EDT 2005


Hi Jakub,

Calling filter->Modified() tells a filter that it is no longer up to 
date.

The setter macros that most ITK classes use to set member variables 
(itkSetMacro, etc., defined in itkMacro.h) are clever and only call 
this->Modified() if they have set a member variable to a *new* value. 
So when you set the parameters to a value that is the same as the old 
value, Modified() never gets called. Doing it manually should solve 
your problem.

The bigger problem, of course, is the bizarrely broken behavior of the 
FFT filter that you reported earlier. Have you (or anyone else?) gotten 
any closer to figuring out the problem?

Zach Pincus

Department of Biochemistry and Program in Biomedical Informatics
Stanford University School of Medicine


On Jun 28, 2005, at 2:21 AM, Jakub Bican wrote:

>
> Hello,
>
> i have a short pipeline - two filters: ResampleImageFilter followed by 
> FFTWRealToComplexConjugateImageFilter.
>
> I am using it to compute different transforms of the same data:
>
> 1) connect the pipeline, set input to the resample filter
> 2) loop:
>     A) change the transform in resample filter according to the loop 
> variable i
>     B) set up the output parameters of resmaple filter 
> (origin,spacing,size)
>     C) UpdateLargestPossibleRegion() of resample filter
>     D) UpdateLargestPossibleRegion() of fourier filter
>     E) store the transformed data and disconnect it:
>             transformedData[i] = fourierFilter->GetOutput();
>             transformedData[i]->DisconnectPipeline();
> 3) end loop
>
> * step C is neccessary due to some bug in fourier filter that i 
> reported some weeks ago (otherwise fourier filter fails)
> * step B is not usually neccessary - but sometimes i use different 
> parameters for each transformed version
>
> The problem is, that if the parameters of the resample filter do not 
> change in step B, then step C does not process anything and 
> immediately terminates without having updated resample filter's 
> output.
>
> I suppose this behavior is expectable, because resample filter has no 
> reason to update its output ("input and any parameters else than 
> something inside of the transform did not change"), but i need to 
> force it to compute.
>
> The only solution i thought of is resetting and reconnecting the 
> pipeline, but i don't like it very much. Please, if anyone knows any 
> clear solution how to force the filter or pipeline to update even if 
> it is up-to-date, let me know.
>
> Thank you very much in advance.
>
> Cheers,
>                 Jakub
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>



More information about the Insight-users mailing list