imagej / imagej2

Open scientific N-dimensional image processing :microscope: :sparkler:
https://imagej.net/
BSD 2-Clause "Simplified" License
1.2k stars 337 forks source link

Line length measurement of movie file stalls ImageJ and throws exception #180

Closed gvogler closed 7 years ago

gvogler commented 7 years ago

Hi!

When performing a line measurement on a single image from a time stack, invoking 'M' to measure causes ImageJ to stall, and randomly throws the following exception:

java.lang.IllegalArgumentException: Row out of range: -1
at ij.measure.ResultsTable.getRowAsString(ResultsTable.java:566)
at ij.plugin.filter.Analyzer.displayResults(Analyzer.java:847)
at ij.plugin.filter.Analyzer.run(Analyzer.java:105)
at ij.plugin.filter.PlugInFilterRunner.processOneImage(PlugInFilterRunner.java:265)
at ij.plugin.filter.PlugInFilterRunner.<init>(PlugInFilterRunner.java:114)
at ij.IJ.runPlugIn(IJ.java:189)
at ij.Executer.runCommand(Executer.java:137)
at ij.Executer.run(Executer.java:63)
at java.lang.Thread.run(Thread.java:745)

Cancelling the measurement gives a warning that <700,000 measurements are to be discarded (though only 1 should be done).

Version used: (Fiji is Just) ImageJ 2.0.0-rc-61/1.51n; Java 1.8.0_66 [64-bit]; ImageJ 1.51n

Example file: [https://www.dropbox.com/s/q6ca8scquypias8/TEST0001_01_1xy.cxd?dl=0]

Again, the problem seems random but maybe the exception can point towards the issue. I am not sure if there are other tools to probe for the issue, if so please let me know.

Thanks,

Geo

ctrueden commented 7 years ago

@graukatze I am unable to reproduce the issue on my system using the linked sample dataset. I drew lines of various widths and mashed the M button as fast as I could, but the measurement was added to the Results window successfully every time.

Did you perform any other analysis prior to doing these measurements? Are you able to reproduce after a fresh start of Fiji?

/cc @rasband

gvogler commented 7 years ago

@ctrueden

This is not file specific, but occurs after a random number of measurements (we measure 2x per file, for many files). Could you maybe duplicate the sample file like 20 times and load them sequentially and measure (open, measure, close)?

rasband commented 7 years ago

I am unable to reproduce this problem. What are your line selections like? Straight line, segmented line or freehand line? What is the line width? How long and convoluted are the lines? What options are set in Analyze>Set Measurements?

gvogler commented 7 years ago

Hi!

@rasband Measurements are all deactivated - I only need the length measurements.

Problem is on 2 different machines, and what I did not mention (d'uh) is that we do 'Plot Z-axis profile' first and save the profile, with 'live' activated. When I de-activate 'live' before doing the line measurement, the problem goes away!

rasband commented 7 years ago

This bug should be fixed in the latest ImageJ daily build (1.51s39). Source code changes are at https://github.com/imagej/imagej1/commits. "Plot Z-axis Profile" and "Measure" were using the same ResultsTable, causing interference in "Live" mode. As a bonus, line length measurements are now much faster when measurements are all deactivated.