img_values#
- stimupy.utils.masks.img_values(img, mask)#
Isolate only image pixels specified by a binary mask
- Parameters:
img (numpy.ndarray) – Image-array of pixel values to be masked
mask (numpy.ndarray) – Array of same size as img. All non-zero pixels/values are treated as ones in a binary bit mask.
- Returns:
numpy.ndarray of same size as img. All bits corresponding to zero bits in the mask are set to NaN.
- Return type: