stimupy.utils#
Modules#
Functions#
|
Adapt intensity range of image |
|
Adapt intensity range of image |
|
Adapt Michelson contrast of image |
|
Adapt Michelson contrast of image in dict |
|
Adapt normalized rms contrast of image (std divided by mean) |
|
Adapt normalized rms contrast of image (std divided by mean) |
|
Adapt rms contrast of image (std) |
|
Adapt rms contrast of image (std) |
|
Remove padding by c |
|
Isolate all image values/pixels, per target region specified in integer mask |
|
Bessel function of the first kind of real order and complex argument. |
|
Hash (md5) array values, and return hex-checksum |
|
Save a 2D numpy array as a grayscale image file. |
|
Save a numpy array to a mat-file. |
|
Save a numpy array to npy-file. |
|
Save a numpy array to a pickle-file. |
|
Hash (md5) values of arrays specified in keys, and save only the hex |
|
Average values of pixels in image, per target region in integer mask |
|
Average pixel value in each target region of stimulus |
|
Function to create a 2d bandpass filter in the frequency domain |
|
Compute the pixels per degree in a presentation setup i.e., the number of pixels in the central one degree of visual angle |
|
Convolve two N-dimensional arrays using FFT |
|
|
|
Return a dict with key-arrays rotated by nrots*90 degrees. |
|
Get all argument names for a given function |
|
Isolate only image pixels specified by a binary mask |
|
All integer factors of integer n |
|
Calculate length (pixels) from visual angle (degrees) and pixels-per-degree |
|
Calculate lengths (pixels) from visual angles (degrees) and pixels-per-degree |
|
Transform luminance values into Munsell values. |
|
Create two-sided version of a stimulus function |
|
Transform Munsell values to luminance values. |
|
Pad image by specified amount(s) of pixels |
|
Pad image by specified degrees of visual angle |
|
Pad images in dictionary by specified amount(s) of pixels Can specify different amount (before, after) each axis. |
|
Pad images in dictionary by specified degrees of visual angle |
|
Pad images in dictionary to a resulting specified shape in pixels |
|
Pad images in dictionary to specified visual size in degrees visual angle |
|
Pad image to a resulting specified shape in pixels |
|
Pad image to specified visual size in degrees visual angle |
|
|
|
Plots visual comparison of two image-arrays |
|
Plot a stimulus |
|
Plot multiple stimuli |
|
Calculate pixels-per-degree from length (pixels) and visual angle (degrees) |
|
Calculate resolution (ppd) from given shape (pixels) and visual size (degrees) |
|
Remove padding by c |
|
Return a copy of an array, resized by the given factor. |
|
Return a copy of an array, resized by the given factor. |
|
Resolves the full resolution, for 2 givens and 1 unknown |
|
Resolves the full resolution, for 2 givens and 1 unknown |
|
Resolves the full resolution ("shape", "ppd", "visual_size"), for 2 givens and 1 unknown in the input dictionary |
|
Return a dict with key-arrays rolled by shift in axes. |
|
Return a dict with key-arrays rotated by nrots*90 degrees. |
|
Round array to provided values (vals) |
|
Calculate shape (pixels) from given visual size (degrees) and pixels-per-degree |
|
Return a dict with resized key-arrays by the given factor. |
|
Create a dictionary by stripping it from all keys that are not also an argument to the provided function |
|
Save stimulus-dict(s) as (pretty) JSON |
|
Save stimulus-dict(s) as mat-file |
|
Save stimulus-dict(s) as pickle-file |
|
Applies a transparency to image at specified (mask) location if provided |
|
Asserts that the combined specification of resolution is geometrically valid. |
|
Asserts that the combined specification of resolution in dict is geometrically valid. |
|
Asserts that the combined specification of resolution is geometrically valid. |
|
Put specification of ppd in canonical form, if possible |
|
Put specification of shape (in pixels) in canonical form, if possible |
|
Put specification of visual size in canonical form, if possible |
|
Calculate visual angle (degrees) from length (pixels) and pixels-per-degree |
|
Calculate visual sizes (degrees) from given shapes (pixels) and pixels-per-degree |
|
Calculate visual size (degrees) from given shape (pixels) and pixels-per-degree |