-
Notifications
You must be signed in to change notification settings - Fork 95
Expand file tree
/
Copy pathconfig.ts
More file actions
211 lines (199 loc) · 5.26 KB
/
config.ts
File metadata and controls
211 lines (199 loc) · 5.26 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
import MRICardiacThumbnail from '@/src/assets/samples/MRI-Cardiac.jpg';
import MRIPROSTATExThumbnail from '@/src/assets/samples/MRI-PROSTATEx.jpg';
import MRAHeadThumbnail from '@/src/assets/samples/MRA-Head_and_Neck.jpg';
import CTAHeadThumbnail from '@/src/assets/samples/CTA-Head_and_Neck.jpg';
import USFetusThumbnail from '@/src/assets/samples/3DUS-Fetus.jpg';
import { Layout, LayoutDirection } from './types/layout';
import { ViewSpec } from './types/views';
import { SampleDataset } from './types';
/**
* These are the initial view IDs.
*/
export const InitViewIDs: Record<string, string> = {
Coronal: 'Coronal',
Sagittal: 'Sagittal',
Axial: 'Axial',
Three: '3D',
};
/**
* View spec for the initial view IDs.
*/
export const InitViewSpecs: Record<string, ViewSpec> = {
[InitViewIDs.Coronal]: {
viewType: '2D',
props: {
viewDirection: 'Right',
viewUp: 'Superior',
},
},
[InitViewIDs.Sagittal]: {
viewType: '2D',
props: {
viewDirection: 'Posterior',
viewUp: 'Superior',
},
},
[InitViewIDs.Axial]: {
viewType: '2D',
props: {
viewDirection: 'Superior',
viewUp: 'Anterior',
},
},
[InitViewIDs.Three]: {
viewType: '3D',
props: {
viewDirection: 'Posterior',
viewUp: 'Superior',
},
},
};
/**
* The default view spec.
*/
export const DefaultViewSpec = InitViewSpecs[InitViewIDs.Axial];
/**
* Defines the default layouts.
*/
export const Layouts: Record<string, Layout> = [
{
name: 'Axial Only',
direction: LayoutDirection.H,
items: [InitViewIDs.Axial],
},
{
name: 'Axial Primary',
direction: LayoutDirection.V,
items: [
InitViewIDs.Axial,
{
direction: LayoutDirection.H,
items: [InitViewIDs.Three, InitViewIDs.Coronal, InitViewIDs.Sagittal],
},
],
},
{
name: '3D Primary',
direction: LayoutDirection.V,
items: [
InitViewIDs.Three,
{
direction: LayoutDirection.H,
items: [InitViewIDs.Coronal, InitViewIDs.Sagittal, InitViewIDs.Axial],
},
],
},
{
name: 'Quad View',
direction: LayoutDirection.H,
items: [
{
direction: LayoutDirection.V,
items: [InitViewIDs.Coronal, InitViewIDs.Three],
},
{
direction: LayoutDirection.V,
items: [InitViewIDs.Sagittal, InitViewIDs.Axial],
},
],
},
{
name: '3D Only',
direction: LayoutDirection.H,
items: [InitViewIDs.Three],
},
].reduce((layouts, layout) => {
return { ...layouts, [layout.name]: layout };
}, {});
export const LABELMAP_PALETTE = {
0: [0, 0, 0, 0], // eraser
1: [153, 153, 0, 255],
2: [76, 76, 0, 255],
3: [255, 255, 0, 255],
4: [0, 76, 0, 255],
5: [0, 153, 0, 255],
6: [0, 255, 0, 255],
7: [76, 0, 0, 255],
8: [153, 0, 0, 255],
9: [255, 0, 0, 255],
10: [0, 76, 76, 255],
11: [0, 153, 153, 255],
12: [0, 255, 255, 255],
13: [0, 0, 76, 255],
14: [0, 0, 153, 255],
} as Record<number, number[]>;
export const SAMPLE_DATA: SampleDataset[] = [
{
name: 'CTA Head and Neck',
filename: 'CTA-Head_and_Neck.zip',
description:
'CTA head and neck scan of elderly patient with tumor. (80 MB)',
url: 'https://data.kitware.com/api/v1/item/6347159711dab81428208e24/download',
image: CTAHeadThumbnail,
},
{
name: 'MRA Head and Neck',
filename: 'MRA-Head_and_Neck.zip',
description:
'MRA from Patient Contributed Image Repository. Click application help icon "(?)" for more info. (15 MB)',
url: 'https://data.kitware.com/api/v1/item/6352a2b311dab8142820a33b/download',
image: MRAHeadThumbnail,
},
{
name: 'MRI Cardiac 3D and Cine',
filename: 'MRI-Cardiac-3D_and_Cine.zip',
description:
'MRI scan with two series: 3D axial non-gated and 2 chamber cine. (4 MB)',
url: 'https://data.kitware.com/api/v1/item/6350b28f11dab8142820949d/download',
image: MRICardiacThumbnail,
},
{
name: 'MRI PROSTATEx',
filename: 'MRI-PROSTATEx-0004.zip',
description:
'MRI from the SPIE-AAPM-NCI PROSTATEx challenge. Click application help "(?)" icon for more info. (3 MB)',
url: 'https://data.kitware.com/api/v1/item/63527c7311dab8142820a338/download',
image: MRIPROSTATExThumbnail,
},
{
name: '3D US Fetus',
filename: '3DUS-Fetus.mha',
description:
'3D ultrasound of a baby. Downloaded from tomovision.com.(8 MB)',
url: 'https://data.kitware.com/api/v1/item/635679c311dab8142820a4f4/download',
image: USFetusThumbnail,
},
];
export const TOOL_COLORS = [
'#58f24c',
'#8de4d3',
'#f0a4b1',
'#a3c9fe',
'#c8f251',
'#fea53b',
];
export const RULER_LABEL_DEFAULTS = {
red: { color: 'red' },
green: { color: '#00ff00' },
white: { color: '#ffffff' },
};
export const RECTANGLE_LABEL_DEFAULTS = {
artifact: { color: '#888888', fillColor: '#ffbf0040' },
innocuous: { color: '#00ff00', fillColor: '#00ff0020' },
lesion: { color: 'red', fillColor: 'transparent' },
};
export const POLYGON_LABEL_DEFAULTS = {
red: { color: 'red' },
green: { color: '#00ff00' },
white: { color: '#ffffff' },
};
export const DEFAULT_KEYMAP = {
UndoRedo: 'z',
DecrementLabel: 'q',
IncrementLabel: 'w',
};
export const DEFAULT_PRESET_BY_MODALITY: Record<string, string> = {
CT: 'CT-AAA',
MR: 'CT-Coronary-Arteries-2',
US: 'US-Fetal',
};