Last active
October 28, 2021 23:04
-
-
Save lacan/2b6cfa1710f3076ef7a4 to your computer and use it in GitHub Desktop.
Measures the regularity index from an ImageJ Voronoi diagram #ImageJ #Fiji #Macro
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Regularity Index Measurement | |
* Author: Olivier Burri | |
* Contact: http://biop.epfl.ch/INFO_Facility.html#staff | |
* Affiliation: BioImaging & Optics Platform, EPFL School of Life Sciences | |
* Date: 18 August 2015 | |
* License: CC BY http://creativecommons.org/licenses/by/4.0/ | |
* | |
* Description: Measures the regularity index from an ImageJ Voronoi diagram | |
* | |
* NOTES: Make sure that "AREA" is selected under "SET MEASUREMENTS" | |
*/ | |
// For Demo's Sake | |
run("Blobs (25K)"); | |
setAutoThreshold("Default"); | |
setOption("BlackBackground", false); | |
run("Convert to Mask"); | |
run("Voronoi"); | |
// This performs the Voronoi Regularity Index Analysis | |
name = getTitle(); | |
setThreshold(0, 0); | |
setOption("Area", true); | |
run("Analyze Particles...", "display exclude clear add"); | |
//Get the areas | |
nR = nResults; | |
areas = newArray(nR); | |
for (i=0; i<nR; i++) { | |
areas[i] = getResult("Area", i); | |
} | |
// Compute mean and STDEV | |
Array.getStatistics(areas, min, max, mean, stdDev); | |
// Finally we have the regularity index | |
regIndx = mean/stdDev; | |
// Output to Log | |
print(name+" Regularity Index = "+d2s(mean,1)+" / "+d2s(stdDev,1)+"= "+d2s(regIndx,1)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment