="sourceCode r"><span id="cb7-1"><a href="#cb7-1" tabindex="-1"></a><span class="co"># Create a sparse representation directly from an ROI</span></span>
<span id="cb7-2"><a href="#cb7-2" tabindex="-1"></a>roi <span class="ot">&lt;-</span> <span class="fu">spherical_roi</span>(img, <span class="fu">c</span>(<span class="dv">30</span>, <span class="dv">30</span>, <span class="dv">20</span>), <span class="at">radius =</span> <span class="dv">8</span>, <span class="at">fill =</span> <span class="dv">1</span>)</