def create_cmats_to_csv_pipeline(name='cmats_to_csv', extra_column_heading='subject'):
 inputnode = pe.Node(interface=util.IdentityInterface(fields=['extra_field', 'matlab_matrix_files']), name='inputnode')
 pipeline = pe.Workflow(name=name)
 Matlab2CSV = pe.MapNode(interface=misc.Matlab2CSV(), name='Matlab2CSV', iterfield=['in_file'])
 MergeCSVFiles = pe.Node(interface=misc.MergeCSVFiles(), name='MergeCSVFiles')
 MergeCSVFiles.inputs.extra_column_heading = extra_column_heading
 pipeline.connect([(inputnode, Matlab2CSV, [('matlab_matrix_files', 'in_file')])])
 pipeline.connect([(Matlab2CSV, MergeCSVFiles, [('csv_files', 'in_files')])])
 pipeline.connect([(inputnode, MergeCSVFiles, [('extra_field', 'extra_field')])])
 outputnode = pe.Node(interface=util.IdentityInterface(fields=['csv_file']), name='outputnode')
 pipeline.connect([(MergeCSVFiles, outputnode, [('csv_file', 'csv_file')])])
 return pipeline

def create_cmats_to_csv_pipeline ( name = 'cmats_to_csv' , extra_column_heading = 'subject' ) : inputnode = pe . Node ( interface = util . IdentityInterface ( fields = [ 'extra_field' , 'matlab_matrix_files' ] ) , name = 'inputnode' ) pipeline = pe . Workflow ( name = name ) Matlab2CSV = pe . MapNode ( interface = misc . Matlab2CSV ( ) , name = 'Matlab2CSV' , iterfield = [ 'in_file' ] ) MergeCSVFiles = pe . Node ( interface = misc . MergeCSVFiles ( ) , name = 'MergeCSVFiles' ) MergeCSVFiles . inputs . extra_column_heading = extra_column_heading pipeline . connect ( [ ( inputnode , Matlab2CSV , [ ( 'matlab_matrix_files' , 'in_file' ) ] ) ] ) pipeline . connect ( [ ( Matlab2CSV , MergeCSVFiles , [ ( 'csv_files' , 'in_files' ) ] ) ] ) pipeline . connect ( [ ( inputnode , MergeCSVFiles , [ ( 'extra_field' , 'extra_field' ) ] ) ] ) outputnode = pe . Node ( interface = util . IdentityInterface ( fields = [ 'csv_file' ] ) , name = 'outputnode' ) pipeline . connect ( [ ( MergeCSVFiles , outputnode , [ ( 'csv_file' , 'csv_file' ) ] ) ] ) return pipeline
creates a workflow to convert the outputs from creatematrix into a single comma-separated value text file .