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


Python Node.out_file方法代码示例

本文整理汇总了Python中nipype.pipeline.engine.Node.out_file方法的典型用法代码示例。如果您正苦于以下问题:Python Node.out_file方法的具体用法?Python Node.out_file怎么用?Python Node.out_file使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在nipype.pipeline.engine.Node的用法示例。


在下文中一共展示了Node.out_file方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: make_func_subcortical_masks

# 需要导入模块: from nipype.pipeline.engine import Node [as 别名]
# 或者: from nipype.pipeline.engine.Node import out_file [as 别名]

#.........这里部分代码省略.........
    right_nacc.inputs.roi_file = 'right_nacc.nii.gz'

    right_amygdala = Node(interface=fsl.ExtractROI(), name = 'right_amygdala')
    right_amygdala.inputs.t_min  = 8
    right_amygdala.inputs.t_size = 1
    right_amygdala.inputs.roi_file = 'right_amygdala.nii.gz'

    right_caudate = Node(interface=fsl.ExtractROI(), name = 'right_caudate')
    right_caudate.inputs.t_min  = 9
    right_caudate.inputs.t_size = 1
    right_caudate.inputs.roi_file = 'right_caudate.nii.gz'

    right_hipoocampus = Node(interface=fsl.ExtractROI(), name = 'right_hipoocampus')
    right_hipoocampus.inputs.t_min  = 10
    right_hipoocampus.inputs.t_size = 1
    right_hipoocampus.inputs.roi_file = 'right_hipoocampus.nii.gz'

    right_pallidum = Node(interface=fsl.ExtractROI(), name = 'right_pallidum')
    right_pallidum.inputs.t_min  = 11
    right_pallidum.inputs.t_size = 1
    right_pallidum.inputs.roi_file = 'right_pallidum.nii.gz'

    right_putamen = Node(interface=fsl.ExtractROI(), name = 'right_putamen')
    right_putamen.inputs.t_min  = 12
    right_putamen.inputs.t_size = 1
    right_putamen.inputs.roi_file = 'right_putamen.nii.gz'

    right_thalamus = Node(interface=fsl.ExtractROI(), name = 'right_thalamus')
    right_thalamus.inputs.t_min  = 13
    right_thalamus.inputs.t_size = 1
    right_thalamus.inputs.roi_file = 'right_thalamus.nii.gz'

    midbrain = Node(interface=fsl.ExtractROI(), name = 'midbrain')
    midbrain.inputs.t_min  = 14
    midbrain.inputs.t_size = 1
    midbrain.inputs.roi_file = 'midbrain.nii.gz'

    flow.connect( inputnode  ,   'func_first'   ,   left_nacc,       'in_file'     )
    flow.connect( inputnode  ,   'func_first'   ,   left_amygdala,   'in_file'     )
    flow.connect( inputnode  ,   'func_first'   ,   left_caudate,    'in_file'     )
    flow.connect( inputnode  ,   'func_first'   ,   left_hipoocampus,'in_file'     )
    flow.connect( inputnode  ,   'func_first'   ,   left_pallidum,   'in_file'     )
    flow.connect( inputnode  ,   'func_first'   ,   left_putamen,    'in_file'     )
    flow.connect( inputnode  ,   'func_first'   ,   left_thalamus,   'in_file'     )

    flow.connect( inputnode  ,   'func_first'   ,   right_nacc,       'in_file'     )
    flow.connect( inputnode  ,   'func_first'   ,   right_amygdala,   'in_file'     )
    flow.connect( inputnode  ,   'func_first'   ,   right_caudate,    'in_file'     )
    flow.connect( inputnode  ,   'func_first'   ,   right_hipoocampus,'in_file'     )
    flow.connect( inputnode  ,   'func_first'   ,   right_pallidum,   'in_file'     )
    flow.connect( inputnode  ,   'func_first'   ,   right_putamen,    'in_file'     )
    flow.connect( inputnode  ,   'func_first'   ,   right_thalamus,   'in_file'     )
    flow.connect( inputnode  ,   'func_first'   ,   midbrain,         'in_file'     )

    flow.connect( left_nacc        ,   'roi_file'   ,outputnode   ,   'left_nacc'       )
    flow.connect( left_amygdala    ,   'roi_file'   ,outputnode   ,   'left_amygdala'   )
    flow.connect( left_caudate     ,   'roi_file'   ,outputnode   ,   'left_caudate'    )
    flow.connect( left_hipoocampus ,   'roi_file'   ,outputnode   ,   'left_hipoocampus')
    flow.connect( left_pallidum    ,   'roi_file'   ,outputnode   ,   'left_pallidum')
    flow.connect( left_putamen     ,   'roi_file'   ,outputnode   ,   'left_putamen'    )
    flow.connect( left_thalamus    ,   'roi_file'   ,outputnode   ,   'left_thalamus'   )
    flow.connect( right_nacc       ,   'roi_file'   ,outputnode   ,   'right_nacc'       )
    flow.connect( right_amygdala   ,   'roi_file'   ,outputnode   ,   'right_amygdala'   )
    flow.connect( right_caudate    ,   'roi_file'   ,outputnode   ,   'right_caudate'    )
    flow.connect( right_hipoocampus,   'roi_file'   ,outputnode   ,   'right_hipoocampus')
    flow.connect( right_pallidum   ,   'roi_file'   ,outputnode   ,   'right_pallidum')
    flow.connect( right_putamen    ,   'roi_file'   ,outputnode   ,   'right_putamen'    )
    flow.connect( right_thalamus   ,   'roi_file'   ,outputnode   ,   'right_thalamus'   )
    flow.connect( midbrain         ,   'roi_file'   ,outputnode   ,   'midbrain'         )


    # add images together
    right_striatum = Node(interface=fsl.MultiImageMaths(), name = 'right_striatum')
    right_striatum.inputs.op_string = '-add %s -add %s -bin'
    right_striatum.out_file         = 'right_striatum.nii.gz'
    list_R_str = Node(util.Function(input_names = ['file_1', 'file_2'],
                                    output_names= ['list'],
                                    function    = return_list),
                                    name        = 'list_str_r')

    flow.connect( right_pallidum     ,   'roi_file'   ,list_R_str       ,   'file_1'         )
    flow.connect( right_putamen      ,   'roi_file'   ,list_R_str       ,   'file_2'         )
    flow.connect( right_caudate      ,   'roi_file'   ,right_striatum   ,   'in_file'        )
    flow.connect( list_R_str         ,   'list'       ,right_striatum   ,   'operand_files'  )
    flow.connect( right_striatum     ,   'out_file'   ,outputnode       ,   'right_striatum' )


    left_striatum = Node(interface=fsl.MultiImageMaths(), name = 'left_striatum')
    left_striatum.inputs.op_string = '-add %s -add %s'
    left_striatum.out_file         = 'left_striatum.nii.gz'
    list_L_str =  list_R_str.clone('list_str_l')

    flow.connect( left_pallidum     ,   'roi_file'   ,list_L_str       ,   'file_1'         )
    flow.connect( left_putamen      ,   'roi_file'   ,list_L_str       ,   'file_2'         )
    flow.connect( left_caudate      ,   'roi_file'   ,left_striatum    ,   'in_file'        )
    flow.connect( list_L_str        ,   'list'       ,left_striatum    ,   'operand_files'  )
    flow.connect( left_striatum     ,   'out_file'   ,outputnode       ,   'left_striatum'  )


    return flow
开发者ID:amadeuskanaan,项目名称:GluREST,代码行数:104,代码来源:func_subcortical.py


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