Posted by
Christian Tischer on
Nov 15, 2012; 9:28am
URL: http://imagej.273.s1.nabble.com/Re-running-headless-Extended-Depth-of-Field-tp5000821.html
Hello Everybody,
in the meantime we (Kota Miura and me) hacked the EDF code ourselves in
order to make it run headless.
for those interested, here is how it works:
1) create a folder "edfgui" in the plugins folder
2) place the file at
https://gist.github.com/4077617 into this folder
3) then, using FIJI, when you can use it via a jython script like so:
from edfgui import ExtendedDepthOfFieldHeadless
from edfgui import Parameters
imp = ...some image stack...
IJ.log("EDF: start...")
parameters = Parameters()
parameters.setQualitySettings(1)
parameters.setTopologySettings(0)
parameters.show3dView = False
parameters.showTopology = False
edfh = ExtendedDepthOfFieldHeadless(imp, parameters)
impEDF = edfh.processHeadless()
IJ.log("EDF: done.")
# if you want to see the result in the GUI mode:
impEDF.show()
# of course you have to remove above line in headless mode as it would
crash otherwise
4) have fun, Tischi
On Wed, Oct 17, 2012 at 10:03 AM, Christian Tischer <
[hidden email]> wrote:
> Dear All,
>
> i am trying to run the Extended Depth of Field as headless (because we
> need to cluster batch process).
>
> but i am getting the error:
>
> ....
> Caused by: java.awt.HeadlessException
> at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:159)
> at java.awt.Window.<init>(Window.java:431)
> at java.awt.Frame.<init>(Frame.java:403)
> at java.awt.Frame.<init>(Frame.java:368)
> at javax.swing.JFrame.<init>(JFrame.java:158)
> at edfgui.AbstractDialog.<init>(AbstractDialog.java:66)
> at edfgui.BasicDialog.<init>(BasicDialog.java:81)
> at EDF_Easy_.run(EDF_Easy_.java:141)
> at ij.IJ.runUserPlugIn(IJ.java:185)
> at ij.IJ.runPlugIn(IJ.java:152)
>
>
> i am running:
>
>
> fiji --jython --headless edf.py
>
>
> where edf.py is:
>
> ###############
>
> from ij import IJ
> from ij import ImageStack
> from ij import ImagePlus
> from ij.plugin import Duplicator
>
> # make a stack
> imp = IJ.openImage("
http://imagej.nih.gov/ij/images/blobs.gif");
> stack = ImageStack(imp.width, imp.height)
> ip = imp.getProcessor()
> stack.addSlice("", ip)
> stack.addSlice("", ip)
> imp = ImagePlus("stack", stack)
> #imp.show()
>
> IJ.run(imp, "Extended Depth of Field (Easy mode)...", "");
>
> ################
>
> my problem is that i cannot figure out which java class and method to call
> directly in order to avoid the Run Method.
>
>
>
http://code.google.com/p/fiji-bi/source/browse/src-plugins/Extended_Depth_Field/EDF_Easy_.java?name=c610ac7a03&r=b08377b6e85f70e6ffe4fdb5c0276dbb711e180f>
> can someone help?
>
> Tischi
>
>
>
>
>
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html