Skip to content
Snippets Groups Projects
Commit 5d1fb96b authored by rhaase's avatar rhaase
Browse files

added solution using imagej

parent 188069e9
No related branches found
No related tags found
No related merge requests found
// blob segmentation of images in folders
//
// This script analyses folders full of image with blobs and measures their average size
//
// Author: Robert Haase, rhaase@mpi-cbg.de
// May 2019
//
///////////////////////////////////
folder = "C:/structure/mpicloud/Projects/201909_Teaching_BioImageAnalysis_Praque/prague/05_examples/example_images/";
function main() {
run("Clear Results");
processFolder(folder + "condition_A/");
saveAs("Results", folder + "ResultsA.xls");
run("Clear Results");
processFolder(folder + "condition_B/");
saveAs("Results", folder + "ResultsB.xls");
run("Clear Results");
}
function processFolder(foldername) {
filelist = getFileList(foldername);
number_of_files_in_folder = lengthOf(filelist);
// go through all images, segment them and collect results in a table
for (i = 0; i < number_of_files_in_folder; i++) {
open(foldername + filelist[i]);
processImage();
close();
}
}
function processImage() {
// remoive noise
run("Gaussian Blur...", "sigma=5");
// segment
setAutoThreshold("Otsu dark");
setOption("BlackBackground", true);
run("Convert to Mask");
// analyze
run("Set Measurements...", "area redirect=None decimal=3");
run("Analyze Particles...", "display");
}
main();
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment