本文整理汇总了Python中nipype.Workflow.write_graph方法的典型用法代码示例。如果您正苦于以下问题:Python Workflow.write_graph方法的具体用法?Python Workflow.write_graph怎么用?Python Workflow.write_graph使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nipype.Workflow
的用法示例。
在下文中一共展示了Workflow.write_graph方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Image
# 需要导入模块: from nipype import Workflow [as 别名]
# 或者: from nipype.Workflow import write_graph [as 别名]
('output_node.trackingFolder', 'input_node.tracking_dir'),
('output_node.tracks_folder', 'input_node.tracks_dir'),
('output_node.highresWmMask', 'input_node.wmmask_1mm'),
('output_node.lowresWmMask', 'input_node.wmmask')]),
(maskGenNode, connectivityRowNode, [(('number_of_rois', roiRange), 'roi'),
('affine_matrix', 'affine_matrix'),
('wmborder_data', 'wmborder')]),
(inputNode, connectivityRowNode, [('subject_id', 'subid')]),
(preprocessing.wf, connectivityRowNode, [('output_node.tracks_folder', 'tracksPath')]),
(mrtrix.mrtrix_main.wf, connectivityRowNode, [('output_node.trk_files', 'track_files')]),
(inputNode, aggregateConnectivityNode, [('subject_id', 'sub_id')]),
(maskGenNode, aggregateConnectivityNode, [('wmborder_data', 'wmborder')]),
(preprocessing.wf, aggregateConnectivityNode, [('output_node.tracks_folder', 'tracksPath')]),
(connectivityRowNode, aggregateConnectivityNode, [('SC_cap_row_filename', 'cap_row_files'),
('SC_dist_row_filename', 'dist_row_files')])
])
# ## Draw the Graph
wf.write_graph(subject_folder + subject_id + "/TVB_workflow_graph.dot", graph2use = 'colored')
# from IPython.display import Image
# Image(filename="./TVB_workflow_graph.dot.png")
# ## Run the Workflow
#wf.run(plugin='MultiProc', plugin_args={'n_procs': cpu_count()})
wf.run(plugin='OAR', plugin_args={'oarsub_args': '-l walltime=04:00:00'})
wf.run()
示例2: Workflow
# 需要导入模块: from nipype import Workflow [as 别名]
# 或者: from nipype.Workflow import write_graph [as 别名]
name="datasink")
# Use the following DataSink output substitutions
substitutions = [('_subject_id_', '')]
datasink.inputs.substitutions = substitutions
###
# Specify Normalization Workflow & Connect Nodes
# Initiation of the ANTS normalization workflow
regflow = Workflow(name='regflow')
regflow.base_dir = opj(experiment_dir, working_dir)
# Connect workflow nodes
regflow.connect([(infosource, selectfiles, [('subject_id', 'subject_id')]),
(selectfiles, antsreg, [('anat', 'moving_image')]),
(antsreg, datasink, [('warped_image',
'[email protected]_image'),
('inverse_warped_image',
'[email protected]_warped_image'),
('composite_transform',
'[email protected]'),
('inverse_composite_transform',
'[email protected]_transform')]),
])
###
# Run Workflow
regflow.write_graph(graph2use='flat')
regflow.run('Linear')