Threshold in a Plugin

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

Threshold in a Plugin

ColinWhite
Hi all,

I'm wondering if there is a way to threshold an image in a plugin? I know I can do it in a macro, but I'd prefer to keep all my code in my plugin file.

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

Re: Threshold in a Plugin

Nathaniel Ryckman
There is a way.

Use IJ.run("plugin name", "plugin options");

I don't know what you mean by keeping all your code in your plugin though. Your plugin is dependent on imageJ code, so you won't be in total control of your plugin no matter what.

Another option you have is to copy the threshold files into your plugin package. In fact, this is what I did. If you choose to do this, there are two ways that I can think of in which you can interact with the copied files:

1) Put an underscore in the copied file's name and then you should be able to run it through the IJ.run("copied_plugin_namespace", "plugin options");
2) Study the copied files and find a point of entry that would produce the same results as IJ.run() and/or modify the copied files to have a good point of entry if one does not already exist.



ColinWhite wrote
Hi all,

I'm wondering if there is a way to threshold an image in a plugin? I know I can do it in a macro, but I'd prefer to keep all my code in my plugin file.

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

Re: Threshold in a Plugin

ColinWhite
Thank you for your response.

I know about IJ.run("plugin name", "plugin options"), but I couldn't figure out what the options for colour thresholding are. When I use Plugins>Macros>Record... it tells me to use this (which has nothing in the options field):

IJ.run(imp, "Color Threshold...", "");

However, I've realized that I can just convert the image to an 8-bit image and then use regular thresholding.

Thanks again.