Issues with creating custoom tables in ImageJ macros

Hi,
I’ve been writing ImageJ macros for a few years now and have run into some issues with previously functioning code since the latest update.

This is the code I have used successfully many times before:

tableTitle1 = "Regions Table";
tableTitle2 = "["+tableTitle1+"]";

if (!isOpen(tableTitle1)) {
	run("Table...", "name="+tableTitle2+" width=1000 height=250");
	print(tableTitle2, "\\Headings:ID\tSlide_ID\tRegion_ID\tTissue_Area\tTissue_%\tCount"); // 6 columns
}

Now when I run this I get “A TableDisplay is required but none exist”

This was working this morning when I was running 1.52p but now that I’ve updated to 1.53c it no longer works. I can see that the Table functions introduced in 1.52a are likely a better way to build tables in future but we have lots of macros written using the above method and would like to keep using them.

Can anyone suggest a solution?

Thanks for reporting this, @jo-maree.

The issue was also reported here:

and @frauzufall submitted a fix already.


The Fiji update introduced a new command to save IJ2 tables (File > Export > Table…) which unfortunately was overriding the run("Table...") macro function.

I wasn’t aware of the existence of run("Table...") to create a table window, as it doesn’t appear anywhere in the ImageJ menu (does it?).

The issue is now fixed in the scijava-table component:

… and will be uploaded to the update site very soon.


Edit:
By the way: a workaround could be to use the recently introduced Table.create() macro function:

Table.create(tableTitle2);
print("[" + tableTitle2 + "]", "\\Headings:ID\tSlide_ID\tRegion_ID\tTissue_Area\tTissue_%\tCount");

(Note that I needed to add brackets [] around the table title according to the docs to make the print function work. Did that work in an up-to-date Fiji “just before” yesterday’s update??)

2 Likes

Done. Please update your Fiji again and let us know here if any issues remain.