// Fluorescence Time Trace Extract // This is meant to speed up processing fluorescence imaging data without loading the whole damn file into RAM. That way, you can use it to analyze data on your laptop.... so long as you have a fast internet connection to your data server. // This version frontloads all of the ROI selection so that the slow part of the analysis (opening all the videos and reading out the data) are batched afterwards. This way, the user doesnt need to sit and wait between experiments. // Step 1: Open File (virtual) [ALREADY OPENED] stk = getTitle(); path = getInfo("image.directory"); name = getInfo("image.filename"); addname = File.getNameWithoutExtension(path+"//"+name); print(path); print(addname); patharray = newArray(size); // Step 2: Sum first ~10 images to make a less noisey image to draw on n_avg = 50; run("Z Project...", "stop=&n_avg projection=[Average Intensity]"); avgip = getTitle(); // Step 2: Prompt user for ROIs run("Enhance Contrast", "saturated=0.35"); setTool("ellipse"); waitForUser("Draw ROIs on image. Press 'T' to add them to the ROI manager"); roiManager("show all with labels"); roiManager("save", path+"\\"+addname+"_roi.zip"); // Step 3: Multimeasure ROI intensities run("Set Measurements...", "mean redirect=None decimal=3"); selectWindow(stk); roiManager("show all with labels"); roiManager("multi-measure one"); // Step 4: Save out mean raw intensities of each ROI to a file saveAs("Results", path+"//"+addname+"_results.csv") // Step 5: Save out ROI positions (if necessary) // Step 6: Close everything out. close(avgip)