Progress reporting with strange behaviour

Im quite new to simpleITK so this is perhaps simple. But I just don’t get it. When I look at the progress of a filter, (I register a Command so I can follow the progress) it behaves strangely.

For most filters like the MedianImageFilter it progress from 0 to almost 1 and the last progress it reports is almost 0, e.g. 3.23634594678879E-08. This messes with my progress bar that I display, but is fairly easy to solve with a nondecreasing progress.

But for some other filters the progress is even stranger, so far only detected it for DiscreteGaussianImageFilter. (Have only tried a few filter so far.) It counts its progress to 0.3333 three times instead of reporting the interval 0-1. And after each 33% interval it also reports 3.23634594678879E-08.

So am I missing something? Especially for the DiscreteGaussianImageFilter. Is there some more Progress variable subdividing the progress into steps that I need to keep track of?

Hello @Anders_G,

I haven’t looked at the underlying C++ ITK code but I suspect this is what is happening:

  1. The DiscreteGaussianImageFilter is using the separability of Gaussian convolutions and you are working in 3D, so instead of a single 3D convolution we have three 1D convolutions.
  2. Each of the convolutions is reporting progress independently but is normalized using the dimension so instead of going from zero to one they go from zero to 1/3 three times.
  3. Please try it with a 2D image. If my suspicion is correct you will get a progress count from zero to 0.5 repeated twice.

Finally, please report this issue on the ITK issue tracker.

1 Like