def main():
    start_time = time.time()

    # Check input parameters
    try:
        opts, args = getopt.getopt(sys.argv[1:],'hi:c:b:g:m:o:p:r:s:v:')
    except getopt.GetoptError:
        usage()
    if not opts:
            usage()
    for opt, arg in opts:
        if opt == '-h':
            usage()
        elif ('-i') in opt:
            param.fname_data = arg
        elif opt in ('-b'):
            param.fname_bvecs = arg
        elif opt in ('-c'):
            param.cost_function_flirt = arg
        elif opt in ('-g'):
            param.plot_graph = int(arg)
        elif opt in ('-m'):
            param.mat_eddy = arg
        elif opt in ('-o'):
            param.output_path = arg
        elif opt in ('-p'):
            param.interp = arg
        elif opt in ('-r'):
            param.delete_tmp_files = int(arg)
        elif opt in ('-s'):
            param.slicewise = int(arg)
        elif opt in ('-v'):
            param.verbose = int(arg)

    # display usage if a mandatory argument is not provided
    if param.fname_data=='' or param.fname_bvecs=='':
        print '\n\nAll mandatory arguments are not provided \n'
        usage()

    if param.output_path=='': param.output_path = os.getcwd() + '/'

    # create temporary folder
    path_tmp = 'tmp.'+time.strftime("%y%m%d%H%M%S")
    sct.run('mkdir '+ path_tmp, param.verbose)

    # go to tmp folder
    os.chdir(path_tmp)

    # run sct_eddy_correct
    eddy_correct(param)

    # come back to parent folder
    os.chdir('..')

    # Delete temporary files
    if param.delete_tmp_files == 1:
        print '\nDelete temporary files...'
        sct.run('rm -rf '+ path_tmp, param.verbose)

    # display elapsed time
    elapsed_time = time.time() - start_time
    print '\nFinished! Elapsed time: '+str(int(round(elapsed_time)))+'s'

#=======================================================================================================================
# Function eddy_correct
#=======================================================================================================================
dataset/ETHPy150Open neuropoly/spinalcordtoolbox/scripts/sct_dmri_eddy_correct.py/main/swapped operands of `in`