# Mask std\_dev question

**URL:** <https://mworks.discourse.group/t/mask-std-dev-question/253>\
**Category:** Support\
**Created:** [May 6, 2019, 1:39pm UTC](https://mworks.discourse.group/t/mask-std-dev-question/253 "2019-05-06T13:39:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [May 6, 2019, 1:39pm UTC](https://mworks.discourse.group/t/mask-std-dev-question/253/1 "2019-05-06T13:39:51Z")

</div>

Hi Chris,

I looked at the online doc but couldn’t easily determine the answer to this:

For a gaussian mask stimulus, there is a size and a std dev parameter.

Size is the full length along one axis, correct? So the full stimulus square is x\_size by y\_size (not x\_size_2, y\_size_2), yes?

Re: std\_dev parameter: does mask have an actual standard dev on screen (in degrees) that is x\_size_std\_dev? So if we set std\_dev to 0.3, and size is 10, then mask std\_dev\_degrees is 3, and from the peak, there are about 1.8 std. devs visible to the nearest edge? (i.e., (size\_x/2) \* std\_dev) I suspect this might not be correct because at std\_dev==3, the pixel values are indistinguishable from the background which I’d suspect happens only around 3 std. devs from the peak. (So then is the actual on screen standard dev: size/2_std\_dev, i.e. 1.5 in above example?)

Let me know if I can make this more clear. I’d look at the code but I also wanted to confirm your intention.

Thanks,  
Mark

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [May 6, 2019, 6:10pm UTC](https://mworks.discourse.group/t/mask-std-dev-question/253/2 "2019-05-06T18:10:43Z")

</div>

Hi Mark,

> Size is the full length along one axis, correct? So the full stimulus square is x\_size by y\_size (not x\_size_2, y\_size_2), yes?

Correct.

> So then is the actual on screen standard dev: size/2\*std\_dev, i.e. 1.5 in above example?

Yes, that’s right. The Gaussian mask is computed on a 2x2 square, centered at the origin, using the equation

```
exp(-1.0 * (dist - mean) * (dist - mean) / (2.0 * stdDev * stdDev))

```

where `dist` is distance from the center. The mask is then stretched to cover a rectangle of `x_size` by `y_size` degrees. If the x and y sizes are equal, then the mask is scaled by size/2 in both directions, so `std_dev` has units of size/2 degrees.

Chris

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [May 6, 2019, 7:14pm UTC](https://mworks.discourse.group/t/mask-std-dev-question/253/3 "2019-05-06T19:14:52Z")

</div>

Thanks! Maybe this explanation is appropriate for the online docs? I’m sure I will forget this in the future and have to refer back to it.

Mark

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [May 7, 2019, 2:05pm UTC](https://mworks.discourse.group/t/mask-std-dev-question/253/4 "2019-05-07T14:05:05Z")

</div>

> Maybe this explanation is appropriate for the online docs?

Sure, I’ll add it.

Chris

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [July 19, 2022, 8:50pm UTC](https://mworks.discourse.group/t/mask-std-dev-question/253/5 "2022-07-19T20:50:14Z")

</div>


