Skip to content

Commit

Permalink
Merge branch 'dev-v2.0.0' into layniinative
Browse files Browse the repository at this point in the history
  • Loading branch information
akhanf committed Feb 3, 2025
2 parents 57d7926 + e7f9763 commit 7e41098
Show file tree
Hide file tree
Showing 23 changed files with 1,747 additions and 1,809 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
needs: ["quality"]
strategy:
matrix:
python-version: ["3.8", "3.9"]
python-version: ["3.9","3.10","3.11","3.12"]

steps:
- name: Install non-python dependencies
Expand Down
14 changes: 0 additions & 14 deletions hippunfold/workflow/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -125,26 +125,12 @@ if config["modality"] == "hippb500":


include: "rules/coords.smk"


include: "rules/warps.smk"


include: "rules/gifti.smk"


include: "rules/subfields.smk"


include: "rules/resample_final_to_crop_native.smk"


include: "rules/qc.smk"


include: "rules/myelin_map.smk"


include: "rules/native_surf.smk"


Expand Down
12 changes: 12 additions & 0 deletions hippunfold/workflow/rules/common.smk
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,18 @@ def get_final_output():

if "corobl" in ref_spaces:

ruleorder: laplace_beltrami > laynii_layers > laplace_coords_dentate > copy_coords_to_results

rule copy_coords_to_results:
input:
os.path.join(work, "{pre}_space-corobl_{post}{suffix}.{ext}"),
output:
os.path.join(root, "{pre,[^/].+}_space-corobl_{post}{suffix,coords}.{ext}"),
group:
"subj"
shell:
"cp {input} {output}"

rule copy_xfm_to_results:
input:
os.path.join(work, "{pre}_{fromto}-corobl_{post}{suffix}.{ext}"),
Expand Down
22 changes: 11 additions & 11 deletions hippunfold/workflow/rules/coords.smk
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def get_labels_for_laplace(wildcards):
suffix="dseg.nii.gz",
desc="postproc",
space="corobl",
hemi="{hemi}"
hemi="{hemi}",
).format(**wildcards)
return seg

Expand All @@ -31,7 +31,7 @@ def get_inputs_laplace(wildcards):
suffix="coords.nii.gz",
desc="init",
space="corobl",
hemi="{hemi}"
hemi="{hemi}",
),
)
return files
Expand All @@ -48,7 +48,7 @@ rule laplace_coords_dentate:
suffix="coords.nii.gz",
desc="init",
space="corobl",
hemi="{hemi}"
hemi="{hemi}",
),
output:
coords=bids(
Expand All @@ -60,7 +60,7 @@ rule laplace_coords_dentate:
desc="laplace",
space="corobl",
hemi="{hemi}",
**inputs.subj_wildcards
**inputs.subj_wildcards,
),
group:
"subj"
Expand All @@ -72,7 +72,7 @@ rule laplace_coords_dentate:
**inputs.subj_wildcards,
dir="{dir}",
hemi="{hemi}",
suffix="laplace-dentate.txt"
suffix="laplace-dentate.txt",
),
container:
config["singularity"]["autotop"]
Expand Down Expand Up @@ -121,7 +121,7 @@ rule prep_dseg_for_laynii_hipp:
desc="laynii",
label="{autotop,hipp}",
space="corobl",
hemi="{hemi}"
hemi="{hemi}",
),
container:
config["singularity"]["autotop"]
Expand All @@ -136,11 +136,11 @@ rule prep_dseg_for_laynii_dentate:
dseg_tissue=bids(
root=work,
datatype="anat",
**inputs.subj_wildcards,
suffix="dseg.nii.gz",
desc="closeDG",
space="corobl",
hemi="{hemi}"
hemi="{hemi}",
**inputs.subj_wildcards,
),
params:
gm_labels=lambda wildcards: " ".join(
Expand Down Expand Up @@ -196,7 +196,7 @@ rule laynii_layers:
desc="equivol",
space="corobl",
hemi="{hemi}",
**inputs.subj_wildcards
**inputs.subj_wildcards,
),
equidist=bids(
root=work,
Expand All @@ -207,7 +207,7 @@ rule laynii_layers:
desc="equidist",
space="corobl",
hemi="{hemi}",
**inputs.subj_wildcards
**inputs.subj_wildcards,
),
shadow:
"minimal"
Expand Down Expand Up @@ -247,7 +247,7 @@ rule laynii_equidist_renzo:
desc="equidistrenzo",
space="corobl",
hemi="{hemi}",
**inputs.subj_wildcards
**inputs.subj_wildcards,
),
shadow:
"minimal"
Expand Down
2 changes: 1 addition & 1 deletion hippunfold/workflow/rules/download.smk
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ rule import_template_dseg:
**inputs.subj_wildcards,
desc="hipptissue",
hemi="{hemi}",
suffix="dseg.nii.gz"
suffix="dseg.nii.gz",
),
group:
"subj"
Expand Down
50 changes: 25 additions & 25 deletions hippunfold/workflow/rules/gifti.smk
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ rule cp_template_to_unfold:
space="unfold",
hemi="{hemi}",
label="{autotop}",
**inputs.subj_wildcards
**inputs.subj_wildcards,
),
container:
config["singularity"]["autotop"]
Expand Down Expand Up @@ -85,7 +85,7 @@ rule calc_unfold_template_coords:
space="{space}",
hemi="{hemi}",
label="{autotop}",
**inputs.subj_wildcards
**inputs.subj_wildcards,
),
container:
config["singularity"]["autotop"]
Expand Down Expand Up @@ -117,15 +117,15 @@ rule constrain_surf_to_bbox:
space="unfold",
hemi="{hemi}",
label="{autotop}",
**inputs.subj_wildcards
**inputs.subj_wildcards,
),
ref_nii=bids(
root=work,
datatype="warps",
space="unfold",
label="{autotop}",
suffix="refvol.nii.gz",
**inputs.subj_wildcards
**inputs.subj_wildcards,
),
output:
gii=bids(
Expand All @@ -138,7 +138,7 @@ rule constrain_surf_to_bbox:
unfoldreg="none",
hemi="{hemi}",
label="{autotop}",
**inputs.subj_wildcards
**inputs.subj_wildcards,
),
log:
bids(
Expand All @@ -148,7 +148,7 @@ rule constrain_surf_to_bbox:
desc="constrainbbox",
hemi="{hemi}",
label="{autotop}",
**inputs.subj_wildcards
**inputs.subj_wildcards,
),
group:
"subj"
Expand All @@ -169,7 +169,7 @@ rule affine_gii_to_native:
space="corobl",
hemi="{hemi}",
label="{autotop}",
**inputs.subj_wildcards
**inputs.subj_wildcards,
),
xfm=bids(
root=work,
Expand All @@ -179,7 +179,7 @@ rule affine_gii_to_native:
from_="{native_modality}",
to="corobl",
desc="affine",
type_="ras"
type_="ras",
),
output:
gii=bids(
Expand All @@ -190,7 +190,7 @@ rule affine_gii_to_native:
space="{native_modality,T1w|T2w}",
hemi="{hemi}",
label="{autotop,hipp|dentate}",
**inputs.subj_wildcards
**inputs.subj_wildcards,
),
container:
config["singularity"]["autotop"]
Expand Down Expand Up @@ -253,7 +253,7 @@ rule create_dscalar_metric_cifti:
suffix="{metric}.dscalar.nii",
space="{space}",
label="{autotop}",
**inputs.subj_wildcards
**inputs.subj_wildcards,
),
container:
config["singularity"]["autotop"]
Expand Down Expand Up @@ -319,7 +319,7 @@ rule create_dlabel_cifti_subfields:
suffix="subfields.dlabel.nii",
space="{space}",
label="hipp",
**inputs.subj_wildcards
**inputs.subj_wildcards,
),
container:
config["singularity"]["autotop"]
Expand Down Expand Up @@ -368,7 +368,7 @@ rule create_spec_file_hipp:
space="{space}",
hemi="{hemi}",
label="{label}",
**inputs.subj_wildcards
**inputs.subj_wildcards,
),
metric=get_gifti_metric_types(wildcards.label),
allow_missing=True,
Expand All @@ -383,7 +383,7 @@ rule create_spec_file_hipp:
hemi="{hemi}",
label="{label}",
atlas="{atlas}",
**inputs.subj_wildcards
**inputs.subj_wildcards,
),
atlas=config["atlas"],
allow_missing=True,
Expand All @@ -397,7 +397,7 @@ rule create_spec_file_hipp:
space="{space}",
hemi="{hemi}",
label="{label}",
**inputs.subj_wildcards
**inputs.subj_wildcards,
),
surfname=["midthickness"],
space=["{space}", "unfold", "unfoldreg"],
Expand All @@ -411,7 +411,7 @@ rule create_spec_file_hipp:
suffix="{cifti}.nii",
space="{space}",
label="{label}",
**inputs.subj_wildcards
**inputs.subj_wildcards,
),
cifti=get_cifti_metric_types(wildcards.label),
allow_missing=True,
Expand All @@ -425,7 +425,7 @@ rule create_spec_file_hipp:
atlas="{atlas}",
space="{space}",
label="{label}",
**inputs.subj_wildcards
**inputs.subj_wildcards,
),
atlas=config["atlas"],
allow_missing=True,
Expand All @@ -441,7 +441,7 @@ rule create_spec_file_hipp:
hemi="{hemi,L|R}",
space="{space}",
label="{label,hipp}",
**inputs.subj_wildcards
**inputs.subj_wildcards,
),
container:
config["singularity"]["autotop"]
Expand All @@ -462,7 +462,7 @@ rule create_spec_file_dentate:
space="{space}",
hemi="{hemi}",
label="{label}",
**inputs.subj_wildcards
**inputs.subj_wildcards,
),
metric=get_gifti_metric_types(wildcards.label),
allow_missing=True,
Expand All @@ -476,7 +476,7 @@ rule create_spec_file_dentate:
space="{space}",
hemi="{hemi}",
label="{label}",
**inputs.subj_wildcards
**inputs.subj_wildcards,
),
surfname=["midthickness"],
space=["{space}", "unfold"],
Expand All @@ -490,7 +490,7 @@ rule create_spec_file_dentate:
suffix="{cifti}.nii",
space="{space}",
label="{label}",
**inputs.subj_wildcards
**inputs.subj_wildcards,
),
cifti=get_cifti_metric_types(wildcards.label),
allow_missing=True,
Expand All @@ -506,7 +506,7 @@ rule create_spec_file_dentate:
hemi="{hemi,L|R}",
space="{space}",
label="{label,dentate}",
**inputs.subj_wildcards
**inputs.subj_wildcards,
),
container:
config["singularity"]["autotop"]
Expand Down Expand Up @@ -534,7 +534,7 @@ rule merge_lr_spec_file_native:
hemi="{hemi}",
space="{space}",
label="{autotop}",
**inputs.subj_wildcards
**inputs.subj_wildcards,
),
hemi=config["hemi"],
allow_missing=True,
Expand All @@ -549,7 +549,7 @@ rule merge_lr_spec_file_native:
space="{space}",
suffix="surfaces.spec",
label="{autotop}",
**inputs.subj_wildcards
**inputs.subj_wildcards,
),
container:
config["singularity"]["autotop"]
Expand All @@ -569,7 +569,7 @@ rule merge_hipp_dentate_spec_file_native:
suffix="surfaces.spec",
space="{space}",
label="{autotop}",
**inputs.subj_wildcards
**inputs.subj_wildcards,
),
autotop=config["autotop_labels"],
allow_missing=True,
Expand All @@ -583,7 +583,7 @@ rule merge_hipp_dentate_spec_file_native:
den="{density}",
space="{space}",
suffix="surfaces.spec",
**inputs.subj_wildcards
**inputs.subj_wildcards,
),
container:
config["singularity"]["autotop"]
Expand Down
Loading

0 comments on commit 7e41098

Please sign in to comment.