Hi,
ImageJ locks an image (i.e., an ImagePlus) before it runs a
PlugInFilter. This prevents you from, e.g., selecting a new
command modifying an image before the previous operation has
finished.
If you start a PlugInFilter from a PlugInFilter by IJ.run,
ImageJ will try to lock the image already locked.
You can avoid this conflict by imp.unlock(), where imp is the
ImagePlus. You get a reference to the ImagePlus in the setup
method.
Michael
________________________________________________________________
On 20 Nov 2007, at 18:52, meastwood98 wrote:
> Hi all,
> Im wanting to execute menu commands from a new plugin i am writing,
> i can do
> this when writing a Plugin type by using IJ.run("command");
> although the
> type of plugin i am writing is a PluginFilter and it does not let
> me do this
> with that type giving the error "Image is locked".
>
> Can anyone help me run menu commands from a PluginFilter type plugin?
>
> I've read in the documentation that the way to do it is
>
> static void run(java.lang.String command)
>
> Ive tried various ways of using this but im not sure how its
> supposed to be
> used, any help would be much appriciated. If you would like a copy
> of my
> program to give you a better idea, please let me know.
>
> Thanks you
>