Commit 348e0b20 authored by rhaase's avatar rhaase

added results for the count-round-exercise

parent c79d469b
File, Number of round cells, Number of elongated cells
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0000.tif,2, 38
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0001.tif,5, 32
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0002.tif,3, 36
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0003.tif,5, 38
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0004.tif,9, 39
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0005.tif,10, 47
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0006.tif,17, 46
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0007.tif,14, 49
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0008.tif,15, 47
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0009.tif,16, 45
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0010.tif,15, 48
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0011.tif,19, 45
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0012.tif,17, 45
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0013.tif,24, 38
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0014.tif,22, 42
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0015.tif,21, 41
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0016.tif,23, 40
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0017.tif,25, 41
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0018.tif,23, 42
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0019.tif,23, 40
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0020.tif,21, 44
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0021.tif,23, 50
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0022.tif,23, 45
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0023.tif,24, 45
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0024.tif,23, 43
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0025.tif,27, 40
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0026.tif,19, 43
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0027.tif,23, 37
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0028.tif,26, 38
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0029.tif,26, 41
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0030.tif,27, 35
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0031.tif,23, 42
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0032.tif,26, 39
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0033.tif,19, 41
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0034.tif,29, 35
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0035.tif,37, 36
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0036.tif,36, 35
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0037.tif,41, 36
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0038.tif,38, 40
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0039.tif,38, 33
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0040.tif,43, 40
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0041.tif,42, 36
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0042.tif,48, 38
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0043.tif,50, 33
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0044.tif,45, 38
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0045.tif,45, 33
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0046.tif,45, 36
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0047.tif,47, 42
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0048.tif,48, 34
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0049.tif,49, 36
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0050.tif,51, 35
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0051.tif,48, 42
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0052.tif,47, 40
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0053.tif,46, 36
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0054.tif,46, 39
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0055.tif,48, 41
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0056.tif,46, 39
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0057.tif,47, 38
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0058.tif,51, 36
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0059.tif,45, 36
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0060.tif,41, 37
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0061.tif,45, 36
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0062.tif,45, 34
C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/rounding_assay0063.tif,48, 29
//
// This script analyses a time lapse of images showing yeast cells.
// It counts the number of round cells over time and visualises
// cells in different colors depending on their features:
// * red: too small or too large
// * yellow: round (dying)
// * green: elongated (alive)
//
// Robert Haase, rhaase@mpi-cbg.de
// May 2019
//
// configuration
input_folder = "C:/structure/teaching/lecture_applied_bioimage_analysis_2020/03_Feature_extraction_and_ImageJ_Macro/example_images/rounding_assay/";
output_folder = "C:/structure/teaching/lecture_applied_bioimage_analysis_2020/04_Adv_ImageJ_Macro/example_code/";
result_file = "result_shape_count.csv";
// how are round cells identified?
maximum_aspect_ratio = 2;
// size constraints for yeast-cells
minimum_cell_size = 10; // in pixels
maximum_cell_size = 200; // in pixels
// prepare resulting CSV file
if ( File.exists(output_folder + result_file) ) {
File.delete(output_folder + result_file);
}
File.append("File, Number of round cells, Number of elongated cells", output_folder + result_file);
// access the folder
filelist = getFileList(input_folder);
for (i = 0; i < lengthOf(filelist); i++) {
//for (i = 30; i < 31; i++) {
filename = input_folder + filelist[i];
if (endsWith(filename, ".tif")) {
// open an image from the rounding assay
open(filename);
// save the window title for later - we want to switch to this image
original_image_title = getTitle();
// duplicate the image and segment it
run("Duplicate...", " ");
setAutoThreshold("Triangle dark");
run("Convert to Mask");
// binary closing
run("Dilate");
run("Dilate");
run("Erode");
run("Erode");
// connected components analysis -> send results to ROI Manager
run("Analyze Particles...", " show=Nothing add");
// switch back to original image
selectWindow(original_image_title);
roiManager("Show None");
number_of_round_regions = 0;
number_of_elongated_regions = 0;
number_of_regions = roiManager("count");
for (j = 0; j < number_of_regions; j++ ) {
// measure area ( = pixel count) and shape
run("Set Measurements...", "area shape redirect=None decimal=3");
roiManager("Select", j);
roiManager("Measure");
pixel_count = getResult("Area", nResults - 1);
aspect_ratio = getResult("AR", nResults - 1);
// visualise if ROIs are too small or not
if (pixel_count > minimum_cell_size && pixel_count < maximum_cell_size) {
if (aspect_ratio > maximum_aspect_ratio) {
number_of_elongated_regions ++;
Overlay.addSelection("green");
} else {
number_of_round_regions ++;
Overlay.addSelection("yellow");
}
} else {
Overlay.addSelection("red");
}
}
File.append(filename + "," + number_of_round_regions + ", " + number_of_elongated_regions , output_folder + result_file);
// clean up after the job is done
if (number_of_regions > 0) {
roiManager("deselect");
roiManager("delete");
}
run("Clear Results");
run("Flatten");
save(output_folder + filelist[i] + "_result_visualisation.jpg");
run("Close All");
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment