Skip to content

Commit

Permalink
adjustments to get working with CITI168 templateseg
Browse files Browse the repository at this point in the history
- in CITI168 we have L and R masks..
- but will need to adjust this to get it working for data (ie Marm ex vivo) where only a
single hemi exists -- will need to include some logic to decide when to
register L hemi, vs when to register Lflip..
  • Loading branch information
akhanf committed Feb 16, 2024
1 parent de8a18a commit 29647cf
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions hippunfold/workflow/rules/templateseg.smk
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ rule template_reg:
moving_img=lambda wildcards, input: Path(input.template_dir)
/ config["template_files"][config["template"]][
get_modality_suffix(config["modality"])
],
].format(**wildcards),
xfm_corobl=lambda wildcards, input: Path(input.template_dir)
/ config["template_files"][config["template"]]["xfm_corobl"],
/ config["template_files"][config["template"]]["xfm_corobl"].format(
**wildcards
),
general_opts="-d 3 -m NCC 2x2x2",
smoothing_opts=get_smoothing_opt,
iteration_opts="-n 100x50x10", #default -n 100x100
Expand All @@ -41,7 +43,7 @@ rule template_reg:
from_="template",
to="subject",
space="corobl",
hemi="{hemi,Lflip|R}"
hemi="{hemi,R|L}"
),
group:
"subj"
Expand Down Expand Up @@ -79,7 +81,7 @@ rule warp_template_dseg:
template_dir=Path(download_dir) / "template" / config["template"],
params:
template_dseg=lambda wildcards, input: Path(input.template_dir)
/ config["template_files"][config["template"]]["dseg"],
/ config["template_files"][config["template"]]["dseg"].format(**wildcards),
interp_opt="-ri LABEL 0.2vox",
output:
inject_seg=bids(
Expand All @@ -89,7 +91,7 @@ rule warp_template_dseg:
suffix="dseg.nii.gz",
desc="postproc",
space="corobl",
hemi="{hemi,Lflip|R}"
hemi="{hemi,R|L}"
),
group:
"subj"
Expand Down Expand Up @@ -126,7 +128,7 @@ rule warp_template_coords:
params:
interp_opt="-ri NN",
template_coords=lambda wildcards, input: Path(input.template_dir)
/ config["template_files"][config["template"]]["coords"],
/ config["template_files"][config["template"]]["coords"].format(**wildcards),
output:
init_coords=bids(
root=work,
Expand All @@ -137,7 +139,7 @@ rule warp_template_coords:
suffix="coords.nii.gz",
desc="init",
space="corobl",
hemi="{hemi,R|Lflip}"
hemi="{hemi,R|L|Lflip}"
),
group:
"subj"
Expand Down Expand Up @@ -173,9 +175,13 @@ rule warp_template_anat:
template_dir=Path(download_dir) / "template" / config["template"],
params:
template_anat=lambda wildcards, input: Path(input.template_dir)
/ config["template_files"][config["template"]][config["modality"]],
/ config["template_files"][config["template"]][config["modality"]].format(
**wildcards
),
xfm_corobl=lambda wildcards, input: Path(input.template_dir)
/ config["template_files"][config["template"]]["xfm_corobl"],
/ config["template_files"][config["template"]]["xfm_corobl"].format(
**wildcards
),
output:
warped=bids(
root=work,
Expand All @@ -184,7 +190,7 @@ rule warp_template_anat:
suffix=f"{config['modality']}.nii.gz",
desc="warpedtemplate",
space="corobl",
hemi="{hemi,Lflip|R}",
hemi="{hemi,L|R}",
),
group:
"subj"
Expand Down

0 comments on commit 29647cf

Please sign in to comment.