#maskfile = os.path.join(wdir, 'mask_3mm_left_striatum.nii.gz')
#respfile = os.path.join(wdir, 'shoot_data_3mm_n50.nii.gz')
#covfile = os.path.join(wdir, 'covariates_basic_n50.txt')
#cvfolds = 2

# with test covariates
wdir = '/home/mrstats/andmar/py.sandbox/normative_nimg'
##wdir = '/Users/andre/data/normative_nimg'
maskfile = os.path.join(wdir, 'mask_3mm_left_striatum.nii.gz')
respfile = os.path.join(wdir, 'shoot_data_3mm_n500.nii.gz')
covfile = os.path.join(wdir, 'covariates_basic_n500.txt')
testresp = os.path.join(wdir, 'shoot_data_3mm_last100.nii.gz')
testcov = os.path.join(wdir, 'covariates_basic_last100.txt')
estimate(respfile,
         covfile,
         maskfile,
         testresp=testresp,
         testcov=testcov,
         alg="rfa")  #, configparam=4)
#cvfolds = 2

#wdir = '/home/mrstats/andmar/py.sandbox/normative_hcp'
#filename = os.path.join(wdir, 'tfmri_gambling_cope2.dtseries.nii')
#covfile = os.path.join(wdir, 'ddscores.txt')
#Nfold = 2

#wdir = '/home/mrstats/andmar/py.sandbox/normative_oslo'
#respfile = os.path.join(wdir, 'ICA100_oslo15_v2.txt')
#covfile = os.path.join(wdir, 'cov_oslo15_v2.txt')
#cvfolds = 2
#nispat.normative.estimate(respfile, covfile, cvfolds=cvfolds)
Exemplo n.º 2
0
    print('Removing existing directory')
    shutil.rmtree(test_dir)
os.makedirs(test_dir, exist_ok=True)
test_num, tdir = update_test_counter(0, test_dir)
print("\n")

print(test_num, "Testing basic config (gpr with nii data)...")
print("----------------------------------------------------------------------")

mask_file_nii = os.path.join(data_dir, 'mask3.nii.gz')
resp_file_nii = os.path.join(data_dir, 'resp_n50.nii.gz')
cov_file_nii = os.path.join(data_dir, 'cov_n50.txt')
resp_file_nii_te = os.path.join(data_dir, 'resp_n100.nii.gz')
cov_file_nii_te = os.path.join(data_dir, 'cov_n100.txt')

estimate(cov_file_nii, resp_file_nii, maskfile=mask_file_nii, 
         testresp = resp_file_nii_te, testcov = cov_file_nii_te)

print(os.getcwd())
save_output(os.getcwd(), tdir)
test_num, tdir = update_test_counter(test_num, test_dir)

print(test_num, "Testing again using the same data under cross-validation")
print("----------------------------------------------------------------------")

estimate(cov_file_nii, resp_file_nii, maskfile = mask_file_nii, cvfolds = 2)

save_output(os.getcwd(), tdir)
test_num, tdir = update_test_counter(test_num, test_dir)

print(test_num, "Test again with txt files. This time using blr...")
print("----------------------------------------------------------------------")
Exemplo n.º 3
0
#wdir = '/home/mrstats/andmar/py.sandbox/normative_nimg'
##wdir = '/Users/andre/data/normative_nimg'
#maskfile = os.path.join(wdir, 'mask_3mm_left_striatum.nii.gz')
#respfile = os.path.join(wdir, 'shoot_data_3mm_n50.nii.gz')
#covfile = os.path.join(wdir, 'covariates_basic_n50.txt')
#cvfolds = 2

# with test covariates
wdir = '/home/mrstats/andmar/py.sandbox/normative_nimg'
##wdir = '/Users/andre/data/normative_nimg'
maskfile = os.path.join(wdir, 'mask_3mm_left_striatum.nii.gz')
respfile = os.path.join(wdir, 'shoot_data_3mm_n50.nii.gz')
covfile = os.path.join(wdir, 'covariates_basic_n50.txt')
testresp = os.path.join(wdir, 'shoot_data_3mm_last100.nii.gz')
testcov = os.path.join(wdir, 'covariates_basic_last100.txt')
estimate(respfile, covfile, maskfile, testresp=testresp, testcov=testcov)
#cvfolds = 2

#wdir = '/home/mrstats/andmar/py.sandbox/normative_hcp'
#filename = os.path.join(wdir, 'tfmri_gambling_cope2.dtseries.nii')
#covfile = os.path.join(wdir, 'ddscores.txt')
#Nfold = 2

#wdir = '/home/mrstats/andmar/py.sandbox/normative_oslo'
#respfile = os.path.join(wdir, 'ICA100_oslo15_v2.txt')
#covfile = os.path.join(wdir, 'cov_oslo15_v2.txt')
#cvfolds = 2
#nispat.normative.estimate(respfile, covfile, cvfolds=cvfolds)

#wdir = '/home/mrstats/andmar/data/enigma_mdd'
#maskfile = None
Exemplo n.º 4
0
#maskfile = os.path.join(wdir, 'mask_3mm_left_striatum.nii.gz')
#respfile = os.path.join(wdir, 'shoot_data_3mm_n50.nii.gz')
#covfile = os.path.join(wdir, 'covariates_basic_n50.txt')
#cvfolds = 2

# with test covariates
wdir = '/home/preclineu/andmar/py.sandbox/normative_nimg'
##wdir = '/Users/andre/data/normative_nimg'
maskfile = os.path.join(wdir, 'mask_3mm_left_striatum.nii.gz')
respfile = os.path.join(wdir, 'shoot_data_3mm_n500.nii.gz')
covfile = os.path.join(wdir, 'covariates_basic_n500.txt')
testresp = os.path.join(wdir, 'shoot_data_3mm_last100.nii.gz')
testcov = os.path.join(wdir, 'covariates_basic_last100.txt')
estimate(covfile,
         respfile,
         maskfile=maskfile,
         testresp=testresp,
         testcov=testcov,
         alg="blr")  #, configparam=4)
#cvfolds = 2

#wdir = '/home/mrstats/andmar/py.sandbox/normative_hcp'
#filename = os.path.join(wdir, 'tfmri_gambling_cope2.dtseries.nii')
#covfile = os.path.join(wdir, 'ddscores.txt')
#Nfold = 2

#wdir = '/home/mrstats/andmar/py.sandbox/normative_oslo'
#respfile = os.path.join(wdir, 'ICA100_oslo15_v2.txt')
#covfile = os.path.join(wdir, 'cov_oslo15_v2.txt')
#cvfolds = 2
#nispat.normative.estimate(covfile, respfile,  cvfolds=cvfolds)
print(normativedir)

# ################################################################################################
# Primary model
wdir = normativedir
os.chdir(wdir)
# input files and paths
cov_train = os.path.join(normativedir, 'cov_train.txt')
resp_train = os.path.join(normativedir, 'resp_train.txt')
cov_test = os.path.join(normativedir, 'cov_test.txt')
resp_test = os.path.join(normativedir, 'resp_test.txt')
# run normative
estimate(resp_train,
         cov_train,
         testcov=cov_test,
         testresp=resp_test,
         cvfolds=None,
         alg="gpr")

################################################################################################
# Forward model
wdir = os.path.join(normativedir, 'forward')
os.chdir(wdir)
# input files and paths
cov_train = os.path.join(normativedir, 'cov_train.txt')
resp_train = os.path.join(normativedir, 'resp_train.txt')
cov_test = os.path.join(wdir, 'synth_cov_test.txt')
# run normative
estimate(resp_train,
         cov_train,
         testcov=cov_test,