You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import numpy as np
from nilearn.datasets import fetch_atlas_schaefer_2018
from neuromaps.parcellate import Parcellater
scale = 'scale100'
schaefer = fetch_atlas_schaefer_2018(n_rois=100)
path = "G:/IDP/37592024/supp/36303070hansen_receptors/hansen_receptors/data/PET_nifti_images/" (my PET path)
receptors_nii = [path+'5HT1a_way_hc36_savli.nii']
parcellated = {}
parcellater = Parcellater(schaefer['maps'], 'MNI152')
for receptor in receptors_nii:
parcellated= parcellater.fit_transform(receptor, 'MNI152', True)
...
However, the error was reported in parcellater.fit_transform step.
"TypeError: expected str, bytes or os.PathLike object, not Nifti1Image".
The "receptor" parameter is a os.PathLike.
Whta's happened? Chould you help me!
Thanks
The text was updated successfully, but these errors were encountered:
I'm not sure why the function thinks the pathlike object is a nifti1image but try updating neuromaps to the latest version on github, hopefully that will fix the problem.
I'm having a similar problem. For what it's worth, here's the traceback for the error I'm getting. It seems that the resample_images function does not like the 'data' variable. My guess is that the file was loaded as an image and passed somewhere it wasn't supposed to be or there is some conflicting environment configuration that is loading something incorrectly. However, I can't figure out where this would be.
I'm attaching both the traceback for my code when I try to run parcellator.fit_transform function as well as the environment files I'm using. One is the true environment and the other is the environment history for the packages I actually pulled to download. I'd be happy to hear if you had any suggestions.
Hello,
I followed this script.
import numpy as np
from nilearn.datasets import fetch_atlas_schaefer_2018
from neuromaps.parcellate import Parcellater
scale = 'scale100'
schaefer = fetch_atlas_schaefer_2018(n_rois=100)
path = "G:/IDP/37592024/supp/36303070hansen_receptors/hansen_receptors/data/PET_nifti_images/" (my PET path)
receptors_nii = [path+'5HT1a_way_hc36_savli.nii']
parcellated = {}
parcellater = Parcellater(schaefer['maps'], 'MNI152')
for receptor in receptors_nii:
parcellated= parcellater.fit_transform(receptor, 'MNI152', True)
...
However, the error was reported in parcellater.fit_transform step.
"TypeError: expected str, bytes or os.PathLike object, not Nifti1Image".
The "receptor" parameter is a os.PathLike.
Whta's happened? Chould you help me!
Thanks
The text was updated successfully, but these errors were encountered: