Imagej how to call Versatile Wand Tool options from plugin

We have been working on a plugin which uses Versatile Wand Tool in Imagej. A custom graphical interface has been made, we needed to make it our own custom GUI for a specific use. It is easy to call Versatile Wand Tool from plugin, but I could not call its options menu. On GUI, there is a button to select Versatile Wand Tool and there is another which should open options menu.

I did make options menu show up by calling Versatile Wand Tool class and then calling the method. But even when I change anything on it, it does not save my preferred options and still goes with default options (for example, value tolerance stays zero even if I change it from my plugin). Codes for calling that options menu are:

    Versatile_Wand_Tool vwto = new Versatile_Wand_Tool();
    vwto.showOptionsDialog();
    vwto.dialogItemChanged(GenericDialog gd, AWTEvent e);

Is there a specific code just like for calling Versatile Wand Tool, I used ’ IJ.runPlugIn("Versatile_Wand_Tool", ""); ’ ?

have you tried using the macro recorder? Perhaps this page will help.

Thanks for info, but I did look at record, though it does not show any command running in background when I double click on Versatile Wand Tool to see options menu.

Perhaps then you could create your own dialog box, take the values, and then pass them in when you call the plugin function?