Skip to content

Commit

Permalink
Add origin to mask_elements
Browse files Browse the repository at this point in the history
  • Loading branch information
JorisVincent committed Dec 14, 2022
1 parent 0560fc2 commit 95ae23f
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions stimuli/components/__init__.py
Expand Up @@ -85,10 +85,11 @@ def image_base(visual_size=None, shape=None, ppd=None, rotation=0.0, origin=None
def mask_elements(
orientation,
edges,
rotation=0.0,
shape=None,
visual_size=None,
ppd=None,
rotation=0.0,
origin=None,
):
"""Generate mask with integer indices for consecutive elements
Expand All @@ -98,15 +99,18 @@ def mask_elements(
which dimension to mask over
edges : Sequence[Number]
upper-limit of each consecutive elements
rotation : float, optional
angle of rotation (in degrees) of segments,
counterclockwise away from 3 o'clock, by default 0.0
visual_size : Sequence[Number, Number], Number, or None (default)
visual size [height, width] of image, in degrees
ppd : Sequence[Number, Number], Number, or None (default)
pixels per degree [vertical, horizontal]
shape : Sequence[Number, Number], Number, or None (default)
shape [height, width] of image, in pixels
rotation : float, optional
angle of rotation (in degrees) of segments,
counterclockwise away from 3 o'clock, by default 0.0
origin : Sequence[Number, Number], Number, or None (default)
placement of origin [height,width from topleft] to calculate distances from.
If None, set to center of visual_size
Returns
----------
Expand All @@ -116,7 +120,9 @@ def mask_elements(
"""

# Set up coordinates
base = image_base(shape=shape, visual_size=visual_size, ppd=ppd, rotation=rotation)
base = image_base(
shape=shape, visual_size=visual_size, ppd=ppd, rotation=rotation, origin=origin
)
distances = base[orientation]

# Mark elements with integer idx-value
Expand Down

0 comments on commit 95ae23f

Please sign in to comment.