Skip to content

Commit bad2874

Browse files
committed
ENH: Add more registration options to mri_vol2vol
1 parent f383af2 commit bad2874

File tree

2 files changed

+29
-8
lines changed

2 files changed

+29
-8
lines changed

nipype/interfaces/freesurfer/preprocess.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1277,7 +1277,15 @@ class ApplyVolTransformInputSpec(FSTraitedSpec):
12771277
fs_target = traits.Bool(argstr='--fstarg', xor=_targ_xor, mandatory=True,
12781278
requires=['reg_file'],
12791279
desc='use orig.mgz from subject in regfile as target')
1280-
_reg_xor = ('reg_file', 'fsl_reg_file', 'xfm_reg_file', 'reg_header', 'subject')
1280+
_reg_xor = ('reg_file', 'lta_file', 'lta_inv_file', 'fsl_reg_file', 'xfm_reg_file',
1281+
'reg_header', 'mni_152_reg', 'subject')
1282+
reg_file = File(exists=True, xor=_reg_xor, argstr='--reg %s',
1283+
mandatory=True,
1284+
desc='tkRAS-to-tkRAS matrix (tkregister2 format)')
1285+
lta_file = File(exists=True, xor=_reg_xor, argstr='--lta %s',
1286+
mandatory=True, desc='Linear Transform Array file')
1287+
lta_inv_file = File(exists=True, xor=_reg_xor, argstr='--lta-inv %s',
1288+
mandatory=True, desc='LTA, invert')
12811289
reg_file = File(exists=True, xor=_reg_xor, argstr='--reg %s',
12821290
mandatory=True,
12831291
desc='tkRAS-to-tkRAS matrix (tkregister2 format)')
@@ -1290,8 +1298,9 @@ class ApplyVolTransformInputSpec(FSTraitedSpec):
12901298
reg_header = traits.Bool(xor=_reg_xor, argstr='--regheader',
12911299
mandatory=True,
12921300
desc='ScannerRAS-to-ScannerRAS matrix = identity')
1293-
subject = traits.Str(xor=_reg_xor, argstr='--s %s',
1294-
mandatory=True,
1301+
mni_152_reg = traits.Bool(xor=_reg_xor, argstr='--regheader', mandatory=True,
1302+
desc='target MNI152 space')
1303+
subject = traits.Str(xor=_reg_xor, argstr='--s %s', mandatory=True,
12951304
desc='set matrix = identity and use subject for any templates')
12961305
inverse = traits.Bool(desc='sample from target to source',
12971306
argstr='--inv')

nipype/interfaces/freesurfer/tests/test_auto_ApplyVolTransform.py

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def test_ApplyVolTransform_inputs():
1616
),
1717
fsl_reg_file=dict(argstr='--fsl %s',
1818
mandatory=True,
19-
xor=('reg_file', 'fsl_reg_file', 'xfm_reg_file', 'reg_header', 'subject'),
19+
xor=('reg_file', 'lta_file', 'lta_inv_file', 'fsl_reg_file', 'xfm_reg_file', 'reg_header', 'mni_152_reg', 'subject'),
2020
),
2121
ignore_exception=dict(nohash=True,
2222
usedefault=True,
@@ -28,28 +28,40 @@ def test_ApplyVolTransform_inputs():
2828
invert_morph=dict(argstr='--inv-morph',
2929
requires=['m3z_file'],
3030
),
31+
lta_file=dict(argstr='--lta %s',
32+
mandatory=True,
33+
xor=('reg_file', 'lta_file', 'lta_inv_file', 'fsl_reg_file', 'xfm_reg_file', 'reg_header', 'mni_152_reg', 'subject'),
34+
),
35+
lta_inv_file=dict(argstr='--lta-inv %s',
36+
mandatory=True,
37+
xor=('reg_file', 'lta_file', 'lta_inv_file', 'fsl_reg_file', 'xfm_reg_file', 'reg_header', 'mni_152_reg', 'subject'),
38+
),
3139
m3z_file=dict(argstr='--m3z %s',
3240
),
41+
mni_152_reg=dict(argstr='--regheader',
42+
mandatory=True,
43+
xor=('reg_file', 'lta_file', 'lta_inv_file', 'fsl_reg_file', 'xfm_reg_file', 'reg_header', 'mni_152_reg', 'subject'),
44+
),
3345
no_ded_m3z_path=dict(argstr='--noDefM3zPath',
3446
requires=['m3z_file'],
3547
),
3648
no_resample=dict(argstr='--no-resample',
3749
),
3850
reg_file=dict(argstr='--reg %s',
3951
mandatory=True,
40-
xor=('reg_file', 'fsl_reg_file', 'xfm_reg_file', 'reg_header', 'subject'),
52+
xor=('reg_file', 'lta_file', 'lta_inv_file', 'fsl_reg_file', 'xfm_reg_file', 'reg_header', 'mni_152_reg', 'subject'),
4153
),
4254
reg_header=dict(argstr='--regheader',
4355
mandatory=True,
44-
xor=('reg_file', 'fsl_reg_file', 'xfm_reg_file', 'reg_header', 'subject'),
56+
xor=('reg_file', 'lta_file', 'lta_inv_file', 'fsl_reg_file', 'xfm_reg_file', 'reg_header', 'mni_152_reg', 'subject'),
4557
),
4658
source_file=dict(argstr='--mov %s',
4759
copyfile=False,
4860
mandatory=True,
4961
),
5062
subject=dict(argstr='--s %s',
5163
mandatory=True,
52-
xor=('reg_file', 'fsl_reg_file', 'xfm_reg_file', 'reg_header', 'subject'),
64+
xor=('reg_file', 'lta_file', 'lta_inv_file', 'fsl_reg_file', 'xfm_reg_file', 'reg_header', 'mni_152_reg', 'subject'),
5365
),
5466
subjects_dir=dict(),
5567
tal=dict(argstr='--tal',
@@ -69,7 +81,7 @@ def test_ApplyVolTransform_inputs():
6981
),
7082
xfm_reg_file=dict(argstr='--xfm %s',
7183
mandatory=True,
72-
xor=('reg_file', 'fsl_reg_file', 'xfm_reg_file', 'reg_header', 'subject'),
84+
xor=('reg_file', 'lta_file', 'lta_inv_file', 'fsl_reg_file', 'xfm_reg_file', 'reg_header', 'mni_152_reg', 'subject'),
7385
),
7486
)
7587
inputs = ApplyVolTransform.input_spec()

0 commit comments

Comments
 (0)