当前位置: 首页>>代码示例>>Python>>正文


Python Workflow.write_graph方法代码示例

本文整理汇总了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()




开发者ID:JohnGriffiths,项目名称:TVB-Pypeline,代码行数:28,代码来源:TVB_pipeline.py

示例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')
开发者ID:miykael,项目名称:nipype_tutorial,代码行数:32,代码来源:ANTS_registration.py


注:本文中的nipype.Workflow.write_graph方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。