forked from elizabethbeard/mriqception
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dvd_testing.py
executable file
·56 lines (39 loc) · 1.33 KB
/
dvd_testing.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/env python
import argparse,datetime,os,sys,time
import pandas as pd
from tools import load_groupfile, query_api, filterIQM, merge_dfs, make_vio_plot
here = os.path.dirname(os.path.abspath(os.path.realpath(__file__)))
group_file = os.path.join(here,'test_data', 'group2_bold.tsv')
filter_list = ['TR > 2.0','FD < .3']
modality = 'bold'
T1apicsv = os.path.join(here, 'demo_api', 'T1w_demo.csv')
T2apicsv = os.path.join(here, 'demo_api', 'T2w_demo.csv')
boldapicsv = os.path.join(here, 'demo_api', 'bold_demo.csv')
if modality == 'T1w':
api_file = T1apicsv
elif modality == 'T2w':
api_file = T1apicsv
elif modality == 'bold':
api_file = boldapicsv
# load user csv as df #
userdf = load_groupfile(group_file)
# load and filter api csv as df #
apidf = pd.read_csv(api_file)
filtered_apidf = filterIQM(apidf,filter_list)
# merge dataframes together #
vis_ready_df = merge_dfs(userdf, filtered_apidf)
IQM_to_plot = ['fwhm_avg','fber']
v = make_vio_plot(vis_ready_df, IQM_to_plot)
# print(vis_ready_df.head)
# for col in userdf.columns:
# print(col)
# print(list(userdf.columns))
# # print(userdf.head)
# for col in apidf.columns:
# print(col)
# print(list(apidf.columns))
# # print(apidf.head)
# for col in filtered_apidf.columns:
# print(col)
# print(list(filtered_apidf.columns))
# # print(filtered_apidf.head)