Coder Social home page Coder Social logo

surfdist's People

Contributors

ellisdg avatar juhuntenburg avatar margulies avatar mfalkiewicz avatar neurabenn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

surfdist's Issues

Errors about running example of surfdist

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~

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.