Unable to set threshold on Fiji

Hello! I am new to Fiji, and I am following a protocol where I am supposed to adjust the threshold of my TIF images to binarise them. However, every time I input my lower/upper threshold and press “set”, the threshold levels jump to a random value (usually 255), and no matter how much I try to change the threshold from the sliding bar or type it in, it does not work.

I am not familiar with coding my own macros or doing anything remotely related to coding, so I am unable to understand any of the solutions given by others to similar this problem people have written about on this forum. However, I did try to update my Fiji software to see if it was a bug, and I have also tried to downgrade to all the older available versions, but to no avail. Could anyone please help me out? I really need this resolved urgently. Thank you.

If you click Apply, does it binarize your image as you have it thresholded?
Also, if you want to type in the value, after you click Set it should pop up a window where you type in the value.


Once you accept those values, the “Red” showing the area you have selected should change to match the values you typed in, even though the original values in the Threshold dialog box will not have changed.
Typing in a value in the original dialog does not work, though I have never understood the logic of why that is.

  1. Set
  2. Type in values
  3. Apply to create binary image based on typed in values.

Edit* as seen below, you probably also wnat to check “Don’t reset range” though I did not have that selected in this picture since I wasn’t really doing anything.

Yes, I’ve tried to click and apply, but everytime after I set the values, it will lag for a second and the automatically jump to a much lower upper and lower threshold (usually 255 and 47), and then no matter how I try to input a new threshold value, I will not get it

1 Like

Could you provide us with the image that shows this problem? Also please specify the threshold values you would like to set.
I have observed behavior that sounds similar to what you describe in the past when the data does not contain the ranges that I want to set as threshold.

I have been having a similar issue, the Image > Adjust > Threshold command does not appear to actually use the user-specified min and max. For example, If I set the parameters as shown below, the preview shows what the expected result would look like.

However, after pressing “Apply” and then using the defaults in the next prompt and pressing “OK” to run the thresholding, the result becomes.

It appears to not actually use the user-set min-max, and the result looks closer to what the “Auto” option would produce. If I am using the command incorrectly, please let me know. Our skeletonization pipeline relies on setting a proper threshold to minimize breaks in the skeleton.

User specified using “Set” or typing in the text boxes?

After using Set, it looks like you don’t have “Don’t reset range checked” so it will ignore anything you have “set” manually anyway and use the Default since that is what is selected and you have told it to reset the range. I do think it is a bit convoluted from a UI perspective, but try setting it so that the range is not reset.

I also do not get any kind of prompt when clicking Apply, so not sure what you mean there.

Hi @Research_Associate, I set the min-max by dragging the sliders manually. When I press “Apply”, this prompt appears:

image

Is the “Apply” button necessary to actually apply the threshold to the image?

Ah, I was converting a single image, not a stack, so I did not get that dialog, thanks.

If you are keeping those settings, it suggests you are recalculating the threshold for each image in the stack using the default method. So you have done away with any adjustments you made in the previous window, and are not using your chosen values.

I see, un-checking “Calculate threshold for each image” seems to preserve my settings. Thanks!

1 Like