Mimics.segment.local_threshold does not seem to work

Hello,

When I call mimics.segment.local_threshold() from code I do not get the same result as using the GUI Local Threshold tool.

In fact, the output mask is barely different from the input mask.

If I call mimics.segment.activate_local_threshold() with the same parameters (input mask, thresholds, search_distance etc) and just click Apply manually I get the expected result. This seems to indicate that my parameters are correct.

Why does mimics.segment.local_threshold() not give the same result as the GUI tool?

How can I get the same result as the GUI tool without user intervention?

Thank you for any help you can offer.

Rob Day

Hi Rob Day,

After few trials by using both API, I unfortunately can’t seem to replicate the error.
Example of the parameters I used are as below, and the result for both auto and manual mask are as expected.

Could you let me know if your parameter for mimics.segment.local_threshold() are set similarly to mine?

Imanina

Hi Imanina,

I have tried your code on a mimics demo file, to compare results.
The issue appears to be that I had not properly converted the thresholds from HU to GV.

If I fix that I can get comparable results using local_threshold() and activate_local_threshold().

Thank you for your help.

Rob