本文整理汇总了Python中nipype.pipeline.engine.Node.output_type方法的典型用法代码示例。如果您正苦于以下问题:Python Node.output_type方法的具体用法?Python Node.output_type怎么用?Python Node.output_type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nipype.pipeline.engine.Node
的用法示例。
在下文中一共展示了Node.output_type方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: func_preprocess
# 需要导入模块: from nipype.pipeline.engine import Node [as 别名]
# 或者: from nipype.pipeline.engine.Node import output_type [as 别名]
def func_preprocess(name = 'func_preproc'):
'''
Method to preprocess functional data after warping to anatomical space.
Accomplished after one step Distortion Correction, Motion Correction and Boundary based linear registration to
anatomical space.
Precodure includes:
# 1- skull strip
# 2- Normalize the image intensity values.
# 3- Calculate Mean of Skull stripped image
# 4- Create brain mask from Normalized data.
'''
# Define Workflow
flow = Workflow(name=name)
inputnode = Node(util.IdentityInterface(fields=['func_in']),
name='inputnode')
outputnode = Node(util.IdentityInterface(fields=['func_preproc',
'func_preproc_mean',
'func_preproc_mask']),
name = 'outputnode')
# 2- Normalize the image intensity values.
norm = Node(interface = fsl.ImageMaths(), name = 'func_normalized')
norm.inputs.op_string = '-ing 1000'
norm.out_data_type = 'float'
norm.output_type = 'NIFTI'
# 4- Create brain mask from Normalized data.
mask = Node(interface = fsl.BET(), name = 'func_preprocessed')
mask.inputs.functional = True
mask.inputs.mask = True
mask.inputs.frac = 0.5
mask.inputs.vertical_gradient = 0
mask.inputs.threshold = True
# 3- Calculate Mean of Skull stripped image
mean = Node(interface = preprocess.TStat(), name = 'func_preprocessed_mean')
mean.inputs.options = '-mean'
mean.inputs.outputtype = 'NIFTI'
flow.connect( inputnode , 'func_in' , norm, 'in_file' )
flow.connect( norm , 'out_file' , mask, 'in_file' )
flow.connect( norm , 'out_file' , mean, 'in_file' )
flow.connect( mask , 'out_file' , outputnode, 'func_preproc')
flow.connect( mask , 'mask_file' , outputnode, 'func_preproc_mask')
flow.connect( mean , 'out_file' , outputnode, 'func_preproc_mean')
return flow