forked from informatics-isi-edu/facebase-facialnorms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
landmarks.php
300 lines (291 loc) · 16.4 KB
/
landmarks.php
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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
<?php
$coordinates = array(
"frontal" => array(
"n" => array("x" => 280, "y" => 424),
"prn" => array("x" => 282, "y" => 272),
"sn" => array("x" => 282, "y" => 232),
"ls" => array("x" => 280, "y" => 188),
"sto" => array("x" => 280, "y" => 160),
"li" => array("x" => 280, "y" => 133),
"sl" => array("x" => 280, "y" => 117),
"gn" => array("x" => 280, "y" => 40),
"en_r" => array("x" => 218, "y" => 385),
"en_l" => array("x" => 348, "y" => 385),
"ex_r" => array("x" => 130, "y" => 380),
"ex_l" => array("x" => 434, "y" => 380),
"al_r" => array("x" => 229, "y" => 255),
"al_l" => array("x" => 335, "y" => 255),
"ac_r" => array("x" => 226, "y" => 256),
"ac_l" => array("x" => 338, "y" => 256),
"sbal_r" => array("x" => 259, "y" => 233),
"sbal_l" => array("x" => 306, "y" => 233),
"cph_r" => array("x" => 263, "y" => 193),
"cph_l" => array("x" => 298, "y" => 193),
"ch_r" => array("x" => 190, "y" => 163),
"ch_l" => array("x" => 376, "y" => 163),
"t_r" => array("x" => 40, "y" => 330),
"t_l" => array("x" => 519, "y" => 330),
"eu_r" => array("x" => 38, "y" => 515),
"eu_l" => array("x" => 522, "y" => 515),
"ft_r" => array("x" => 111, "y" => 482),
"ft_l" => array("x" => 462, "y" => 482),
"zy_r" => array("x" => 65, "y" => 355),
"zy_l" => array("x" => 500, "y" => 355),
"go_r" => array("x" => 100, "y" => 146),
"go_l" => array("x" => 461, "y" => 146),
"g" => array("x" => 280, "y" => 464),
"op" => array("x" => null, "y" => null)
),
"oblique-left" => array(
"n" => array("x" => 70, "y" => 424),
"prn" => array("x" => 24, "y" => 292),
"sn" => array("x" => 70, "y" => 240),
"ls" => array("x" => 71, "y" => 207),
"sto" => array("x" => 75, "y" => 186),
"li" => array("x" => 80, "y" => 156),
"sl" => array("x" => 86, "y" => 135),
"gn" => array("x" => 142, "y" => 52),
"en_r" => array("x" => null, "y" => null),
"en_l" => array("x" => 152, "y" => 389),
"ex_r" => array("x" => null, "y" => null),
"ex_l" => array("x" => 214, "y" => 388),
"al_r" => array("x" => null, "y" => null),
"al_l" => array("x" => 119, "y" => 281),
"ac_r" => array("x" => null, "y" => null),
"ac_l" => array("x" => 127, "y" => 270),
"sbal_r" => array("x" => null, "y" => null),
"sbal_l" => array("x" => 91, "y" => 243),
"cph_r" => array("x" => 49, "y" => 209),
"cph_l" => array("x" => 85, "y" => 210),
"ch_r" => array("x" => null, "y" => null),
"ch_l" => array("x" => 168, "y" => 190),
"t_r" => array("x" => null, "y" => null),
"t_l" => array("x" => 438, "y" => 366),
"eu_r" => array("x" => null, "y" => null),
"eu_l" => array("x" => 468, "y" => 486),
"ft_r" => array("x" => null, "y" => null),
"ft_l" => array("x" => 247, "y" => 480),
"zy_r" => array("x" => null, "y" => null),
"zy_l" => array("x" => 250, "y" => 355),
"go_r" => array("x" => null, "y" => null),
"go_l" => array("x" => 376, "y" => 172),
"g" => array("x" => 65, "y" => 458),
"op" => array("x" => null, "y" => null)
),
"oblique-right" => array(
"n" => array("x" => 530, "y" => 424),
"prn" => array("x" => 576, "y" => 292),
"sn" => array("x" => 530, "y" => 240),
"ls" => array("x" => 529, "y" => 207),
"sto" => array("x" => 524, "y" => 186),
"li" => array("x" => 520, "y" => 156),
"sl" => array("x" => 514, "y" => 135),
"gn" => array("x" => 458, "y" => 52),
"en_r" => array("x" => 448, "y" => 389),
"en_l" => array("x" => null, "y" => null),
"ex_r" => array("x" => 386, "y" => 388),
"ex_l" => array("x" => null, "y" => null),
"al_r" => array("x" => 481, "y" => 281),
"al_l" => array("x" => null, "y" => null),
"ac_r" => array("x" => 473, "y" => 270),
"ac_l" => array("x" => null, "y" => null),
"sbal_r" => array("x" => 509, "y" => 243),
"sbal_l" => array("x" => null, "y" => null),
"cph_r" => array("x" => 49, "y" => 209),
"cph_l" => array("x" => 85, "y" => 210),
"ch_r" => array("x" => 432, "y" => 190),
"ch_l" => array("x" => null, "y" => null),
"t_r" => array("x" => 162, "y" => 366),
"t_l" => array("x" => null, "y" => null),
"eu_r" => array("x" => 132, "y" => 486),
"eu_l" => array("x" => null, "y" => null),
"ft_r" => array("x" => 353, "y" => 480),
"ft_l" => array("x" => null, "y" => null),
"zy_r" => array("x" => 350, "y" => 355),
"zy_l" => array("x" => null, "y" => null),
"go_r" => array("x" => 224, "y" => 172),
"go_l" => array("x" => null, "y" => null),
"g" => array("x" => 65, "y" => 458),
"op" => array("x" => 535, "y" => null)
),
"lateral-left" => array(
"n" => array("x" => 51, "y" => 398),
"prn" => array("x" => 3, "y" => 270),
"sn" => array("x" => 55, "y" => 229),
"ls" => array("x" => 56, "y" => 200),
"sto" => array("x" => 76, "y" => 181),
"li" => array("x" => 71, "y" => 152),
"sl" => array("x" => 88, "y" => 126),
"gn" => array("x" => 128, "y" => 53),
"en_r" => array("x" => null, "y" => null),
"en_l" => array("x" => null, "y" => null),
"ex_r" => array("x" => null, "y" => null),
"ex_l" => array("x" => 114, "y" => 371),
"al_r" => array("x" => null, "y" => null),
"al_l" => array("x" => null, "y" => null),
"ac_r" => array("x" => null, "y" => null),
"ac_l" => array("x" => null, "y" => null),
"sbal_r" => array("x" => null, "y" => null),
"sbal_l" => array("x" => null, "y" => null),
"cph_r" => array("x" => null, "y" => null),
"cph_l" => array("x" => null, "y" => null),
"ch_r" => array("x" => null, "y" => null),
"ch_l" => array("x" => null, "y" => null),
"t_r" => array("x" => null, "y" => null),
"t_l" => array("x" => null, "y" => null),
"eu_r" => array("x" => null, "y" => null),
"eu_l" => array("x" => null, "y" => null),
"ft_r" => array("x" => null, "y" => null),
"ft_l" => array("x" => null, "y" => null),
"zy_r" => array("x" => null, "y" => null),
"zy_l" => array("x" => null, "y" => null),
"go_r" => array("x" => null, "y" => null),
"go_l" => array("x" => null, "y" => null),
"g" => array("x" => 36, "y" => 454),
"op" => array("x" => 647, "y" => 481)
),
"lateral-right" => array( ),
);
$descriptions = array(
"n" => "Midline point where the frontal and nasal bones contact (nasofrontal suture). Soft tissue nasion corresponds to the underlying bony landmark.",
"prn" => "Midline point marking the maximum protrusion of the nasal tip.",
"sn" => "Midline point marking the junction between the inferior border of the nasal septum and the cutaneous upper lip. It is the apex of the nasolabial angle.",
"ls" => "Midline point of the vermilion border of the upper lip, at the base of the philtrum.",
"sto" => "Midpoint of the labial fissure.",
"li" => "Midline point of the vermilion border of the lower lip.",
"sl" => "Midpoint along the inferior margin of the cutaneous lower lip (labiomental sulcus).",
"gn" => "Midline point on the inferior border of the mandible. Corresponds to the underlying bony landmark.",
"en" => "Apex of the angle formed at the inner corner of the palpebral fissure where the upper and lower eyelids meet.",
"ex" => "Apex of the angle formed at the outer corner of the palpebral fissure where the upper and lower eyelids meet.",
"al" => "Most lateral point on the nasal ala.",
"ac" => "Most posterolateral point on the alar cartilage, located within the crease formed by the union of the alar cartilage and the skin of the cheek.",
"sbal" => "Point located at the lower margin of the nasal ala, where the cartilage insterts in the cutaneous upper lip.",
"cph" => "Point marking the lateral crest of the philtrum at the vermilion border of the upper lip.",
"ch" => "Point marking the lateral extent of the labial fissure.",
"t" => "Point marking the notch at the superior margin of the tragus, where the cartilage meets the skin of the face.",
"eu" => "The most lateral point on the parietal region of the head.",
"ft" => "The most medial projecting point situated along the temporal crest of the frontal bone.",
"zy" => "The most lateral point on the zygomatic arch. As such, this landmark may be located on the zygomatic process of the temporal bone.",
"go" => "The most lateral point at the gonial/mandibular angle.",
"g" => "The most anterior midline point on the frontal bone situated between the supraorbital ridges.",
"op" => "The most posterior midline point on the occipital bone, as defined in relation to the glabella."
);
$digital = array(
"n" => "Nasion (n)",
"prn" => "Pronasion (prn)",
"sn" => "Subnasale (sn)",
"ls" => "Labiale Superior (ls)",
"sto" => "Stomion (sto)",
"li" => "Labiale Inferius (li)",
"sl" => "Sublabiale (sl)",
"gn" => "Gnathion (gn)",
"en_r" => "Right Endocanthion (en_r)",
"en_l" => "Left Endocanthion (en_l)",
"ex_r" => "Right Exocanthion (ex_r)",
"ex_l" => "Left Exocanthion (ex_l)",
"al_r" => "Right Alare (al_r)",
"al_l" => "Left Alare (al_l)",
"ac_r" => "Right Alar Curvature Point (ac_r)",
"ac_l" => "Left Alar Curvature Point (ac_l)",
"sbal_r" => "Right Subalare (sbal_r)",
"sbal_l" => "Left Subalare (sbal_l)",
"cph_r" => "Right Christa Philtri (cph_r)",
"cph_l" => "Left Christa Philtri (cph_l)",
"ch_r" => "Right Chelion (ch_r)",
"ch_l" => "Left Chelion (ch_l)",
"t_r" => "Right Tragion (t_r)",
"t_l" => "Left Tragion (t_l)"
);
$caliper = array(
"g" => "Glabella (g)",
"eu_r" => "Right Euryon (eu_r)",
"eu_l" => "Left Euryon (eu_l)",
"ft_r" => "Right Frontotemporale (ft_r)",
"ft_l" => "Left Frontotemporale (ft_l)",
"zy_r" => "Right Zygion (zy_r)",
"zy_l" => "Left Zygion (zy_l)",
"go_r" => "Right Gonion (go_r)",
"go_l" => "Left Gonion (go_l)",
"op" => "Opisthocranion (op)"
);
$views = array(
"n" => "frontal",
"prn" => "frontal",
"sn" => "frontal",
"ls" => "frontal",
"sto" => "frontal",
"li" => "frontal",
"sl" => "frontal",
"gn" => "frontal",
"en_r" => "oblique-right",
"en_l" => "oblique-left",
"ex_r" => "oblique-right",
"ex_l" => "oblique-left",
"al_r" => "oblique-right",
"al_l" => "oblique-left",
"ac_r" => "oblique-right",
"ac_l" => "oblique-left",
"sbal_r" => "oblique-right",
"sbal_l" => "oblique-left",
"cph_r" => "frontal",
"cph_l" => "frontal",
"ch_r" => "frontal",
"ch_l" => "frontal",
"t_r" => "oblique-right",
"t_l" => "oblique-left",
"g" => "frontal",
"eu_r" => "oblique-right",
"eu_l" => "oblique-left",
"ft_r" => "oblique-right",
"ft_l" => "oblique-left",
"zy_r" => "oblique-right",
"zy_l" => "oblique-left",
"go_r" => "oblique-right",
"go_l" => "oblique-right",
"op" => "lateral-left"
);
/*
{
"id": "n"
"name": "Nasion (n)"
"frontal":{x: 280, y: 424}
"oblique-left": {x: 70, y 424}
"oblique-right": {x: 530, y 424}
"lateral-left": {x: 51, y: 398}
"lateral-right":{}
"description": "Midline point where the frontal and nasal bones contact (nasofrontal suture). Soft tissue nasion corresponds to the underlying bony landmark."
"measurement_device": "digital"
"view": "frontal"
},*/
$landmarks = array();
$i = 0;
foreach ($digital as $key => $value){
$landmarks[$i] = array();
$landmarks[$i]['id'] = $key;
$landmarks[$i]['name'] = $value;
$landmarks[$i]['view'] = $views[$key];
$landmarks[$i]['frontal'] = $coordinates["frontal"][$key];
$landmarks[$i]['oblique-left'] = $coordinates["oblique-left"][$key];
$landmarks[$i]['oblique-right'] = $coordinates["oblique-right"][$key];
$landmarks[$i]['lateral-left'] = $coordinates["lateral-left"][$key];
$landmarks[$i]['lateral-right'] = $coordinates["lateral-right"][$key];
$landmarks[$i]['description'] = $descriptions[$key];
$landmarks[$i]['measurement_device'] = 'digital';
$i++;
}
foreach ($caliper as $key => $value){
$landmarks[$i] = array();
$landmarks[$i]['id'] = $key;
$landmarks[$i]['name'] = $value;
$landmarks[$i]['view'] = $views[$key];
$landmarks[$i]['frontal'] = $coordinates["frontal"][$key];
$landmarks[$i]['oblique-left'] = $coordinates["oblique-left"][$key];
$landmarks[$i]['oblique-right'] = $coordinates["oblique-right"][$key];
$landmarks[$i]['lateral-left'] = $coordinates["lateral-left"][$key];
$landmarks[$i]['lateral-right'] = $coordinates["lateral-right"][$key];
$landmarks[$i]['description'] = $descriptions[$key];
$landmarks[$i]['measurement_device'] = 'caliper';
$i++;
}
$json = json_encode($landmarks, JSON_PRETTY_PRINT);
echo $json;