Bio-Formats

Main Downloads
C++ Downloads
Licensing

Previous topic

Public test data

Next topic

Writing a new file format reader

This Page

Note

This documentation is for the new Bio-Formats 5.1 version. See the latest Bio-Formats 5.0.x version or the previous versions page to find documentation for the version you are using.

Generating test imagesΒΆ

Sometimes it is nice to have a file of a specific size or pixel type for testing. To generate a file (that contains gradient images):

touch "my-special-test-file&pixelType=uint8&sizeX=8192&sizeY=8192.fake"

Whatever is before the & is the image name; remaining key value pairs should be pretty self-explanatory. Just replace the values with whatever you need for testing.

There are a few other keys that can be added as well:

Key Value
sizeZ number of Z sections
sizeC number of channels
sizeT number of timepoints
bitsPerPixel number of valid bits (<= number of bits implied by pixel type)
rgb number of channels that are merged together
dimOrder dimension order (e.g. XYZCT)
little whether or not the pixel data should be little-endian
interleaved whether or not merged channels are interleaved
indexed whether or not a color lookup table is present
falseColor whether or not the color lookup table is just for making the image look pretty
series number of series (Images)
lutLength number of entries in the color lookup table

You can often work with the .fake file directly, but in some cases support for those files is disabled and so you will need to convert the file to something else. Make sure that you have Bio-Formats built and the JARs in your CLASSPATH (individual JARs or just bioformats_package.jar):

bfconvert test&pixelType=uint8&sizeX=8192&sizeY=8192.fake test.tiff

If you do not have the command line tools installed, substitute loci.formats.tools.ImageConverter for bfconvert.