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

Hippunfold result wrong: "dentate_curvature.shape.gii" actually is "hipp_curvature.shape.gii" #344

Open
zyy1219888 opened this issue Jan 7, 2025 · 4 comments

Comments

@zyy1219888
Copy link

No description provided.

@zyy1219888 zyy1219888 changed the title Hippunfold result wrong: dentate_curvature.shape.gii Hippunfold result wrong: "dentate_curvature.shape.gii" actually is "hipp_curvature.shape.gii" Jan 7, 2025
@zyy1219888
Copy link
Author

zyy1219888 commented Jan 7, 2025

Dear Hippunfold official:

No matter the Hippunfold version is the 1.4.1 or the newest, in the result folder "surf", one result was found actually is wrong.

That is, the vertex number of file "0p5mm_label-dentate_curvature.shape.gii" is 7262 instead of 1788 ! Further, I checked the reason. It was found that the curvature features in this file is totally identical with that in the file "0p5mm_label-hipp_curvature.shape.gii".

In addition, this error not only exists in 0p5mm density, but also in 1mm (and possibly 2mm). And, T1/T2, L/R are also included.

I would greatly appreciate that if you could check the original codes and fix it as soon as possible.

More importantly, How can I conveniently and fastly recalculate the correct result "0p5mm_label-dentate_curvature.shape.gii" , rather than running the entire Hippunfold again? Because our data volume is very large, close to 50, 000 scans.

Thanks a lot !
1
2

@jordandekraker
Copy link
Collaborator

Thanks, you're absolutely right. We found this bug and have fixed it in the latest release: https://github.com/khanlab/hippunfold/releases/tag/v1.5.2

Recomputing the dentate curvature should be relatively fast an easy:

wb_command -surface-curvature {input} -mean {output}

Where the input is the dentate midthickness surface file (.surf.gii)

We also normalize this result using this (very short) script:
https://github.com/khanlab/hippunfold/blob/master/hippunfold/workflow/scripts/normalize_tanh.py

I can help you write a FOR loop to run this for all subjects, sessions, and hemispheres if you like. If you're using hippunfold in a singularity/docker container, you can run such a loop from within the container to ensure wb_command and python's nibabel are present.

@zyy1219888
Copy link
Author

Great!Thanks a lot!

We are using the singularity container to run the hippunofld, and we really need the help you mentioned to kindly provide the FOR loop script to recompute the dentate curvature in our all data. Thanks very much!

Besides, may I ask a basic question about why the thickness of dentate is not computed?

@jordandekraker
Copy link
Collaborator

jordandekraker commented Jan 9, 2025

Create file into your hippunfold output directory:

rule calculate_curvature_from_surface:
    input:
        gii=hippunfold/{filename}_label-dentate_midthickness.surf.gii
    output:
        gii=hippunfold/{filename}_label-dentate_curvature_unnorm.surf.gii
    shell:
        "wb_command -surface-curvature {input} -mean {output}"

rule normalize_curvature:
    input:
        gii=hippunfold/{filename}_label-dentate_curvature_unnorm.surf.gii
    output:
        gii=hippunfold/{filename}_label-dentate_curvature.surf.gii
    script:
        "/src/hippunfold/workflow/scripts/scripts/normalize_tanh.py"

rule all:
    hippunfold/{filename}_label-dentate_curvature.surf.gii

Give it the name "Snakefile" and execute it with this:

cd <YOUR HIPPUNFOLD OUTPUT DIR>
singularity shell -e <PATH TO YOUR HIPPUNFOLD SINGULARITY CONTAINER>
snakemake --cores 8

Let me know if you run into any problems!

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

2 participants