|
17 | 17 |
|
18 | 18 | import nipype.interfaces.io as nio # Data i/o
|
19 | 19 | import nipype.interfaces.fsl as fsl # fsl
|
20 |
| -import nipype.interfaces.utility as util # utility |
21 | 20 | import nipype.pipeline.engine as pe # pypeline engine
|
22 | 21 | import nipype.algorithms.modelgen as model # model generation
|
23 | 22 | from nipype.workflows.fmri.fsl import (create_featreg_preproc,
|
24 | 23 | create_modelfit_workflow,
|
25 |
| - create_fixed_effects_flow, |
26 | 24 | create_reg_workflow)
|
27 | 25 | from nipype.interfaces.base import Bunch
|
28 | 26 |
|
|
37 | 35 |
|
38 | 36 | fsl.FSLCommand.set_default_output_type('NIFTI_GZ')
|
39 | 37 |
|
40 |
| -""" |
41 |
| -Setting up workflows |
42 |
| --------------------- |
43 |
| -
|
44 |
| -In this tutorial we will be setting up a hierarchical workflow for fsl |
45 |
| -analysis. This will demonstrate how pre-defined workflows can be setup and |
46 |
| -shared across users, projects and labs. |
47 |
| -
|
48 |
| -
|
49 |
| -Setup preprocessing workflow |
50 |
| ----------------------------- |
51 |
| -
|
52 |
| -This is a generic fsl feat preprocessing workflow encompassing skull stripping, |
53 |
| -motion correction and smoothing operations. |
54 |
| -
|
55 |
| -""" |
56 |
| - |
57 | 38 |
|
58 | 39 |
|
59 | 40 | """
|
|
104 | 85 | regressor_names=None,
|
105 | 86 | regressors=None)]
|
106 | 87 |
|
107 |
| -modelfit = create_modelfit_workflow() |
| 88 | +modelfit = create_modelfit_workflow(f_contrasts=True) |
108 | 89 | modelfit.inputs.inputspec.interscan_interval = TR
|
109 | 90 | modelfit.inputs.inputspec.model_serial_correlations = True
|
110 | 91 | modelfit.inputs.inputspec.bases = {'dgamma': {'derivs': True}}
|
|
141 | 122 | Setup the datasink
|
142 | 123 | """
|
143 | 124 |
|
144 |
| -# datasink = pe.Node(interface=nio.DataSink(parameterization=False), name="datasink") |
145 |
| -# datasink.inputs.base_directory = os.path.abspath('./fsl_feeds/l1out') |
146 |
| -# datasink.inputs.substitutions = [('dtype_mcf_mask_mean', 'meanfunc'), |
147 |
| -# ('brain_brain_flirt','coregistered')] |
148 |
| -# # store relevant outputs from various stages of the 1st level analysis |
149 |
| -# l1pipeline.connect([(firstlevel, datasink,[('fixedfx.flameo.stats_dir',"fixedfx.@con"), |
150 |
| -# ('preproc.coregister.out_file','coregstruct'), |
151 |
| -# ('preproc.meanfunc2.out_file','meanfunc'), |
152 |
| -# ('modelfit.conestimate.zstats', 'level1.@Z'), |
153 |
| -# ]) |
154 |
| -# ]) |
| 125 | +datasink = pe.Node(interface=nio.DataSink(parameterization=False), name="datasink") |
| 126 | +datasink.inputs.base_directory = os.path.abspath('./fsl_feeds/l1out') |
| 127 | +datasink.inputs.substitutions = [('fmri_dtype_mcf_mask_smooth_mask_gms_mean_warp', 'meanfunc')] |
| 128 | +# store relevant outputs from various stages of the 1st level analysis |
| 129 | +l1pipeline.connect(registration, 'outputspec.transformed_files', datasink, 'level1.@Z') |
| 130 | +l1pipeline.connect(registration, 'outputspec.transformed_mean', datasink, 'meanfunc') |
| 131 | + |
155 | 132 | """
|
156 | 133 | Execute the pipeline
|
157 | 134 | --------------------
|
|
0 commit comments