Skip to content

Commit 1a991b9

Browse files
committed
ENH: Set subject_id xor reference_file
1 parent f2f18ed commit 1a991b9

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

nipype/interfaces/freesurfer/registration.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ class MRICoregInputSpec(FSTraitedSpec):
344344
source_file = File(argstr='--mov %s', desc='source file to be registered',
345345
mandatory=True, copyfile=False)
346346
reference_file = File(argstr='--ref %s', desc='reference (target) file',
347-
mandatory=True, copyfile=False)
347+
mandatory=True, copyfile=False, xor=['subject_id'])
348348
out_lta_file = traits.Either(True, File, argstr='--lta %s', default=True,
349349
usedefault=True,
350350
desc='output registration file (LTA format)')
@@ -356,7 +356,8 @@ class MRICoregInputSpec(FSTraitedSpec):
356356
subjects_dir = Directory(exists=True, argstr='--sd %s',
357357
desc='FreeSurfer SUBJECTS_DIR')
358358
subject_id = traits.Str(
359-
argstr='--s %s', position=1,
359+
argstr='--s %s', position=1, mandatory=True, xor=['reference_file'],
360+
requires=['subjects_dir'],
360361
desc='freesurfer subject ID (implies ``reference_mask == '
361362
'aparc+aseg.mgz`` unless otherwise specified)')
362363
dof = traits.Enum(6, 9, 12, argstr='--dof %d',

nipype/interfaces/freesurfer/tests/test_auto_MRICoreg.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ def test_MRICoreg_inputs():
6060
reference_file=dict(argstr='--ref %s',
6161
copyfile=False,
6262
mandatory=True,
63+
xor=['subject_id'],
6364
),
6465
reference_mask=dict(argstr='--ref-mask %s',
6566
position=2,
@@ -77,7 +78,10 @@ def test_MRICoreg_inputs():
7778
source_oob=dict(argstr='--mov-oob',
7879
),
7980
subject_id=dict(argstr='--s %s',
81+
mandatory=True,
8082
position=1,
83+
requires=['subjects_dir'],
84+
xor=['reference_file'],
8185
),
8286
subjects_dir=dict(argstr='--sd %s',
8387
),

0 commit comments

Comments
 (0)