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 278 - Cannot save montaged image as a TIFF
Cannot save montaged image as a TIFF
Status: RESOLVED FIXED
Product: Fiji
Classification: Unclassified
Component: TrakEM2
unspecified
PC Windows
: P4 normal
Assigned To: ImageJ Bugs Mailing List
Depends on:
Blocks:
 
Reported: 2011-01-27 13:09 CST by Yuriy M
Modified: 2011-02-03 01:35 CST
1 user (show)

See Also:

Description Yuriy M 2011-01-27 13:09:29 CST
[Enter details of the problem or bug and how to reproduce it here.]
From a TrakEM2 project trying to save motaged image as Tiff (File/Save As/Tiff). Returned this:

java.lang.IndexOutOfBoundsException
	at java.io.FileOutputStream.writeBytes(Native Method)
	at java.io.FileOutputStream.write(FileOutputStream.java:260)
	at java.io.BufferedOutputStream.write(BufferedOutputStream.java:105)
	at java.io.DataOutputStream.write(DataOutputStream.java:90)
	at ij.io.ImageWriter.write8BitImage(ImageWriter.java:29)
	at ij.io.ImageWriter.write(ImageWriter.java:271)
	at ij.io.TiffEncoder.write(TiffEncoder.java:118)
	at ij.io.TiffEncoder.write(TiffEncoder.java:138)
	at ij.io.FileSaver.saveAsTiff(FileSaver.java:106)
	at ij.io.FileSaver.saveAsTiff(FileSaver.java:86)
	at ij.plugin.filter.Writer.run(Writer.java:20)
	at ij.plugin.filter.PlugInFilterRunner.processOneImage(PlugInFilterRunner.java:249)
	at ij.plugin.filter.PlugInFilterRunner.<init>(PlugInFilterRunner.java:102)
	at ij.IJ.runPlugInUnchecked(IJ.java:177)
	at ij.IJ.runPlugIn(IJ.java:157)
	at ij.Executer.runCommand(Executer.java:147)
	at ij.Executer.run(Executer.java:78)
	at java.lang.Thread.run(Thread.java:619)

Information about your version of Java - this information is useful for the Fiji developers:
  os.arch => amd64
  os.name => Windows 7
  os.version => 6.1
  java.version => 1.6.0_20
  java.vendor => Sun Microsystems Inc.
  java.runtime.name => Java(TM) SE Runtime Environment
  java.runtime.version => 1.6.0_20-b02
  java.vm.name => Java HotSpot(TM) 64-Bit Server VM
  java.vm.version => 16.3-b01
  java.vm.vendor => Sun Microsystems Inc.
  java.vm.info => mixed mode
  java.awt.graphicsenv => sun.awt.Win32GraphicsEnvironment
  java.specification.name => Java Platform API Specification
  java.specification.version => 1.6
  sun.cpu.endian => little
  sun.desktop => windows
  file.separator => \
Comment 1 Albert Cardona 2011-01-27 15:36:08 CST
Hi Yuriy,

TrakEM2 relies mostly on its own right-click popup menu.
To export the montaged tiles as a flat, large image, right-click and choose "Export - Make flat image". It will give the choice of 8-bit or RGB. If you want 16-bit ot 32-bit, you'll have to write a 5-line script to use the static method Patch. In jython:

from java.awt import Color
layer = Display.getFrontLayer()
flat = Patch.makeFlatImage(ImagePlus.GRAY16, layer, layer.getParent.get2DBounds(), 1.0, layer.getDisplayables(Patch), Color.black)
FileSaver(ImagePlus("flat", flat)).saveAsTiff("/path/to/file.tif")


Have a look at:
http://pacific.mpi-cbg.de/javadoc/ini/trakem2/display/Patch.html#makeFlatImage(int, ini.trakem2.display.Layer, java.awt.Rectangle, double, java.util.Collection, java.awt.Color)
Comment 2 Yuriy M 2011-01-27 15:43:51 CST
Hi Albert,

Yes, I figured that much already... still this is a bug, maybe not trakEM's bug, but still. Doesn't look quite like a meaningful way to support a product.

Thanks, Yuri(In reply to comment #1)
> Hi Yuriy,
> 
> TrakEM2 relies mostly on its own right-click popup menu.
> To export the montaged tiles as a flat, large image, right-click and choose
> "Export - Make flat image". It will give the choice of 8-bit or RGB. If you
> want 16-bit ot 32-bit, you'll have to write a 5-line script to use the static
> method Patch. In jython:
> 
> from java.awt import Color
> layer = Display.getFrontLayer()
> flat = Patch.makeFlatImage(ImagePlus.GRAY16, layer,
> layer.getParent.get2DBounds(), 1.0, layer.getDisplayables(Patch), Color.black)
> FileSaver(ImagePlus("flat", flat)).saveAsTiff("/path/to/file.tif")
> 
> 
> Have a look at:
> http://pacific.mpi-cbg.de/javadoc/ini/trakem2/display/Patch.html#makeFlatImage(int,
> ini.trakem2.display.Layer, java.awt.Rectangle, double, java.util.Collection,
> java.awt.Color)
> 

Comment 3 Albert Cardona 2011-01-27 17:55:12 CST
(In reply to comment #2)
> Hi Albert,
> 
> Yes, I figured that much already... still this is a bug, maybe not trakEM's
> bug, but still. Doesn't look quite like a meaningful way to support a product.
> 
> Thanks, Yuri(In reply to comment #1)


Indeed, I have not closed this bug yet :)

TrakEM2 should ignore all those Fiji-issued commands that it doesn't know how to handle properly.

Albert
Comment 4 Johannes Schindelin 2011-01-29 14:53:10 CST
I would appreciate a more civil tone on this bug tracker. We are all volunteers here, not paid-for helpdesk people!
Comment 5 Albert Cardona 2011-02-03 01:35:39 CST
Pushed a fix to the git repos and the fiji updater.