Login  Register

Re: Phansalkar threshold bug

Posted by Gabriel Landini on Jul 02, 2016; 11:54am
URL: http://imagej.273.s1.nabble.com/Phansalkar-threshold-bug-tp5016717p5016805.html

On Friday 01 Jul 2016 23:32:26 Kenneth Sloan wrote:
> Perhaps I missed it (if so, I apologize) - but, since I’ve just finished
> processing some 1500 images with a plugin that depends on Phansalkar…can
> someone please give me a gloss on what the bug is and how it manifests
> itself?

Hi Kenneth,
Some details. I received the report, fixed it the next day, uploaded to my
page, sent the fix to Wayne (he includes the plugin in the default IJ
download) and fixed and pushed the commit for Fiji plugin. I then reported it
here:

https://list.nih.gov/cgi-bin/wa.exe?A2=ind1606&L=IMAGEJ&F=&S=&P=99376

About the bug itself, there was a missing "t" when calling the method ".sqrt".
This was very unfortunate; it was not picked up as a syntax error because
there also exists a method called "sqr". So instead of computing the standard
deviation as the sqrt(variance) the method computed the square of the
variance. Testing the old an new versions with the default setting radius of
15 on the Lena image, the difference was not as great as I feared it would be.
I think this may be because of the function of the SD in the formula and the
small size of the neighbourhood, where greyscale values might not vary that
much.

I am so sorry that this has caused you extra hassle, and I know that this is
no consolation, but I also had to repeat processing on a number of  images
myself.
I am specially grateful to Arttu Miettinen for spotting the bug and letting me
know immediately.  For me it was also a reminder of the benefits of open
source software, where many eyes can scrutinize code and spot things that are
missed by others.

Cheers

Gabriel

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html