Re: running headless: Extended Depth of Field

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: running headless: Extended Depth of Field

Christian Tischer
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
Reply | Threaded
Open this post in threaded view
|

Re: running headless: Extended Depth of Field

dscho
Hi Tischi,

On Thu, 15 Nov 2012, Christian Tischer wrote:

> 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

It would be good if you could make this available on GitHub so that the
changes can be reviewed and hopefully even merged, in the worst case at
least ported from EDF version to the next.

Thanks,
Johannes

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: running headless: Extended Depth of Field

Pulceblue
In reply to this post by Christian Tischer
Dear Tischi,
I'm reaaly interested in your EDF headless mode, however, I'm now familiar with jyton coding to apply it to my case. Is it possible to run EDF in headless mode also with a macro script?
Thanks a lot in advance for the help?
Claudio