Difference between revisions of "Max Inscribed Circles"

m
Line 16: Line 16:
 
The code for this plugin was inspired by this [http://www.mathworks.ch/matlabcentral/fileexchange/30805-maximum-inscribed-circle-using-distance-transform Matlab Central function]
 
The code for this plugin was inspired by this [http://www.mathworks.ch/matlabcentral/fileexchange/30805-maximum-inscribed-circle-using-distance-transform Matlab Central function]
  
[[File:Max_largest_circ_dialog.png|200px|thumb|left|Dialog]]
+
[[File:Max_largest_circ_dialog.png |400px|thumb|right|Example]]
[[File:Max_largest_circ_beforeafter.png|200px|thumb|left|Example]]
 
  
  
Line 31: Line 30:
 
Setting the Minimum Disk Diameter to 0 will return a single ROI with the largest inscribed circle.
 
Setting the Minimum Disk Diameter to 0 will return a single ROI with the largest inscribed circle.
  
[[File:Max_largest_circ_dialog.png|200px|thumb|left|Dialog]]
+
[[File:Max_largest_circ_beforeafter.png|400px|thumb|right|Example]]
 +
 
  
 
== Macro Recordable ==
 
== Macro Recordable ==

Revision as of 06:30, 19 August 2015

Max Inscribed Circles (Fiji)
Author Olivier Burri, Romain Guiet
Maintainer Olivier Burri
File Max_Inscribed_Circle.jar
Source on GitHub
Initial release August 2015
Latest version August 2015
Development status stable
Website BIOP Staff Page


Purpose

This is an implementation of the Largest Inscribed Circle algorithm using an euclidean distance map. The algorithm is looped until a circle diameter smaller than the defined minimum diameter is found. The code for this plugin was inspired by this Matlab Central function

Example


Installation

This plugin is available from the BIOP Update Site This places it in a "BIOP" Folder in the plugins directory of Fiji/ImageJ

Use

Call up the plugin using Plugins->BIOP->Max Inscribed Circles... and select the stacks that you wish to use.

It will add all the found circles to the ROI Manager.

Setting the Minimum Disk Diameter to 0 will return a single ROI with the largest inscribed circle.

Example


Macro Recordable

Making use of the GenericDialog class, the plugin is macro-recordable.

run("Max Inscribed Circles...", "minimum=20");

Running from a Plugin

What you need to run this in a plugin is

import ch.epfl.biop.MaxInscribedCircles;

And then call the static method

//imp must be an 8-bit binary image
ArrayList<Roi> circles = MaxInscribedCircles.findCircles(ImagePlus imp, double minD);


Notes

The plugin does not work with selections, only masks.

The accuracy is not perfect as we are using the distance map which has finite values. But for most practical purposes (Circles larger than 2 pixels in diameter), it should be sufficient.