Saving File Sequences Using bfconvert Command Line Tools under Windows

Hey Folks!

This tripped us up for a few days so thought I’d post this here in case anyone else bumps in to a similar issues.

The command line batch scripts for bio-formats include a handy tool called bfconvert which is an alternative to the BIO-FORMATS import / export options in ImageJ.

When saving a file out as a sequence of ome.tif files (as opposed to a single very big multi-page ome.tif) bfconvert supports the use of sequential number variables: %t for time sequence, %z for z position, %c for channel number, etc.

Unfortunately, the Windows command line (CMD) treats those % symbols as a special character that needs to be escaped in a particular way in order to work. You have to double it up.


The example from the documentation which reads:

bfconvert /path/to/input output_series_%s_Z%z_C%c_T%t.tiff

would actually need to be written out as:

bfconvert /path/to/input output_series_%%s_Z%%z_C%%c_T%%t.tiff

to work properly under Windows.

Thanks again for the great tools. Happy to contribute a little bit of knowledge back.

Be Well,
Nat Reveal
BIOQUANT Image Analysis Corporation

1 Like


thanks for your post, you are absolutely correct the semantics of the pattern is different on Windows systems.
We have opened a Pull Request to amend the Bio-Formats documentation accordingly which should land into the next Bio-Formats release.

1 Like