ps://rdrr.io/r/base/tempfile.html" class="external-link">tempfile</a></span><span class="op">(</span>fileext <span class="op">=</span> <span class="st">".nii.gz"</span><span class="op">)</span></span>
<span><span class="fu"><a href="../reference/writeNIfTI2.html">writenii</a></span><span class="op">(</span><span class="va">img2</span>, <span class="va">outfile</span><span class="op">)</span></span>
<span><span class="fu"><a href="https://rdrr.io/r/base/files.html" class="external-link">file.exists</a></span