/* * Cell_Proliferation * Authors: Pau Carrillo-Barberà, José M. Morante-Redolat, José F. Pertusa * Department of Cellular & Functional Biology * University of Valencia (Valencia, Spain) */ /* * This macro is a high-throughput screening tool for cell proliferation assays. * It is based on nucleoside analogue pulse alone or in combination with up to * two additional nuclear markers. */ macro "Cell_Proliferation" { //choose a macro mode and a directory #@ String (label=" ", value="High Content Screening
Cell Proliferation
", visibility=MESSAGE, persist=false) heading #@ String(label="Select mode:", choices={"Analysis", "Pre-Analysis (parameter tweaking)"}, style="radioButtonVertical") mode #@ File(label="Select a directory:", style="directory") dir #@ String (label="Project", choices={"Filtering", "StarDist", "Load"}, persist=true, style="radioButtonHorizontal") project #@ String (label="Load function", choices={"No", "Yes"}, value="Yes", persist=true, style="radioButtonHorizontal") illumCorr #@ String (label="Save ROIs?", choices={"No", "Yes"}, value="Yes", persist=true, style="radioButtonHorizontal") saveROIs #@ String (label=" ", value="", visibility=MESSAGE, persist=false) logo #@ String (label=" ", value="Neuromolecular Biology Lab
ERI BIOTECMED - Universitat de València (Spain)
", visibility=MESSAGE, persist=false) message //set options setOption("ExpandableArrays", true); setOption("BlackBackground", false); setOption("ScaleConversions", true); roiManager("reset"); print("\\Clear"); run("Clear Results"); close("*"); //File management //Identification of the TIF files //create an array containing the names of the files in the directory path list = getFileList(dir); Array.sort(list); tifFiles=0; //count the number of TIF files for (i=0; idocumentation" +" for help"; Dialog.addHelp(html); Dialog.show() projectName=Dialog.getString(); pattern[0]=Dialog.getChoice(); pattern[1]=Dialog.getChoice(); pattern[2]=Dialog.getChoice(); pattern[3]=Dialog.getChoice(); if (project == "Filtering") { normalize=Dialog.getCheckbox(); gaussianNuclei=Dialog.getNumber(); thresholdNuclei=Dialog.getChoice(); erodeNuclei=Dialog.getNumber(); openNuclei=Dialog.getNumber(); watershedNuclei=Dialog.getCheckbox(); } else { overlap_threshold=Dialog.getNumber(); } size=Dialog.getString(); flat_field[0]=Dialog.getChoice(); flat_field[1]=Dialog.getChoice(); flat_field[2]=Dialog.getChoice(); flat_field[3]=Dialog.getChoice(); if (pattern[2]=="Empty" && pattern[3] != "Empty") { pattern[2]=pattern[3]; pattern[3]="Empty"; flat_field[2]=flat_field[3]; flat_field[3]="None"; } pattern_fullname=newArray("Empty", "Empty", "Empty", "Empty"); for (i=0; i=10) { maxRandomFields=10; } else { maxRandomFields=fieldsxwell; } Dialog.addMessage("Random fields per well:"); Dialog.addSlider("", 1, maxRandomFields, maxRandomFields); measurements=newArray("Area", "Circ.", "AR", "Solidity", "Round", "Mean", "IntDen"); Dialog.addChoice("Measure", measurements, "Mean"); Dialog.addNumber("Split threshold", 250); Dialog.addNumber("Set Line Width", 3); } Dialog.addHelp(html); Dialog.show(); selectionMode=Dialog.getRadioButton(); if(mode=="Pre-Analysis (parameter tweaking)") { maxRandomFields=Dialog.getNumber(); measure_test=Dialog.getChoice(); split_test=Dialog.getNumber(); roi_line_width=Dialog.getNumber(); } for (i=0; i=0; i--) { if (number==randomArray[i]) { recurrent=true; } } if(recurrent==false || count==0) { // open images channels_test=newArray(2); for (i=0; i max) { roiDiscard[discardCount]=i; discardCount++; } } if (discardCount != 0) { roiManager("select", roiDiscard); roiManager("delete"); } run("Clear Results"); } function excludeEdges() { roiEdge=newArray(); run("Set Measurements...", "bounding display redirect=None decimal=2"); roiManager("deselect"); roiManager("measure"); nROI=roiManager("count"); getDimensions(width, height, channels, slices, frames); toScaled(width); toScaled(height); roiEdgeCount=0; for (i=0; i= width || by + iHeight >= height) { roiEdge[roiEdgeCount]=i; roiEdgeCount++; } } if (roiEdgeCount != 0) { roiManager("select", roiEdge); roiManager("delete"); } run("Clear Results"); } function displayOutlines (image1, image2, getMeasure, threshold, line_width) { index1=indexOf(image1, "("); index2=indexOf(image1, " wv"); well=substring(image1, 0, index1)+ ")"; field=substring(image1, index1, index2)+ ")"; name=well + " " +field; run("Merge Channels...", "c1=["+image2+"] c3=["+image1+"] keep"); rename(name); run("Set Measurements...", "area mean shape integrated display redirect=["+image2+"] decimal=2"); roiManager("deselect"); roiManager("measure"); nROI=roiManager("count"); roiManager("Set Line Width", line_width); for (a=0; a threshold) { roiManager("select", a); roiManager("Set Color", "orange"); roiManager("draw"); } else { roiManager("select", a); roiManager("Set Color", "cyan"); roiManager("draw"); } } } function hours_minutes_seconds(seconds) { hours=seconds/3600; hours_floor=floor(hours); remaining_seconds=seconds-(hours_floor*3600); remaining_minutes=remaining_seconds/60; minutes_floor=floor(remaining_minutes); remaining_seconds=remaining_seconds-(minutes_floor*60); hours_floor=d2s(hours_floor, 0); minutes_floor=d2s(minutes_floor, 0); remaining_seconds=d2s(remaining_seconds, 0); if (lengthOf(hours_floor) < 2) hours_floor="0"+hours_floor; if (lengthOf(minutes_floor) < 2) minutes_floor="0"+minutes_floor; if (lengthOf(remaining_seconds) < 2) remaining_seconds="0"+remaining_seconds; return hours_floor+":"+minutes_floor+":"+remaining_seconds; } }