Login  Register

Re: "Set Threshold" records incorrect values - 16bit images - Ubuntu

Posted by Ghislain Bugnicourt on Aug 28, 2008; 9:15am
URL: http://imagej.273.s1.nabble.com/Set-Threshold-records-incorrect-values-16bit-images-Ubuntu-tp3695217p3695227.html

Good morning.
I've got three messages to answer or comment.
So your help was not just a wonderful dream ?

Another time, here is Wyane's new plugin : Threshold_Adjuster.java
His message explains it :
Wayne wrote
  Dear Ghislain,
This looks like a thread synchronization problem. Here is a version of
the plugin that makes the scaleDown() and scaleUpAndSet() methods
synchronized. Does it work any better?
Well I'm sorry but the bug remained. It was a good idea (as far as I can understand), but don't take the line inversion (previous post) into consideration. I didn't manage to witness it again.
Only the scaleDown() repetition comes back frequently, like in order to correct an error (see the 85 in bold, previous message).

Michael Schmid wrote
Hi Ghislain,
sorry to bother you - 2 questions:
- Does the plugin modified with IJ.log messages have the same
   bug as the built-in Threshold command?
- Do you get messages in the log window if you move the sliders?
If the answer to both questions is "yes", we can rule out that
the problem is caused by the sliders.
(for explanation: the adjustmentValueChanged(e) methods should
be called if a user moves the sliders).
Best wishes,
I am sorry : I had not understood that this function was called when we move the sliders.
So I did your modifications again, but in Wayne's plugin.
I don't know what to expect, but it seems to work properly. And the bug remains.
I consider that the IJ.log lines could only help us find the problem, they will never solve it miraculously :).
Brief : my 2 answers are yes, but it doesn't demonstrate that the sliders have a problem.
Example of the result : in this case, I just moved the min value with its slider, to get min = 97. The max value didn't move, it is at 768 (but it could be anything else and we would get -1 also at the 'after' line).
    Adjustment:
    java.awt.event.AdjustmentEvent[ADJUSTMENT_VALUE_CHANGED,...
    ...adjType=UNIT_INCREMENT,value=5,isAdjusting=false] on scrollbar0
    Before: -1,-1
    After: 5,-1
If I chose to move the other slider, of course, I get "After: -1, 255" for instance (if I reach 768 which is the max). And the "Before" line is always : -1, -1.

David Randell wrote
At the point where the values changed to 0/64, the
previously thresholded image reverted back to the original
un-thresholded image, and it remained in that state.
I think both limits (max and min) are just colocated at the 84 grey level. So we don't get the "un-thresholded" image back, but the image thresholded with 84/84. It is normal, in fact.
Thanks for your tries. We complete each other...