Thanks ymzayek!
I get the following error when I try to run img.get_fdata:
Moreover, what I really need is to run a masker, and that’s how I noticed this problem. The code I’m using is:
masker = NiftiLabelsMasker(labels_img=mask_nii, standardize=True)
ts = masker.fit_transform(nii_path).T
in order to get the time series, but I obtain the following warning:
...python3.10/site-packages/nilearn/_utils/niimg.py:63: UserWarning: Non-finite values detected. These values will be replaced with zeros.
which I trace back to the matrix being loaded incorrectly
