/* * 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 pre-established
parameter dataset?", choices={"No", "Yes"}, persist=true, style="radioButtonHorizontal") importPD #@ String (label="Load llumination
correction reference
image?", 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"); 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; i count+1) { index1=indexOf(tifArray[count], "wv "); index2=lastIndexOf(tifArray[count], " - "); channels[count]=substring(tifArray[count], index1+3, index2); count++; } //add an 'Empty' option into the channels name array for (i=0; i=imagesxfield) { channels[i]="Empty"; } } //create a channel array without the 'Empty' option channelsSlice=Array.slice(channels, 0, channels.length-1); //set some parameter menu arrays threshold=getList("threshold.methods"); pattern=newArray(4); flat_field=newArray(4); //create a flat-field array with a 'None' option if(illumCorr=="Yes") { illumCorrPath=getDirectory("Choose the folder containing the flat-field images"); illumCorrList=getFileList(illumCorrPath); concatNone=newArray("None"); illumCorrList=Array.concat(concatNone,illumCorrList); } else { illumCorrList=newArray("None"); } //Extract values from a parameter dataset file if(importPD=="Yes") { parametersDatasetPath=File.openDialog("Choose the parameter dataset file:"); //parameter selection (pre-established) parametersString=File.openAsString(parametersDatasetPath); parameterRows=split(parametersString, "\n"); parameters=newArray(parameterRows.length); 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(); //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.show(); selectionMode=Dialog.getRadioButton(); if(mode=="Pre-Analysis (parameter tweaking)") { maxRandomFields=Dialog.getNumber(); measure_test=Dialog.getChoice(); split_test=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"); } }