Skip to content

Commit 0a72b4e

Browse files
committed
Make requested changes.
In freesurfer/base/FSSurfaceCommand: - Remove unnecessary __init__ - Move _get_filecopy_info docstring to _normalize_filenames - Add to _associated_files docstring - Output files with no path info go to in_file’s directory, not working directory. In freesurfer/utils/MRIsCombine: - Add to MRIsCombine dosctring
1 parent 5f4d402 commit 0a72b4e

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

nipype/interfaces/freesurfer/base.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -169,17 +169,14 @@ class FSSurfaceCommand(FSCommand):
169169
output filename. Output out_file must be adjusted to accommodate this.
170170
By including the full path in the filename, we can also avoid this behavior.
171171
"""
172-
def __init__(self, **inputs):
173-
super(FSSurfaceCommand, self).__init__(**inputs)
174-
175172
def _get_filecopy_info(self):
176-
"""Filename normalization routine to perform only when run in Node
177-
context
178-
"""
179173
self._normalize_filenames()
180174
return super(FSSurfaceCommand, self)._get_filecopy_info()
181175

182176
def _normalize_filenames(self):
177+
"""Filename normalization routine to perform only when run in Node
178+
context
179+
"""
183180
pass
184181

185182
@staticmethod
@@ -188,10 +185,12 @@ def _associated_file(in_file, out_name):
188185
189186
Use in_file prefix to indicate hemisphere for out_name, rather than
190187
inspecting the surface data structure.
188+
Also, output to in_file's directory if path information not provided
189+
for out_name.
191190
"""
192191
path, base = os.path.split(out_name)
193192
if path == '':
194-
_, in_file = os.path.split(in_file)
193+
path, in_file = os.path.split(in_file)
195194
hemis = ('lh.', 'rh.')
196195
if in_file[:3] in hemis and base[:3] not in hemis:
197196
base = in_file[:3] + base

nipype/interfaces/freesurfer/utils.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -981,6 +981,11 @@ class MRIsCombine(FSSurfaceCommand):
981981
For complete details, see the `mris_convert Documentation.
982982
<https://surfer.nmr.mgh.harvard.edu/fswiki/mris_convert>`_
983983
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+
leaving out_file blank.
988+
984989
Example
985990
-------
986991

0 commit comments

Comments
 (0)