CenterForDigitalHumanities / SpectralRTI_Toolkit

Process Spectral RTI Images in ImageJ
GNU General Public License v3.0
1 stars 0 forks source link

Null Pointer Exception #85

Closed thanneken closed 5 years ago

thanneken commented 5 years ago

Plugin Version: 0.0.9 ImageJ 1.52g, 2.0.0-rc-68 What was the specific component that changed? Operating systems tested: Windows10, Linux Prefs file: Appropriate file separators added/verified before starting (see separate issue)

preferredCompress=C:\Program Files (x86)\Kakadu\kdu_compress.exe
preferredJp2Args=-rate -,2.4,1.48331273,.91673033,.56657224,.35016049,.21641118,.13374944,.08266171 Creversible=no Clevels=5 Stiles={1024,1024} Cblk={64,64} Cuse_sop=yes Cuse_eph=yes Corder=RPCL ORGgen_plt=yes ORGtparts=R Cmodes=BYPASS -double_buffering 10 -num_threads 4 -no_weights
preferredFitter=C:\Scratch\deferredbatch.cmd
jpegQuality=90
hshOrder=3
hshThreads=16
webRtiMaker=C:\Program Files More\webRTI\webGLRtiMaker.exe
shortFileNames=true

(It didn't like this prefs file, asked to locate fitter and deferred batch, wrote back the prefs file with forward slashes on Windows)

Tested Task Set 1: Accurate Color RTI, WebRTI, raking Result 1:

[INFO] Running the fitter for AccurateColor...
[INFO] Preferred fitter is 
[INFO] Detected the preferred fitter is in fact a cmd or bash file.  This will defer processing.
[INFO] End fitter process
Compress String: preferredCompress=C:/Program Files (x86)/Kakadu/kdu_compress.exe

[INFO] Created JP2 E:\Projects\Ambrosiana_C73inf_116\StaticRaking\Ambrosiana_C73inf_116_Ac_00.jp2
[INFO] What is transmissive source ...Ambrosiana_C73inf_116_TX500CN_041.tif
Sep 24, 2018 11:40:18 AM com.slu.imagej.SpectralRTI_Toolkit run
SEVERE: null
java.lang.NullPointerException
    at com.slu.imagej.SpectralRTI_Toolkit.theMacro_tested(SpectralRTI_Toolkit.java:1598)
    at com.slu.imagej.SpectralRTI_Toolkit.run(SpectralRTI_Toolkit.java:2433)
    at org.scijava.command.CommandModule.run(CommandModule.java:199)
    at org.scijava.module.ModuleRunner.run(ModuleRunner.java:168)
    at org.scijava.module.ModuleRunner.call(ModuleRunner.java:127)
    at org.scijava.module.ModuleRunner.call(ModuleRunner.java:66)
    at org.scijava.thread.DefaultThreadService$3.call(DefaultThreadService.java:238)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

[WARNING] Finished processing the run().

Tested Task Set 2: PCA Pseudo RTI, WebRTI, raking Result 2:

[INFO] A directory has been created for PCA images at E:\Projects\Ambrosiana_C73inf_116\PCA\
[INFO] Got PCA method: Generate and manually select two
Sep 24, 2018 11:45:05 AM com.slu.imagej.SpectralRTI_Toolkit run
SEVERE: null
java.lang.NullPointerException
    at com.slu.imagej.SpectralRTI_Toolkit.theMacro_tested(SpectralRTI_Toolkit.java:1919)
    at com.slu.imagej.SpectralRTI_Toolkit.run(SpectralRTI_Toolkit.java:2433)
    at org.scijava.command.CommandModule.run(CommandModule.java:199)
    at org.scijava.module.ModuleRunner.run(ModuleRunner.java:168)
    at org.scijava.module.ModuleRunner.call(ModuleRunner.java:127)
    at org.scijava.module.ModuleRunner.call(ModuleRunner.java:66)
    at org.scijava.thread.DefaultThreadService$3.call(DefaultThreadService.java:238)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
[WARNING] Finished processing the run().

Tested Task Set 3: Custom RTI, WebRTI, raking Result 3: pop up message: "There are no windows open"

[INFO] Created JP2 E:\Projects\Ambrosiana_C73inf_116\StaticRaking\Ambrosiana_C73inf_116_KTK01_00.jp2
[INFO] What is transmissive source ...Ambrosiana_C73inf_116_TX500CN_041.tif
Sep 24, 2018 11:48:39 AM com.slu.imagej.SpectralRTI_Toolkit run
SEVERE: null
java.lang.RuntimeException: Macro canceled
    at ij.IJ.abort(IJ.java:2234)
    at ij.IJ.testAbort(IJ.java:378)
    at ij.IJ.run(IJ.java:311)
    at ij.IJ.run(IJ.java:367)
    at com.slu.imagej.SpectralRTI_Toolkit.theMacro_tested(SpectralRTI_Toolkit.java:2315)
    at com.slu.imagej.SpectralRTI_Toolkit.run(SpectralRTI_Toolkit.java:2433)
    at org.scijava.command.CommandModule.run(CommandModule.java:199)
    at org.scijava.module.ModuleRunner.run(ModuleRunner.java:168)
    at org.scijava.module.ModuleRunner.call(ModuleRunner.java:127)
    at org.scijava.module.ModuleRunner.call(ModuleRunner.java:66)
    at org.scijava.thread.DefaultThreadService$3.call(DefaultThreadService.java:238)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

[WARNING] Finished processing the run().
thehabes commented 5 years ago

The Null pointers are because of [INFO] What is transmissive source ...Ambrosiana_C73inf_116_TX500CN_041.tif

Since you use short names, there is an elipses instead of the the directory path. A crucial line of code was removed in a previous commit transmissiveSource = transmissiveSource.replace("...", transmissive_gamma_dir.toString()+File.separator); //in case of shortName which ensures even in the case of wanting short names that this variable stores the actual Path.

thanneken commented 5 years ago

Still getting a null pointer exception in Extended Spectrum. Here is the log:

[INFO] shotFileNames: false
[INFO] Set a fixed brightness value.  It is 1.0
[INFO] List of transmissive sources
[INFO] [/home/thanneken/Downloads/Ambrosiana_C73inf_115/Captures-Transmissive-Gamma/Ambrosiana_C73inf_115_TX500CN_041.tif, /home/thanneken/Downloads/Ambrosiana_C73inf_115/Captures-Transmissive-Gamma/Ambrosiana_C73inf_115_TX580YL_040.tif, /home/thanneken/Downloads/Ambrosiana_C73inf_115/Captures-Transmissive-Gamma/Ambrosiana_C73inf_115_TX735IR_042.tif, /home/thanneken/Downloads/Ambrosiana_C73inf_115/Captures-Transmissive-Gamma/Ambrosiana_C73inf_115_TX940IR_039.tif]
[INFO] Gathered 56 raking image selections.
[INFO] [false, true, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, true, false]
[INFO] We should have red, green and blue narrow bands
[INFO] [Ambrosiana_C73inf_115_MB630RD_009_F.tif, Ambrosiana_C73inf_115_MB655DR_010_F.tif, Ambrosiana_C73inf_115_MB735IR_012_F.tif, Ambrosiana_C73inf_115_MB850IR_013_F.tif, Ambrosiana_C73inf_115_MB940IR_014_F.tif]
[INFO] [Ambrosiana_C73inf_115_MB505CN_004_F.tif, Ambrosiana_C73inf_115_MB530GN_005_F.tif, Ambrosiana_C73inf_115_MB560LI_006_F.tif, Ambrosiana_C73inf_115_MB590AM_007_F.tif, Ambrosiana_C73inf_115_MB615RO_008_F.tif]
[INFO] [Ambrosiana_C73inf_115_MB365UV_011_F.tif, Ambrosiana_C73inf_115_MB420VI_001_F.tif, Ambrosiana_C73inf_115_MB450RB_002_F.tif, Ambrosiana_C73inf_115_MB470LB_003_F.tif]
Sep 27, 2018 5:36:39 PM com.slu.imagej.SpectralRTI_Toolkit run
SEVERE: null
java.lang.NullPointerException
    at com.slu.imagej.SpectralRTI_Toolkit.theMacro_tested(SpectralRTI_Toolkit.java:1685)
    at com.slu.imagej.SpectralRTI_Toolkit.run(SpectralRTI_Toolkit.java:2445)
    at org.scijava.command.CommandModule.run(CommandModule.java:199)
    at org.scijava.module.ModuleRunner.run(ModuleRunner.java:168)
    at org.scijava.module.ModuleRunner.call(ModuleRunner.java:127)
    at org.scijava.module.ModuleRunner.call(ModuleRunner.java:66)
    at org.scijava.thread.DefaultThreadService$3.call(DefaultThreadService.java:238)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

[WARNING] Finished processing the run().

Similar result with and without short filenames. Is 'shotFileNames' a deliberate shortening of short?

Also noticed that the log says the brightness multiplier was set to 1. I had set it to normalize based on a user-selected a region of interest. Actually maybe that is right for the RTI processing, and the ROI normalization is for a later/different step, the raking processing.

thanneken commented 5 years ago

With PCA:

[INFO] List of transmissive sources
[INFO] [/home/thanneken/Downloads/Ambrosiana_C73inf_115/Captures-Transmissive-Gamma/Ambrosiana_C73inf_115_TX500CN_041.tif, /home/thanneken/Downloads/Ambrosiana_C73inf_115/Captures-Transmissive-Gamma/Ambrosiana_C73inf_115_TX580YL_040.tif, /home/thanneken/Downloads/Ambrosiana_C73inf_115/Captures-Transmissive-Gamma/Ambrosiana_C73inf_115_TX735IR_042.tif, /home/thanneken/Downloads/Ambrosiana_C73inf_115/Captures-Transmissive-Gamma/Ambrosiana_C73inf_115_TX940IR_039.tif]
[INFO] Gathered 56 raking image selections.
[INFO] [false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false]
[INFO] Got PCA method: Generate and manually select two
Sep 27, 2018 5:45:12 PM com.slu.imagej.SpectralRTI_Toolkit run
SEVERE: null
java.lang.NullPointerException
    at com.slu.imagej.SpectralRTI_Toolkit.theMacro_tested(SpectralRTI_Toolkit.java:1931)
    at com.slu.imagej.SpectralRTI_Toolkit.run(SpectralRTI_Toolkit.java:2445)
    at org.scijava.command.CommandModule.run(CommandModule.java:199)
    at org.scijava.module.ModuleRunner.run(ModuleRunner.java:168)
    at org.scijava.module.ModuleRunner.call(ModuleRunner.java:127)
    at org.scijava.module.ModuleRunner.call(ModuleRunner.java:66)
    at org.scijava.thread.DefaultThreadService$3.call(DefaultThreadService.java:238)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

[WARNING] Finished processing the run().
thehabes commented 5 years ago

Windows 7 ImageJ 1.52h All version of included plugins in the GitHub code page - notOK branch, most importantly Stack_Manipulation-2.0.1 ImageJ Java version 1.8.0_172 (64 bit)

Testing these today, I was not able to replicate these NullPointerExceptions. Hopefully this round of big fixes hit what was causing the problem.

thanneken commented 5 years ago

I just go through a complete run of the typical processing set on linux... no errors.

I'm not sure what is meant above about the plugins and the notOK branch. I was using the latest jar from the master branch.