Open hummuscience opened 6 years ago
Hi @Cumol, the Bio-Formats command-line tools and more generally IFormatReader.setId
method is expecting a file as the input and will not handle directories as suggested by the exception.
Converting Metamorph files into a single (OME-)TIFF should definitely work as long as you point the bfconvert
utility to one of the files consituting the fileset.
Using your test files and Bio-Formats 5.9.0, the two commands below should produce a single OME-TIFF and TIFF image:
sbesson@ls30630:Downloads $ bfconvert 23.001 23.ome.tiff
23.001
MetamorphTiffReader initializing 23.001
Reading IFDs
Populating metadata
Populating OME metadata
[Metamorph TIFF] -> 23.ome.tiff [OME-TIFF]
Converted 1/10 planes (10%)
Converted 10/10 planes (100%)
[done]
6.068s elapsed (3.5+325.3ms per plane, 1761ms overhead)
sbesson@ls30630:Downloads $ bfconvert 23.001 23.tiff
23.001
MetamorphTiffReader initializing 23.001
Reading IFDs
Populating metadata
Populating OME metadata
[Metamorph TIFF] -> 23.tiff [Tagged Image File Format]
Converted 1/10 planes (10%)
Converted 10/10 planes (100%)
[done]
6.69s elapsed (3.9+216.6ms per plane, 3615ms overhead)
@sbesson wanted to try it out and wondered why it still gives the same error. It seems like th command line tools on the website are still the older version:
https://docs.openmicroscopy.org/bio-formats/5.8.2/users/comlinetools/index.html
When I run bfconvert -version it outputs 5.6.0 (from August 2017)
Additional question. What determines the speed of conversion? RAM? Number of processes?
I tried one full dataset and was able to convert it correctly.
Then tried another one and got the following output:
23.001
MetamorphTiffReader initializing 23.001
Reading IFDs
Populating metadata
Populating OME metadata
Error reading IFD type at: 6
Exception in thread "main" java.lang.NullPointerException
at loci.common.xml.XMLTools.sanitizeXML(XMLTools.java:298)
at loci.formats.in.MetamorphTiffReader.parseFile(MetamorphTiffReader.java:628)
at loci.formats.in.MetamorphTiffReader.initFile(MetamorphTiffReader.java:217)
at loci.formats.FormatReader.setId(FormatReader.java:1397)
at loci.formats.ImageReader.setId(ImageReader.java:842)
at loci.formats.tools.ImageConverter.testConvert(ImageConverter.java:385)
at loci.formats.tools.ImageConverter.main(ImageConverter.java:884)
currently trying to find out how to replicate this with a small number of files
UPDATE: the first 10 files are converted properly. I wonder what is causing the issue. If it is one of th 15k files that follow, it might be hard to find out which. Is there a way to "skip" corrupt files?
With regards the version, are you running the command from the bftools folder? Using the link you had in https://docs.openmicroscopy.org/bio-formats/5.8.2/users/comlinetools/index.html I get the below:
./bfconvert -version Version: 5.8.2 Build date: 20 April 2018 VCS revision: 07ecd9a5d239985f8ae57462c12124c2fa5ccd9b
As for the error message, the MetamorphTiffReader expects the files to contain a blob of XML metadata in the Image Description. That particular error would suggest that this is missing. If you have the libtiff
tools you can check the file using tiffinfo
, this will print out the TIFF IFD metadata and you should see the XML blob in Image Description.
I am trying to concatenate a time series of MetaMorph files into a singe .tif file with bfconvert (command line tool) but cannot make it work.
Is it at all possible? If so, what is the correct syntax?
This is what I am trying:
these files can be used as example:
https://www.dropbox.com/s/2xvxycbwvm9p85k/test-series.zip?dl=0