|
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 |
@@ -214,9 +215,14 @@ def init_syn_sdc_wf( |
214 | 215 | find_zooms = pe.Node(niu.Function(function=_adjust_zooms), name="find_zooms") |
215 | 216 | zooms_epi = pe.Node(RegridToZooms(), name="zooms_epi") |
216 | 217 |
|
| 218 | + syn_config = data.load(f"sd_syn{'_sloppy' * sloppy}.json") |
| 219 | + |
| 220 | + vox_params = pe.Node(niu.Function(function=_mm2vox), name="vox_params") |
| 221 | + vox_params.inputs.registration_config = json.loads(syn_config.read_text()) |
| 222 | + |
217 | 223 | # SyN Registration Core |
218 | 224 | syn = pe.Node( |
219 | | - Registration(from_file=data.load(f"sd_syn{'_sloppy' * sloppy}.json")), |
| 225 | + Registration(from_file=syn_config), |
220 | 226 | name="syn", |
221 | 227 | n_procs=omp_nthreads, |
222 | 228 | ) |
@@ -295,11 +301,14 @@ def init_syn_sdc_wf( |
295 | 301 | (anat_dilmsk, amask2epi, [("out_file", "input_image")]), |
296 | 302 | (amask2epi, epi_umask, [("output_image", "in2")]), |
297 | 303 | (readout_time, warp_dir, [("pe_direction", "pe_dir")]), |
| 304 | + (clip_epi, vox_params, [("out_file", "moving_image")]), |
| 305 | + (readout_time, vox_params, [("pe_direction", "pe_dir")]), |
298 | 306 | (warp_dir, syn, [("out", "restrict_deformation")]), |
299 | 307 | (anat_merge, syn, [("out", "fixed_image")]), |
300 | 308 | (fixed_masks, syn, [("out", "fixed_image_masks")]), |
301 | 309 | (epi_merge, syn, [("out", "moving_image")]), |
302 | 310 | (moving_masks, syn, [("out", "moving_image_masks")]), |
| 311 | + (vox_params, syn, [("out", "transform_parameters")]), |
303 | 312 | (syn, extract_field, [(("forward_transforms", _pop), "transform")]), |
304 | 313 | (clip_epi, extract_field, [("out_file", "epi")]), |
305 | 314 | (readout_time, extract_field, [("readout_time", "ro_time"), |
|
0 commit comments