@@ -958,24 +958,20 @@ class MRIsCombineInputSpec(FSTraitedSpec):
958
958
"""
959
959
Uses Freesurfer's mris_convert to combine two surface files into one.
960
960
"""
961
- in_file1 = File (exists = True , mandatory = True , position = 1 ,
962
- argstr = '--combinesurfs %s' ,
963
- desc = 'File to be combined with in_file2' )
964
- in_file2 = File (exists = True , mandatory = True , position = 2 ,
965
- argstr = '%s' ,
966
- desc = 'File to be combined with in_file1' )
961
+ in_files = traits .List (File (Exists = True ), maxlen = 2 , minlen = 2 ,
962
+ mandatory = True , position = 1 , argstr = '--combinesurfs %s' ,
963
+ desc = 'Two surfaces to be combined.' )
967
964
out_file = File (argstr = '%s' , position = - 1 , genfile = True ,
968
965
mandatory = True ,
969
- desc = 'Output filename. Combined surfaces from in_file1 and '
970
- 'in_file2.' )
966
+ desc = 'Output filename. Combined surfaces from in_files.' )
971
967
972
968
973
969
class MRIsCombineOutputSpec (TraitedSpec ):
974
970
"""
975
971
Uses Freesurfer's mris_convert to combine two surface files into one.
976
972
"""
977
973
out_file = File (exists = True , desc = 'Output filename. Combined surfaces from '
978
- 'in_file1 and in_file2 .' )
974
+ 'in_files .' )
979
975
980
976
981
977
class MRIsCombine (FSCommand ):
@@ -990,18 +986,23 @@ class MRIsCombine(FSCommand):
990
986
991
987
>>> import nipype.interfaces.freesurfer as fs
992
988
>>> mris = fs.MRIsCombine()
993
- >>> mris.inputs.in_file1 = 'lh.pial'
994
- >>> mris.inputs.in_file2 = 'rh.pial'
995
- >>> mris.inputs.out_file = 'out.stl'
989
+ >>> mris.inputs.in_files = ['lh.pial', 'rh.pial']
990
+ >>> mris.inputs.out_file = 'bh.pial'
996
991
>>> mris.cmdline # doctest: +ALLOW_UNICODE
997
- 'mris_convert --combinesurfs lh.pial rh.pial out.stl '
992
+ 'mris_convert --combinesurfs lh.pial rh.pial bh.pial '
998
993
>>> mris.run() # doctest: +SKIP
999
994
"""
1000
995
_cmd = 'mris_convert'
1001
996
input_spec = MRIsCombineInputSpec
1002
997
output_spec = MRIsCombineOutputSpec
1003
998
1004
999
def _list_outputs (self ):
1000
+ """
1001
+ If the output file is not specified starting with 'lh.' or 'rh.',
1002
+ FreeSurfer prepends 'lh.' to the filename. It never adds 'rh.', even if
1003
+ both input files are from the right hemisphere. Output out_file must be
1004
+ adjusted to accommodate this.
1005
+ """
1005
1006
outputs = self .output_spec ().get ()
1006
1007
if any (self .inputs .out_file .startswith (pre ) for pre in ['lh.' , 'rh.' ]):
1007
1008
outputs ['out_file' ] = self .inputs .out_file
0 commit comments