NOTICE! This is a static HTML version of a legacy Fiji BugZilla bug.

The Fiji project now uses GitHub Issues for issue tracking.

Please file all new issues there.

Bug 120 - LOCI export fails on non-imported images
LOCI export fails on non-imported images
Status: RESOLVED FIXED
Product: Fiji
Classification: Unclassified
Component: Plugins
unspecified
Macintosh Mac OS
: P4 minor
Assigned To: ImageJ Bugs Mailing List
Depends on:
Blocks:
 
Reported: 2009-12-07 17:43 CST by Jean-Yves Tinevez
Modified: 2010-01-11 21:08 CST
1 user (show)

See Also:

Description Jean-Yves Tinevez 2009-12-07 17:43:01 CST
Hey all.
I am not sure that this is a Fiji bug (proper to LOCI) or even a bug.

It is not possible to export an image using the Bioformat exporter in Fiji. It fails whatever is the export format chosen, whatever the image is. 
Trying it with a sample loaded using for instance the Open command of Fiji generates the following exception:

java.lang.NullPointerException
	at loci.formats.ome.OMEXML200809Metadata.setPixelsSizeX(OMEXML200809Metadata.java:4174)
	at loci.plugins.exporter.Exporter.run(Exporter.java:218)
	at loci.plugins.LociExporter.run(LociExporter.java:73)
	at ij.plugin.filter.PlugInFilterRunner.processOneImage(PlugInFilterRunner.java:247)
	at ij.plugin.filter.PlugInFilterRunner.<init>(PlugInFilterRunner.java:102)
	at ij.IJ.runUserPlugIn(IJ.java:186)
	at ij.IJ.runPlugIn(IJ.java:151)
	at ij.Executer.runCommand(Executer.java:145)
	at ij.Executer.run(Executer.java:76)
	at java.lang.Thread.run(Thread.java:637)


However, the export succed IF the image was opened using Bioformats importer, which make me wonder if this is a bug. 
Can someone confirm on something else than a MAC?


Information about your version of Java - this information is useful for the Fiji developers:
  os.arch => x86_64
  os.name => Mac OS X
  os.version => 10.5.8
  java.version => 1.6.0_17
  java.vendor => Apple Inc.
  java.runtime.name => Java(TM) SE Runtime Environment
  java.runtime.version => 1.6.0_17-b04-248-9M3125
  java.vm.name => Java HotSpot(TM) 64-Bit Server VM
  java.vm.version => 14.3-b01-101
  java.vm.vendor => Apple Inc.
  java.vm.info => mixed mode
  java.awt.graphicsenv => apple.awt.CGraphicsEnvironment
  java.specification.name => Java Platform API Specification
  java.specification.version => 1.6
  sun.cpu.endian => little
  sun.desktop => null
  file.separator => /
Comment 1 Curtis Rueden 2010-01-08 19:53:39 CST
I was unable to duplicate this problem on my Mac OS X 10.6 machine with Fiji/ImageJA 1.43d:
  java.version: 1.6.0_17
  java.vendor: Apple Inc.
  mrj.version: 1060.1.6.0_17-248
  os.name: Mac OS X
  os.version: 10.6.2
  os.arch: x86_64
  file.separator: /
  path.separator: :
  line.separator: <lf>

I tried opening the MRI Stack and CT sample datasets, saving as TIF, reopening (with built-in TIFF support, not Bio-Formats Importer), and then exporting using Bio-Formats Exporter, and the file is successfully written (no NullPointerException). I tried saving as OME-TIFF (uncompressed and J2K compression) and JP2 format.

If anyone is still experiencing this issue, could you provide a specific example of a file (ideally one of the sample images) and output format that fails for you using the Bio-Formats Exporter?
Comment 2 Jean-Yves Tinevez 2010-01-11 10:32:21 CST
(In reply to comment #1)

Unfortunately, I can reproduce this bug all the time, with:

  os.arch => x86_64
  os.name => Mac OS X
  os.version => 10.5.8
  java.version => 1.6.0_17
  java.vendor => Apple Inc.
  java.runtime.name => Java(TM) SE Runtime Environment
  java.runtime.version => 1.6.0_17-b04-248-9M3125
  java.vm.name => Java HotSpot(TM) 64-Bit Server VM
  java.vm.version => 14.3-b01-101
  java.vm.vendor => Apple Inc.
  java.vm.info => mixed mode
  java.awt.graphicsenv => apple.awt.CGraphicsEnvironment
  java.specification.name => Java Platform API Specification
  java.specification.version => 1.6
  sun.cpu.endian => little
  sun.desktop => null
  file.separator => /


The exception happens, even if I follow Curtis' instruction: remote-loading the MRI sample, saving it as tiff using built-in support, opening it as tiff using built-in support. Now using the LOCI exporter generates the exception. 

It appears that Curtis OS and mine differ by minor version number. Can someone confirm/infirm on another OS?
Comment 3 Curtis Rueden 2010-01-11 17:11:15 CST
Thanks for confirming, Jean-Yves. After updating Fiji core and plugins to the latest versions, I am able to duplicate the bug on my 10.6 system.

The latest version of loci_tools.jar available through the Fiji updater is a version from 2009-Sep-09, and has the problem.

Updating loci_tools.jar to today's trunk (r5776), the problem no longer exists, so the bug was fixed some time in the past four months.

So, the problem will go away when a newer version of loci_tools.jar is available from the Fiji updater. Should we wait to close the bug until that happens, then?
Comment 4 Jean-Yves Tinevez 2010-01-11 17:18:36 CST
(In reply to comment #3)

Johannes might had a reason not to update it, such as an unwanted dialog window.
Can we have his input before?
Comment 5 Johannes Schindelin 2010-01-11 17:45:07 CST
I just uploaded a new version, and committed the new bio-formats revision (with a small fixup in the Fakefile).
Comment 6 Jean-Yves Tinevez 2010-01-11 17:58:02 CST
(In reply to comment #5)


Unfortunately, the metadata is *not* saved with the file, tough no excecption is raised. 
Here is what I get if I reopen (even with the LOCI importer) a file I saved with LOCI exporter (with some metadata in it):

 null DimensionOrder	XYCZT
 null IsInterleaved	false
 null IsRGB	false
 null LittleEndian	true
 null PixelType	uint8
 null SizeC	1
 null SizeT	1
 null SizeX	186
 null SizeY	226
 null SizeZ	27
Local machine	/Users/tinevez/Desktop/q1.ome.tif
Comment 7 Curtis Rueden 2010-01-11 21:08:43 CST
Jean-Yves is correct that metadata is not saved on export unless the data was originally brought in by the Bio-Formats Importer. If you open the image with the Importer, then save using the Exporter, the image calibration is preserved. But if you open the image using ImageJ's native I/O, then save with the Exporter, the image calibration is lost.

This is a separate bug than the NullPointerException originally reported here, so I am closing this ticket. But I have filed another bug in the LOCI Trac to monitor the metadata export issue:
  https://skyking.microscopy.wisc.edu/trac/java/ticket/458