[Insight-users] Filter is not updating

Luis Ibanez luis.ibanez at kitware.com
Tue Aug 30 12:55:12 EDT 2005


Hi Nils,

The use of DisconectPipeline() seems to be correct
in your code.



Could you please answer the following questions:

1) How many inputs do you have in composite filter ?

2) Did you initialized "iterationOutput[i]" before
    entering the while(!this->Halt()) loop ?

3) Did you initialized "coupledOutput[i]" before
    entering the while(!this->Halt()) loop ?


Overall,... it looks strange in your code that you
seem to have N filters and N inputs, but they are
not forming a pipeline. Instead they seems to be
used independently one from the others. Is this you
real intent ?


Please let us know


   Thanks


     Luis



-----------------------
Nils H. Busch wrote:
> Hi,
> 
> I have written an iterative filter derived from ImageToImageFilter
> containing two level set image filters connected to each other. I run both
> filters for one iteration, then reset their inputs and run the iteration
> cycle until both converge.
> As told, I assign the output of the previous run of one filter to a
> pointer, then call DisconnectPipeline on it and then feed it as inputs to
> both filters.
> My code (in GenerateData()) looks like this (excerpt)
> 
> while(!this->Halt()) {
>   for(unsigned int i = 0; i < this->GetNumberOfInputs(); ++i) {
>     m_Filter[i]->SetInput(iterationOutput[i]);
>     m_Filter[i]->SetCoupledInput(coupledOutput[i]);
>     m_Filter[i]->Update();
>     iterationOutput[i] = m_Filter[i]->GetOutput();
>     iterationOutput[i]->DisconnectPipeline();
>     // This assignes the new output of this filter to the input pointer of
>     // the coupled filter
>     // Causes SIGFPE exception during next iteration
>     coupledOutput[(i+1)%c_NUM_FILTER] = iterationOutput[i];
>    }
>    ++m_ElapsedIterations;
> }
> 
> coupledOutput is an array that stores the outputs of the respective
> coupled filter, i.e. coupledOutput[0] stores the pointer to the output
> image of the coupled filter, i.e. filter[1];
> 
> I encounter two problems which might be related.
> First of all, the filters don't execute when Update() is called on them,
> although their inputs have changed (different pointers). Second, the
> assignment for the coupled output causes a SIGFPE exception on the next
> iteration cycle. In another part of my code, I had a similar assignment,
> which was redundant and after removing it there, the same error went away
> at that point.
> 
> My current suspicion is that since the filters don't execute, the
> SetSecondInput (which calls SetNthInput(2,...) internally) method does not
> propagate the newly assigned pointer to the component filter properly,
> especially an internally used image interpolater might not receive the new
> pointer and attempt to operate on a piece of obsolete memory. Since the
> filters don't execute, the methods actually (mainly ComputeUpdate)
> referencing the image are not called either, so this might be a wrong
> guess.
> 
> I have two questions:
> Any ideas why those filters don't execute although their input pointers
> are definitely different. Do I need to check the modified and update times
> more closely? What relations between the different modification and
> pipeline update times must hold to have a filter execute ?
> 
> Is the assignment in question per se wrong (something one must not do
> after DisconnectPipeline or do differently) ?
> 
> Thanks for any help,
> 
> 



More information about the Insight-users mailing list