// 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. // Written by Wilson Adams | Siciliano Lab | Oct 2021 //====================================================== // Step 1: Open File (virtual) [ALREADY OPENED] //roiManager("reset"); stk = getTitle(); path = getInfo("image.directory"); name = getInfo("image.filename"); addname = File.getNameWithoutExtension(path+"//"+name); print(path); print(addname); svdir = path+"//processing"; //print(File.exists(svdir)); File.makeDirectory(svdir); // 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"); //run("Select All"); //roiManager("Add"); // whole image ROI setTool("rectangle"); //makeRectangle(437, 272, 490, 457); roiManager("select", 1); waitForUser("Update ROI if needed..."); roiManager("show none"); roiManager("show all with labels"); roiManager("save", svdir+"\\"+addname+"_roi.zip"); //roiManager("reset"); /* // Step 3: Multimeasure ROI intensities run("Set Measurements...", "mean redirect=None decimal=3"); selectWindow(stk); roiManager("show none"); 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); close(stk);