@@ -976,16 +976,18 @@ class MRIsCombineOutputSpec(TraitedSpec):
976
976
977
977
class MRIsCombine (FSSurfaceCommand ):
978
978
"""
979
- Uses Freesurfer's mris_convert to combine two surface files into one.
979
+ Uses Freesurfer's `` mris_convert`` to combine two surface files into one.
980
980
981
981
For complete details, see the `mris_convert Documentation.
982
982
<https://surfer.nmr.mgh.harvard.edu/fswiki/mris_convert>`_
983
983
984
- If given an out_file that does not begin with 'lh.' or 'rh.',
985
- mris_convert will prepend 'lh.' to the file name.
986
- To avoid this behavior, consider setting out_file = './<filename>', or
984
+ If given an `` out_file`` that does not begin with `` 'lh.'`` or `` 'rh.'`` ,
985
+ `` mris_convert`` will prepend `` 'lh.'`` to the file name.
986
+ To avoid this behavior, consider setting `` out_file = './<filename>'`` , or
987
987
leaving out_file blank.
988
988
989
+ In a Node/Workflow, ``out_file`` is interpreted literally.
990
+
989
991
Example
990
992
-------
991
993
@@ -1003,24 +1005,21 @@ class MRIsCombine(FSSurfaceCommand):
1003
1005
1004
1006
def _list_outputs (self ):
1005
1007
outputs = self ._outputs ().get ()
1006
- outputs ['out_file' ] = self ._associated_file (self .inputs .in_files [0 ],
1007
- self .inputs .out_file )
1008
- return outputs
1009
1008
1010
- @staticmethod
1011
- def _associated_file (in_file , out_name ):
1012
- """Unlike the standard _associated_file, which uses the prefix from
1013
- in_file, in MRIsCombine, it uses 'lh.' as the prefix for the output
1014
- file no matter what the inputs are.
1015
- """
1016
- path , base = os .path .split (out_name )
1017
- if path == '' :
1018
- hemis = ('lh.' , 'rh.' )
1019
- if base [:3 ] not in hemis :
1020
- base = 'lh.' + base
1021
- return os .path .abspath (os .path .join (path , base ))
1009
+ # mris_convert --combinesurfs uses lh. as the default prefix
1010
+ # regardless of input file names, except when path info is
1011
+ # specified
1012
+ path , base = os .path .split (self .inputs .out_file )
1013
+ if path == '' and base [:3 ] not in ('lh.' , 'rh.' ):
1014
+ base = 'lh.' + base
1015
+ outputs ['out_file' ] = os .path .abspath (os .path .join (path , base ))
1016
+
1017
+ return outputs
1022
1018
1023
1019
def _normalize_filenames (self ):
1020
+ """ In a Node context, interpret out_file as a literal path to
1021
+ reduce surprise.
1022
+ """
1024
1023
if isdefined (self .inputs .out_file ):
1025
1024
self .inputs .out_file = os .path .abspath (self .inputs .out_file )
1026
1025
0 commit comments