Giter VIP home page Giter VIP logo

read_and_write_excel_modified's Introduction

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:

  • no_count_column: Prevents the plugin from adding a "Count" column automatically.
  • stack_results : Instructs the plugin to export data underneath pre-existing data in the Excel file, instead of adjacent to it.
  • file=: The path to the excel file to use (uses the default desktop file otherwise)
  • sheet=: Which sheet in the excel file to put the results in
  • dataset_label=: The label to write in the cell above the data in the excel file
  • file_mode=: This should be used if you're going to be writing large amounts of data multiple times to the same file, it will let you keep a file open, queue multiple writes to it, then write and close it. This prevents wasting time by having to reopen the whole Excel file every time you wish to write more to it, which can take very long if you have a lot of data in the file. Use it by setting it to one of the following:
    • read_and_open: Will just open an excel file (the one you specify with file=)...make sure you do write_and_close when you're done or you'll have problems.
    • write_and_close: Will just write everything you've queued with queue_write, then close the excel file.
    • queue_write: Will queue something to be written to the excel file you've opened previously with read_and_open

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"
  3. Find 'ResultsToExcel' in the list of plugins and mark the check-box.
    4) Give the new update site a name, and use the URL http://sites.imagej.net/Bkromhout/ (does not host the most recent version currently)
  4. Close the "Manage update sites" window and click "Apply changes" in the Imagej Updater main window.
    5) You should now see the plugin available in the updater.
  5. Restart ImageJ.

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");

read_and_write_excel_modified's People

Contributors

antinos avatar bkromhout avatar

Stargazers

 avatar Michele Wiseman avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.