Skip to content

Extract coordinates of central sulcus #48

Discussion options

You must be logged in to vote

for instance:

from soma import aims
import numpy as np

graph = aims.read('filename.arg')
sulci_names = set(['S.C._left', 'S.C._right'])  # extend if needed
sum_coords = np.zeros((3, ))
npts = 0
for v in graph.vertices():
    if v.get('label') in sulci_names:
        mesh = v.get('aims_Tmtktri')
        if mesh:
            vert = mesh.vertex()
            sum_coords += np.sum(np.asarray(vert), axis=0)
             npts += len(vert)
avg_coords = sum_coords / npts

coords are in native space, in the Aims images convention (https://brainvisa.info/aimsdata-5.0/user_doc/tutorial.html#handling-referentials-and-transformations)

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@MultimodalBrainMonitoringUDA
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by c-langlet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
Aims Image processing topics
2 participants