File tree Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Original file line number Diff line number Diff line change 1515from nipype .interfaces .fsl .maths import ApplyMask
1616from nipype .interfaces .ants import N4BiasFieldCorrection , Atropos , MultiplyImages
1717
18- from ..utils .misc import get_template_specs
18+ from ..utils .misc import get_template_specs , select_first as _pop
1919
2020# niworkflows
2121from ..interfaces .ants import (
@@ -897,12 +897,6 @@ def init_n4_only_wf(
897897 return wf
898898
899899
900- def _pop (in_files ):
901- if isinstance (in_files , (list , tuple )):
902- return in_files [0 ]
903- return in_files
904-
905-
906900def _select_labels (in_segm , labels ):
907901 from os import getcwd
908902 import numpy as np
Original file line number Diff line number Diff line change @@ -215,10 +215,13 @@ def splitext(fname):
215215def select_first (in_files ):
216216 """
217217 Select the first file from a list of filenames.
218+
218219 Used to grab the first echo's file when processing
219220 multi-echo data through workflows that only accept
220221 a single file.
221222
223+ Examples
224+ --------
222225 >>> select_first('some/file.nii.gz')
223226 'some/file.nii.gz'
224227 >>> select_first(['some/file1.nii.gz', 'some/file2.nii.gz'])
@@ -227,8 +230,7 @@ def select_first(in_files):
227230 """
228231 if isinstance (in_files , (list , tuple )):
229232 return in_files [0 ]
230- else :
231- return in_files
233+ return in_files
232234
233235
234236def _copy_any (src , dst ):
You can’t perform that action at this time.
0 commit comments