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

Summary statistics of the surface metrics #206

Open
romeopenheiro opened this issue Aug 8, 2022 · 3 comments
Open

Summary statistics of the surface metrics #206

romeopenheiro opened this issue Aug 8, 2022 · 3 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@romeopenheiro
Copy link

Is there a way to get the summary statistics for each of the surface metrics? I am looking to get the mean of the thickness, gyrification, and curvature. If you have an example of a script that I could use, that’d be very helpful.

@akhanf
Copy link
Member

akhanf commented Aug 8, 2022

Actually, I have a draft PR that does this (aggregating over subfields) in #178.

It should work (I think I only wanted to add some documentation before merging), but if you are using hippunfold on cbrain you may be better off just running the commands/code separately.

In that case, what I did was to use wb_command on the dscalar and dlabel files to parcellate with the mean value in each label, along with some other shell commands to fiddle with the resulting CSV file.

    shell:
        "wb_command -cifti-parcellate {input.dscalar} {input.dlabel} COLUMN temp.pscalar.nii && "
        "wb_command -cifti-transpose temp.pscalar.nii temp.tpscalar.nii && "
        "wb_command -cifti-convert -to-text temp.tpscalar.nii data.csv -col-delim ,  && "
        "echo 'L Sub,L CA1,L CA2,L CA3,L CA4,R Sub,R CA1,R CA2,R CA3,R CA4' > header.csv && "
        "cat header.csv data.csv > {output.csv}"

Can see more in the #178 PR as well. Let me know if that works.

@romeopenheiro
Copy link
Author

romeopenheiro commented Sep 13, 2022

Thank you for sharing your code. I understood what each line of the shell command is doing. However, I am not sure how to implement this locally on my device.

I checked the documentation of Connectome Workbench and I was not able to figure out how to go through the directories to acquire the surface metric CSV file. Do you have any example script I could take a look at to figure this out? Or a link to a resource?

@akhanf
Copy link
Member

akhanf commented Oct 20, 2022

Connected by e-mail, but closing the loop here in case it is of interest to others too:

This gist has an example of how to calculate surface-based metrics aggregated over subfields and the dentate gyrus:
https://gist.github.com/akhanf/ae2547b7d201d9f303410956a59f4573

I'll keep this issue open as a reminder to include something like this in hippunfold workflow too

@akhanf akhanf added enhancement New feature or request good first issue Good for newcomers labels Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants