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

Guenter Giese Guenter.Giese at mpimf-heidelberg.mpg.de
Mon Sep 4 15:25:59 BST 2017


Hi Christoph,

thank you for your comments on this issue.

In the XML part of the OME-TIFF file, the lower case Mu letter is 
correctly stored in two bytes (C2 B5, as checked with the Notepad++ Hex 
editor utility).

The culprit seems to be the tiffcomment utility generating XML that is 
not well formed.

(@OME team: please have a look at the tiffcomment utility)


At least, the XML part of the OME-TIFF file seems to be generated 
properly by our software.



Thank you for your help!

Guenter



Am 01.09.2017 um 21:30 schrieb Christoph Gohlke:
> 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
>>
>>
> _______________________________________________
> 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