|
Bugzilla – Bug 752 |
"Profile Plot Options..." exception via macro/batch mode |
Last modified: 2014-06-16 16:47:36 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. |
| "Profile Plot Options..." exception via macro/batch mode | |
|
|
|
||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
|
|||||||
Created attachment 151 Macro Log When running "Profile Plot Options" via macro... run("Profile Plot Options...", "width=450 height=200 minimum=0 maximum=0 interpolate"); ...the following exception appears consistently across all platforms/builds in headless mode. Any input or help would be /greatly/ appreciated. java.lang.IllegalArgumentException: Width (-62) and height (-245) must be > 0 at java.awt.image.SampleModel.<init>(SampleModel.java:108) at java.awt.image.ComponentSampleModel.<init>(ComponentSampleModel.java:128) at java.awt.image.PixelInterleavedSampleModel.<init>(PixelInterleavedSampleModel.java:69) at java.awt.image.Raster.createInterleavedRaster(Raster.java:638) at java.awt.image.Raster.createInterleavedRaster(Raster.java:265) at java.awt.image.Raster.createInterleavedRaster(Raster.java:194) at java.awt.image.ComponentColorModel.createCompatibleWritableRaster(ComponentColorModel.java:2808) at java.awt.image.BufferedImage.<init>(BufferedImage.java:409) at ij.plugin.JpegWriter.saveAsJpeg(JpegWriter.java:40) at ij.plugin.JpegWriter.save(JpegWriter.java:28) at ij.io.FileSaver.saveAsJpeg(FileSaver.java:355) at ij.io.FileSaver.saveAsJpeg(FileSaver.java:347) at ij.plugin.filter.Writer.run(Writer.java:24) at ij.plugin.filter.PlugInFilterRunner.processOneImage(PlugInFilterRunner.java:262) at ij.plugin.filter.PlugInFilterRunner.<init>(PlugInFilterRunner.java:111) at ij.IJ.runPlugIn(IJ.java:171) at ij.Executer.runCommand(Executer.java:131) at ij.Executer.run(Executer.java:64) at ij.IJ.run(IJ.java:269) at ij.IJ.run(IJ.java:323) at ij.IJ.saveAs(IJ.java:1722) at ij.IJ.saveAs(IJ.java:1654) at ij.macro.Functions.saveAs(Functions.java:2846) at ij.macro.Functions.doFunction(Functions.java:155) 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.plugin.Macro_Runner.runMacroFile(Macro_Runner.java:137) at ij.IJ.runMacroFile(IJ.java:130) at ij.ImageJ.main(ImageJ.java:678) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at imagej.patcher.LegacyEnvironment.main(LegacyEnvironment.java:374) at fiji.Main.main(Main.java:155) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at imagej.ClassLauncher.launch(ClassLauncher.java:222) at imagej.ClassLauncher.run(ClassLauncher.java:159) at imagej.ClassLauncher.main(ClassLauncher.java:72)Just to clarify, the full macro I'm running is: run("Profile Plot Options...", "width=450 height=200 minimum=0 maximum=0 interpolate"); open("data.jpg"); run("Plot Profile"); saveAs("Jpeg", "profile.jpg"); ...and it works fine on Fiji and ImageJ2 (as a macro) when not in headless mode. My only goal is to disable the grey grid generated in the line profile but ran into this snag. Thanks again! Please let me know how I can help! :)Sure thing. I'll try to get that attached tonight. I don't think it even gets to that point, however, since it fails on this line... run("Profile Plot Options...", "width=450 height=200 minimum=0 maximum=0 interpolate"); ThanksCreated attachment 155 Data image used.Apologies for letting this sit for so long. We have been swamped fixing ImageJ2-related issues. I tried your macro with your data, using the command: $FIJI_DIR/Contents/MacOS/ImageJ-macosx --headless -macro bryan.ijm Where "bryan.ijm" is your macro: run("Profile Plot Options...", "width=450 height=200 minimum=0 maximum=0 interpolate"); open("data.jpg"); run("Plot Profile"); saveAs("Jpeg", "profile.jpg"); On my system, this gives the error: Unsupported format or not found File is not in a supported format, a reader plugin is not available, or it was not found. So I changed "data.jpg" to "data.png" and then received: Line or rectangular selection required So I added a makeLine call: run("Profile Plot Options...", "width=450 height=200 minimum=0 maximum=0 interpolate"); open("data.png"); makeLine(18, 36, 252, 15); run("Plot Profile"); saveAs("Jpeg", "profile.jpg"); And _then_ I finally see the exception you reported. Investigating now...> ssh: connect to host github.com port 22: Operation timed out You can also push via https...