Skip to content

Commit a0b934b

Browse files
committed
adding match fov to bring fs brain mask to T1w space
1 parent 2777fbe commit a0b934b

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

CPAC/anat_preproc/anat_preproc.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1322,17 +1322,30 @@ def freesurfer_fsl_brain_connector(wf, cfg, strat_pool, pipe_num, opt):
13221322

13231323
wf.connect(combine_mask, "out_file", binarize_combined_mask, "in_file")
13241324

1325+
# CCS brain mask is in FS space, transfer it back to native T1 space
1326+
match_fov_ccs_brain_mask = pe.Node(
1327+
interface=fsl.FLIRT(), name=f"match_fov_CCS_brain_mask_{node_id}"
1328+
)
1329+
match_fov_ccs_brain_mask.inputs.apply_xfm = True
1330+
match_fov_ccs_brain_mask.inputs.uses_qform = True
1331+
match_fov_ccs_brain_mask.inputs.interp = "nearestneighbour"
1332+
1333+
node, out = strat_pool.get_data("pipeline-fs_raw-average")
1334+
wf.connect(node, out, match_fov_ccs_brain_mask, "reference")
1335+
1336+
wf.connect(binarize_combined_mask, "out_file", match_fov_ccs_brain_mask, "in_file")
1337+
13251338
if opt == "FreeSurfer-BET-Tight":
13261339
outputs = {
13271340
"space-T1w_desc-tight_brain_mask": (
1328-
binarize_combined_mask,
1341+
match_fov_ccs_brain_mask,
13291342
"out_file",
13301343
)
13311344
}
13321345
elif opt == "FreeSurfer-BET-Loose":
13331346
outputs = {
13341347
"space-T1w_desc-loose_brain_mask": (
1335-
binarize_combined_mask,
1348+
match_fov_ccs_brain_mask,
13361349
"out_file",
13371350
)
13381351
}

0 commit comments

Comments
 (0)