Skip to content

Commit

Permalink
docs: docstring for combine_masks
Browse files Browse the repository at this point in the history
  • Loading branch information
JorisVincent committed Apr 3, 2023
1 parent 53dea7d commit c1aa531
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions stimupy/components/__init__.py
Expand Up @@ -185,6 +185,29 @@ def mask_regions(


def combine_masks(*masks):
"""Combines several masks into a singular mask
Increments mask-indices, such that the resulting mask contains consecutive integer
indices.
Masks are combined in order.
Parameters
----------
mask_1, mask_2, ... : numpy.ndarray
Masks to be combined
Returns
-------
numpy.ndarray
Combined mask, where integer indices are in order of the input masks.
Raises
------
ValueError
if masks do not all have the same shape (in pixels)
ValueError
if multiple masks index the same pixel
"""
# Initialize
combined_mask = np.zeros_like(masks[0])
for mask in masks:
Expand Down

0 comments on commit c1aa531

Please sign in to comment.