Command Line Tools


We have created several scripts for using Bio-Formats on the command line.

Installation

Download bftools.zip, unzip it into a new folder, then download loci_tools.jar and place it in the same folder.

The zip file contains both Unix scripts and Windows batch files. Currently available tools include:

  • showinf – Prints information about a given image file to the console, and displays the image itself in the Bio-Formats image viewer.
  • bfview – Launches the Bio-Formats image viewer, displaying the given file (if any).
  • ijview – Displays the given image file in ImageJ using the Bio-Formats Importer plugin (requires ij.jar).
  • bfconvert – Converts an image file from one format to another. Bio-Formats must support writing to the output file (determined by extension; see the supported formats table).
  • formatlist – Displays a list of supported file formats in HTML, plaintext or XML.
  • xmlindent – A simple XML prettifier similer to xmllint --format but more robust in that it attempts to produce output regardless of syntax errors in the XML.
  • xmlvalid – A command-line XML validation tool, useful for checking an OME-XML document for compliance with the OME-XML schema.
  • omeul – A command-line client-side import tool for OME.
  • tiffcomment – Dumps the comment from the given TIFF file's first IFD entry; useful for examining the OME-XML block in an OME-TIFF file.

All scripts require loci_tools.jar in the same directory as the command line tools.

Tutorial

We have posted a Bio-Formats command line tools tutorial to the FARSIGHT web site.

Using the tools directly from source

If you have checked out the source from our Subversion repository you already have the command line tools in the tools directory. You can configure the scripts to use your source tree instead of loci_tools.jar in the same directory by following these steps:

  1. Point your CLASSPATH to the checked-out directory and the JAR files in the jar folder.
    • E.g., on Windows with Java 1.6 or later, if you have checked out the source at C:\code\loci, set your CLASSPATH environment variable to the value C:\code\loci\jar\*;C:\code\loci. You can access the environment variable configuration area by right-clicking on My Computer, choosing Properties, Advanced tab, Environment Variables button.
  2. Compile the source with ant compile.
  3. Set the LOCI_DEVEL environment variable to any value. (The variable just needs to be defined.)