-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added use_template_seg option, and MBMv2 files
still a WIP TODO: clean-up config and CLI for specifying templates -- right now --template and --template_files is used to select the rigid/affine reg template, and --inject_template and --inject_files is used to select the template shape injection or registration-based segmentation template (for use_template_seg).. could harmonize the structure for files, and keep separate flags..
- Loading branch information
Showing
17 changed files
with
386 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
|
||
configfile: 'config.yml' | ||
|
||
rule all: | ||
input: | ||
coords=expand('tpl-{template}_dir-{dir}_hemi-{hemi}_space-corobl_label-{label}_desc-laplace_coords.nii.gz', | ||
template='MBMv2',dir=['AP','PD','IO'],hemi='R',label=['hipp','dentate']) | ||
|
||
ruleorder: laplace_dentate_AP > laplace_coords | ||
|
||
rule laplace_coords: | ||
input: | ||
lbl=lambda wildcards: config['laplace_labels'][wildcards.label][wildcards.dir]['img'].format(**wildcards), | ||
params: | ||
gm_labels=lambda wildcards: config['laplace_labels'][wildcards.label][wildcards.dir]['gm'], | ||
src_labels=lambda wildcards: config['laplace_labels'][wildcards.label][wildcards.dir]['src'], | ||
sink_labels=lambda wildcards: config['laplace_labels'][wildcards.label][wildcards.dir]['sink'], | ||
convergence_threshold=1e-5, | ||
max_iters=10000, | ||
output: | ||
coords='tpl-{template}_dir-{dir}_hemi-{hemi}_space-corobl_label-{label}_desc-laplace_coords.nii.gz' | ||
log: | ||
'logs/tpl-{template}_dir-{dir}_hemi-{hemi}_space-corobl_label-{label}_desc-laplace_coords.txt' | ||
script: | ||
"../../workflow/scripts/laplace_coords.py" | ||
|
||
rule laplace_dentate_AP: | ||
""" we just mask this from the hipp label""" | ||
input: | ||
lbl=lambda wildcards: config['laplace_labels'][wildcards.label][wildcards.dir]['img'].format(**wildcards), | ||
coords='tpl-{template}_dir-AP_hemi-{hemi}_space-corobl_label-hipp_desc-laplace_coords.nii.gz' | ||
params: | ||
gm_labels=lambda wildcards: config['laplace_labels'][wildcards.label][wildcards.dir]['gm'], | ||
output: | ||
coords='tpl-{template}_dir-{dir,AP}_hemi-{hemi}_space-corobl_label-{label,dentate}_desc-laplace_coords.nii.gz' | ||
shell: | ||
'c3d {input.lbl} -retain-labels {params.gm_labels} -binarize {input.coords} -multiply -o {output.coords}' | ||
|
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
laplace_labels: | ||
hipp: | ||
AP: | ||
img: 'tpl-{template}_hemi-{hemi}_space-corobl_desc-tissuemanual_dseg.nii.gz' | ||
gm: | ||
- 1 | ||
- 8 | ||
src: | ||
- 5 | ||
sink: | ||
- 6 | ||
PD: | ||
img: 'tpl-{template}_hemi-{hemi}_space-corobl_desc-tissuemanual_dseg.nii.gz' | ||
gm: | ||
- 1 | ||
- 8 | ||
src: | ||
- 3 | ||
sink: | ||
- 8 | ||
IO: | ||
img: 'tpl-{template}_hemi-{hemi}_space-corobl_desc-tissuemanual_dseg.nii.gz' | ||
gm: | ||
- 1 | ||
- 8 | ||
src: | ||
- 2 | ||
- 4 | ||
- 7 | ||
sink: | ||
- 0 | ||
dentate: | ||
AP: | ||
img: 'tpl-{template}_hemi-{hemi}_space-corobl_desc-tissuemanual_dseg.nii.gz' | ||
gm: | ||
- 8 | ||
src: | ||
- 5 | ||
sink: | ||
- 6 | ||
PD: | ||
img: 'tpl-{template}_hemi-{hemi}_space-corobl_desc-tissueDGmanual_dseg.nii.gz' | ||
gm: | ||
- 8 | ||
src: | ||
- 1 | ||
sink: | ||
- 2 | ||
IO: | ||
img: 'tpl-{template}_hemi-{hemi}_space-corobl_desc-tissuemanual_dseg.nii.gz' | ||
gm: | ||
- 8 | ||
src: | ||
- 1 | ||
sink: | ||
- 2 | ||
- 4 | ||
- 7 | ||
- 0 | ||
|
||
|
Binary file added
BIN
+123 KB
...s/tpl-MBMv2/tpl-MBMv2_dir-AP_hemi-R_space-corobl_label-dentate_desc-laplace_coords.nii.gz
Binary file not shown.
Binary file added
BIN
+427 KB
...rces/tpl-MBMv2/tpl-MBMv2_dir-AP_hemi-R_space-corobl_label-hipp_desc-laplace_coords.nii.gz
Binary file not shown.
Binary file added
BIN
+103 KB
...s/tpl-MBMv2/tpl-MBMv2_dir-IO_hemi-R_space-corobl_label-dentate_desc-laplace_coords.nii.gz
Binary file not shown.
Binary file added
BIN
+446 KB
...rces/tpl-MBMv2/tpl-MBMv2_dir-IO_hemi-R_space-corobl_label-hipp_desc-laplace_coords.nii.gz
Binary file not shown.
Binary file added
BIN
+102 KB
...s/tpl-MBMv2/tpl-MBMv2_dir-PD_hemi-R_space-corobl_label-dentate_desc-laplace_coords.nii.gz
Binary file not shown.
Binary file added
BIN
+389 KB
...rces/tpl-MBMv2/tpl-MBMv2_dir-PD_hemi-R_space-corobl_label-hipp_desc-laplace_coords.nii.gz
Binary file not shown.
5 changes: 5 additions & 0 deletions
5
hippunfold/resources/tpl-MBMv2/tpl-MBMv2_from-native_to-corobl_type-itk_affine.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#Insight Transform File V1.0 | ||
#Transform 0 | ||
Transform: MatrixOffsetTransformBase_double_3_3 | ||
Parameters: 1 0 0 0 0.6018150231520484 -0.7986355100472928 0 0.7986355100472928 0.6018150231520484 0 2.2613285618049965 -4.855523654670475 | ||
FixedParameters: 0 0 0 |
Binary file added
BIN
+17.3 KB
hippunfold/resources/tpl-MBMv2/tpl-MBMv2_hemi-R_space-corobl_desc-tissueDGmanual_dseg.nii.gz
Binary file not shown.
Binary file added
BIN
+56.6 KB
hippunfold/resources/tpl-MBMv2/tpl-MBMv2_hemi-R_space-corobl_desc-tissuemanual_dseg.nii.gz
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.