avg_target_values

avg_target_values#

stimupy.utils.masks.avg_target_values(stim, mask_key='target_mask', f_average=np.median)#

Average pixel value in each target region of stimulus

Parameters:
  • stim (dict[str: Any]) – stimulus-dict with at least “img” and “mask” containing the stimulus image and integer-mask, respectively.

  • mask_key (str) – string with mask-key name

  • f_average (function, default=numpy.median) – How to average/summarise the pixels in each target region

Returns:

each entry in the list is the average value of pixels in target region, index in the list is the integer index in the mask

Return type:

list[float]

See also

avg_img_values