//This FIJI script is designed to take RFP and GFP images from GEDI data and output 1 CSV
//quantifying the fluorescent intensities from both channels
//It is specifically written for images of SF8628 cells that have been exposed to 25 Gy and seeded //in 96 well plates at a 2500 cell per well density
//Designate where/what directory/folder the CSV output will be saved
#@ File(label = "Output directory", style = "directory") output
//Make a list of images so it can be called by an integer value
list = getList("image.titles");
//The list integers start from 0, so double check which images are opening first by showing the //array, this will dictate what image in the list you are using below
//Select the open image window by its integer value from the list to do further processing on, in //this case we are generating cell masks from the RFP channel which is the second image in our //image list, remember the list starts with 0 and the first image in the order that we opened it is
// GFP, so to select the 2nd image that is open we would select the list integer of "1" to designate selecting the RFP image.
//In this case we first want to duplicate the image to threshold and leave the original untouched //because we will be overlaying the mask
//on top of it to extract fluorescence intensity data
//Command to duplicate the open image
run("Duplicate...", " ");
//Manually set the threshold, the minimum value is one that should be tested/iterated for what //works best to capture your cell mask of interest
setThreshold(1139, 65535);
setOption("BlackBackground", true);
///Analyze all the particles in your image to generate ROIs, we will use these ROIs to place on the //original image and measure the fluorescent intensity
run("Analyze Particles...", "size=150-Infinity display clear include summarize add");
//The parameters under analyze particles can be changed to exclude a certain size, this will //need to be tested depending on the size of your object and the magnification used,
//and what you are interested in. In our test case, we have measured our cells and want the //minimum cutoff for particle counting to be 150.
//If there are artifacts in your image that you can avoid using, the size or feret diameter filter this is //a good place to implement that
//You need to set the types of measurements that will be extracted after measuring the image //mask, these can be changed, the best way is to record a macros
//and select specifically what you want measured and then paste that macros line here
run("Set Measurements...", "area mean standard min feret's integrated area_fraction display redirect=None decimal=3");
//Clear the results becasue we do not want mask measurements in the final CSV file
//Select the original image, in this case it is the RFP image
//Overlay the ROIs from the ROI manager onto the image of interest
//Now measure all of our ROIs on our new image
//Now we select the GFP image, in this case its the first image that we opened, so the list index is //"0"
//Again, overlay the ROIs onto the selected GFP image "0" and measure them
//We want the title of the image in our filename, in this case the title of the image has the expt //details that we can parse out later with an R script
//so we use the following command to save the title of the image into a variable called fileName that we can use to name our CSV of the results file
saveAs("Results", output + fileName + ".csv");
//Close all image windows