NOTICE! This is a static HTML version of a legacy LOCI Software ticket.

LOCI projects are now located on GitHub. The Bio-Formats project can be found here.

Ticket #405 (closed defect: fixed)

Opened 2009-07-03T13:43:14-05:00

Last modified 2009-10-12T10:15:31-05:00

OME-TIFF export erroneously reuses OME metadata from input dataset

Reported by: curtis Owned by: melissa
Priority: major Milestone: bio-formats-4.1
Component: plugins Severity: critical
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by curtis)

The Bio-Formats Exporter plugin feeds the input dataset's OME-XML directly to the output writer, which is fine in the simple case but can often cause problems. (Upon initial inspection, the bfconvert command line utility does not appear to have these problems, though it would be good to check the code to verify.)

For example, the Exporter is unable to export datasets opened from series beyond the first when the dimensions differ:

run("Bio-Formats Importer", "open=[/Volumes/DATA/leica-lif/andrew/Par6 GFP delaminating cells.lif] view=Hyperstack stack_order=XYCZT series022");
run("Bio-Formats Exporter", "compression=Uncompressed save=/Users/curtis/Desktop/out.ome.tif");

Results in an exception:

java.lang.IllegalArgumentException: ZCT size vs image count mismatch (sizeZ=5, sizeC=1, sizeT=2, total=51)
	at loci.formats.FormatTools.getZCTCoords(FormatTools.java:293)
	at loci.formats.out.OMETiffWriter.close(OMETiffWriter.java:125)
	at loci.formats.out.TiffWriter.saveBytes(TiffWriter.java:170)
	at loci.formats.out.TiffWriter.saveBytes(TiffWriter.java:191)
	at loci.formats.out.OMETiffWriter.saveBytes(OMETiffWriter.java:171)
	at loci.formats.FormatWriter.saveBytes(FormatWriter.java:89)
	at loci.plugins.exporter.Exporter.run(Exporter.java:367)
	at loci.plugins.LociExporter.run(LociExporter.java:73)

Another example is if you have imported only a subset of the data, using split channels, or specify ranges:

run("Bio-Formats Importer", "open=/Volumes/DATA/deltavision/brian/lung-lentiCMtriple-1_R3D.dv autoscale split_channels view=Hyperstack stack_order=XYCZT");
close();
run("Bio-Formats Exporter", "save=/Users/curtis/Desktop/lung_c2.ome.tif compression=Uncompressed");

Here the OME-TIFF file successfully exports, but SizeC is still 2 instead of 1, resulting in missing planes, and a fallback behavior to the vanilla TIFF reader on subsequent import.

Change History

comment:1 Changed 2009-07-03T14:05:56-05:00 by curtis

  • Description modified
  • Summary changed from OME-TIFF export ZCT/image count mismatch for series beyond the first to OME-TIFF export erroneously reuses OME metadata from input dataset

comment:2 Changed 2009-07-03T14:19:54-05:00 by curtis

Another likely example:

run("Bio-Formats Importer", "open=/Volumes/DATA/zeiss-zvi/nicolas/image.zvi crop view=Hyperstack stack_order=XYCZT x_coordinate_1=0 y_coordinate_1=0 width_1=1023 height_1=1022");
run("Bio-Formats Exporter", "compression=Uncompressed save=/Users/curtis/Desktop/image.ome.tif");

Results in:

java.lang.ArithmeticException: / by zero
	at loci.formats.gui.AWTTiffTools.writeImage(AWTTiffTools.java:155)
	at loci.formats.out.TiffWriter.saveBytes(TiffWriter.java:169)
	at loci.formats.out.TiffWriter.saveBytes(TiffWriter.java:191)
	at loci.formats.out.OMETiffWriter.saveBytes(OMETiffWriter.java:171)
	at loci.formats.FormatWriter.saveBytes(FormatWriter.java:89)
	at loci.plugins.exporter.Exporter.run(Exporter.java:364)
	at loci.plugins.LociExporter.run(LociExporter.java:73)

comment:3 Changed 2009-08-24T10:11:30-05:00 by melissa

  • Milestone set to bio-formats-4.1.0

comment:4 Changed 2009-10-12T10:15:31-05:00 by melissa

  • Status changed from new to closed
  • Resolution set to fixed

(In [5579]) Modify the input dataset's OME-XML before exporting. Closes #405.