[Insight-users] Filter is not updating]

Nils H. Busch nilsb at cbs.mpg.de
Thu Sep 1 04:08:04 EDT 2005


Hi,

thanks for the quick reply.

Thanks to the suggestions and questions from both of you, I have found my
mistake.
> Do your filters subclass off of itkSegmentationLevelSetImageFilter?
Yes, they do.
> If
> looks like
> there is code that only calculates/allocates the speed and advection
image if the state
> of the filter is UNITIALIZED. You might want to add a line to your loop
>
> m_Filter[i]->SetStateToUnitialized();
>
> to force the filter to rebuild these images.  If this fixes, your
problem, then
> we should force the level set filters to be unitialized if the inputs
are changed.
>
Actually, I was trying to be too smart and had for both component filters
ManualReinitialization set to true leaving the filters initialized. I did
that, because I wrongly had hoped I could save some computation time by
circumventing the initialization loop in FiniteDifferenceFilter. I
believed this would be alright as the filters would have executed already
on subsequent iterations. Having looked more closely at that loop, I now
realize that most (all?) methods called there are essential not least
resetting elapsed iterations. After having fixed that, my composite filter
runs just fine as did the component filters before when used standalone.

I am wondering though, if there is anything from that initialization loop
one could cossibly leave out. CopyInputToOutput and Initialize do some
lengthy computations in the derived SparseFieldLevelSetImageFilter but
other  than using some shared internal update buffers for both component
filters, I see no real way for speed up.

As a side note, I discovered that setting the number of iterations for a
level set segmentation filter to one and concecutively restarting that
filter with its updated output as input yields slightly worse results
compared to using that filter conventionally. Seems the zero crossing
filtering and initialization routine introduces small errors.

Thanks again.


-- 
  Nils H. Busch


More information about the Insight-users mailing list