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

Saving annotation to file #53

Open
iamjoostjanssen opened this issue Aug 17, 2023 · 2 comments
Open

Saving annotation to file #53

iamjoostjanssen opened this issue Aug 17, 2023 · 2 comments
Assignees
Labels
question Usage question.

Comments

@iamjoostjanssen
Copy link

Hi,

We're using vis.subject.annot() to save custom annotations. Supposedly, a custom annotation is made (using freesurfer tools?) and this is saved to an image. Would it be possible to also output the custom annotation (in gii or cifti or .annot) and not just it's image?

Thank you for the great tool!

-joost

@dfsp-spirit
Copy link
Owner

Hi, could you give me an example function call of what you are doing? I have an idea but I want to be sure. I will have a look, and I guess it should be possible to do that.

@dfsp-spirit
Copy link
Owner

dfsp-spirit commented Jan 2, 2024

Basically an annotation is just a long list of integers, one per vertex in the brain mesh, where each integer represents a region (e.g., 1=region1, 2=region2, and so on). The order of the list corresponds to the vertex list, so a list of 4,7,7,... would assign the first vertex region code 4, the second and third vertex region code 7, and so on. If needed, you can assign a color to each code for visualization.

That being said: yes, it is possible to do what you want. Use the functions freesurferformats::write.fs.annot() and freesurferformats::write.fs.annot.gii(). As the freesurferformats package is a dependency of fsbrain, you already have it installed.

Unless you have more questions, I would close this as solved next time I iterate though here.

@dfsp-spirit dfsp-spirit self-assigned this Jan 2, 2024
@dfsp-spirit dfsp-spirit added the question Usage question. label Jan 2, 2024
@dfsp-spirit dfsp-spirit changed the title Saving output Saving annotation to file Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Usage question.
Projects
None yet
Development

No branches or pull requests

2 participants