khanlab / hippunfold

BIDS App for Hippunfold (automated hippocampal unfolding and subfield segmentation)

Home Page:https://hippunfold.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Summary statistics of the surface metrics

romeopenheiro opened this issue · comments

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.

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.

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?

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