I am trying to generalize an algorithm for N-dimensional arrays, but there are many code patterns for which I don’t have a solution yet. I will use this thread to ask a few questions.

How do you generalize the following code to work with N-dimensional arrays as opposed to just 3D arrays?

```
activated[gridsize[1]+1:padsize[1],:,:] .= false
activated[:,gridsize[2]+1:padsize[2],:] .= false
activated[:,:,gridsize[3]+1:padsize[3]] .= false
```

Tried to make use of the functionality in `Base.Cartesian`

like `@nref`

but without success.