t;-</span> <span class="fu">c</span>(<span class="dv">10</span>, <span class="dv">10</span>, <span class="dv">10</span>, <span class="dv">20</span>)  <span class="co"># 10x10x10 volume, 20 time points</span></span>
<span id="cb3-3"><a href="#cb3-3" tabindex="-1"></a>dat_4d <span class="ot">&lt;-</span> <span class="fu">array</span>(<span class="fu">rnorm</span>(<span class="fu">prod</span>(dims_4d)), dims_4d)</span>
<span id="cb3-4"><a href="#cb3-4" tabindex="-1"></a>vec_4d <span class="ot">&lt;-</span> <sp