We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f437f69 commit ce25d24Copy full SHA for ce25d24
sdcflows/interfaces/bspline.py
@@ -374,12 +374,7 @@ def _run_interface(self, runtime):
374
unwarp = None
375
376
# Pre-cached interpolator object
377
- unwarp = B0FieldTransform(
378
- coeffs=[nb.load(cname) for cname in self.inputs.in_coeff],
379
- num_threads=(
380
- None if not isdefined(self.inputs.num_threads) else self.inputs.num_threads
381
- ),
382
- )
+ unwarp = B0FieldTransform(coeffs=[nb.load(cname) for cname in self.inputs.in_coeff])
383
384
# Reconstruct the field from the coefficients, on the target dataset's grid.
385
unwarp.fit(
@@ -401,6 +396,9 @@ def _run_interface(self, runtime):
401
396
pe_dir,
402
397
ro_time,
403
398
xfms=hmc_mats,
399
+ # num_threads=(
400
+ # None if not isdefined(self.inputs.num_threads) else self.inputs.num_threads
+ # ),
404
)
405
return runtime
406
sdcflows/transform.py
@@ -164,7 +164,7 @@ def apply(
164
cval: float = 0.0,
165
prefilter: bool = True,
166
output_dtype: Union[str, np.dtype] = None,
167
- num_threads: int = None,
+ # num_threads: int = None,
168
):
169
"""
170
Apply a transformation to an image, resampling on the reference spatial object.
@@ -202,8 +202,6 @@ def apply(
202
output_dtype : :obj:`str` or :obj:`~numpy.dtype`
203
Override the output data type, instead of propagating it from the
204
moving image.
205
- num_threads : :obj:`int`
206
- Number of CPUs resampling can be parallelized on.
207
208
Returns
209
-------
@@ -236,13 +234,14 @@ def apply(
236
234
np.meshgrid(*ijk_axis, indexing="ij"), dtype="float32"
237
235
).reshape(3, -1)
238
239
- if xfms is None:
+ if xfms is not None:
+ mov_ras2vox = np.linalg.inv(moving.affine)
240
# Map coordinates from reference to time-step
241
xfms.reference = moving
242
hmc_xyz = xfms.map(xfms.reference.ndcoords.T)
243
# Convert from RAS to voxel coordinates
244
voxcoords = (
245
- np.linalg.inv(xfms.reference.affine)
+ mov_ras2vox
246
@ _as_homogeneous(np.vstack(hmc_xyz), dim=xfms.reference.ndim).T
247
)[:3, ...]
248
sdcflows/workflows/apply/correction.py
@@ -159,10 +159,8 @@ def init_unwarp_wf(*, free_mem=None, omp_nthreads=1, debug=False, name="unwarp_w
159
(merge, average, [("out_file", "in_file")]),
160
(average, brainextraction_wf, [("out_file", "inputnode.in_file")]),
161
(merge, outputnode, [("out_file", "corrected")]),
162
- (resample, outputnode, [("out_field", "fieldmap"),
163
- ("out_warp", "fieldwarp")]),
- (resample_ref, outputnode, [("out_field", "fieldmap_ref"),
- ("out_warp", "fieldwarp_ref")]),
+ (resample, outputnode, [("out_field", "fieldmap")]),
+ (resample_ref, outputnode, [("out_field", "fieldmap_ref")]),
(brainextraction_wf, outputnode, [
("outputnode.out_file", "corrected_ref"),
("outputnode.out_mask", "corrected_mask"),
sdcflows/workflows/fit/pepolar.py
@@ -229,8 +229,7 @@ def init_topup_wf(
229
(split_blips, unwarp, [("out_files", "in_data")]),
230
(sort_pe_blips, unwarp, [("readout_times", "ro_time"),
231
("pe_dirs", "pe_dir")]),
232
- (unwarp, outputnode, [("out_warp", "out_warps"),
233
- ("out_field", "fmap")]),
+ (unwarp, outputnode, [("out_field", "fmap")]),
(unwarp, concat_corrected, [("out_corrected", "in_files")]),
(concat_corrected, ref_average, [("out_file", "in_file")]),
])
sdcflows/workflows/fit/syn.py
@@ -328,8 +328,7 @@ def init_syn_sdc_wf(
328
(zooms_bmask, outputnode, [("output_image", "fmap_mask")]),
329
(bs_filter, outputnode, [("out_coeff", "fmap_coeff")]),
330
(unwarp, outputnode, [("out_corrected", "fmap_ref"),
331
- ("out_field", "fmap"),
332
- ("out_warp", "out_warp")]),
+ ("out_field", "fmap")]),
333
334
# fmt: on
335
0 commit comments