Skip to content

Commit

Permalink
Fixes to get this branch working
Browse files Browse the repository at this point in the history
- had some conflicts to resolve from the atlas PRs
- working with dry-run now
- TODO: full test, and consider making surf metrics consistent with
volume tsv files in format/layout -- or maybe an additional single tidy table for all
  • Loading branch information
akhanf committed Aug 15, 2022
1 parent 845ba8f commit 58e395c
Show file tree
Hide file tree
Showing 9 changed files with 242 additions and 38 deletions.
88 changes: 88 additions & 0 deletions hippunfold/resources/freesurfer/freesurfer_labellist.L.txt
Original file line number Diff line number Diff line change
@@ -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
88 changes: 88 additions & 0 deletions hippunfold/resources/freesurfer/freesurfer_labellist.R.txt
Original file line number Diff line number Diff line change
@@ -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
28 changes: 28 additions & 0 deletions hippunfold/resources/magdeburg/magdeburg_labellist.L.txt
Original file line number Diff line number Diff line change
@@ -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
28 changes: 28 additions & 0 deletions hippunfold/resources/magdeburg/magdeburg_labellist.R.txt
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions hippunfold/workflow/rules/common.smk
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down
44 changes: 6 additions & 38 deletions hippunfold/workflow/rules/gifti.smk
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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"]:
Expand Down Expand Up @@ -919,6 +885,7 @@ rule create_parcellated_scalar_csv:
suffix="subfields.dlabel.nii",
space="{space}",
label="hipp",
atlas="{atlas}",
**config["subj_wildcards"]
),
dscalar=bids(
Expand All @@ -938,6 +905,7 @@ rule create_parcellated_scalar_csv:
suffix="{metric}.csv",
space="{space}",
label="{autotop,hipp}",
atlas="{atlas}",
**config["subj_wildcards"]
),
container:
Expand Down
2 changes: 2 additions & 0 deletions hippunfold/workflow/rules/qc.smk
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ rule plot_subj_surf_scalars:
suffix="{metric}.csv",
space="{space}",
label="hipp",
atlas="{atlas}",
**config["subj_wildcards"]
),
output:
Expand All @@ -280,6 +281,7 @@ rule plot_subj_surf_scalars:
den="{density}",
desc="subfields",
suffix="{metric}.png",
atlas="{atlas}",
**config["subj_wildcards"]
),
),
Expand Down

0 comments on commit 58e395c

Please sign in to comment.