I’m new to imagej macros and have a small but major problem with my nuclear selection program.
I have written a macro which:
- Creates a mask of all nuclei in an image
- Creates a selection mask using a cytoplasm stain
- Applies the cytoplasm selection over the nuclei mask
- Clears outside the cytoplasm selection (i.e removing all nuclei not with stained cytoplasm)
- It then records the fluorescent intensity within this specific cell type nuclear mask
However, currently some nuclei which are close to the edge/half in half outside of the cytoplasmic stain are cropped because it clears the part of the nucleus that is outside of the cytoplasmic selection.
Is there a command to keep the whole nucleus if that nucleus is touching the cytoplasm selection and only remove those nuclei which are not touching any cytoplasm?