I have a mask corresponding to an image patch and I would like to further modify the mask to exclude from the mask all voxels that correspond to image voxels outside a range of intensities. What is the best way to accomplish this?
You can use iterators to go through the input image and mask, and set appropriate values to pixels in the output image. An example which uses iterators.
If you don’t want to do that, you can threshold your input again, then do some operations on the two masks (multiply or subtract) to get the desired output. An example which uses a mask. A list of intensity-based filters.