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 1019 - Align image by Line ROI results in Java error
Align image by Line ROI results in Java error
Status: RESOLVED FIXED
Product: Fiji
Classification: Unclassified
Component: Plugins
unspecified
PC Windows
: P4 normal
Assigned To: ImageJ Bugs Mailing List
Depends on:
Blocks:
 
Reported: 2015-03-04 10:06 CST by amc910
Modified: 2015-03-26 04:51 CDT
2 users (show)

See Also:

Description amc910 2015-03-04 10:06:17 CST
Hi there,

I'm trying to run the 'Align image by line ROI' utility, and I keep getting a Java error.

The following macro results in the same error:
-----------------
run("Dot Blot (7K)");
run("Dot Blot (7K)");

selectWindow("Dot_Blot.jpg");
makeLine(116, 256, 475, 97);
selectWindow("Dot_Blot-1.jpg");
makeLine(106, 111, 404, 172);

run("Align Image by line ROI");
-----------------

Hit 'OK' and the following Java error is printed:

-----------------
(Fiji Is Just) ImageJ 2.0.0-rc-25/1.49p; Java 1.6.0_24 [64-bit]; Windows 7 6.1; 100MB of 5971MB (1%)
 
java.lang.NullPointerException
	at Align_Image.align(Align_Image.java:139)
	at Align_Image.run(Align_Image.java:83)
	at ij.IJ.runUserPlugIn(IJ.java:199)
	at ij.IJ.runPlugIn(IJ.java:163)
	at ij.Executer.runCommand(Executer.java:131)
	at ij.Executer.run(Executer.java:64)
	at ij.IJ.run(IJ.java:275)
	at ij.IJ.run(IJ.java:250)
	at ij.macro.Functions.doRun(Functions.java:593)
	at ij.macro.Functions.doFunction(Functions.java:89)
	at ij.macro.Interpreter.doStatement(Interpreter.java:226)
	at ij.macro.Interpreter.doStatements(Interpreter.java:214)
	at ij.macro.Interpreter.run(Interpreter.java:111)
	at ij.macro.Interpreter.run(Interpreter.java:81)
	at ij.macro.Interpreter.run(Interpreter.java:92)
	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:794)
	at net.imagej.legacy.plugin.IJ1MacroEngine.eval(IJ1MacroEngine.java:116)
	at net.imagej.legacy.plugin.IJ1MacroEngine.eval(IJ1MacroEngine.java:160)
	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:164)
	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)
-------------

From the first two lines in the error log I'm assuming it has to do with lines 139 and 83 in Align_image.java:
131:    float dx1 = line1.x2 - line1.x1;
83:    ImageProcessor result = align(source.getProcessor(), line1, target.getProcessor(), line2, withScaling, withRotation);

From: https://github.com/fiji/VIB/blob/master/src/main/java/Align_Image.java

I'm afraid I'm not really sure where to go from here, any ideas?

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:\Work\FIJI-W~1\Fiji.app/java/win64/jdk1.6.0_24//jre
  imagej.dir => C:\Work\FIJI-W~1\Fiji.app

Information about the version of each plugin:

Activated update sites:
ImageJ: http://update.imagej.net/ (last check:20150302042523)
Fiji: http://fiji.sc/update/ (last check:20150302225742)

Files not up-to-date:
  b0038cbf (MODIFIED) 20150304154358 jars/ij-1.49m.jar
  1ad3be0d (LOCAL_ONLY) 20140201185146 jars/jpedalSTD.jar
  c7660983 (LOCAL_ONLY) 20140731142918 macros/Angus1.ijm
  c55dde81 (LOCAL_ONLY) 20140731142926 macros/Angus2.ijm
  0be8846e (LOCAL_ONLY) 20141210131404 macros/BatchScale.ijm
  0a23f9af (LOCAL_ONLY) 20140729120848 macros/Bleach Correction.ijm
  d71b3fa8 (LOCAL_ONLY) 20150217134500 macros/Confocal1.ijm
  9078abc5 (LOCAL_ONLY) 20150120131532 macros/Cropping.ijm
  6eeac28f (LOCAL_ONLY) 20141204141336 macros/DateLastModified.ijm
  19ddd309 (LOCAL_ONLY) 20140626124302 macros/FullScan_100x.ijm
  35e3bd87 (LOCAL_ONLY) 20140626124325 macros/FullScan_200x.ijm
  6727eb24 (LOCAL_ONLY) 20140626124218 macros/FullScan_25x.ijm
  470b2083 (LOCAL_ONLY) 20140626124344 macros/FullScan_500x.ijm
  23e828fb (LOCAL_ONLY) 20140626124239 macros/FullScan_50x.ijm
  51565b01 (LOCAL_ONLY) 20141209172107 macros/LoggerDataExtract.ijm
  3b8be573 (LOCAL_ONLY) 20140624092005 macros/MultiOpen.ijm
  c2c3c8fa (LOCAL_ONLY) 20141209172109 macros/ScannertoRGBij.ijm
  20c298a4 (LOCAL_ONLY) 20140604130515 macros/StackReg.ijm
  54bc1cc8 (LOCAL_ONLY) 20140731181111 macros/Timelapse overlay.ijm
  0e90592c (LOCAL_ONLY) 20140624161002 macros/Timelapse1.ijm
  0ea65c05 (LOCAL_ONLY) 20140804113436 macros/VirtualDubMacro.ijm
  05337381 (LOCAL_ONLY) 20140804144053 macros/WB Single.ijm
  76215538 (LOCAL_ONLY) 20140804144725 macros/WB Stack.ijm
  b0408dbd (LOCAL_ONLY) 20150126154553 macros/WhiteBalanceAreaMean.ijm
  83f01961 (LOCAL_ONLY) 20140729120800 plugins/Bleach Correction.ijm
  e532d82b (LOCAL_ONLY) 20140626175231 plugins/FullScan_100x.ijm
  553b12f8 (LOCAL_ONLY) 20140626175259 plugins/FullScan_200x.ijm
  842dac39 (LOCAL_ONLY) 20140626175242 plugins/FullScan_25x.ijm
  b90fcf8c (LOCAL_ONLY) 20140626175540 plugins/FullScan_500x.ijm
  fb0ea92b (LOCAL_ONLY) 20140626175247 plugins/FullScan_50x.ijm
  29aa129b (LOCAL_ONLY) 20140530113502 plugins/MeasureStack.class
  698e201e (LOCAL_ONLY) 20140530113502 plugins/MeasureStackReviewer.class
  db437772 (LOCAL_ONLY) 20140530113502 plugins/Measure_Stack.class
  2b893d8c (LOCAL_ONLY) 20140624133848 plugins/MultiOpen.ijm
  b7e36bf5 (LOCAL_ONLY) 20140804104151 plugins/RXTXcomm.jar
  b3b73e80 (LOCAL_ONLY) 20141210131339 plugins/Scan_.jar
  6aca4c14 (LOCAL_ONLY) 20140804151315 plugins/WB Single.ijm
  ff703cc6 (LOCAL_ONLY) 20140610111222 plugins/ij-dcraw_.jar
  27598922 (LOCAL_ONLY) 20140804103936 plugins/serial_ext.jar
  dcb0f1b8 (LOCAL_ONLY) 20141210131339 plugins/uk.co.mmscomputing.device.twain.jar
Comment 1 amc910 2015-03-04 11:39:39 CST
As an update, I've just tried to restart FIJI and run the Align by line ROI plugin on the sample images, and it has worked ok.
After some poking it looks as though the exception comes about when there are more than two images open, that is more images open than those you wish to align.
The order the images are opened also seems to be an issue.
If I open boat.gif(1), bridge.gif(2) and Dot_Blot.jpg(3), I can align 1 and 2, but both 2 and 3 and 1 and 3 throw up another nullpointer exception.

Aligning 2 and 3 gives the same

at Align_Image.align(Align_Image.java:139)

error, but 1 and 3 gives

at Align_Image.align(Align_Image.java:141)

These errors also seem to stop if I bother to put a line ROI on the third image not being used, and just ignore it from then on.

So, this bug is now workable, but not ideal (especially if you don't know the fix)

Cheers,
Angus
Comment 2 Curtis Rueden 2015-03-24 22:24:22 CDT
Thanks for the report!

This bug is now fixed:
https://github.com/fiji/VIB/commit/a24791f4383b2127e2a263f6327760b223f48965

I released VIB 2.0.3 and uploaded it to the Fiji update site.

Enjoy.
Comment 3 amc910 2015-03-26 04:51:41 CDT
Great, cheers Curtis!

Angus