Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace the vertex_label_index in .annot file #5

Open
tanjia123456 opened this issue Oct 20, 2020 · 0 comments
Open

replace the vertex_label_index in .annot file #5

tanjia123456 opened this issue Oct 20, 2020 · 0 comments

Comments

@tanjia123456
Copy link

hello,freesurfer
Previously, rh.white and rh.aparc.2009s.annot were used to generate vertex_id
and vertex_label,
'
surface = Surface.read_triangular('rh.white')
surface.load_annotation_file('rh.aparc.a2009s.annot')
with open("rhlabels.txt","w") as f:
for vertex_index, vertex in enumerate(surface.vertices):
vertex_label_index = surface.annotation.vertex_label_index[vertex_index]
vertex_label = surface.annotation.labels[vertex_label_index]
#print(vertex_index, vertex, vertex_label)
#f.write("vertex_index:{} vertexlabel:{} \n".format(vertex_index,
vertex_label))
f.write("vertex_index:{} vertex_label:{}\n".format(vertex_index,
vertex_label))
'
the output:vertex_index:0 vertexlabel:Label(name=S_precentral-sup-part, index=70, color=#1514c8)
after some algorthm: vertex_index:0 label_index=71
and the label_index obtained after a certain algorithm was updated to replace the vertex_labe_index in rh.aparc.2009s.annot, and then load the result with freeview. But I don't know how to replace the vertex_label_index value in .annot file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant