Skip to content

Commit 1bb4416

Browse files
committed
add to init and changes, rename some arguments and add descriptions, add
example
1 parent d999a56 commit 1bb4416

File tree

3 files changed

+29
-11
lines changed

3 files changed

+29
-11
lines changed

CHANGES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
Next Release
22
============
33

4+
* ENH: New Freesurfer interface: Tkregister2 (for conversion of fsl style matrices to freesurfer format)
45
* ENH: New FSL interfaces: WarpPoints, WarpPointsToStd.
56
* ENH: New Freesurfer interface: MRIPretess
67
* ENH: New miscelaneous interface: AddCSVRow

nipype/interfaces/freesurfer/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
from .utils import (SampleToSurface, SurfaceSmooth, SurfaceTransform, Surface2VolTransform,
1313
SurfaceSnapshots,ApplyMask, MRIsConvert, MRITessellate, MRIPretess,
1414
MRIMarchingCubes, SmoothTessellation, MakeAverageSubject,
15-
ExtractMainComponent)
15+
ExtractMainComponent, Tkregister2)

nipype/interfaces/freesurfer/utils.py

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,22 +1189,39 @@ class ExtractMainComponent(CommandLine):
11891189
input_spec=ExtractMainComponentInputSpec
11901190
output_spec=ExtractMainComponentOutputSpec
11911191

1192-
class Tkregister2InputSpec(FSTraitedSpec):
1193-
1194-
mov = File(exists=True, mandatory=True, argstr="--mov %s")
1195-
fsl = File(exists=True, argstr="--fsl %s")
1196-
subject_id = traits.String(argstr="--s %s", mandatory=True)
1197-
noedit = traits.Bool(argstr="--noedit")
1198-
out_reg_file = File(name_template='%s.dat', name_source='fsl', mandatory=True, argstr="--reg %s")
11991192

1193+
class Tkregister2InputSpec(FSTraitedSpec):
1194+
moving_image = File(exists=True, mandatory=True, argstr="--mov %s",
1195+
desc='moving volume')
1196+
fsl_in_matrix = File(exists=True, argstr="--fsl %s",
1197+
desc='fsl-style registration input matrix')
1198+
subject_id = traits.String(argstr="--s %s", mandatory=True,
1199+
desc='freesurfer subject ID')
1200+
subjects_dir = traits.Str(argstr='--sd %s',
1201+
desc=('freesurfer subjects directory defaults to $SUBJECTS_DIR'))
1202+
noedit = traits.Bool(True, argstr="--noedit", desc='do not open edit window (exit)', usedefault=True)
1203+
reg_file = File(name_template='%s.dat', name_source='fsl',
1204+
mandatory=True, argstr="--reg %s",
1205+
desc='freesurfer-style registration file')
12001206

12011207
class Tkregister2OutputSpec(TraitedSpec):
1208+
reg_file = File(exists=True, desc='freesurfer-style registration file')
12021209

1203-
out_reg_file = File(exists=True)
1210+
class Tkregister2(FSCommand):
1211+
"""Use tkregister2 without the manual editing stage to convert
1212+
FSL-style registration matrix (.mat) to FreeSurfer-style registration matrix (.dat)
12041213
1214+
Examples
1215+
--------
12051216
1206-
class Tkregister2(FSCommand):
1207-
1217+
>>> from nipype.interfaces.freesurfer import Tkregister2
1218+
>>> tk2 = Tkregister2(reg_file='register.dat')
1219+
>>> tk2.inputs.moving_image = 'func.nii.gz'
1220+
>>> tk2.inputs.fsl_in_matrix = 'func2anat.mat'
1221+
>>> tk2.inputs.subject_id = 'test_subject'
1222+
>>> tk2.inputs.subjects_dir = '.'
1223+
>>> tk2.run()
1224+
"""
12081225
_cmd = "tkregister2"
12091226
input_spec = Tkregister2InputSpec
12101227
output_spec = Tkregister2OutputSpec

0 commit comments

Comments
 (0)