[Neuroimaging] writing a 1D python array to 3D Nifti file

Yaroslav Halchenko lists at onerussian.com
Mon May 9 17:44:09 EDT 2022


I would have recommended to "go back" and to avoid explicit flattening /
re-3ding etc.  Why you had to go into 1D?

PS reminded me about an excellent sci-fi book "Three body problem" where
poor folks had to dry up to survive through apocalypses (and being
rolled up and stored deep underground) and then rehydrate, so in
effect do 3D -> 2D -> 3D  ;)  not sure how they survived ;)

On Mon, 09 May 2022, Lorenzo Pini wrote:

>    Dear experts, 
>    I uploaded a 3D nifti file with nibabel, transformed it into a 1D array
>    and performed some transformations. My final 1D array has size 902629 (MNI
>    vector space). 
>    Now, I would like to convert this 1D array back to a 3D nifti image. Any
>    advice to perform this operation?
>    Thankx,
>    L

> _______________________________________________
> Neuroimaging mailing list
> Neuroimaging at python.org
> https://mail.python.org/mailman/listinfo/neuroimaging


-- 
Yaroslav O. Halchenko
Center for Open Neuroscience     http://centerforopenneuroscience.org
Dartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755
WWW:   http://www.linkedin.com/in/yarik        



More information about the Neuroimaging mailing list