stimupy.utils.export#
Functions#
Hash (md5) array values, and return hex-checksum |
|
Save a 2D numpy array as a grayscale image file. |
|
Save a numpy array to npy-file. |
|
Save a numpy array to a mat-file. |
|
Save a numpy array to a pickle-file. |
|
Hash (md5) values of arrays specified in keys, and save only the hex |
|
Save stimulus-dict(s) as (pretty) JSON |
|
Save stimulus-dict(s) as mat-file |
|
Save stimulus-dict(s) as pickle-file |
- array_to_checksum(arr)[source]#
Hash (md5) array values, and return hex-checksum
- Parameters:
arr (numpy.ndarray) – array to be hashed.
- Returns:
hex-string representation of hash (MD5) of given array
- Return type:
- array_to_image(arr, filename, format=None, norm=True)[source]#
Save a 2D numpy array as a grayscale image file.
- Parameters:
arr (numpy.ndarray) – array to be exported. Values will be cropped to [0,255].
filename (Path or str) – (full) path to the file to be created.
norm (bool) – multiply array by 255, by default True
- array_to_npy(arr, filename)[source]#
Save a numpy array to npy-file.
- Parameters:
arr (numpy.ndarray) – array to be exported.
filename (Path or str) – (full) path to the file to be created.
- array_to_mat(arr, filename)[source]#
Save a numpy array to a mat-file.
- Parameters:
arr (numpy.ndarray) – array to be exported.
filename (Path or str) – (full) path to the file to be created.
- array_to_pickle(arr, filename)[source]#
Save a numpy array to a pickle-file.
- Parameters:
arr (numpy.ndarray) – array to be exported.
filename (Path or str) – (full) path to the file to be created.
- arrays_to_checksum(stim, keys=['img', 'mask'])[source]#
Hash (md5) values of arrays specified in keys, and save only the hex