def convert(input, output):
dirname = os.path.dirname(output)<EOL>if not os.path.exists(dirname):<EOL><INDENT>os.makedirs(dirname)<EOL><DEDENT>basename = os.path.basename(output)<EOL>basename = re.sub('<STR_LIT>', '<STR_LIT>', basename)<EOL>dcm2niix = commons.which('<STR_LIT>')<EOL>cmd = [<EOL>'<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT:y>',<EOL>'<STR_LIT>', '<STR_LIT:y>',<EOL>'<STR_LIT>', '<STR_LIT:y>',<EOL>'<STR_LIT>', basename,<EOL>'<STR_LIT>', dirname,<EOL>input<EOL>]<EOL>logger.debug(cmd)<EOL>sp.check_output(cmd)<EOL>
Run dcm2niix on input file