var tab = " \t"; var redthreshold = 40; macro "snap screen and setup measurements [F4]" { run("Capture Screen"); setTool("rectangle"); waitForUser("Draw a rectangle over the area you want to analyze then OK"); run("Crop"); run("Split Channels"); run("Merge Channels...", "c1=[Screenshot (red)] c2=[Screenshot (green)] c3=[Screenshot (blue)] create"); run("Brightness/Contrast..."); setSlice(2); setTool("freehand"); roiManager("reset"); waitForUser("Trace the big green area and hit OK"); roiManager("Add"); setSlice(1); roiManager("show all with labels"); } // end of setup macro /* Next step, user traces each plaque and adds it to ROI Manager by pressing "t". Then user runs the next macro which would output area of entire vessel, area of each plaque, how much red in each, and ratio of plaque to total area. */ macro "Do Measurements] [F5]" { run("Set Measurements...", "area redirect=None decimal=0"); c = roiManager("count"); header = "entirevessel \t plaque \t ratio-plaque-vessel \t red \t ratio-red-plaque"; output = ""; roiManager("Select", 0); // first ROI must be the entire vessel/chamber run("Measure"); output = output + getResult("Area", nResults-1) + tab"; vesselsize = getResult("Area", nResults-1); for (i=1; i