Skip to content
Snippets Groups Projects
Commit 4bfe7d0b authored by rhaase's avatar rhaase
Browse files

added script for plotting circularity over time

parent c451b03e
No related branches found
No related tags found
No related merge requests found
// configuration
folder = "C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/";
result_csv_file = "summary.csv";
frame_delay_in_minutes = 0.2;
// configure measurement
run("Set Measurements...", "fit shape redirect=None decimal=3");
// retrieve all files in the folder in an array
filelist = getFileList(folder);
number_of_files = lengthOf(filelist);
// create two arrays to put measurements in later
time_array = newArray(number_of_files);
circularity_array = newArray(number_of_files);
for (i = 0; i < number_of_files; i++) {
image_file = filelist[i];
if ( endsWith(image_file, ".tif")) {
// process image
open(folder + image_file);
setAutoThreshold("MaxEntropy dark");
setOption("BlackBackground", true);
run("Convert to Mask");
// get rid of single pixels
run("Erode");
run("Dilate");
// measure properties
run("Clear Results");
run("Analyze Particles...", "display");
run("Summarize");
// read out value from table
circularity = getResult("Circ.", nResults() - 4);
// put value and time in array
time_array[i] = i * frame_delay_in_minutes;
circularity_array[i] = circularity;
// close the current image
close();
}
}
Plot.create("Circularity", "Time / min", "Circularity", time_array, circularity_array);
Plot.setColor("green");
Plot.show();
// save the result table
//IJ.renameResults("Summary", "Results");
saveAs("Results", folder + result_csv_file);
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