Masks - Dilating


I have images of cell where the nucleus and one protein is labeled. The protein in mostly in the nucleus except when I treat the cells with a drug, then the protein localizes to the periphery of the nucleus. I would like to quantify this by drawing a mask around the nucleus (they are not uniformly circular), measure the insensity of the signal, and then increasing the mask by 10% and taking a second measurement of the intensity of the signal.

Basically I would like to draw a mask and then dilate it.

How can I do this? What plug-ins would I need?

Any advice would be great!

You can draw the mask using the freehand tool. Then use the “Create Mask” command (press L for the Command Finder to easily run commands), then “Dilate” repeatedly to dilate the mask as needed.

If you post an image, we might be able to recommend a more automated/quantitative approach, as well.

See Segmentation for an overview of ImageJ segmentation approaches.

1 Like

Thank you. I have tried that, but when I use the “create mask” control, all I get is a separate black and white image of what I drew…

I want to draw an outline around the nucleus, measure the pixel intensity, dilate the outline by a specified amount and then take a second measurement.

Is there a way to do this with the create a mask feature?

Please read the Segmentation overview. The rough workflow is to create the mask (separate black and white image), do any morphological operations (e.g., dilation), then run the “Create Selection” command and then “Restore Selection” back on your original image before measuring it.

1 Like

Thank you! It worked. Now all I need is a keyboard shortcut to dilate the mask a bunch of times…

Actually, you can record a series of actions as a macro. See the Recorder page.

See the Batch Processing page for a general overview of how to perform actions en masse.

Once you have a macro or script in your menu structure, you can also assign a keyboard shortcut to it for easier execution.

Hi @khatera87,

If you want to try to automate the segmentation and measurement steps you may want to have a look at a potential workflow identification step-by-step using auto thresholds you may want to have a look on a basic introduction video here from the last IJ conference. This might be interesting for you because it mainly also works on nuclei.
You may also want to consider that when you run the IJ dilation function several times the shape of your object in the binary image starts to change. This increases with increasing dilation iterations. The BioVoxxel Toolbox (see update sites) offers you a dilation (EDM Binary Operations) which keeps the object shape as good as possible (see time point 1:09:15 in the video).

These procedures you can then put in a macro as Curtis described.

An alternative is thinking about a KNIME workflow for extraction and analysis of your objects of interest