|
Bugzilla – Bug 1092 |
Incorrect units for y and z; subsequent Bio-Formats bug |
Last modified: 2015-06-18 19:29:15 CDT |
| ⚠ |
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. |
| Incorrect units for y and z; subsequent Bio-Formats bug | |
|
|
|
||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
This might actually be _two_ bugs. 1) Running 'Image > Properties...' or 'Analyze > Set Scale...' to change the units and scale will change only the units for x, *not* the units for y and z directions. The same problem apparently occurs when saving a virtual stack (with micron calibration) to a tiff stack: the resulting file will have microns in x and pixels in y and z. 2) As a consequence, when you save such a "mis-scaled" image and read it with Bio-Formats Importer, the stack trace pasted below is thrown. Unfortunately, this breaks any use of the Grid/Collection Stitching plugin because it exclusively uses Bio-Formats to open even "Standard ImageJ" tiff files. I suggest that the Bio-Formats Importer should be a bit more forgiving and issue a warning only, instead of throwing an exception here. This macro code illustrates both issues: // ****************************************************** tmp = getDirectory("temp"); file_name = "calibration_bug.tif" newImage("Calibration_test", "8-bit black", 100, 100, 20); run("Properties...", "channels=1 slices=20 frames=1 unit=um pixel_width=0.8 pixel_height=0.8 voxel_depth=0.8"); Stack.getUnits(x, y, z, t, val); print("Units: x=" + x + " y=" + y + " z=" + z + " time=" + t + " value=" + val); saveAs("Tiff", tmp + file_name); run("Bio-Formats Importer", "open=" + tmp + file_name +" color_mode=Default view=Hyperstack stack_order=XYCZT"); // ****************************************************** Here's the stack trace: (Fiji Is Just) ImageJ 2.0.0-rc-30/1.49u; Java 1.6.0_24 [64-bit]; Windows 7 6.1; 46MB of 98221MB (<1%) java.lang.NullPointerException at loci.plugins.in.Calibrator.applyCalibration(Calibrator.java:71) at loci.plugins.in.ImagePlusReader.readImage(ImagePlusReader.java:307) at loci.plugins.in.ImagePlusReader.readImages(ImagePlusReader.java:238) at loci.plugins.in.ImagePlusReader.readImages(ImagePlusReader.java:216) at loci.plugins.in.ImagePlusReader.openImagePlus(ImagePlusReader.java:111) at loci.plugins.in.Importer.readPixels(Importer.java:146) at loci.plugins.in.Importer.run(Importer.java:85) at loci.plugins.LociImporter.run(LociImporter.java:78) at ij.IJ.runUserPlugIn(IJ.java:199) at ij.IJ.runPlugIn(IJ.java:163) at ij.Executer.runCommand(Executer.java:132) at ij.Executer.run(Executer.java:62) at ij.IJ.run(IJ.java:279) at ij.macro.Functions.doRun(Functions.java:597) at ij.macro.Functions.doFunction(Functions.java:95) at ij.macro.Interpreter.doStatement(Interpreter.java:227) at ij.macro.Interpreter.doStatements(Interpreter.java:215) at ij.macro.Interpreter.run(Interpreter.java:112) at ij.macro.Interpreter.run(Interpreter.java:82) at ij.macro.Interpreter.run(Interpreter.java:93) at ij.plugin.Macro_Runner.runMacro(Macro_Runner.java:153) at ij.IJ.runMacro(IJ.java:116) at ij.IJ.runMacro(IJ.java:105) at net.imagej.legacy.IJ1Helper.runMacro(IJ1Helper.java:857) at net.imagej.legacy.plugin.IJ1MacroEngine.eval(IJ1MacroEngine.java:116) at net.imagej.legacy.plugin.IJ1MacroEngine.eval(IJ1MacroEngine.java:163) at org.scijava.script.ScriptModule.run(ScriptModule.java:175) at org.scijava.module.ModuleRunner.run(ModuleRunner.java:167) at org.scijava.module.ModuleRunner.call(ModuleRunner.java:126) at org.scijava.module.ModuleRunner.call(ModuleRunner.java:65) at org.scijava.thread.DefaultThreadService$2.call(DefaultThreadService.java:181) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Information about your version of Java: os.arch => amd64 os.name => Windows 7 os.version => 6.1 java.version => 1.6.0_24 java.vendor => Sun Microsystems Inc. java.runtime.name => Java(TM) SE Runtime Environment java.runtime.version => 1.6.0_24-b07 java.vm.name => Java HotSpot(TM) 64-Bit Server VM java.vm.version => 19.1-b02 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 => \ The up-to-date check says: REMIND_LATER Information relevant to JAVA_HOME related problems: JAVA_HOME is set to: C:\UTILIT~1\FIJI-D~1.APP/java/win64/jdk1.6.0_24//jre imagej.dir => C:\UTILIT~1\FIJI-D~1.APP Information about the version of each plugin: Activated update sites: ImageJ: http://update.imagej.net/ (last check:20150618000647) Fiji: http://fiji.sc/update/ (last check:20150617220654)