We're Hiring!

Converting Tiffs to OME-TIFF

General and open developer discussion about using OMERO APIs from C++, Java, Python, Matlab and more! Please new questions at https://forum.image.sc/tags/omero
Please note:
Historical discussions about OMERO. Please look for and ask new questions at https://forum.image.sc/tags/omero

If you are having trouble with custom code, please provide a link to a public repository, ideally GitHub.

Converting Tiffs to OME-TIFF

Postby ctr26 » Sun Oct 18, 2015 10:04 pm

Hi all,

I see here that a LabVIEW based OME-TIFF creator is unlikely to happen very soon. As a work around I plan on using a libtiff dll interface built in labview to export my images there. I would therefore like to use the bioformats command line tools to extract the header of my non-xml tiff files and replace it with a suitable OME header. Two problems have cropped up though.

1

tiffcomment -set 'newmetadata.xml' sample.ome.tif

literally inserts 'newmetadata.xml' into the header rather than the contents of a file. Has anyone else had this problem?

2

I'm not entirely convinced tiffcomment extracts or injects the full XML data I would need to convert a page series of tiffs created by libtiff into an OME-TIFF hyperstack type image. Has anyone else tried to convert a regular TIFF stack to an OME-TIFF hyperstack pre/post or mid stack creation?

Any help welcome, I am fairly new to bioformats but would love to get on board!

Regards,

Craig
ctr26
 
Posts: 4
Joined: Fri Oct 16, 2015 7:47 pm

Re: Converting Tiffs to OME-TIFF

Postby mtbc » Mon Oct 19, 2015 7:47 am

Dear Craig,

I know nothing of LabView, but does it help that Bio-Formats now ships with a BSD-licensed OME-TIFF writer that is implemented wholly in C++? https://www.openmicroscopy.org/site/sup ... rview.html gives a summary.

Cheers,

Mark
User avatar
mtbc
Team Member
 
Posts: 282
Joined: Tue Oct 23, 2012 10:59 am
Location: Dundee, Scotland

Re: Converting Tiffs to OME-TIFF

Postby sbesson » Mon Oct 19, 2015 8:00 am

ctr26 wrote:Hi all,


Hi Craig

ctr26 wrote:tiffcomment -set 'newmetadata.xml' sample.ome.tif

literally inserts 'newmetadata.xml' into the header rather than the contents of a file. Has anyone else had this problem?


The following snippet correctly insert the content of the XML file into the TIFF header for me:

Code: Select all
sbesson@ls30630:tmp $ echo "test" > metadata.xml
sbesson@ls30630:tmp $ tiffcomment -set 'metadata.xml' test.tif


The following allows me to reproduce your issue:

Code: Select all
sbesson@ls30630:tmp $ rm metadata.xml
sbesson@ls30630:tmp $ tiffcomment -set 'metadata.xml' test.tif


Can you check the -set argument you are passing is a relative or absolute path to an existing XML file?

ctr26 wrote:Has anyone else tried to convert a regular TIFF stack to an OME-TIFF hyperstack pre/post or mid stack creation?


To the best my knowledge, several groups have certainly been able to insert OME-XML headers into TIFF stacks to correctly specify their dimensionality and metadata. The trick is to have the header properly formatted here. Are you dealing with a single multi-page TIFF or several multi-page TIFFs?

Best,
Sebastien
User avatar
sbesson
Team Member
 
Posts: 421
Joined: Tue Feb 28, 2012 7:20 pm

Re: Converting Tiffs to OME-TIFF

Postby ctr26 » Mon Oct 19, 2015 10:18 am

Its a single mulipage tiff stack and I fixed the bat issue by using " instead of ', oh windows...
ctr26
 
Posts: 4
Joined: Fri Oct 16, 2015 7:47 pm


Return to Developer Discussion

Who is online

Users browsing this forum: Google [Bot] and 0 guests