Skip to content

Commit 647d690

Browse files
authored
Merge pull request #481 from HippocampusGirl/fix/nipype-xor-list
[FIX] AttributeError for _ApplyCoeffsFieldInputSpec
2 parents 4b1f566 + 9c1c0c0 commit 647d690

File tree

4 files changed

+21
-2
lines changed

4 files changed

+21
-2
lines changed

sdcflows/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ def doctest_fixture(doctest_namespace, request):
7272
dsA_dir=data_dir / "dsA",
7373
dsB_dir=data_dir / "dsB",
7474
dsC_dir=data_dir / "dsC",
75+
data_dir=data_dir,
7576
)
7677
doctest_namespace.update((key, Path(val.root)) for key, val in layouts.items())
7778

sdcflows/interfaces/bspline.py

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,12 +309,12 @@ class _ApplyCoeffsFieldInputSpec(BaseInterfaceInputSpec):
309309
fmap2data_xfm = InputMultiObject(
310310
File(exists=True),
311311
desc="the transform by which the target EPI can be resampled on the fieldmap's grid.",
312-
xor="data2fmap_xfm",
312+
xor=["data2fmap_xfm"],
313313
)
314314
data2fmap_xfm = InputMultiObject(
315315
File(exists=True),
316316
desc="the transform by which the fieldmap can be resampled on the target EPI's grid.",
317-
xor="fmap2data_xfm",
317+
xor=["fmap2data_xfm"],
318318
)
319319
in_xfms = traits.List(
320320
traits.List(traits.List(traits.Float)),
@@ -380,6 +380,24 @@ class ApplyCoeffsField(SimpleInterface):
380380
With those coordinates known, interpolation is trivial.
381381
4. Generate a spatial image with the new data.
382382
383+
Example
384+
-------
385+
386+
>>> from sdcflows.interfaces.bspline import ApplyCoeffsField
387+
>>> unwarp = ApplyCoeffsField(pe_dir='j', ro_time=0.03125)
388+
>>> unwarp.inputs.in_data = str(data_dir / 'epi.nii.gz')
389+
>>> unwarp.inputs.in_coeff = str(data_dir / 'topup-coeff.nii.gz')
390+
>>> unwarp.inputs.data2fmap_xfm = str(data_dir / 'epi2fmap_xfm.txt')
391+
>>> result = unwarp.run() # doctest: +SKIP
392+
393+
Inverse transforms may be used instead:
394+
395+
>>> unwarp = ApplyCoeffsField(pe_dir='j', ro_time=0.03125)
396+
>>> unwarp.inputs.in_data = str(data_dir / 'epi.nii.gz')
397+
>>> unwarp.inputs.in_coeff = str(data_dir / 'topup-coeff.nii.gz')
398+
>>> unwarp.inputs.fmap2data_xfm = str(data_dir / 'fmap2epi_xfm.txt')
399+
>>> result = unwarp.run() # doctest: +SKIP
400+
383401
"""
384402

385403
input_spec = _ApplyCoeffsFieldInputSpec

sdcflows/tests/data/epi2fmap_xfm.txt

Whitespace-only changes.

sdcflows/tests/data/fmap2epi_xfm.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)