biocompibens / SME

Smooth 2D manifold extraction from 3D image stack
GNU General Public License v3.0
21 stars 3 forks source link

error: out of bound quantile value running the plugin in fiji #8

Open SoleneW opened 6 years ago

SoleneW commented 6 years ago

Hi, I have having this error on few images when I run the plugin using fiji. I have a dataset with 20 stack images and it only happens with 5 or 6 of them but I don't know why are they have the same shape and properties.

org.apache.commons.math3.exception.OutOfRangeException: out of bounds quantile value: 0, must be in (0, 100] at org.apache.commons.math3.stat.descriptive.rank.Percentile.evaluate(Percentile.java:341) at org.apache.commons.math3.stat.descriptive.rank.Percentile.evaluate(Percentile.java:273) at SME_PROJECTION_SRC.SME_ENS_EnergyOptimisation.initWparam(SME_ENS_EnergyOptimisation.java:234) at SME_PROJECTION_SRC.SME_ENS_EnergyOptimisation.initOptimisation(SME_ENS_EnergyOptimisation.java:108) at SME_PROJECTION_SRC.SME_ENS_EnergyOptimisation.(SME_ENS_EnergyOptimisation.java:62) at SME_PROJECTION_SRC.SME_Plugin_Get_Manifold.runEnergyOptimisation(SME_Plugin_Get_Manifold.java:199) at SME_PROJECTION_SRC.SME_Plugin_Simple_CONF.runEnoptStep(SME_Plugin_Simple_CONF.java:97) at SME_PROJECTION_SRC.SME_Plugin_Simple_CONF.getManifold(SME_Plugin_Simple_CONF.java:81) at SME_PROJECTION_SRC.SME_Plugin_Simple_CONF.runConfColour(SME_Plugin_Simple_CONF.java:329) at SME_PROJECTION_SRC.SME_Plugin_Simple.run(SME_Plugin_Simple.java:249) at ij.IJ.runUserPlugIn(IJ.java:221) at ij.IJ.runPlugIn(IJ.java:185) at ij.Executer.runCommand(Executer.java:137) at ij.Executer.run(Executer.java:66) at java.lang.Thread.run(Thread.java:745)

erexhepa commented 6 years ago

Hi,

Difficult to pinpoint the cause of the error just from the trace above. Can you share a sample stack ? Or a full stack if it is not too big ?

SoleneW commented 6 years ago

yes sure here is one of the stack causing the error. I send you a link to the cloud as it was too big to be directly uploaded on github. https://cloud.biologie.ens.fr/index.php/s/qCYPArXxA5Zi8BD

Thanks, Solène

maweigert commented 6 years ago

Hey,

I see the same bug appearing in the Fiji Plugin (Fiji 2.0.0-rc-65) with the same error message as above, on OSX (10.12.16) and Linux (Ubuntu 16.04).

It might be related to line

https://github.com/biocompibens/SME/blob/d4e3af6570fdb2a902f2e0b917258d6999b9af43/src_java/SME_stacking/SME_ENS_EnergyOptimisation.java#L150

where overlap2 looks like to take values bigger than 1?

To reproduce, here are 3 stacks (32x128x128) with a grid surface embedded in noise of increasing sigma (0,60,120):

https://cloud.mpi-cbg.de/index.php/s/aCpp5NItWKySOPQ

Interestingly, the exception only appears in stacks with either no noise (sigma = 0) or very high noise (sigma = 120), whereas all is fine for the intermediate noise level (sigma = 60). See screenshot (upper row: the 3 stacks with increasing sigma. lower row, exception or result).

sme_exception
erexhepa commented 6 years ago

Hi,

Thanks to both of you for sharing the data. I will have a look at the error with your stacks. Not sure what is causing it but from what you are reporting it doesn't seem to be OS related.

Thanks

erexhepa commented 6 years ago

Hi,

The error was indeed on the line initiating the overlap parameter. When the overlap was beyond or below the (0-100) dynamic range the initiation was either 0 or above 100 hence the raised error by the apache math library that expects the percentile value to initialise the lambda parameter to be in the range 0-100.

We did not have such cases during our test and did not see the error on the code. I fixed it and tested in a cropped version provided by @SoleneW and the stacked with various sigmas. it is working quite nicely on the test cases with different sigmas.

I will upload the jar so you can test it.

maweigert commented 6 years ago

Great, that was quick, thanks! :) Let me know, when the jar is ready...

erexhepa commented 6 years ago

Hi just uploaded and updated the ZIP archive with the updated and corrected version of the plugin. Let me know if there is any issues and thanks for flaging the bug.

Elton

maweigert commented 6 years ago

Cool, everything seems to work just fine now :) Thanks for the awesome speedy response and fix!