|
99 | 99 | if not idx == len(group_list.keys()) - 1:
|
100 | 100 | title += '-'
|
101 | 101 |
|
102 |
| -""" |
| 102 | + """ |
103 | 103 |
|
104 |
| -.. warning:: |
105 |
| - The 'info' dictionary below is used to define the input files. In this case, the diffusion weighted image contains the string 'dwi'. |
106 |
| - The same applies to the b-values and b-vector files, and this must be changed to fit your naming scheme. |
| 104 | + .. warning:: |
| 105 | + The 'info' dictionary below is used to define the input files. In this case, the diffusion weighted image contains the string 'dwi'. |
| 106 | + The same applies to the b-values and b-vector files, and this must be changed to fit your naming scheme. |
107 | 107 |
|
108 | 108 |
|
109 |
| -""" |
110 |
| -info = dict(dwi=[['subject_id', 'dti']], |
111 |
| - bvecs=[['subject_id', 'bvecs']], |
112 |
| - bvals=[['subject_id', 'bvals']]) |
| 109 | + """ |
| 110 | + info = dict(dwi=[['subject_id', 'dti']], |
| 111 | + bvecs=[['subject_id', 'bvecs']], |
| 112 | + bvals=[['subject_id', 'bvals']]) |
113 | 113 |
|
114 |
| -""" |
115 |
| -This line creates the processing workflow given the information input about the groups and subjects. |
| 114 | + """ |
| 115 | + This line creates the processing workflow given the information input about the groups and subjects. |
116 | 116 |
|
117 |
| -.. seealso:: |
| 117 | + .. seealso:: |
118 | 118 |
|
119 |
| - * nipype/workflows/dmri/mrtrix/group_connectivity.py |
120 |
| - * nipype/workflows/dmri/mrtrix/connectivity_mapping.py |
121 |
| - * :ref:`dmri_connectivity_advanced |
| 119 | + * nipype/workflows/dmri/mrtrix/group_connectivity.py |
| 120 | + * nipype/workflows/dmri/mrtrix/connectivity_mapping.py |
| 121 | + * :ref:`dmri_connectivity_advanced |
122 | 122 |
|
123 |
| -""" |
| 123 | + """ |
124 | 124 |
|
125 |
| -l1pipeline = create_group_connectivity_pipeline(group_list, group_id, data_dir, subjects_dir, output_dir, info) |
| 125 | + l1pipeline = create_group_connectivity_pipeline(group_list, group_id, data_dir, subjects_dir, output_dir, info) |
126 | 126 |
|
127 |
| -""" |
128 |
| -This is used to demonstrate the ease through which different parameters can be set for each group. |
129 |
| -These values relate to the absolute threshold used on the fractional anisotropy map. This is done |
130 |
| -in order to identify single-fiber voxels. In brains with more damage, however, it may be necessary |
131 |
| -to reduce the threshold, since their brains are have lower average fractional anisotropy values. |
| 127 | + """ |
| 128 | + This is used to demonstrate the ease through which different parameters can be set for each group. |
| 129 | + These values relate to the absolute threshold used on the fractional anisotropy map. This is done |
| 130 | + in order to identify single-fiber voxels. In brains with more damage, however, it may be necessary |
| 131 | + to reduce the threshold, since their brains are have lower average fractional anisotropy values. |
132 | 132 | """
|
133 | 133 |
|
134 |
| -if group_id == 'parkinsons': |
135 |
| - l1pipeline.inputs.connectivity.mapping.threshold_FA.absolute_threshold_value = 0.5 |
136 |
| -else: |
137 |
| - l1pipeline.inputs.connectivity.mapping.threshold_FA.absolute_threshold_value = 0.7 |
| 134 | + if group_id == 'parkinsons': |
| 135 | + l1pipeline.inputs.connectivity.mapping.threshold_FA.absolute_threshold_value = 0.5 |
| 136 | + else: |
| 137 | + l1pipeline.inputs.connectivity.mapping.threshold_FA.absolute_threshold_value = 0.7 |
138 | 138 |
|
139 |
| -""" |
140 |
| -These lines relate to inverting the b-vectors in the encoding file, and setting the |
141 |
| -maximum harmonic order of the pre-tractography spherical deconvolution step. This is |
142 |
| -done to show how to set inputs that will affect both groups. |
143 |
| -""" |
| 139 | + """ |
| 140 | + These lines relate to inverting the b-vectors in the encoding file, and setting the |
| 141 | + maximum harmonic order of the pre-tractography spherical deconvolution step. This is |
| 142 | + done to show how to set inputs that will affect both groups. |
| 143 | + """ |
144 | 144 |
|
145 |
| -l1pipeline.inputs.connectivity.mapping.fsl2mrtrix.invert_y = True |
146 |
| -l1pipeline.inputs.connectivity.mapping.csdeconv.maximum_harmonic_order = 6 |
| 145 | + l1pipeline.inputs.connectivity.mapping.fsl2mrtrix.invert_y = True |
| 146 | + l1pipeline.inputs.connectivity.mapping.csdeconv.maximum_harmonic_order = 6 |
147 | 147 |
|
148 |
| -""" |
149 |
| -Define the parcellation scheme to use. |
150 |
| -""" |
| 148 | + """ |
| 149 | + Define the parcellation scheme to use. |
| 150 | + """ |
151 | 151 |
|
152 |
| -parcellation_name = 'scale500' |
153 |
| -l1pipeline.inputs.connectivity.mapping.Parcellate.parcellation_name = parcellation_name |
154 |
| -cmp_config = cmp.configuration.PipelineConfiguration() |
155 |
| -cmp_config.parcellation_scheme = "Lausanne2008" |
156 |
| -l1pipeline.inputs.connectivity.mapping.inputnode_within.resolution_network_file = cmp_config._get_lausanne_parcellation('Lausanne2008')[parcellation_name]['node_information_graphml'] |
| 152 | + parcellation_name = 'scale500' |
| 153 | + l1pipeline.inputs.connectivity.mapping.Parcellate.parcellation_name = parcellation_name |
| 154 | + cmp_config = cmp.configuration.PipelineConfiguration() |
| 155 | + cmp_config.parcellation_scheme = "Lausanne2008" |
| 156 | + l1pipeline.inputs.connectivity.mapping.inputnode_within.resolution_network_file = cmp_config._get_lausanne_parcellation('Lausanne2008')[parcellation_name]['node_information_graphml'] |
157 | 157 |
|
158 |
| -""" |
159 |
| -Set the maximum number of tracks to obtain |
160 |
| -""" |
| 158 | + """ |
| 159 | + Set the maximum number of tracks to obtain |
| 160 | + """ |
161 | 161 |
|
162 |
| -l1pipeline.inputs.connectivity.mapping.probCSDstreamtrack.desired_number_of_tracks = 100000 |
| 162 | + l1pipeline.inputs.connectivity.mapping.probCSDstreamtrack.desired_number_of_tracks = 100000 |
163 | 163 |
|
164 |
| -""" |
165 |
| -The first level pipeline we have tweaked here is run within the for loop. |
166 |
| -""" |
| 164 | + """ |
| 165 | + The first level pipeline we have tweaked here is run within the for loop. |
| 166 | + """ |
167 | 167 |
|
168 |
| -l1pipeline.run() |
169 |
| -l1pipeline.write_graph(format='eps', graph2use='flat') |
| 168 | + l1pipeline.run() |
| 169 | + l1pipeline.write_graph(format='eps', graph2use='flat') |
170 | 170 |
|
171 |
| -""" |
172 |
| -Next we create and run the second-level pipeline. The purpose of this workflow is simple: |
173 |
| -It is used to merge each subject's CFF file into one, so that there is a single file containing |
174 |
| -all of the networks for each group. This can be useful for performing Network Brain Statistics |
175 |
| -using the NBS plugin in ConnectomeViewer. |
| 171 | + """ |
| 172 | + Next we create and run the second-level pipeline. The purpose of this workflow is simple: |
| 173 | + It is used to merge each subject's CFF file into one, so that there is a single file containing |
| 174 | + all of the networks for each group. This can be useful for performing Network Brain Statistics |
| 175 | + using the NBS plugin in ConnectomeViewer. |
176 | 176 |
|
177 |
| -.. seealso:: |
| 177 | + .. seealso:: |
178 | 178 |
|
179 |
| - http://www.connectomeviewer.org/documentation/users/tutorials/tut_nbs.html |
| 179 | + http://www.connectomeviewer.org/documentation/users/tutorials/tut_nbs.html |
180 | 180 |
|
181 |
| -""" |
| 181 | + """ |
182 | 182 |
|
183 |
| -l2pipeline = create_merge_network_results_by_group_workflow(group_list, group_id, data_dir, subjects_dir, output_dir) |
184 |
| -l2pipeline.inputs.l2inputnode.network_file = cmp_config._get_lausanne_parcellation('Lausanne2008')[parcellation_name]['node_information_graphml'] |
185 |
| -l2pipeline.run() |
186 |
| -l2pipeline.write_graph(format='eps', graph2use='flat') |
| 183 | + l2pipeline = create_merge_network_results_by_group_workflow(group_list, group_id, data_dir, subjects_dir, output_dir) |
| 184 | + l2pipeline.inputs.l2inputnode.network_file = cmp_config._get_lausanne_parcellation('Lausanne2008')[parcellation_name]['node_information_graphml'] |
| 185 | + l2pipeline.run() |
| 186 | + l2pipeline.write_graph(format='eps', graph2use='flat') |
187 | 187 |
|
188 | 188 | """
|
189 | 189 | Now that the for loop is complete there are two grouped CFF files each containing the appropriate subjects.
|
|
0 commit comments