// Colour deconvolution and ratio // please select the first colour as the one to be filtered out. // G.Landini at bham ac uk // 1 July 2004, 4 Nov 2005, 23 Feb 2009, 23 Nov 2010 a=getTitle(); setBatchMode(true); selectWindow(a); run("Colour Deconvolution", "hide vectors='From ROI' "); selectWindow(a); run("RGB Stack"); selectWindow(a+"-(Colour_1)"); rename("1"); run("RGB Color"); wait(100); // sometimes there is a timing error selectWindow("1"); run("RGB Stack"); run("Conversions...", " "); run("Image Calculator...", "image1="+a+" operation=Divide image2=1 create 32-bit stack"); b=getTitle(); run("Multiply...", "stack value=255"); setMinAndMax(0, 255); selectWindow(a); run("RGB Color"); selectWindow(b); run("8-bit"); run("Convert Stack to RGB"); setBatchMode(false);