def test_rapidtide2x_phase3(debug=False):
    recalculate = True
    if recalculate:
        # create outputdir if it doesn't exist
        create_dir(get_test_temp_path())

        # trigger the usage function
        rapidtide2x_workflow.usage()

        # and launch the processing
        theargs = ['rapidtide2x']
        theargs += [os.path.join(get_examples_path(), 'fmri.nii.gz')]
        theargs += [
            os.path.join(get_test_temp_path(), 'rapidtide2x_phase3output')
        ]
        theargs += ['--nowindow']
        theargs += ['--windowfunc=hamming']
        theargs += ['--liang', '--eckart', '--phat']
        theargs += ['--usesp']
        theargs += ['--preservefiltering']
        theargs += ['--corrmaskthresh=0.25']
        theargs += ['-I', '-B', '-a', '-M', '-m']
        theargs += ['-C', '-R', '-L', '-V', '-F', '0.01,0.08']
        theargs += ['-v', '--debug']
        theargs += ['--globalmaskmethod=mean']
        theargs += ['--mklthreads=1']
        theargs += ['--nosharedmem']
        theargs += ['-S']
        rapidtide2x_workflow.rapidtide_main(theargs)
    assert True
Esempio n. 2
0
def test_rapidtide2x_phase3(debug=False):
    recalculate = True
    if recalculate:
        # create outputdir if it doesn't exist
        create_dir(get_test_temp_path())

        # trigger the usage function
        rapidtide2x_workflow.usage()

        # and launch the processing
        theargs = ["rapidtide2x"]
        theargs += [os.path.join(get_examples_path(), "fmri.nii.gz")]
        theargs += [
            os.path.join(get_test_temp_path(), "rapidtide2x_phase3output")
        ]
        theargs += ["--nowindow"]
        theargs += ["--windowfunc=hamming"]
        theargs += ["--liang", "--eckart", "--phat"]
        theargs += ["--usesp"]
        theargs += ["--preservefiltering"]
        theargs += ["--corrmaskthresh=0.25"]
        theargs += ["-I", "-B", "-a", "-M", "-m"]
        theargs += ["-C", "-R", "-L", "-V", "-F", "0.01,0.08"]
        theargs += ["-v", "--debug"]
        theargs += ["--globalmaskmethod=mean"]
        theargs += ["--mklthreads=1"]
        theargs += ["--nosharedmem"]
        theargs += ["-S"]
        rapidtide2x_workflow.rapidtide_main(theargs)
    assert True
Esempio n. 3
0
def test_rapidtide2x(debug=False):
    recalculate = True
    if recalculate:
        # create outputdir if it doesn't exist
        create_dir(get_test_temp_path())

        # and launch the processing
        theargs = ["rapidtide2x"]
        theargs += [os.path.join(get_examples_path(), "fmri.nii.gz")]
        theargs += [
            os.path.join(get_test_temp_path(), "rapidtide2x_phase2output")
        ]
        theargs += [
            "--regressor=" +
            os.path.join(get_test_data_path(),
                         "rapidtide2x_phase1target_reference_fmrires.txt")
        ]
        theargs += ["--regressortstep=1.5"]
        theargs += ["--limitoutput"]
        theargs += ["-s", "25.0"]
        theargs += ["-L"]
        theargs += ["-r", "-20,20"]
        theargs += ["-f", "2"]
        theargs += ["--passes=3"]
        theargs += ["--refineoffset"]
        theargs += ["--despecklepasses=4"]
        theargs += ["--accheck"]
        theargs += ["--nprocs=2"]
        theargs += ["--saveoptionsasjson"]
        theargs += ["--detrendorder=3"]
        theargs += ["--pickleft"]
        theargs += [
            "--corrmask=" +
            os.path.join(get_examples_path(), "quartermask.nii.gz")
        ]
        theargs += ["--noglm"]
        rapidtide2x_workflow.rapidtide_main(theargs)

    diffmaps = tide_util.comparerapidtideruns(
        os.path.join(get_test_temp_path(), "rapidtide2x_phase2output"),
        os.path.join(get_test_target_path(), "rapidtide2x_phase2target"),
    )

    for mapname, maps in diffmaps.items():
        print("checking", mapname)
        print("\trelmindiff", maps["relmindiff"])
        print("\trelmaxdiff", maps["relmaxdiff"])
        print("\trelmeandiff", maps["relmeandiff"])
        print("\trelmse", maps["relmse"])
        assert maps["relmindiff"] < 1e2
        assert maps["relmaxdiff"] < 1e2
        assert maps["relmeandiff"] < 1e-2
        assert maps["relmse"] < 1e2
def test_rapidtide2x(debug=False):
    recalculate = True
    if recalculate:
        # create outputdir if it doesn't exist
        create_dir(get_test_temp_path())
    
        # and launch the processing
        theargs = ['rapidtide2x']
        theargs += [os.path.join(get_examples_path(), 'fmri.nii.gz')]
        theargs += [os.path.join(get_test_temp_path(), 'rapidtide2x_phase2output')]
        theargs += ['--regressor=' + os.path.join(get_test_data_path(), 'rapidtide2x_phase1target_reference_fmrires.txt')]
        theargs += ['--regressortstep=1.5']
        theargs += ['--limitoutput']
        theargs += ['-s', '25.0']
        theargs += ['-L']
        theargs += ['-r', '-20,20']
        theargs += ['-f', '2']
        theargs += ['--passes=3']
        theargs += ['--refineoffset']
        theargs += ['--despecklepasses=4']
        theargs += ['--accheck']
        theargs += ['--nprocs=2']
        theargs += ['--saveoptionsasjson']
        theargs += ['--detrendorder=3']
        theargs += ['--pickleft']
        theargs += ['--corrmask=' + os.path.join(get_examples_path(), 'quartermask.nii.gz')]
        theargs += ['--noglm']
        rapidtide2x_workflow.rapidtide_main(theargs)
    
    diffmaps = tide_util.comparerapidtideruns(os.path.join(get_test_temp_path(), 'rapidtide2x_phase2output'), os.path.join(get_test_target_path(), 'rapidtide2x_phase2target'))

    for mapname, maps in diffmaps.items():
        print('checking', mapname)
        print('\trelmindiff', maps['relmindiff'])
        print('\trelmaxdiff', maps['relmaxdiff'])
        print('\trelmeandiff', maps['relmeandiff'])
        print('\trelmse', maps['relmse'])
        assert maps['relmindiff'] < 1e2
        assert maps['relmaxdiff'] < 1e2
        assert maps['relmeandiff'] < 1e-2
        assert maps['relmse'] < 1e2