Skip to content

Commit 0f7597f

Browse files
committed
Merge pull request #1199 from satra/fix/spmversion
fix: let spm use base class for version
2 parents 09a5851 + 4bde53c commit 0f7597f

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

nipype/interfaces/spm/preprocess.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,8 @@ class Segment(SPMCommand):
766766
767767
"""
768768

769-
if Info.version() and Info.version()['name'] == "SPM12":
769+
_local_version = SPMCommand().version
770+
if _local_version and '12.' in _local_version:
770771
_jobtype = 'tools'
771772
_jobname = 'oldseg'
772773
else:
@@ -893,7 +894,8 @@ class NewSegment(SPMCommand):
893894

894895
input_spec = NewSegmentInputSpec
895896
output_spec = NewSegmentOutputSpec
896-
if Info.version() and Info.version()['name'] == "SPM12":
897+
_local_version = SPMCommand().version
898+
if _local_version and '12.' in _local_version:
897899
_jobtype = 'spatial'
898900
_jobname = 'preproc'
899901
else:

nipype/interfaces/spm/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ def _list_outputs(self):
450450
from glob import glob
451451
outputs = self._outputs().get()
452452
od = os.path.abspath(self.inputs.output_dir)
453-
453+
454454
ext = self.inputs.format
455455
if self.inputs.output_dir_struct == "flat":
456456
outputs['out_files'] = glob(os.path.join(od, '*.%s'%ext))

nipype/pipeline/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -993,7 +993,7 @@ def clean_working_directory(outputs, cwd, inputs, needed_outputs, config,
993993
inputdict = inputs.get()
994994
input_files.extend(walk_outputs(inputdict))
995995
needed_files += [path for path, type in input_files if type == 'f']
996-
for extra in ['_0x*.json', 'provenance.*', 'pyscript*.m',
996+
for extra in ['_0x*.json', 'provenance.*', 'pyscript*.m', 'pyjobs*.mat',
997997
'command.txt', 'result*.pklz', '_inputs.pklz', '_node.pklz']:
998998
needed_files.extend(glob(os.path.join(cwd, extra)))
999999
if files2keep:

0 commit comments

Comments
 (0)