Skip to content

Commit bf8f5bf

Browse files
committed
📝 Restore broken DOT graphs in docstrings
1 parent 2b48241 commit bf8f5bf

File tree

16 files changed

+222
-56
lines changed

16 files changed

+222
-56
lines changed

CPAC/alff/alff.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,22 @@ def create_alff(wf_name='alff_workflow'):
115115
-mas rest_mask.nii.gz
116116
fALFF_Z.nii.gz
117117
118+
.. exec::
119+
from CPAC.alff import create_alff
120+
wf = create_alff()
121+
wf.write_graph(
122+
graph2use='orig',
123+
dotfilename='./images/generated/alff.dot'
124+
)
125+
118126
High Level Workflow Graph:
119127
120-
.. image:: ../images/alff.dot.png
128+
.. image:: ../../images/generated/alff.png
121129
:width: 500
122130
123131
Detailed Workflow Graph:
124132
125-
.. image:: ../images/alff_detailed.dot.png
133+
.. image:: ../../images/generated/alff_detailed.png
126134
:width: 500
127135
128136

CPAC/anat_preproc/anat_preproc.py

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -588,12 +588,31 @@ def create_anat_preproc(method='afni', already_skullstripped=False,
588588
-expr 'a*step(b)'
589589
-prefix mprage_RPI_3dc.nii.gz
590590
591+
.. exec::
592+
import yaml
593+
from urllib.request import urlopen
594+
from CPAC.anat_preproc import create_anat_preproc
595+
from CPAC.utils.configuration import Configuration
596+
597+
wf = create_anat_preproc(
598+
config=Configuration(yaml.safe_load(urlopen(
599+
'https://raw.githubusercontent.com/FCP-INDI/C-PAC/develop/'
600+
'dev/docker_data/default_pipeline.yml'
601+
)))
602+
)
603+
wf.write_graph(
604+
graph2use='orig',
605+
dotfilename='./images/generated/anatpreproc.dot'
606+
)
607+
591608
High Level Workflow Graph:
592-
.. image:: ../images/anatpreproc_graph.dot.png
609+
610+
.. image:: ../../images/generated/anatpreproc.png
593611
:width: 500
594612
595613
Detailed Workflow Graph:
596-
.. image:: ../images/anatpreproc_graph_detailed.dot.png
614+
615+
.. image:: ../../images/generated/anatpreproc_detailed.png
597616
:width: 500
598617
599618
Examples
@@ -738,5 +757,3 @@ def create_anat_preproc(method='afni', already_skullstripped=False,
738757
preproc.connect(anat_leaf2, 'anat_data', outputnode, 'anat_skull_leaf')
739758

740759
return preproc
741-
742-

CPAC/cwas/pipeline.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,22 @@ def create_cwas(name='cwas', working_dir=None, crash_dir=None):
6363
4. Calculate MDMR statistics for the voxel
6464
5. Determine significance of MDMR statistics with permutation tests
6565
66+
.. exec::
67+
from CPAC.cwas import create_cwas
68+
wf = create_cwas()
69+
wf.write_graph(
70+
graph2use='orig',
71+
dotfilename='./images/generated/create_cwas.dot'
72+
)
73+
6674
Workflow Graph:
6775
68-
.. image:: ../images/cwas.dot.png
76+
.. image:: ../../images/generated/cwas.png
6977
:width: 500
7078
7179
Detailed Workflow Graph:
7280
73-
.. image:: ../images/cwas_detailed.dot.png
81+
.. image:: ../../images/generated/cwas_detailed.png
7482
:width: 500
7583
7684
References

CPAC/easy_thresh/easy_thresh.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,21 @@ def easy_thresh(wf_name):
138138
139139
High Level Workflow Graph:
140140
141-
.. image:: ../images/easy_thresh.dot.png
141+
.. exec::
142+
from CPAC.easy_thresh import easy_thresh
143+
wf = easy_thresh('easy_thresh_wf')
144+
wf.write_graph(
145+
graph2use='orig',
146+
dotfilename='./images/generated/easy_thresh.dot'
147+
)
148+
149+
.. image:: ../../images/generated/easy_thresh.png
142150
:width: 800
143151
144152
145153
Detailed Workflow Graph:
146154
147-
.. image:: ../images/easy_thresh_detailed.dot.png
155+
.. image:: ../../images/generated/generated.easy_thresh_detailed.png
148156
:width: 800
149157
150158
Examples
@@ -479,6 +487,3 @@ def get_tuple(infile_a, infile_b):
479487
"""
480488
out_file = (infile_a, infile_b[1])
481489
return out_file
482-
483-
484-

CPAC/func_preproc/func_preproc.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -731,21 +731,30 @@ def create_func_preproc(skullstrip_tool, motion_correct_tool,
731731
-odt char
732732
733733
.. exec::
734+
import yaml
735+
from urllib.request import urlopen
734736
from CPAC.func_preproc import create_func_preproc
735-
wf = create_func_preproc()
737+
from CPAC.utils.configuration import Configuration
738+
739+
wf = create_func_preproc('fsl', '3dvolreg', 'mean',
740+
config=Configuration(yaml.safe_load(urlopen(
741+
'https://raw.githubusercontent.com/FCP-INDI/C-PAC/develop/'
742+
'dev/docker_data/default_pipeline.yml'
743+
)))
744+
)
736745
wf.write_graph(
737746
graph2use='orig',
738747
dotfilename='./images/generated/func_preproc.dot'
739748
)
740749
741750
High Level Workflow Graph:
742751
743-
.. image:: ../images/generated/func_preproc.png
752+
.. image:: ../../images/generated/func_preproc.png
744753
:width: 1000
745754
746755
Detailed Workflow Graph:
747756
748-
.. image:: ../images/generated/func_preproc_detailed.png
757+
.. image:: ../../images/generated/func_preproc_detailed.png
749758
:width: 1000
750759
751760
Examples

CPAC/generate_motion_statistics/generate_motion_statistics.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,12 @@ def motion_power_statistics(name='motion_stats', motion_correct_tool='3dvolreg')
135135
136136
High Level Workflow Graph:
137137
138-
.. image:: ../images/generated/motion_statistics.png
138+
.. image:: ../../images/generated/motion_statistics.png
139139
:width: 1000
140140
141141
Detailed Workflow Graph:
142142
143-
.. image:: ../images/generated/motion_statistics_detailed.png
143+
.. image:: ../../images/generated/motion_statistics_detailed.png
144144
:width: 1000
145145
146146
Examples

CPAC/group_analysis/group_analysis.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,15 +214,23 @@ def create_fsl_flame_wf(ftest=False, wf_name='groupAnalysis'):
214214
215215
A seperate workflow called easythresh is called to run easythresh steps.
216216
217+
.. exec::
218+
from CPAC.group_analysis import create_fsl_flame_wf
219+
wf = create_fsl_flame_wf()
220+
wf.write_graph(
221+
graph2use='orig',
222+
dotfilename='./images/generated/group_analysis.dot'
223+
)
224+
217225
High Level Workflow Graph:
218226
219-
.. image:: ../images/group_analysis.dot.png
227+
.. image:: ../../images/generated/group_analysis.png
220228
:width: 800
221229
222230
223231
Detailed Workflow Graph:
224232
225-
.. image:: ../images/group_analysis_detailed.dot.png
233+
.. image:: ../../images/generated/group_analysis_detailed.png
226234
:width: 800
227235
228236
Examples
@@ -497,4 +505,3 @@ def run_feat_pipeline(group_config, merge_file, merge_mask, f_test,
497505

498506
# Run the actual group analysis workflow
499507
wf.run()
500-

CPAC/median_angle/median_angle.py

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,14 +200,22 @@ def create_median_angle_correction(name='median_angle_correction'):
200200
1. Compute the median angle with respect to the first principal component of the subject
201201
2. Shift the angle of every voxel so that the new median angle equals the target angle
202202
203+
.. exec::
204+
from CPAC.median_angle import create_median_angle_correction
205+
wf = create_median_angle_correction()
206+
wf.write_graph(
207+
graph2use='orig',
208+
dotfilename='./images/generated/median_angle_correction.dot'
209+
)
210+
203211
Workflow Graph:
204212
205-
.. image:: ../images/median_angle_correction.dot.png
213+
.. image:: ../../images/generated/median_angle_correction.png
206214
:width: 500
207215
208216
Detailed Workflow Graph:
209217
210-
.. image:: ../images/median_angle_correction_detailed.dot.png
218+
.. image:: ../../images/generated/median_angle_correction_detailed.png
211219
:width: 500
212220
213221
"""
@@ -272,14 +280,22 @@ def create_target_angle(name='target_angle'):
272280
3. Calculate the corresponding median_angle on the fitted model for the subject
273281
with the smallest mean bold amplitude of the group.
274282
283+
.. exec::
284+
from CPAC.median_angle import create_target_angle
285+
wf = create_target_angle()
286+
wf.write_graph(
287+
graph2use='orig',
288+
dotfilename='./images/generated/target_angle.dot'
289+
)
290+
275291
Workflow Graph:
276292
277-
.. image:: ../images/target_angle.dot.png
293+
.. image:: ../../images/generated/target_angle.png
278294
:width: 500
279295
280296
Detailed Workflow Graph:
281297
282-
.. image:: ../images/target_angle_detailed.dot.png
298+
.. image:: ../../images/generated/target_angle_detailed.png
283299
:width: 500
284300
285301
"""
@@ -313,4 +329,3 @@ def create_target_angle(name='target_angle'):
313329
outputspec, 'target_angle')
314330

315331
return target_angle
316-

CPAC/nuisance/nuisance.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -587,8 +587,8 @@ def create_regressor_workflow(nuisance_selectors,
587587
High Level Workflow Graph:
588588
589589
.. exec::
590-
from CPAC.nuisance import create_nuisance_regression_workflow
591-
wf = create_nuisance_regression_workflow({
590+
from CPAC.nuisance import create_regressor_workflow
591+
wf = create_regressor_workflow({
592592
'PolyOrt': {'degree': 2},
593593
'tCompCor': {'summary': {'method': 'PC', 'components': 5}, 'threshold': '1.5SD', 'by_slice': True},
594594
'aCompCor': {'summary': {'method': 'PC', 'components': 5}, 'tissues': ['WhiteMatter', 'CerebrospinalFluid'], 'extraction_resolution': 2},
@@ -605,12 +605,12 @@ def create_regressor_workflow(nuisance_selectors,
605605
dotfilename='./images/generated/nuisance.dot'
606606
)
607607
608-
.. image:: ../images/generated/nuisance.png
608+
.. image:: ../../images/generated/nuisance.png
609609
:width: 1000
610610
611611
Detailed Workflow Graph:
612612
613-
.. image:: ../images/generated/nuisance_detailed.png
613+
.. image:: ../../images/generated/nuisance_detailed.png
614614
:width: 1000
615615
616616
"""

CPAC/registration/registration.py

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,22 @@ def create_fsl_fnirt_nonlinear_reg(name='fsl_fnirt_nonlinear_reg'):
9595
2. Invert the affine transformation to provide the user a transformation (affine only) from the
9696
space of the reference file to the input file.
9797
98+
.. exec::
99+
from CPAC.registration import create_fsl_fnirt_nonlinear_reg
100+
wf = create_fsl_fnirt_nonlinear_reg()
101+
wf.write_graph(
102+
graph2use='orig',
103+
dotfilename='./images/generated/nonlinear_register.dot'
104+
)
105+
98106
Workflow Graph:
99107
100-
.. image:: ../images/nonlinear_register.dot.png
108+
.. image:: ../../images/generated/nonlinear_register.png
101109
:width: 500
102110
103111
Detailed Workflow Graph:
104112
105-
.. image:: ../images/nonlinear_register_detailed.dot.png
113+
.. image:: ../../images/generated/nonlinear_register_detailed.png
106114
:width: 500
107115
108116
"""
@@ -212,14 +220,22 @@ def create_register_func_to_mni(name='register_func_to_mni'):
212220
outputspec.mni_func : string (nifti file)
213221
Functional scan registered to MNI standard space
214222
223+
.. exec::
224+
from CPAC.registration import create_register_func_to_mni
225+
wf = create_register_func_to_mni()
226+
wf.write_graph(
227+
graph2use='orig',
228+
dotfilename='./images/generated/register_func_to_mni.dot'
229+
)
230+
215231
Workflow Graph:
216232
217-
.. image:: ../images/register_func_to_mni.dot.png
233+
.. image:: ../../images/generated/register_func_to_mni.png
218234
:width: 500
219235
220236
Detailed Workflow Graph:
221237
222-
.. image:: ../images/register_func_to_mni_detailed.dot.png
238+
.. image:: ../../images/generated/register_func_to_mni_detailed.png
223239
:width: 500
224240
"""
225241
register_func_to_mni = pe.Workflow(name=name)
@@ -769,14 +785,22 @@ def create_wf_calculate_ants_warp(name='create_wf_calculate_ants_warp', num_thre
769785
770786
1. Calculates a nonlinear anatomical-to-template registration.
771787
788+
.. exec::
789+
from CPAC.registration import create_wf_calculate_ants_warp
790+
wf = create_wf_calculate_ants_warp()
791+
wf.write_graph(
792+
graph2use='orig',
793+
dotfilename='./images/generated/calculate_ants_warp.dot'
794+
)
795+
772796
Workflow Graph:
773797
774-
.. image::
798+
.. image:: ../../images/generated/calculate_ants_warp.png
775799
:width: 500
776800
777801
Detailed Workflow Graph:
778802
779-
.. image::
803+
.. image:: ../../images/generated/calculate_ants_warp_detailed.png
780804
:width: 500
781805
'''
782806

0 commit comments

Comments
 (0)