CenterForDigitalHumanities / SpectralRTI_Toolkit

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

PCA Select Two #30

Closed thanneken closed 6 years ago

thanneken commented 6 years ago

Testing on Ubuntu, 4K display, 32 GB RAM... Selected process for PCA "generate and manually select two" Plugin created "PCA of Captures-Narrowband-NoGamma" stack Crashed before prompting to delete all slices except two. Last in Log: [Sun Apr 08 16:34:57 CDT 2018] [INFO] [] Got PCA method: Generate and manually select two Last in Console:

Computing pca...eigenimages (952569408bytes) ok Sun Apr 08 16:35:58 CDT 2018
PCA...cleaning eigensystem
Apr 08, 2018 4:36:06 PM com.slu.imagej.SpectralRTI_Toolkit run
SEVERE: null
java.lang.NullPointerException
    at com.slu.imagej.SpectralRTI_Toolkit.theMacro_tested(SpectralRTI_Toolkit.java:1190)
    at com.slu.imagej.SpectralRTI_Toolkit.run(SpectralRTI_Toolkit.java:1517)
    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().

By the way, for testing purposes you could save time and RAM by culling the Narrowband and Fluorescence folders to about 3-5 files total.

thehabes commented 6 years ago

I had run into this before, it should be fixed with the version of the plugin I upload today. I must have left an older version in master. I will try to replicate this in my next round of testing.

thanneken commented 6 years ago

Just encountered the same bug, this time on Windows 10, 16 GB RAM.

thehabes commented 6 years ago

This code in particular broke on

WindowManager.getImage("PCA of Captures-Narrowband-NoGamma kept stack").setRoi(pcaX,pcaY,pcaWidth,pcaHeight);

The null error happens because in this case the window's name is "PCA of Captures-Narrowband-NoGamma", so WindowManager.getImage recognized this as a null window. The "kept stack" window is not available yet. Moved this bit of code after PCA of Captures-Narrowband-NoGamma rename to PCA of Captures-Narrowband-NoGamma kept stack.

thehabes commented 6 years ago

This is fixed.