Supervised Image Classification with ImageJ and R in Bio7

[This article was first published on R – Bio7, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

24.08.2020

It’s a while ago that I wrote about supervised image classification combining ImageJ and R in Bio7 (see video here). Later I decided to create a classification Graphical User Interface for Bio7 to make this process easier and implement typical functions for convenience.

However it took some time to finish a first version of this plugin and also to create a first documentation – working on it when I had some time to spare.

Click on the screenshot below to see a video on YouTube:

The plugin uses mainly the Java API of ImageJ to load, transform and filter images for a feature stack and transfer ROI (Region Of Interest) selections of this stack (pixel values) to R to train and classify the data with dedicated R scripts. The GUI itself reuses a powerful ImageJ component to collect selections (ROI Manager) and is embedded in a flexible view container (can be dragged around and detached).

Until now the plugin supports several datatypes, conversions, filters (features) and a GUI to apply a trained R classifier on multiple selected images or directories with the selected features easily.

The simple R scripts which can be executed from the GUI are using by default the randomForest package to train and classify the images. Automatically the classified results are transferred back to ImageJ for visualization and post-processing, e.g.,  object detection or particle analysis.

For a reproducible workflow all selections (using ROI Manager methods) and current GUI settings can be saved, e.g., for classification workflows of different tasks (cell detection, landscape analysis, etc.).

The plugin itself can be downloaded and installed via Github (e.g., using the Eclipse EGit plugin) and then compiled dynamically. Later it will be shipped with the upcoming Bio7 3.2 release.

At all the plugin is concepted in that way that it can be extended easily (extending the GUI  interface using, e.g., the free Eclipse WindowBuilder plugin or simply extending the R scripts).
I tried to hold the source compact, as easy as possible and as complex as necessary.

The installation details and documentation can be found on the dedicated Github page:

https://github.com/Bio7/Bio7_Classification

If you have some suggestions or ideas for improvements of the plugin let me know.

If you don’t know Bio7 at all:

The plugin can be installed into the OpenSource software Bio7 which can be found here:

https://bio7.org

To leave a comment for the author, please follow the link and comment on their blog: R – Bio7.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)