|
23 | 23 | """ |
24 | 24 | Estimating the susceptibility distortions without fieldmaps. |
25 | 25 | """ |
| 26 | +import json |
26 | 27 |
|
27 | 28 | from nipype.pipeline import engine as pe |
28 | 29 | from nipype.interfaces import utility as niu |
@@ -227,9 +228,14 @@ def init_syn_sdc_wf( |
227 | 228 | find_zooms = pe.Node(niu.Function(function=_adjust_zooms), name="find_zooms") |
228 | 229 | zooms_epi = pe.Node(RegridToZooms(), name="zooms_epi") |
229 | 230 |
|
| 231 | + syn_config = data.load(f"sd_syn{'_sloppy' * sloppy}.json") |
| 232 | + |
| 233 | + vox_params = pe.Node(niu.Function(function=_mm2vox), name="vox_params") |
| 234 | + vox_params.inputs.registration_config = json.loads(syn_config.read_text()) |
| 235 | + |
230 | 236 | # SyN Registration Core |
231 | 237 | syn = pe.Node( |
232 | | - Registration(from_file=data.load(f"sd_syn{'_sloppy' * sloppy}.json")), |
| 238 | + Registration(from_file=syn_config), |
233 | 239 | name="syn", |
234 | 240 | n_procs=omp_nthreads, |
235 | 241 | ) |
@@ -310,11 +316,14 @@ def init_syn_sdc_wf( |
310 | 316 | (anat_dilmsk, amask2epi, [("out_file", "input_image")]), |
311 | 317 | (amask2epi, epi_umask, [("output_image", "in2")]), |
312 | 318 | (readout_time, warp_dir, [("pe_direction", "pe_dir")]), |
| 319 | + (clip_epi, vox_params, [("out_file", "moving_image")]), |
| 320 | + (readout_time, vox_params, [("pe_direction", "pe_dir")]), |
313 | 321 | (warp_dir, syn, [("out", "restrict_deformation")]), |
314 | 322 | (anat_merge, syn, [("out", "fixed_image")]), |
315 | 323 | (fixed_masks, syn, [("out", "fixed_image_masks")]), |
316 | 324 | (epi_merge, syn, [("out", "moving_image")]), |
317 | 325 | (moving_masks, syn, [("out", "moving_image_masks")]), |
| 326 | + (vox_params, syn, [("out", "transform_parameters")]), |
318 | 327 | (syn, extract_field, [(("forward_transforms", _pop), "transform")]), |
319 | 328 | (clip_epi, extract_field, [("out_file", "epi")]), |
320 | 329 | (readout_time, extract_field, [("readout_time", "ro_time"), |
|
0 commit comments