The ImageJ plugin API

As you have just seen in the previous example, there is a class that implements several filters, but the exact operation you want to implement will surely have to rely on many other classes. The best resource you can have at hand when coding a new ImageJ plugin is the ImageJ Java API, accessible at http://rsbweb.nih.gov/ij/developer/api/. This includes a list of all the classes and methods that can be used to develop your plugin.

We understand that this resource can be very arid at the beginning of your coding practices. Remember that reading code written by others is an excellent way of learning once you have a grip on the basics. A large number of plugins offered at http://rsbweb.nih.gov/ij/plugins/index.html also have their source code available. So, this is a great starting point to extend what you already know about plugin development.

Even though it is not the purpose of this book to offer an exhaustive list of all the classes and the operations they provide, in the following table we have listed some of them which are mostly used:

Operation

Relevant classes or methods

Filter

RankFilters, Filters3D

Open / Save image

Opener, FileSaver, IJ.open(), IJ.save()

Plot

Plot

Run macro

IJ.runMacro(), IJ.runMacroFile()

Histogram

ImageProcessor.getHistogram()

ROI handling

ROI (and its subclasses)

Measurements

Measurements interface and all the implementing classes and interfaces, especially ImageStatistics

Analyze Particles

ParticleAnalyzer

Get active image

IJ.getImage()

Get image IDs, get image by ID or name

WindowManager.getIDList(), WindowManager.getImage()

Capture mouse movements or clicks on the image

Add the appropriate AWT Listeners to the ImageCanvas object

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset