/* * 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="Load function", choices={"No", "Yes"}, value="Yes", persist=true, style="radioButtonHorizontal") illumCorr #@ String (label="Load project", choices={"No", "Yes"}, persist=true, style="radioButtonHorizontal") importPD #@ 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"); roiManager("reset"); 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(); normalize=Dialog.getCheckbox(); gaussianNuclei=Dialog.getNumber(); thresholdNuclei=Dialog.getChoice(); erodeNuclei=Dialog.getNumber(); openNuclei=Dialog.getNumber(); watershedNuclei=Dialog.getCheckbox(); 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<4; i++) { for (j= 0; j<4; j++) { if (startsWith(channels_fullname[i], pattern[j])) { pattern_fullname[i]=channels_fullname[i]; } } } //check the channel selection if(pattern[0]==pattern[1]) { beep(); exit("Nuclei ["+pattern[0]+"] and nucleoside analogue ["+pattern[1]+"] channels can not be the same") } else if (pattern[0]==pattern[2] || pattern[0]==pattern[3]) { beep(); exit("Nuclei ["+pattern[0]+"] and addititional marker ["+pattern[2]+"]/["+pattern[3]+"] channels can not be the same") } else if (pattern[1]==pattern[2] || pattern[1]==pattern[3]) { beep(); exit("Nucleoside analogue ["+pattern[1]+"] and addititional marker ["+pattern[2]+"]/["+pattern[3]+"] channels can not be the same") } else if (pattern[2]==pattern[3] && pattern[2]!="Empty") { beep(); exit("Addititional marker ["+pattern[2]+"]/["+pattern[3]+"] channels can not be the same") } //get min and max sizes size=min_max_size(size); //Create a parameter dataset file title1 = "Parameter dataset"; title2 = "["+title1+"]"; f = title2; run("Table...", "name="+title2+" width=500 height=500"); print(f, "Project\t" + projectName); print(f, "Nuclei\t" + pattern[0]); print(f, "Nucleoside analogue\t" + pattern[1]); print(f, "Marker1\t" + pattern[2]); print(f, "Marker2\t" + pattern[3]); print(f, "Enhance (nuclei)\t" + normalize); print(f, "Gaussian (nuclei)\t" + gaussianNuclei); print(f, "Threshold (nuclei)\t" + thresholdNuclei); print(f, "Erode (nuclei)\t" + erodeNuclei); print(f, "Open (nuclei)\t" + openNuclei); print(f, "Watershed (nuclei)\t" + watershedNuclei); print(f, "Size\t" + size[0]+"-"+size[1]); print(f, "Flat-field (nuclei)\t" + flat_field[0]); print(f, "Flat-field (nucleoside analogue)\t" + flat_field[1]); print(f, "Flat-field (marker1)\t" + flat_field[2]); print(f, "Flat-field (marker2)\t" + flat_field[3]); //save as TXT saveAs("txt", dir+File.separator+projectName); selectWindow(title1); run("Close"); //'Well Selection' dialog box selectionOptions=newArray("Select All", "Include", "Exclude"); fileCheckbox=newArray(nWells); selection=newArray(nWells); title = "Select Wells"; Dialog.create(title); Dialog.addRadioButtonGroup("", selectionOptions, 3, 1, selectionOptions[0]); Dialog.addCheckboxGroup(sqrt(nWells) + 1, sqrt(nWells) + 1, wellName, selection); if(mode=="Pre-Analysis (parameter tweaking)") { if(fieldsxwell>=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", 500); 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 threshold) { roiManager("select", a); roiManager("Set Color", "orange"); roiManager("draw"); } else { roiManager("select", a); roiManager("Set Color", "cyan"); roiManager("draw"); } } roiManager("reset"); run("Clear Results"); } }