stack_dicts

stack_dicts#

stimupy.utils.stack_dicts(dct1, dct2, direction='horizontal', keys=('img', '*mask'), keep_mask_indices=False)#

Return a dict with resized key-arrays by the given factor. Every value is repeated factor[d] times along dimension d.

Parameters:
  • dct1 (dict) – dict containing arrays to be stacked

  • dct2 (dict) – dict containing arrays to be stacked

  • direction (str) – stack horizontal(ly) or vertical(ly) (default: horizontal)

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

Returns:

same as input dict1 but with stacked key-arrays and updated keys for “visual_size” and “shape”

Return type:

dict[str, Any]