Skip to content

Commit ddce410

Browse files
committed
Merge pull request #403 from satra/fix/test
fix: examples
2 parents e25701c + c8f0283 commit ddce410

File tree

2 files changed

+29
-10
lines changed

2 files changed

+29
-10
lines changed

examples/fmri_fsl_reuse.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,6 @@
1717

1818
import os # system functions
1919

20-
"""
21-
.. note::
22-
config for logging should be set before anything else
23-
"""
24-
25-
from nipype.utils.config import config
26-
config.set('logging', 'log_to_file', 'false')
27-
config.set_log_dir(os.getcwd())
28-
2920
import nipype.interfaces.io as nio # Data i/o
3021
import nipype.interfaces.fsl as fsl # fsl
3122
import nipype.interfaces.utility as util # utility

examples/amri_freesurfer.py renamed to examples/smri_freesurfer.py

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,36 @@
1+
#!/usr/bin/env python
2+
"""
3+
================
4+
sMRI: FreeSurfer
5+
================
6+
7+
This script, smri_freesurfer.py, demonstrates the ability to call reconall on
8+
a set of subjects and then make an average subject.
9+
10+
python smri_freesurfer.py
11+
12+
Import necessary modules from nipype.
13+
"""
14+
15+
import os
16+
117
import nipype.pipeline.engine as pe
218
import nipype.interfaces.io as nio
3-
import os
419
from nipype.interfaces.freesurfer.preprocess import ReconAll
520
from nipype.interfaces.freesurfer.utils import MakeAverageSubject
621

22+
723
subject_list = ['s1', 's3']
824
data_dir = os.path.abspath('data')
925
subjects_dir = os.path.abspath('amri_freesurfer_tutorial/subjects_dir')
1026

1127
wf = pe.Workflow(name="l1workflow")
1228
wf.base_dir = os.path.abspath('amri_freesurfer_tutorial/workdir')
1329

30+
"""
31+
Grab data
32+
"""
33+
1434
datasource = pe.MapNode(interface=nio.DataGrabber(infields=['subject_id'],
1535
outfields=['struct']),
1636
name='datasource',
@@ -20,6 +40,10 @@
2040
datasource.inputs.template_args = dict(struct=[['subject_id', 'struct']])
2141
datasource.inputs.subject_id = subject_list
2242

43+
"""
44+
Run recon-all
45+
"""
46+
2347
recon_all = pe.MapNode(interface=ReconAll(), name='recon_all',
2448
iterfield=['subject_id', 'T1_files'])
2549
recon_all.inputs.subject_id = subject_list
@@ -29,6 +53,10 @@
2953

3054
wf.connect(datasource, 'struct', recon_all, 'T1_files')
3155

56+
"""
57+
Make average subject
58+
"""
59+
3260
average = pe.Node(interface=MakeAverageSubject(), name="average")
3361
average.inputs.subjects_dir = subjects_dir
3462

0 commit comments

Comments
 (0)