<div dir="ltr">Hi all,<div><br></div><div>I am a newby using nibabel and I am having some trouble.</div><div><br></div><div>I want to load a Nifti volume, modify its image, and save it. However, if I do something like this:</div><div><br></div><div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div>img = nb.load("input.nii.gz")<br></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div>matrix = img.get_data()</div><div>matrix = np.zeros(matrix.shape)<br></div><div>nb.save(img, "output.nii.gz")<br></div></blockquote></div><div><br></div><div>and open the saved volume, I obtain the same input volume, not zeros...</div><div><br></div><div>Is there any step I am missing? Maybe an "update" or "set_data" method...</div><div><br></div><div>Thank you in advance!<br clear="all"><div><div class="gmail_signature"><div dir="ltr"><b>--</b><div><b>      Ángel Torrado Carvajal</b><div><br><b>      Research Assistant</b><br>      Medical Image Analysis Laboratory</div><div>      Universidad Rey Juan Carlos</div><div><br></div><div>      Despacho 155 - Departamental II</div><div>      Calle Tulipán s/n</div><div>      28933 Móstoles - Madrid</div><div><br></div><div><font color="#009900"><b>      Before printing this message, make sure it's necessary. Protecting the environment is in your hand.</b></font></div><div><b style="color:rgb(0,153,0)">      Antes de imprimir este mensaje, asegúrate de que es necesario. Proteger el medio ambiente está también en tu mano.</b></div></div></div></div></div>
</div></div>