NOTICE! This is a static HTML version of a legacy Fiji BugZilla bug.

The Fiji project now uses GitHub Issues for issue tracking.

Please file all new issues there.

Bug 1157 - getResultString() returns null on re-opened Results table
getResultString() returns null on re-opened Results table
Status: RESOLVED FIXED
Product: ImageJ
Classification: Unclassified
Component: Legacy
unspecified
PC Windows
: P5 normal
Assigned To: ImageJ Bugs Mailing List
Depends on:
Blocks:
 
Reported: 2015-09-09 02:15 CDT by Jan Eglinger
Modified: 2015-09-10 12:21 CDT
1 user (show)

See Also:

Description Jan Eglinger 2015-09-09 02:15:03 CDT
As noticed by 'user3772045' on stackoverflow.com [1], the `getResultString("Column", row)` returns `null` when run on a results table that was opened from a file.

The following macro reproduces the issue:

    row = nResults;
    dir = getDirectory("temp");

    setResult("String", row, "xyz");
    setResult("Number", row, 5.0);

    // get results from new table
    print(getResultString("String", 0));
    print(getResult("Number", 0));

    saveAs("Results", dir + "Results.xls");
    open(dir + "Results.xls");

    // get results from re-opened table
    print(getResultString("String", 0));
    print(getResult("Number", 0));


On a related note, repeated runs of this macro (with the results table open) result in unexpected behaviour: a new "String" column is created, and the string and number values get filled into the wrong columns.

Cheers,
Jan

[1]: http://stackoverflow.com/q/32468347/1919049
Comment 1 Wayne Rasband 2015-09-10 12:21:39 CDT
This bug is fixed in the latest ImageJ daily build (1.50c8). Note that the bug only occurs when the first column is non-numeric and all other columns are numeric.