Login  Register

Re: Using results from plugins in scripts

Posted by Marcello DiStasio on Nov 01, 2013; 4:52pm
URL: http://imagej.273.s1.nabble.com/Using-results-from-plugins-in-scripts-tp5005391p5005422.html

Thanks Curtis!  I will take a crack at refactoring the java code into the
recommended run and exec methods and if it works I'll file a pull request.
-Marcello
On Oct 31, 2013 2:57 PM, "Curtis Rueden" <[hidden email]> wrote:

> Hi Marcello,
>
> > What I want is access to one (or all) of these result images in my
> > calling script.  Is there a way (in Jython) to 'drill down' into the
> > plugin in order to get the ImagePlus objects for these results?
>
> Let's look at the source code for Colour_Deconvolution:
>
> https://github.com/fiji/fiji/blob/master/src-plugins/Colour_Deconvolution/src/main/java/Colour_Deconvolution.java
>
> You can see that all work is done in the run(String) method and three
> ImagePlus objects are created and shown at the end. There is no recourse.
> The plugin would need to be refactored to split the work into helper
> methods which return the ImagePlus objects without showing them. Then you
> could call that Java API from Jython to use it as a library.
>
> I encourage you to make these changes and then file a pull request on
> GitHub so that we can improve the plugin in the core Fiji distribution.
> See:
> https://help.github.com/articles/using-pull-requests
>
> Regards,
> Curtis
>
>
> On Wed, Oct 30, 2013 at 5:17 PM, Marcello DiStasio <[hidden email]
> >wrote:
>
> > Hello ImageJ list, and apologies if this isn't the appropriate venue for
> > this question, but I have been unable to come up with an obvious answer
> > elsewhere.
> >
> > I want to use a plugin (one that is a standard plugin bundled with Fiji
> as
> > a *.jar in the ./Fiji.app/plugins directory -- specifically
> > 'Colour_Deconvolution') as part of an image processing pipeline that I am
> > writing using Jython.  I am able to run the command as recorded by the
> > Macro Recorder using the IJ.run method:
> >
> > IJ.run(imp, "Colour Deconvolution", "vectors=H&E")
> >
> > The problem is that this method returns nothing to the calling script.
>  The
> > method runs the command in Fiji, and 3 result images are generated and
> > shown.  What I want is access to one (or all) of these result images in
> my
> > calling script.  Is there a way (in Jython) to 'drill down' into the
> plugin
> > in order to get the ImagePlus objects for these results?
> >
> > Thanks!
> > -Marcello
> >
> > --
> > ImageJ mailing list: http://imagej.nih.gov/ij/list.html
> >
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html