Skip to content

Commit

Permalink
add surface smoothing for curvature calculation
Browse files Browse the repository at this point in the history
now produces nice sulcal/gyral maps with curvature
  • Loading branch information
akhanf committed Jan 2, 2025
1 parent f4b9183 commit 8f6d02f
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion hippunfold/workflow/rules/native_surf.smk
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

# --- parameters - will put these in config eventually


surf_thresholds = {"inner": 0, "outer": 1, "midthickness": 0.5}

# this is for the mapping from inner to outer
Expand Down Expand Up @@ -247,6 +246,39 @@ rule update_native_mesh_structure:
" -surface-secondary-type {params.secondary_type}"


rule smooth_surface:
input:
surf_gii=bids(
root=work,
datatype="surf",
suffix="{surfname}.surf.gii",
space="corobl",
hemi="{hemi}",
label="{label}",
**inputs.subj_wildcards
),
params:
smoothing_strength=0.8,
smoothing_iterations=10,
output:
surf_gii=bids(
root=work,
datatype="surf",
suffix="{surfname}.surf.gii",
space="corobl",
desc="smoothed",
hemi="{hemi}",
label="{label}",
**inputs.subj_wildcards
),
container:
config["singularity"]["autotop"]
group:
"subj"
shell:
"wb_command -surface-smoothing {input} {params.smoothing_strength} {params.smoothing_iterations} {output}"


# --- creating unfold surface from native anatomical


Expand Down Expand Up @@ -654,6 +686,7 @@ rule calculate_curvature_from_surface:
datatype="surf",
suffix="midthickness.surf.gii",
space="corobl",
desc="smoothed",
hemi="{hemi}",
label="{label}",
**inputs.subj_wildcards
Expand Down

0 comments on commit 8f6d02f

Please sign in to comment.