-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon.py
executable file
·41 lines (37 loc) · 1.36 KB
/
common.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
'''
This module contains common functionality that many of the other modules use.
'''
import enum
class Study(enum.Enum):
'''
Represents if the study is Rau's or Yuanxia's.
'''
Rau = 1
Yuanxia = 2
# The dtypes are used so that numpy can read in the analysis files and understand
# their structure and how they're meant to be displayed. The names are the column
# names (which let us index by column in a readable way). The formats are the data
# types of the columns. The format string is the printf style character to use
# for formatting the output file (only used for sorting the files).
rau_dsc_dtype = {
'names': ('participant_id', 'file_id', 'dilation_radius', 'dsc'),
'formats': ('i4', 'i4', 'i4', 'f4'),
'format_string': ['%d', '%d', '%d', '%f']
}
yuanxia_dsc_dtype = {
'names': ('participant_id', 'file_id', 'time_pressure', 'dilation_radius', 'dsc'),
'formats': ('i4', 'i4', 'i4', 'i4', 'f4'),
'format_string': ['%d', '%d', '%d', '%d', '%f']
}
rau_gtc_dtype = {
'names': ('file_id', 'dilation_radius', 'gtc'),
'formats': ('i4', 'i4', 'f4'),
'format_string': ['%d', '%d', '%f']
}
yuanxia_gtc_dtype = {
'names': ('file_id', 'time_pressure', 'dilation_radius', 'gtc'),
'formats': ('i4', 'i4', 'i4', 'f4'),
'format_string': ['%d', '%d', '%d', '%f']
}
# The range of values to dilate.
dilation_radii = range(0, 5)