neuroanatomyandconnectivity / surfdist Goto Github PK
View Code? Open in Web Editor NEWFor calculating exact geodesic distances on cortical surface meshes
License: MIT License
For calculating exact geodesic distances on cortical surface meshes
License: MIT License
Hi~
When I test the example code in the readme
, there is an error when I run sd.analysis.dist_calc
Here are my codes:
cmap = 'coolwarm'
base_dir = 'path/2/Applications/freesurfer/subjects/'
surf = nib.freesurfer.read_geometry(os.path.join(base_dir, 'bert/surf/lh.pial'))
cort = np.sort(nib.freesurfer.read_label(os.path.join(base_dir, 'bert/label/lh.cortex.label')))
sulc = nib.freesurfer.read_morph_data(os.path.join(base_dir, 'bert/surf/lh.sulc'))
src = sd.load.load_freesurfer_label(os.path.join(base_dir, 'bert/label/lh.aparc.a2009s.annot'), 'S_central', cort)
## All codes above run successfully~~
# calculate distance
dist = sd.analysis.dist_calc(surf, cort, src)
AND Here are the errors:
NumbaNotImplementedError Traceback (most recent call last)
File [~/anaconda3/envs/d2l/lib/python3.9/site-packages/numba/core/typing/typeof.py:244](https://vscode-remote+ssh-002dremote-002bchenzy-005fsever1.vscode-resource.vscode-cdn.net/export/bioinfo-team/home/chenzy/Desktop/PythonTutorial/MedicalImages_Deeplearning/fmri_learning/~/anaconda3/envs/d2l/lib/python3.9/site-packages/numba/core/typing/typeof.py:244), in _typeof_ndarray(val, c)
243 try:
--> 244 dtype = numpy_support.from_dtype(val.dtype)
245 except errors.NumbaNotImplementedError:
File [~/anaconda3/envs/d2l/lib/python3.9/site-packages/numba/np/numpy_support.py:114](https://vscode-remote+ssh-002dremote-002bchenzy-005fsever1.vscode-resource.vscode-cdn.net/export/bioinfo-team/home/chenzy/Desktop/PythonTutorial/MedicalImages_Deeplearning/fmri_learning/~/anaconda3/envs/d2l/lib/python3.9/site-packages/numba/np/numpy_support.py:114), in from_dtype(dtype)
112 return types.NestedArray(subtype, dtype.shape)
--> 114 raise errors.NumbaNotImplementedError(dtype)
NumbaNotImplementedError: >i4
During handling of the above exception, another exception occurred:
NumbaValueError Traceback (most recent call last)
[/export/bioinfo-team/home/chenzy/Desktop/PythonTutorial/MedicalImages_Deeplearning/fmri_learning/test.ipynb](https://vscode-remote+ssh-002dremote-002bchenzy-005fsever1.vscode-resource.vscode-cdn.net/export/bioinfo-team/home/chenzy/Desktop/PythonTutorial/MedicalImages_Deeplearning/fmri_learning/test.ipynb) Cell 4 in ()
[1](vscode-notebook-cell://ssh-remote%2Bchenzy_sever1/export/bioinfo-team/home/chenzy/Desktop/PythonTutorial/MedicalImages_Deeplearning/fmri_learning/test.ipynb#W3sdnNjb2RlLXJlbW90ZQ%3D%3D?line=0) # calculate distance
----> [2](vscode-notebook-cell://ssh-remote%2Bchenzy_sever1/export/bioinfo-team/home/chenzy/Desktop/PythonTutorial/MedicalImages_Deeplearning/fmri_learning/test.ipynb#W3sdnNjb2RlLXJlbW90ZQ%3D%3D?line=1) dist = sd.analysis.dist_calc(surf, cort, src)
File [~/anaconda3/envs/d2l/lib/python3.9/site-packages/surfdist-0.15.5-py3.9.egg/surfdist/analysis.py:14](https://vscode-remote+ssh-002dremote-002bchenzy-005fsever1.vscode-resource.vscode-cdn.net/export/bioinfo-team/home/chenzy/Desktop/PythonTutorial/MedicalImages_Deeplearning/fmri_learning/~/anaconda3/envs/d2l/lib/python3.9/site-packages/surfdist-0.15.5-py3.9.egg/surfdist/analysis.py:14), in dist_calc(surf, cortex, source_nodes)
6 def dist_calc(surf, cortex, source_nodes):
8 """
9 Calculate exact geodesic distance along cortical surface from set of source nodes.
10 "dist_type" specifies whether to calculate "min", "mean", "median", or "max" distance values
...
--> 246 raise errors.NumbaValueError(f"Unsupported array dtype: {val.dtype}")
247 layout = numpy_support.map_layout(val)
248 readonly = not val.flags.writeable
NumbaValueError: Unsupported array dtype: >i4
The requirements of my computer:
python 3.9.10
numpy 1.23.5
numba 0.56.4
Cython 0.29.33
tvb-gist 2.2
nibabel 3.2.2
Could you please help me to solve the problem, Thank you~
0.13.18 is the most recent version on pip and is incompatible with python 3
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.