ijpb / MorphoLibJ

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

Strange behaviour of ResultsTables #29

Closed tischi closed 5 years ago

tischi commented 5 years ago

Hello @iarganda @dlegland @imagejan

I am trying to read from MLJ ResultsTables using Java API and I get weird errors, having to do with the fact that the Label ColumnIndex is -1. Basically I don't manage to read the correct numbers from the table using Java. Interestingly, when I save the table once to disc and read it again it works.

I realized the following:

image

The table on the right comes directly from MLJ and it is missing the RowNumberColumn (without heading), which all the other tables have. I suspect that maybe this causes the errors. Could you maybe have a look at your code to see what the difference is to, e.g. AnalyzeParticles? My current feeling is that the MLJ ResultsTables are in some way having a defect...at least, as said, I don't manage the properly read the numbers from them using the Java API.

tischi commented 5 years ago

I found the solution within your code!

It makes indeed the distinction whether there is a rowNumber or not: https://github.com/ijpb/MorphoLibJ/blob/master/src/main/java/inra/ijpb/plugins/LabelToValuePlugin.java#L361