.conda_envs/py37_dev/lib/python3.7/site-packages/nilearn/image/resampling.py:602: RuntimeWarning: NaNs or infinite values are present in the data passed to resample. This is a bad thing as they make resampling ill-defined and much slower.
fill_value=fill_value)
This is my first time working with first-level analyses, and I’m not sure what is generating these resampling RuntimeWarnings, in addition to whether this type of output looks reasonable. Would appreciate any help. Thanks!
Thanks for reaching out ! Could you please include the information requested in the topic template, incl the version of the software you’re using ?
In particular, it looks like you’ve tagged this topic with the nilearn software but you’re using the nltools software in your code snippets. nltools is calling nilearn internally, but I’m not sure from that API how best to pass an ensure_finite=True argument to your image loading.
I don’t think that we have an nltools tag right now, but @ejolly and @ljchang might be able to point you in the right direction – or let us know if we should add a new tag to the forum
Hi @cyx203 & @emdupre, nltools uses nilearn to automatically resample data into a default 2x2x2mm space. Every software stores their data in slightly different ways and this is a fairly common warning when loading data from SPM. Everything seems like it is working based on your picture, but my guess is that it was fairly slow to load. You can write out new images that have been resampled once this is done using Brain_Data(cont_list).write('file_name') if you use .nii.gz as the file name extension it will write out a gzipped nifti file. you can also use .hdf5 which will save the object as an hdf5 file, which is much faster to read and write, but not compatible with other software.