@@ -55,7 +55,7 @@ def copy2subjdir(cls, in_file, folder=None, basename=None, subject_id=None):
5555 out_file = os .path .join (out_dir , basename )
5656 if not os .path .isfile (out_file ):
5757 shutil .copy (in_file , out_file )
58-
58+ return out_file
5959
6060def createoutputdirs (outputs ):
6161 """create an output directories. If not created, some freesurfer interfaces fail"""
@@ -1569,13 +1569,12 @@ class MRIFillInputSpec(FSTraitedSpec):
15691569 desc = "Input segmentation file for MRIFill" )
15701570 transform = File (argstr = "-xform %s" , mandatory = False , exists = True ,
15711571 desc = "Input transform file for MRIFill" )
1572- log_file = File (argstr = "-a %s" , mandatory = False , exists = False ,
1573- desc = "Input segmentation file for MRIFill" )
1572+ log_file = File (argstr = "-a %s" , desc = "Output log file for MRIFill" )
15741573
15751574
15761575class MRIFillOutputSpec (TraitedSpec ):
15771576 out_file = File (exists = False , desc = "Output file from MRIFill" )
1578-
1577+ log_file = File ( desc = "Output log file from MRIFill" )
15791578
15801579class MRIFill (FSCommand ):
15811580 """
@@ -1599,6 +1598,8 @@ class MRIFill(FSCommand):
15991598 def _list_outputs (self ):
16001599 outputs = self ._outputs ().get ()
16011600 outputs ["out_file" ] = os .path .abspath (self .inputs .out_file )
1601+ if isdefined (self .inputs .log_file ):
1602+ outputs ["log_file" ] = os .path .abspath (self .inputs .log_file )
16021603 return outputs
16031604
16041605
@@ -1760,9 +1761,11 @@ def run(self, **inputs):
17601761 inputs ['subjects_dir' ] = self .inputs .subjects_dir
17611762 hemi = self .inputs .hemisphere
17621763 copy2subjdir (self , self .inputs .sphere , folder = 'surf' )
1763- copy2subjdir (self , self .inputs .in_orig ,
1764- folder = 'surf' ,
1765- basename = '{0}.orig' .format (hemi ))
1764+ # the orig file is edited in place
1765+ self .inputs .in_orig = copy2subjdir (self ,
1766+ self .inputs .in_orig ,
1767+ folder = 'surf' ,
1768+ basename = '{0}.orig' .format (hemi ))
17661769 copy2subjdir (self , self .inputs .in_inflated ,
17671770 folder = 'surf' ,
17681771 basename = '{0}.inflated' .format (hemi ))
0 commit comments