surfdist

For calculating exact geodesic distances on cortical surface meshes

https://github.com/neuroanatomyandconnectivity/surfdist

Science Score: 23.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 6 committers (16.7%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (5.2%) to scientific vocabulary

Keywords from Contributors

brain-imaging neuroimaging brainweb dataflow dataflow-programming workflow-engine
Last synced: 11 months ago · JSON representation

Repository

For calculating exact geodesic distances on cortical surface meshes

Basic Info
  • Host: GitHub
  • Owner: NeuroanatomyAndConnectivity
  • License: mit
  • Language: Python
  • Default Branch: master
  • Size: 1.41 MB
Statistics
  • Stars: 53
  • Watchers: 5
  • Forks: 25
  • Open Issues: 2
  • Releases: 0
Created over 10 years ago · Last pushed almost 2 years ago
Metadata Files
Readme License

README.md

surfdist

Build Status

Calculate the exact geodesic distance on a triangular surface mesh using the gdist package, which is based on the c++ library.

Installation

pip install surfdist

Example

import nibabel as nib
import numpy as np
import matplotlib.pyplot as plt
import os
import surfdist as sd
from surfdist import viz, load, utils, analysis

# calculate and display distance from central sulcus at each node:
cmap = 'coolwarm'
base_dir = '/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'))

# load central sulcus nodes
src  = sd.load.load_freesurfer_label(os.path.join(base_dir, 'bert/label/lh.aparc.a2009s.annot'), 'S_central', cort)

# calculate distance
dist = sd.analysis.dist_calc(surf, cort, src)

# visualize
plot_med = sd.viz.viz(surf[0], surf[1], dist, bg_map=sulc, bg_on_stat=True, cmap=cmap)
plot_lat = sd.viz.viz(surf[0], surf[1], dist, azim=180, bg_map=sulc, bg_on_stat=True, cmap=cmap)

# Calculate distances on native surface and display on fsaverage
fsa4 = nib.freesurfer.read_geometry(os.path.join(base_dir,'fsaverage4/surf/lh.sphere.reg'))[0]
fsa4_sulc=nib.freesurfer.read_morph_data(os.path.join(base_dir, 'fsaverage4/surf/lh.sulc'))
native = nib.freesurfer.read_geometry(os.path.join(base_dir, 'bert/surf/lh.sphere.reg'))[0]
idx_fsa4_to_native = sd.utils.find_node_match(fsa4, native)[0]

surf_fsa4 = nib.freesurfer.read_geometry(os.path.join(base_dir, 'fsaverage4/surf/lh.pial'))
plot_fsa4_med = sd.viz.viz(surf_fsa4[0], surf_fsa4[1], dist[idx_fsa4_to_native], bg_map=fsa4_sulc, bg_on_stat=True, cmap=cmap)
plot_fsa4_lat = sd.viz.viz(surf_fsa4[0], surf_fsa4[1], dist[idx_fsa4_to_native], azim=180, bg_map=fsa4_sulc, bg_on_stat=True, cmap=cmap)

plt.show()

Owner

  • Name: NeuroanatomyAndConnectivity
  • Login: NeuroanatomyAndConnectivity
  • Kind: organization

GitHub Events

Total
  • Watch event: 4
  • Pull request event: 1
Last Year
  • Watch event: 4
  • Pull request event: 1

Committers

Last synced: over 3 years ago

All Time
  • Total Commits: 93
  • Total Committers: 6
  • Avg Commits per committer: 15.5
  • Development Distribution Score (DDS): 0.387
Top Committers
Name Email Commits
margulies d****s@g****m 57
David Ellis d****s@u****u 14
Marcel Falkiewicz m****z@g****m 9
austin benn a****n@a****l 5
Julia Huntenburg j****g@g****m 4
austin benn r****n@g****m 4
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 4
  • Total pull requests: 15
  • Average time to close issues: 4 months
  • Average time to close pull requests: 6 months
  • Total issue authors: 3
  • Total pull request authors: 6
  • Average comments per issue: 0.75
  • Average comments per pull request: 0.2
  • Merged pull requests: 11
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: 28 days
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 1.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • margulies (2)
  • DrChenziyan (1)
  • dmoracze (1)
Pull Request Authors
  • neurabenn (6)
  • mfalkiewicz (3)
  • juhuntenburg (3)
  • margulies (3)
  • kaurao (2)
  • ellisdg (1)
Top Labels
Issue Labels
enhancement (2)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 33 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 2
  • Total versions: 20
  • Total maintainers: 1
pypi.org: surfdist

For calculating exact geodesic distances on cortical surface meshes

  • Versions: 20
  • Dependent Packages: 0
  • Dependent Repositories: 2
  • Downloads: 33 Last month
Rankings
Forks count: 8.0%
Dependent packages count: 10.0%
Stargazers count: 10.4%
Dependent repos count: 11.6%
Average: 14.1%
Downloads: 30.6%
Maintainers (1)
Last synced: 11 months ago

Dependencies

requirements.txt pypi
  • Cython >=0.29.21
  • matplotlib >=3.3.0
  • nibabel >=3.1.1
  • numba >=0.50.1
  • numpy >=1.19.1
  • scipy >=1.5.2
  • tvb-gdist >=2.0.2