CenterForDigitalHumanities / SpectralRTI_Toolkit

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

Case consistency required for Linux #67

Closed thanneken closed 6 years ago

thanneken commented 6 years ago

Used the 2:30 today build to go smoothly all the way up to writing the PCA Pseudocolor jpegs, and failed on a minor bug that goes back (pretty sure) to case not mattering on Windows but yes on Linux. The plugin created the directory "PseudocolorRTI" and later tried to write to the directory "PseudoColorRTI" with a capital C. The error generated a dialog titled "Jpeg Writer" with the message java.lang.illegalStateException: Output has not been set! The console gave:

[INFO] A directory has been created for Pseudocolor RTI at /media/thanneken/Jub-02/Projects/Ambrosiana_C73inf_115/PseudocolorRTI/
[INFO] On hem capture index 0
[INFO] Save PS RTI source image /media/thanneken/Jub-02/Projects/Ambrosiana_C73inf_115/PseudoColorRTI/PseudoColor_Ambrosiana_C73inf_115_RTI-A01_043.jpg
java.io.FileNotFoundException: /media/thanneken/Jub-02/Projects/Ambrosiana_C73inf_115/PseudoColorRTI/PseudoColor_Ambrosiana_C73inf_115_RTI-A01_043.jpg (No such file or directory)
    at java.io.RandomAccessFile.open0(Native Method)
    at java.io.RandomAccessFile.open(RandomAccessFile.java:316)
    at java.io.RandomAccessFile.<init>(RandomAccessFile.java:243)
    at javax.imageio.stream.FileImageOutputStream.<init>(FileImageOutputStream.java:69)
    at com.sun.imageio.spi.FileImageOutputStreamSpi.createOutputStreamInstance(FileImageOutputStreamSpi.java:55)
    at javax.imageio.ImageIO.createImageOutputStream(ImageIO.java:419)
    at ij.plugin.JpegWriter.saveAsJpeg(JpegWriter.java:59)
    at ij.plugin.JpegWriter.save(JpegWriter.java:28)
    at ij.io.FileSaver.saveAsJpeg(FileSaver.java:380)
    at ij.io.FileSaver.saveAsJpeg(FileSaver.java:372)
    at ij.plugin.filter.Writer.run(Writer.java:26)
    at ij.plugin.filter.PlugInFilterRunner.processOneImage(PlugInFilterRunner.java:265)
    at ij.plugin.filter.PlugInFilterRunner.<init>(PlugInFilterRunner.java:114)
    at ij.IJ.runPlugIn(IJ.java:194)
    at ij.Executer.runCommand(Executer.java:137)
    at ij.Executer.run(Executer.java:66)
    at ij.IJ.run(IJ.java:302)
    at ij.IJ.run(IJ.java:358)
    at ij.IJ.saveAs(IJ.java:1886)
    at com.slu.imagej.SpectralRTI_Toolkit.theMacro_tested(SpectralRTI_Toolkit.java:1627)
    at com.slu.imagej.SpectralRTI_Toolkit.run(SpectralRTI_Toolkit.java:1836)
    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)
Jun 01, 2018 3:40:35 PM com.slu.imagej.SpectralRTI_Toolkit run
thehabes commented 6 years ago

believe I got it, casing is consistent as PseudoColorRTI

thanneken commented 6 years ago

Almost there...

PseudocolorRTI/Ambrosiana_C73inf_115_PseudocolorRTI.lp PseudocolorRTI/Ambrosiana_C73inf_115_PseudocolorRTI_20180601_0359.txt Similarly, the paths in the lp file, e.g., /media/thanneken/Jub-02/Projects/Ambrosiana_C73inf_115/PseudocolorRTI/Pseudocolor_Ambrosiana_C73inf_115_RTI-A01_043.jpg 0.17889495 -0.9825294 0.05130836

if (psRtiDesired) {
                    createLpFile("Pseudocolor", projectDirectory);
                    runFitter("Pseudocolor");
}

Even though many instances are purely internal or UI, I would be tempted to search and replace the entire code.

thehabes commented 6 years ago

Did a full string replace and checked for errors, it all looks fine.

thanneken commented 6 years ago

Confirmed on Linux