Skip to content

Commit d088410

Browse files
committed
SPM12 outputs .nii instead of .img/.hdr
1 parent 4d855cb commit d088410

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

examples/fmri_spm.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,13 @@
1818
import os # system functions
1919

2020
from nipype import config
21-
config.enable_provenance()
21+
#config.enable_provenance()
2222

2323
from nipype.interfaces import spm, fsl
2424

2525
# In order to use this example with SPM's matlab common runtime
26-
# matlab_cmd = ('/Users/satra/Downloads/spm8/run_spm8.sh '
27-
# '/Applications/MATLAB/MATLAB_Compiler_Runtime/v713/ script')
28-
# spm.SPMCommand.set_mlab_paths(matlab_cmd=matlab_cmd, use_mcr=True)
26+
matlab_cmd = ('/Applications/spm12/run_spm12.sh /Applications/MATLAB/MATLAB_Compiler_Runtime/v713/ script')
27+
spm.SPMCommand.set_mlab_paths(matlab_cmd=matlab_cmd, use_mcr=True)
2928

3029
import nipype.interfaces.io as nio # Data i/o
3130
import nipype.interfaces.utility as util # utility
@@ -349,7 +348,8 @@ def getstripdir(subject_id):
349348
# collect all the con images for each contrast.
350349
contrast_ids = range(1,len(contrasts)+1)
351350
l2source = pe.Node(nio.DataGrabber(infields=['fwhm', 'con']), name="l2source")
352-
l2source.inputs.template=os.path.abspath('spm_tutorial/l1output/*/con*/*/_fwhm_%d/con_%04d.img')
351+
# we use .*i* to capture both .img (SPM8) and .nii (SPM12)
352+
l2source.inputs.template=os.path.abspath('spm_tutorial/l1output/*/con*/*/_fwhm_%d/con_%04d.*i*')
353353
# iterate over all contrast images
354354
l2source.iterables = [('fwhm',fwhmlist),
355355
('con',contrast_ids)]

examples/fmri_spm_dartel.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,8 @@ def getstripdir(subject_id):
481481
# collect all the con images for each contrast.
482482
contrast_ids = range(1,len(contrasts)+1)
483483
l2source = pe.Node(nio.DataGrabber(infields=['fwhm', 'con']), name="l2source")
484-
l2source.inputs.template=os.path.abspath('spm_dartel_tutorial/l1output/*/con*/*/_fwhm_%d/con_%04d.img')
484+
# we use .*i* to capture both .img (SPM8) and .nii (SPM12)
485+
l2source.inputs.template=os.path.abspath('spm_dartel_tutorial/l1output/*/con*/*/_fwhm_%d/con_%04d.*i*')
485486
# iterate over all contrast images
486487
l2source.iterables = [('fwhm',fwhmlist),
487488
('con',contrast_ids)]

examples/fmri_spm_nested.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ def getstripdir(subject_id):
419419
"""
420420

421421
if __name__ == '__main__':
422-
level1.run()
422+
level1.run('MultiProc')
423423
level1.write_graph()
424424

425425
"""
@@ -435,7 +435,8 @@ def getstripdir(subject_id):
435435
# collect all the con images for each contrast.
436436
contrast_ids = range(1,len(contrasts)+1)
437437
l2source = pe.Node(nio.DataGrabber(infields=['fwhm', 'con']), name="l2source")
438-
l2source.inputs.template=os.path.abspath('spm_tutorial2/l1output/*/con*/*/_fwhm_%d/con_%04d.img')
438+
# we use .*i* to capture both .img (SPM8) and .nii (SPM12)
439+
l2source.inputs.template=os.path.abspath('spm_tutorial2/l1output/*/con*/*/_fwhm_%d/con_%04d.*i*')
439440
# iterate over all contrast images
440441
l2source.iterables = [('fwhm',fwhmlist),
441442
('con',contrast_ids)]
@@ -477,5 +478,5 @@ def getstripdir(subject_id):
477478
"""
478479

479480
if __name__ == '__main__':
480-
l2pipeline.run()
481+
l2pipeline.run('MultiProc')
481482

0 commit comments

Comments
 (0)