resize_dict

resize_dict#

stimupy.utils.resize_dict(dct, factor, keys=('img', '*mask'))#

Return a copy of an array, resized by the given factor. Every value is repeated factor[d] times along dimension d.

Parameters:
  • dct (dict) – dict containing arrays to be resized

  • factor (tuple of 2 ints) – the resize factor in the y and x dimensions

  • keys (Sequence[String, String] or String) – keys in dict for images to be padded

Returns:

same as input dict but with larger key-arrays according to “(arr.shape[0] * factor[0], arr.shape[1] * factor[1])” and updated keys for “visual_size” and “shape”

Return type:

dict[str, Any]