I am working on what should be a fairly simple macro in which I am to do a couple of things:
- Split a multi-channel image and background subtract each image, using a user-selected ROI (these get named “mRFP1” and “smURF”)
- Have the user draw ROIs around cells and add them to the ROI manager
- Use the multi-measure tool to measure the mean intensity in each ROI in each channel
- Take all of the pixels in each ROI and convert into a 2-column table, where each row is a single pixel in the ROI, and each column is the intensity of each channel for each pixel.
I’ve got steps 1 & 2 working well, but I cannot get step 3 to work as desired and do not know how to even start with step 4.
For Step 3 my current code is:
run("Set Measurements...", "mean redirect=None decimal=3"); setTool("freehand"); selectWindow("smURF"); waitForUser("Add cells to ROI manager, then press Okay to continue...."); roiManager("Measure"); selectWindow("mRFP1"); roiManager("Measure");
The issue I have is that this code puts the mRFP1 measurements after the smURF measurements - e.g. if I have 2 ROIs, the results from smURF are in rows 1&2, and the results from mRFP1 are in rows 3&4. What I want is for the results for the same ROI to appear on the same row, but in separate columns, in the result window. How do I do that?
And any advice on how to do step #4 is welcome.