bkromhout / Read_and_Write_Excel_Modified

Read_and_Write_Excel ImageJ Plugin
2 stars 2 forks source link

Read and Write Excel (Modified)

This is a highly modified version of Anthony Sinadinos's Read_and_Write_Excel ImageJ plugin. It requires at least ImageJ 1.51p and Java 8. The project itself is in IntelliJ IDEA format, but I've tried to maven-ize it too.

The plugin extracts data from the default ImageJ Results Table and adds it to a page in an .xlsx Excel file. Results Table column headers are added automatically too.

By default, the plugin will use (and create, if necessary) a file named "Rename me after writing is done.xlsx" on the desktop, and put the data into a sheet called "A". If writing to a sheet that already has data in it, the new data will be added adjacent to previous data.

The defaults can be overridden when calling the plugin from an ImageJ macro using one or more of the parameters below.

Macro Parameters

This version of the Read_and_Write_Excel plugin supports additional features which make it more flexible for usage in ImageJ macros. These are the supported parameters:

Installation

The easiest way to install the plugin is to use Fiji's built-in updater: 1) Go to Help > Update... 2) Click "Manage update sites" 3) Click "Add update site" 4) Give the new update site a name, and use the URL http://sites.imagej.net/Bkromhout/ 5) You should now see the plugin available in the updater.

If you can't do that for some reason, you should also be able to download the latest release, unzip it, and copy the plugin's JAR to the ImageJ plugins folder, and the JARs in the "jars" folder to ImageJ's "jars" folder.

Usage Example

run("Read and Write Excel", "file_mode=read_and_open file=[/Users/bkromhout/Desktop/Test.xlsx]");
print("Opened file");

// Put lots of data in the results table...

run("Read and Write Excel", "file_mode=queue_write");
print("Wrote 1");
run("Clear Results");

// Put even more data in the results table...

run("Read and Write Excel", "file_mode=queue_write no_count_column dataset_label=[Test dataset label] sheet=[Sheet Name]");
print("Wrote 2");

run("Read and Write Excel", "file_mode=write_and_close");
print("Closed file");