ijpb / MorphoLibJ

Collection of mathematical morphology methods and plugins for ImageJ
http://imagej.net/MorphoLibJ
GNU Lesser General Public License v3.0
98 stars 49 forks source link

bug in "Intensity measurements 2D/3D". #38

Closed dlegland closed 4 years ago

dlegland commented 4 years ago

got an error message when applied on 3D grayscale image + 3D bits label image (arabidopsis embryo).

iarganda commented 4 years ago

Could you be more specific?

dlegland commented 4 years ago

well, it's a follow up of the mail I CC to you....

Error message was: ImageJ 1.52o; Java 1.6.0_24 [64-bit]; Windows NT (unknown) 6.2; 11MB of 34000MB (<1%)

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at java.util.ArrayList.RangeCheck(ArrayList.java:547) at java.util.ArrayList.get(ArrayList.java:322) at inra.ijpb.measure.IntensityMeasures.getMedian(IntensityMeasures.java:191) at inra.ijpb.plugins.IntensityMeasures3D.run(IntensityMeasures3D.java:156) at ij.IJ.runUserPlugIn(IJ.java:229) at ij.IJ.runPlugIn(IJ.java:193) at ij.Executer.runCommand(Executer.java:137) at ij.Executer.run(Executer.java:66) at java.lang.Thread.run(Thread.java:662)

I used as test image the arabidopsis embryo we used for watershed demonstration. I did not really did into it actually... Maybe this is simply a basic mistake of plugin mis-use?

dlegland commented 4 years ago

suggestion: on some images, we remove labels before processing (for example when touchoing borders). Maybe this can cause the pbm?

dlegland commented 4 years ago

Hi, I could find a bug in IntensityMeasures, in the computeNeighborVoxels() method. When computing the values of the neighbors, the values of the labels are used as index. When there is only one region, this cause an outof range access... I made a quick fix, but I have the impression there may be some other problems if the image does not contains label in increasing order.... I pushed the fix, but will continue investigating.

dlegland commented 4 years ago

I think it was fixed by 3ae0c1cb29b698fb8be2fc8bb0f4e9bb080514ca actually! Closing!