There are several scripts for using Bio-Formats on the command line.
Download bftools.zip, unzip it into a new folder.
Note
As of Bio-Formats 5.0.0, this zip now contains the bundled jar and you no longer need to download loci_tools.jar or the new bioformats_package.jar separately.
The zip file contains both Unix scripts and Windows batch files.
Currently available tools include:
Some of these tools also work in combination, for example Validating XML in an OME-TIFF uses both tiffcomment and xmlvalid.
Running any of these commands without any arguments will print usage information to help you. When run with the -version argument, showinf and bfconvert will display the version of Bio-Formats that is being used (version number, build date, and Git commit reference).
Firstly, obtain a copy of the sources and build them (see Obtaining and building Bio-Formats). You can configure the scripts to use your source tree instead of bioformats_package.jar in the same directory by following these steps:
If you run bftools outside of the OMERO environment, you may encounter an issue with the automatic version checker causing a tool to crash when trying to connect to upgrade.openmicroscopy.org.uk. The error message will look something like this:
Failed to compare version numbers
java.io.IOException: Server returned HTTP response code: 400 for URL:
http://upgrade.openmicroscopy.org.uk?version=4.4.8;os.name=Linux;os.
version=2.6.32-358.6.2.el6.x86_64;os.arch=amd64;java.runtime.version=
1.6.0_24-b24;java.vm.vendor=Sun+Microsystems+Inc.;bioformats.caller=
Bio-Formats+utilities
To avoid this issue, call the tool with the -no-upgrade parameter.
For debugging errors or investigating performance issues, it can be useful to use profiling tools while running Bio-Formats. The command-line tools can invoke the HPROF agent library to profile Heap and CPU usage. Setting the BF_PROFILE environment variable allows to turn profiling on, e.g.:
BF_PROFILE=true showinf -nopix -no-upgrade myfile