diff --git a/hippunfold/resources/bigbrain/sub-bigbrain_labellist.L.txt b/hippunfold/resources/bigbrain/bigbrain_labellist.L.txt similarity index 100% rename from hippunfold/resources/bigbrain/sub-bigbrain_labellist.L.txt rename to hippunfold/resources/bigbrain/bigbrain_labellist.L.txt diff --git a/hippunfold/resources/bigbrain/sub-bigbrain_labellist.R.txt b/hippunfold/resources/bigbrain/bigbrain_labellist.R.txt similarity index 100% rename from hippunfold/resources/bigbrain/sub-bigbrain_labellist.R.txt rename to hippunfold/resources/bigbrain/bigbrain_labellist.R.txt diff --git a/hippunfold/resources/freesurfer/freesurfer_labellist.L.txt b/hippunfold/resources/freesurfer/freesurfer_labellist.L.txt new file mode 100644 index 00000000..6bc0283c --- /dev/null +++ b/hippunfold/resources/freesurfer/freesurfer_labellist.L.txt @@ -0,0 +1,88 @@ +Left alveus +201 255 204 153 255 +Left perforant_pathway +202 255 128 128 255 +Left parasubiculum +203 175 175 75 255 +Left presubiculum +204 64 0 64 255 +Left subiculum +205 0 0 255 255 +Left CA1 +206 255 0 0 255 +Left CA2 +207 128 128 255 255 +Left CA3 +208 0 128 0 255 +Left CA4 +209 196 160 128 255 +Left GC-DG +210 32 200 255 255 +Left HATA +211 128 255 128 255 +Left fimbria +212 204 153 204 255 +Left lateral_ventricle +213 121 17 136 255 +Left molecular_layer_HP +214 128 0 0 255 +Left hippocampal_fissure +215 128 32 255 255 +Left entorhinal_cortex +216 255 204 102 255 +Left molecular_layer_subiculum +217 128 128 128 255 +Left Amygdala +218 104 255 255 255 +Left Cerebral_White_Matter +219 0 226 0 255 +Left Cerebral_Cortex +220 205 63 78 255 +Left Inf_Lat_Vent +221 197 58 250 255 +Left Perirhinal +222 33 150 250 255 +Left Cerebral_White_Matter_Edge +223 226 0 0 255 +Left Background +224 100 100 100 255 +Left Ectorhinal +225 197 150 250 255 +Left HP_tail +226 170 170 255 255 +Left Polymorphic-Layer +227 128 255 128 255 +Left Intracellular-Space +228 204 153 204 255 +Left HP_body +231 0 255 0 255 +Left HP_head +232 255 0 0 255 +Left presubiculum-head +233 32 0 32 255 +Left presubiculum-body +234 64 0 64 255 +Left subiculum-head +235 0 0 175 255 +Left subiculum-body +236 0 0 255 255 +Left CA1-head +237 175 75 75 255 +Left CA1-body +238 255 0 0 255 +Left CA3-head +239 0 80 0 255 +Left CA3-body +240 0 128 0 255 +Left CA4-head +241 120 90 50 255 +Left CA4-body +242 196 160 128 255 +Left GC-ML-DG-head +243 75 125 175 255 +Left GC-ML-DG-body +244 32 200 255 255 +Left molecular_layer_HP-head +245 100 25 25 255 +Left molecular_layer_HP-body +246 128 0 0 255 diff --git a/hippunfold/resources/freesurfer/freesurfer_labellist.R.txt b/hippunfold/resources/freesurfer/freesurfer_labellist.R.txt new file mode 100644 index 00000000..73ac6e66 --- /dev/null +++ b/hippunfold/resources/freesurfer/freesurfer_labellist.R.txt @@ -0,0 +1,88 @@ +Right alveus +201 255 204 153 255 +Right perforant_pathway +202 255 128 128 255 +Right parasubiculum +203 175 175 75 255 +Right presubiculum +204 64 0 64 255 +Right subiculum +205 0 0 255 255 +Right CA1 +206 255 0 0 255 +Right CA2 +207 128 128 255 255 +Right CA3 +208 0 128 0 255 +Right CA4 +209 196 160 128 255 +Right GC-DG +210 32 200 255 255 +Right HATA +211 128 255 128 255 +Right fimbria +212 204 153 204 255 +Right lateral_ventricle +213 121 17 136 255 +Right molecular_layer_HP +214 128 0 0 255 +Right hippocampal_fissure +215 128 32 255 255 +Right entorhinal_cortex +216 255 204 102 255 +Right molecular_layer_subiculum +217 128 128 128 255 +Right Amygdala +218 104 255 255 255 +Right Cerebral_White_Matter +219 0 226 0 255 +Right Cerebral_Cortex +220 205 63 78 255 +Right Inf_Lat_Vent +221 197 58 250 255 +Right Perirhinal +222 33 150 250 255 +Right Cerebral_White_Matter_Edge +223 226 0 0 255 +Right Background +224 100 100 100 255 +Right Ectorhinal +225 197 150 250 255 +Right HP_tail +226 170 170 255 255 +Right Polymorphic-Layer +227 128 255 128 255 +Right Intracellular-Space +228 204 153 204 255 +Right HP_body +231 0 255 0 255 +Right HP_head +232 255 0 0 255 +Right presubiculum-head +233 32 0 32 255 +Right presubiculum-body +234 64 0 64 255 +Right subiculum-head +235 0 0 175 255 +Right subiculum-body +236 0 0 255 255 +Right CA1-head +237 175 75 75 255 +Right CA1-body +238 255 0 0 255 +Right CA3-head +239 0 80 0 255 +Right CA3-body +240 0 128 0 255 +Right CA4-head +241 120 90 50 255 +Right CA4-body +242 196 160 128 255 +Right GC-ML-DG-head +243 75 125 175 255 +Right GC-ML-DG-body +244 32 200 255 255 +Right molecular_layer_HP-head +245 100 25 25 255 +Right molecular_layer_HP-body +246 128 0 0 255 diff --git a/hippunfold/resources/magdeburg/magdeburg_labellist.L.txt b/hippunfold/resources/magdeburg/magdeburg_labellist.L.txt new file mode 100644 index 00000000..bc6ac378 --- /dev/null +++ b/hippunfold/resources/magdeburg/magdeburg_labellist.L.txt @@ -0,0 +1,28 @@ +Left CA1 +1 255 0 0 255 +Left CA2 +2 0 255 0 255 +Left DG +3 0 0 255 255 +Left CA3 +4 255 255 0 255 +Left Tail +5 0 255 255 255 +Left Label_6 +6 255 0 255 255 +Left Label_7 +7 255 239 213 255 +Left Sub +8 240 86 224 255 +Left ErC +9 205 133 63 255 +Left A35 +10 102 205 170 255 +Left A36 +11 0 0 128 255 +Left PhC +12 230 0 50 255 +Left Cysts +13 55 160 230 255 +Left Label_17 +17 221 160 221 255 diff --git a/hippunfold/resources/magdeburg/magdeburg_labellist.R.txt b/hippunfold/resources/magdeburg/magdeburg_labellist.R.txt new file mode 100644 index 00000000..5d7c289f --- /dev/null +++ b/hippunfold/resources/magdeburg/magdeburg_labellist.R.txt @@ -0,0 +1,28 @@ +Right CA1 +1 255 0 0 255 +Right CA2 +2 0 255 0 255 +Right DG +3 0 0 255 255 +Right CA3 +4 255 255 0 255 +Right Tail +5 0 255 255 255 +Right Label_6 +6 255 0 255 255 +Right Label_7 +7 255 239 213 255 +Right Sub +8 240 86 224 255 +Right ErC +9 205 133 63 255 +Right A35 +10 102 205 170 255 +Right A36 +11 0 0 128 255 +Right PhC +12 230 0 50 255 +Right Cysts +13 55 160 230 255 +Right Label_17 +17 221 160 221 255 diff --git a/hippunfold/workflow/rules/common.smk b/hippunfold/workflow/rules/common.smk index 28414a21..7b968e75 100644 --- a/hippunfold/workflow/rules/common.smk +++ b/hippunfold/workflow/rules/common.smk @@ -301,10 +301,12 @@ def get_final_qc(): space="{space}", suffix="{metric}.png", den="{density}", + atlas="{atlas}", **config["subj_wildcards"], ), density=config["output_density"], metric=["gyrification", "curvature", "thickness"], + atlas=config["atlas"], space=ref_spaces, allow_missing=True, ) diff --git a/hippunfold/workflow/rules/gifti.smk b/hippunfold/workflow/rules/gifti.smk index 137617b5..dcb92aa0 100644 --- a/hippunfold/workflow/rules/gifti.smk +++ b/hippunfold/workflow/rules/gifti.smk @@ -516,44 +516,6 @@ rule nii_to_label_gii: "unfold_template_hipp", "tpl-avg_space-unfold_den-{density}_midthickness.surf.gii", ), - output: - metric_gii=bids( - root=work, - datatype="surf", - den="{density}", - suffix="subfields.label.func.gii", - space="{space}", - hemi="{hemi}", - label="hipp", - **config["subj_wildcards"] - ), - group: - "subj" - container: - config["singularity"]["autotop"] - shell: - "wb_command -metric-convert -from-nifti {input.label_nii} {input.surf} {output.metric_gii}" - - -rule metric_to_label_gii: - input: - metric_gii=bids( - root=work, - datatype="surf", - den="{density}", - suffix="subfields.label.func.gii", - space="{space}", - hemi="{hemi}", - label="hipp", - **config["subj_wildcards"] - ), - label_list=os.path.join( - workflow.basedir, - "..", - "resources", - "bigbrain", - "sub-bigbrain_labellist.{hemi}.txt", - ), output: label_gii=bids( root=root, @@ -574,6 +536,10 @@ rule metric_to_label_gii: "wb_command -volume-to-surface-mapping {input.label_nii} {input.surf} {output.label_gii} -enclosing" + + + + def get_cmd_cifti_metric(wildcards, input, output): cmd = f"wb_command -cifti-create-dense-scalar {output}" if "L" in config["hemi"]: @@ -919,6 +885,7 @@ rule create_parcellated_scalar_csv: suffix="subfields.dlabel.nii", space="{space}", label="hipp", + atlas="{atlas}", **config["subj_wildcards"] ), dscalar=bids( @@ -938,6 +905,7 @@ rule create_parcellated_scalar_csv: suffix="{metric}.csv", space="{space}", label="{autotop,hipp}", + atlas="{atlas}", **config["subj_wildcards"] ), container: diff --git a/hippunfold/workflow/rules/qc.smk b/hippunfold/workflow/rules/qc.smk index 4aaaa2f5..8a8dc13f 100644 --- a/hippunfold/workflow/rules/qc.smk +++ b/hippunfold/workflow/rules/qc.smk @@ -269,6 +269,7 @@ rule plot_subj_surf_scalars: suffix="{metric}.csv", space="{space}", label="hipp", + atlas="{atlas}", **config["subj_wildcards"] ), output: @@ -280,6 +281,7 @@ rule plot_subj_surf_scalars: den="{density}", desc="subfields", suffix="{metric}.png", + atlas="{atlas}", **config["subj_wildcards"] ), ),