Pass an ImagePlus to a plugin other than the active window ImagePlus

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

Pass an ImagePlus to a plugin other than the active window ImagePlus

kacollins
I am writing a plugin. I am familiar with how to use IJ.run to run a second plugin from my plugin. However, I need to be able to pass a specific ImagePlus to that plugin rather than have it grab the active window ImagePlus. Is it possible to run a plugin from another plugin and pass it a specific ImagPlus?

Thanks,
     Karen
Reply | Threaded
Open this post in threaded view
|

Re: Pass an ImagePlus to a plugin other than the active window ImagePlus

ctrueden
Hi Karen,

I need to be able to pass a specific
> ImagePlus to that plugin rather than have it grab the active window
> ImagePlus. Is it possible to run a plugin from another plugin and pass it a
> specific ImagPlus?
>

Check out the method:
  IJ.run(ImagePlus imp, String command, String options)

-Curtis

On Wed, Dec 1, 2010 at 8:06 PM, kacollins <[hidden email]>wrote:

> I am writing a plugin. I am familiar with how to use IJ.run to run a second
> plugin from my plugin. However, I need to be able to pass a specific
> ImagePlus to that plugin rather than have it grab the active window
> ImagePlus. Is it possible to run a plugin from another plugin and pass it a
> specific ImagPlus?
>
> Thanks,
>     Karen
> --
> View this message in context:
> http://imagej.588099.n2.nabble.com/Pass-an-ImagePlus-to-a-plugin-other-than-the-active-window-ImagePlus-tp5794538p5794538.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: Pass an ImagePlus to a plugin other than the active window ImagePlus

Albert Cardona-2
In reply to this post by kacollins
2010/12/2 kacollins <[hidden email]>:
> I am writing a plugin. I am familiar with how to use IJ.run to run a second
> plugin from my plugin. However, I need to be able to pass a specific
> ImagePlus to that plugin rather than have it grab the active window
> ImagePlus. Is it possible to run a plugin from another plugin and pass it a
> specific ImagPlus?


Yes:

ImagePlus imp = ...

IJ.run(imp, "Any Plugin", "radius=10");

Albert

--
http://albert.rierol.net
Reply | Threaded
Open this post in threaded view
|

Re: Pass an ImagePlus to a plugin other than the active window ImagePlus

kacollins
Wow, I can't believe I missed that one. Google's top link brings up an outdated API for IJ.run, and I didn't notice that it was a non-official ImageJ website (http://www.coe.uncc.edu/~arwillis/online/docs/ImageJ-docs/api/ij/IJ.html). It only listed the other two versions of IJ.run. In any event, your suggested solution is exactly what I needed, and it works perfectly!

Karen