[Neuroimaging] help using SPM beta images in python

Ariel Rokem arokem at gmail.com
Fri Dec 4 19:21:01 EST 2020


Hi Ashley,

Just a hunch. Could you try:

    betadata = mydata.get_fdata()

Instead of:

    betadata = mydata.get_data()

Note the single character change from "data" to "fdata".

Cheers,

Ariel

On Fri, Dec 4, 2020 at 3:55 PM Ashley Victoria Lawrence <
avlawrence at email.arizona.edu> wrote:

> Hello,
>
> I have beta images in nifti format which were created in SPM12 in Matlab.
> I would like to take these already created beta images and perform further
> analyses on them using python because I would like to write a searchlight
> program. Unfortunately I am having trouble when loading the beta images
> into python. I have been using
>
> mydata = nib.load(beta.nii)
> betadata = mydata.get_data()
>
> However, this results in me just getting NAs or zeros in the shape of my
> beta images which are [79,95,79]
>
> When I view my nifti images in SPM they are not empty, so I'm sure there
> must be something wrong with how I am loading them.
>
> Does anyone know what I might be doing wrong? I am fairly new to python so
> I appreciate any guidance you might be able to provide.
>
> Thank you,
> Ashley
>
> --
> Ashley V. Lawrence, M.A.
> Doctoral Candidate
> Clinical Neuropsychology
> Cognition and Neuroimaging Lab
> University of Arizona
> Pronouns: She, Her, Hers
> _______________________________________________
> Neuroimaging mailing list
> Neuroimaging at python.org
> https://mail.python.org/mailman/listinfo/neuroimaging
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/neuroimaging/attachments/20201204/46459de8/attachment.html>


More information about the Neuroimaging mailing list