Closed caggursoy closed 6 months ago
If I remove the character from line 336 of _atlasbrowser.py I encounter a completely different error.
Original script
`region_id = int(self._atlas[atlas_coords]) Edited script
region_id = int(self._atlas[atlas_coords])`
Please see the error below, when the edited script is run with the following parameters:
coord = np.array([0,40,-4])
atlas.find_regions(coord)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/zi/home/cagatay.guersoy/.conda/envs/nipype/lib/python3.10/site-packages/mni_to_atlas/atlas_browser.py", line 141, in find_regions
region = self._find_region(atlas_coords)
File "/zi/home/cagatay.guersoy/.conda/envs/nipype/lib/python3.10/site-packages/mni_to_atlas/atlas_browser.py", line 336, in _find_region
region_id = int(self._atlas[atlas_coords])
TypeError: only length-1 arrays can be converted to Python scalars
Thanks for bringing this to my attention! I haven't touched this code in a while so I'll have to investigate what's going wrong, will try to have a solution in the coming days.
Cheers!
@caggursoy Please can you try updating your Python version to >= 3.11, that should stop this from happening.
Will try to release a new version in the coming days as a more permanent fix.
Hi,
I am receiving the following runtime error whenever I try to import the package. Here's how I try to import it
from mni_to_atlas import AtlasBrowser
And here's my system information:
I would be glad if you can offer any help with this regard