Yep, that's it. And the create_mask function loops over all regions.
Once the mask is created (which is a one time operation) to get the indexes of all pixels from region 3:
```
mask==3
```
`scan` is a relatively expensive operation but it's done once.

A prototype implementation is here:

https://github.com/nden/code-experiments/blob/master/generalized_wcs_api/prototype/region.py