[ome-users] OME-TIFF: problem with the "micron" character (micrometer unit)

Christoph Gohlke cgohlke at uci.edu
Fri Sep 1 20:30:39 BST 2017


Hello,

one issue is that the tiffcomment utility outputs XML that is not well 
formed. OME-XML should be UTF-8 encoded, but tiffcomment apparently 
encodes with latin1, iso-8859-1, or similar (Bioformats 5.6.0 on Windows 
10).
Try re-encoding the XML file (e.g. in Python3 Q&D):

xml = open('comment.xml', 'rb').read()
xml = xml.decode('iso-8859-1').encode('utf8')
open('comment.xml', 'wb').write(xml)

Another issue could be that the XML in the ome.tiff file is not encoded 
correctly. Open the ome.tiff file with a HEX editor. The lower case Mu 
letter should be stored in two bytes (C2 B5), not just one byte (B5).

But then, according to the TIFF6 specification, only 7-bit ASCII 
characters can be stored in ImageDescription tags. Strictly, the Mu 
character should not be in OME-XML when stored in TIFF.

Finally, the character(s) displayed on the screen depend on which 
encoding and/or character-set are used by the viewing software.

Christoph


On 9/1/2017 7:59 AM, Guenter Giese wrote:
> Dear list members,
> 
> I am working with Fiji / BioFormats v 5.6.0 on a Windows 7 PC.
> 
> When I open an ome-tiff file with the Bio-Formats Importer, I receive 
> the following text string in the OME Metadata window:
> 
>       WorkingDistanceUnit="µm">
> 
> When I use the tiffcomment utility to extract the xml header of a tiff 
> file (output.tiff) using a batch file (.\tiffcomment ..\output.tiff > 
> ..\comment.xml), I end up with the following string in the Objective ID 
> attributes:
> 
>       WorkingDistanceUnit="�m">
> 
> So the initial working distance unit seems to be no more valid.
> 
> (note: the weird character before the m"> string displayed in the 
> previous line seems to be dependent on the mail program too....)
> 
> How to solve this problem?
> 
> Thanks for help,
> 
> Guenter
> _______________________________________________
> ome-users mailing list
> ome-users at lists.openmicroscopy.org.uk
> http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users
> 
> 


More information about the ome-users mailing list