def nlmeans_pipeline(name='Denoise', params={'patch_radius': 1, 'block_radius': 5}):
 inputnode = pe.Node(niu.IdentityInterface(fields=['in_file', 'in_mask']), name='inputnode')
 outputnode = pe.Node(niu.IdentityInterface(fields=['out_file']), name='outputnode')
 nmask = pe.Node(niu.Function(input_names=['in_file', 'in_mask'], output_names=['out_file'], function=bg_mask), name='NoiseMsk')
 nlmeans = pe.Node(dipy.Denoise(**params), name='NLMeans')
 wf = pe.Workflow(name=name)
 wf.connect([(inputnode, nmask, [('in_file', 'in_file'), ('in_mask', 'in_mask')]), (inputnode, nlmeans, [('in_file', 'in_file'), ('in_mask', 'in_mask')]), (nmask, nlmeans, [('out_file', 'noise_mask')]), (nlmeans, outputnode, [('out_file', 'out_file')])])
 return wf

def nlmeans_pipeline ( name = 'Denoise' , params = { 'patch_radius' : 1 , 'block_radius' : 5 } ) : inputnode = pe . Node ( niu . IdentityInterface ( fields = [ 'in_file' , 'in_mask' ] ) , name = 'inputnode' ) outputnode = pe . Node ( niu . IdentityInterface ( fields = [ 'out_file' ] ) , name = 'outputnode' ) nmask = pe . Node ( niu . Function ( input_names = [ 'in_file' , 'in_mask' ] , output_names = [ 'out_file' ] , function = bg_mask ) , name = 'NoiseMsk' ) nlmeans = pe . Node ( dipy . Denoise ( ** params ) , name = 'NLMeans' ) wf = pe . Workflow ( name = name ) wf . connect ( [ ( inputnode , nmask , [ ( 'in_file' , 'in_file' ) , ( 'in_mask' , 'in_mask' ) ] ) , ( inputnode , nlmeans , [ ( 'in_file' , 'in_file' ) , ( 'in_mask' , 'in_mask' ) ] ) , ( nmask , nlmeans , [ ( 'out_file' , 'noise_mask' ) ] ) , ( nlmeans , outputnode , [ ( 'out_file' , 'out_file' ) ] ) ] ) return wf
workflow that performs nlmeans denoising example .