contrast_conversions#
Functions#
|
Applies a transparency to image at specified (mask) location if provided |
|
Adapt Michelson contrast of image |
|
Adapt rms contrast of image (std) |
|
Adapt normalized rms contrast of image (std divided by mean) |
|
Adapt intensity range of image |
|
Adapt Michelson contrast of image in dict |
|
Adapt rms contrast of image (std) |
|
Adapt normalized rms contrast of image (std divided by mean) |
|
Adapt intensity range of image |
- stimupy.utils.contrast_conversions.transparency(img, mask=None, alpha=0.5, tau=0.2)[source]#
Applies a transparency to image at specified (mask) location if provided
- Parameters:
img (np.array) – image to which transparency will be applied
mask (np.array or None (default)) – if not None, transparency will be provided at non-zero locations provided in this mask
alpha (Number) – alpha of transparency (i.e. how transparent the medium is), default 0.2
tau (Number) – tau of transparency (i.e. value of transparent medium), default 0.5
- Return type:
img with the applied transparency
- stimupy.utils.contrast_conversions.adapt_michelson_contrast(img, michelson_contrast, mean_luminance=None)[source]#
Adapt Michelson contrast of image
- Parameters:
- Returns:
img – image with adapted michelson contrast and mean luminance if passed
- Return type:
np.ndarray
- stimupy.utils.contrast_conversions.adapt_rms_contrast(img, rms_contrast, mean_luminance=None)[source]#
Adapt rms contrast of image (std)
- Parameters:
- Returns:
img – image with adapted rms contrast and mean luminance if passed
- Return type:
np.ndarray
- stimupy.utils.contrast_conversions.adapt_normalized_rms_contrast(img, rms_contrast, mean_luminance=None)[source]#
Adapt normalized rms contrast of image (std divided by mean)
- Parameters:
- Returns:
img – image with adapted rms contrast and mean luminance if passed
- Return type:
np.ndarray
- stimupy.utils.contrast_conversions.adapt_intensity_range(img, intensity_min=0.0, intensity_max=1.0)[source]#
Adapt intensity range of image
- stimupy.utils.contrast_conversions.adapt_michelson_contrast_dict(stim, michelson_contrast, mean_luminance=None)[source]#
Adapt Michelson contrast of image in dict
- Parameters:
- Returns:
dict with the stimulus (key: “img”), Michelson contrast (key: “michelson_contrast”), mean luminance (“mean_luminance”) and additional keys containing stimulus parameters
- Return type:
- stimupy.utils.contrast_conversions.adapt_rms_contrast_dict(stim, rms_contrast, mean_luminance=None)[source]#
Adapt rms contrast of image (std)
- Parameters:
- Returns:
dict with the stimulus (key: “img”), RMS contrast (key: “rms_contrast”), mean luminance (“mean_luminance”) and additional keys containing stimulus parameters
- Return type:
- stimupy.utils.contrast_conversions.adapt_normalized_rms_contrast_dict(stim, rms_contrast, mean_luminance=None)[source]#
Adapt normalized rms contrast of image (std divided by mean)
- Parameters:
- Returns:
dict with the stimulus (key: “img”), RMS contrast (key: “rms_contrast”), mean luminance (“mean_luminance”) and additional keys containing stimulus parameters
- Return type:
- stimupy.utils.contrast_conversions.adapt_intensity_range_dict(stim, intensity_min=0.0, intensity_max=1.0)[source]#
Adapt intensity range of image
- Parameters:
- Returns:
dict with the stimulus (key: “img”), intensity range (key: “intensity_range”), and additional keys containing stimulus parameters
- Return type: