|
15 | 15 | from niworkflows.interfaces.freesurfer import ( |
16 | 16 | PatchedRobustRegister as RobustRegister, |
17 | 17 | ) |
| 18 | +from niworkflows.interfaces.header import MatchHeader |
18 | 19 | from niworkflows.interfaces.morphology import BinaryDilation |
19 | 20 | from niworkflows.interfaces.patches import FreeSurferSource |
20 | 21 | from smriprep.interfaces.freesurfer import MakeMidthickness |
@@ -126,6 +127,9 @@ def init_mcribs_surface_recon_wf( |
126 | 127 | mask_dil = pe.Node(BinaryDilation(radius=3), name='mask_dil') |
127 | 128 | mask_las = pe.Node(ReorientImage(target_orientation='LAS'), name='mask_las') |
128 | 129 |
|
| 130 | + # N4 has low tolerance for mismatch between input / mask |
| 131 | + match_header = pe.Node(MatchHeader(), name='match_header') |
| 132 | + |
129 | 133 | # N4BiasCorrection occurs in MCRIBTissueSegMCRIBS (which is skipped) |
130 | 134 | # Run it (with mask to rescale intensities) prior injection |
131 | 135 | n4_mcribs = pe.Node( |
@@ -177,7 +181,9 @@ def init_mcribs_surface_recon_wf( |
177 | 181 | ('subjects_dir', 'subjects_dir'), |
178 | 182 | ('subject_id', 'subject_id')]), |
179 | 183 | (t2w_las, n4_mcribs, [('out_file', 'input_image')]), |
180 | | - (mask_las, n4_mcribs, [('out_file', 'mask_image')]), |
| 184 | + (mask_las, match_header, [('out_file', 'in_file')]), |
| 185 | + (t2w_las, match_header, [('out_file', 'reference')]), |
| 186 | + (match_header, n4_mcribs, [('out_file', 'mask_image')]), |
181 | 187 | (n4_mcribs, mcribs_recon, [('output_image', 't2w_file')]), |
182 | 188 | (seg_las, mcribs_recon, [('out_file', 'segmentation_file')]), |
183 | 189 | (inputnode, mcribs_postrecon, [ |
|
0 commit comments