// Generic multiple colour co-localisation analysis macro // Analyses a series of greyscale slices in a stack, each corresponding to a colour channel // Expandable to any number of colour channels (slices) // Provides number of pixels above threshold for each combination of colour channels // Data provided is in bins corresponding to (for three channels): // // Bin Ch 1 Ch 2 Ch 3 // 0 - - - // 1 + - - // 2 - + - // 3 + + - // 4 - - + // 5 + - + // 6 - + + // 7 + + + // Set threshold values for each colour channel (each slice) // Add extra thresholds for more than 5 channels Threshold = newArray(6); Threshold[1] = 10; Threshold[2] = 40; Threshold[3] = 50; Threshold[4] = 50 Threshold[5] = 50; // Check for RGB image and convert to greyscale stack // Where Ch 1 = red, Ch 2 = green, Ch 3 = blue // Breaks if image name includes "(RGB)" image = getImageID(); selectImage(image); info = getInfo(); if (indexOf(info, "(RGB)") >1) { run("RGB Split"); run("Convert Images to Stack"); exit("Draw your ROI and rerun the macro");} stack = getImageID(); selectImage(stack); slices = nSlices(); results = newArray(pow(2, slices)); Greyscales = 255; if (indexOf(info, "pixel: 16")>1) {Greyscales = 65535;} //run("Measure"); setBackgroundColor(0,0,0); for (i =0; i