// Multicolor ROI Map function MultiColorROImap(img) { /* Given an example image template and a list of ROIs, this function returns a mask where the intensity value of each ROI is incremented by a value of one. With a colormap, it allows visualization of time series data along side spatial data without needing a live movie. ====================================== // for troubleshooting */ // img = getTitle(); // Input Image selectWindow(img); Stack.getDimensions(width, height, channels, slices, frames); // Make Mask Template newImage('mask', '16-bit', width, height, 1); mask = getTitle(); selectWindow(mask); roiManager("show all with labels"); roiManager("fill"); // Distance Transform Watershed run("Distance Transform Watershed", "distances=[City-Block (1,2)] output=[16 bits] normalize dynamic=1 connectivity=4"); run("Fire"); map = getTitle(); rename(img+_ROIlegend); close(mask) }