|
61 | 61 | }, |
62 | 62 | { |
63 | 63 | "cell_type": "code", |
64 | | - "execution_count": null, |
| 64 | + "execution_count": 4, |
65 | 65 | "id": "e47b3da1-7cfb-4b64-a44f-dda0c7924b7f", |
66 | 66 | "metadata": {}, |
67 | 67 | "outputs": [], |
|
92 | 92 | "\n", |
93 | 93 | "xml_path = r'./data/monkey-data/annotations/xml/A_P000001.xml'\n", |
94 | 94 | "output_path = r'./data/monkey-data/annotations_polygon/A_P000001_polygon.xml'\n", |
| 95 | + "\n", |
| 96 | + "#TODO: check those values because in the eval they changed the numbers!\n", |
95 | 97 | "lymphocyte_half_box_size = 4.5 # the size of half of the bbox around the lymphocyte dot in um\n", |
96 | | - "monocytes_half_box_size = 11.0 # the size of half of the bbox around the monocytes dot in um\n", |
97 | | - "min_spacing = 0.25\n", |
| 98 | + "#NOTE: reduced this to 5.0 as the eval script (it was 11.0)\n", |
| 99 | + "monocytes_half_box_size = 5.0 # the size of half of the bbox around the monocytes dot in um\n", |
| 100 | + "min_spacing = 0.24199951445730394 # NOTE: changed this!\n", |
| 101 | + "#spacing is the zoom level of the image, in micro-meters per pixel (was rounded to 0.25)\n", |
| 102 | + "\n", |
| 103 | + "# convert the dot annotations (in mm) to polygon bounding boxes\n", |
98 | 104 | "dot2polygon(xml_path, lymphocyte_half_box_size, monocytes_half_box_size, min_spacing, output_path)" |
99 | 105 | ] |
100 | 106 | }, |
101 | 107 | { |
102 | 108 | "cell_type": "code", |
103 | | - "execution_count": 9, |
| 109 | + "execution_count": 7, |
104 | 110 | "id": "4ab2cd84-a475-4433-94b6-c1d259e1af07", |
105 | 111 | "metadata": {}, |
106 | 112 | "outputs": [ |
|
286 | 292 | " print(xml_path)\n", |
287 | 293 | " output_path = os.path.join(annotation_polygon_dir,os.path.splitext(os.path.basename(xml_path))[0] + '_polygon' + os.path.splitext(os.path.basename(xml_path))[1])\n", |
288 | 294 | " print(output_path)\n", |
289 | | - " lymphocyte_half_box_size = 4.5 # the size of half of the bbox around the lymphocyte dot in um\n", |
290 | | - " monocytes_half_box_size = 11.0 # the size of half of the bbox around the monocytes dot in um\n", |
291 | | - " min_spacing = 0.25\n", |
| 295 | + " # lymphocyte_half_box_size = 4.5 # the size of half of the bbox around the lymphocyte dot in um\n", |
| 296 | + " # monocytes_half_box_size = 11.0 # the size of half of the bbox around the monocytes dot in um\n", |
| 297 | + " # min_spacing = 0.25\n", |
292 | 298 | " dot2polygon(xml_path, lymphocyte_half_box_size, monocytes_half_box_size, min_spacing, output_path)" |
293 | 299 | ] |
294 | 300 | }, |
|
302 | 308 | }, |
303 | 309 | { |
304 | 310 | "cell_type": "code", |
305 | | - "execution_count": 10, |
| 311 | + "execution_count": 8, |
306 | 312 | "id": "a8fc5aaf-c068-4b8f-bf37-91a609a234d5", |
307 | 313 | "metadata": {}, |
308 | 314 | "outputs": [], |
|
347 | 353 | }, |
348 | 354 | { |
349 | 355 | "cell_type": "code", |
350 | | - "execution_count": 12, |
| 356 | + "execution_count": 10, |
351 | 357 | "id": "45e85653-a4b7-4977-a143-b15bad959828", |
352 | 358 | "metadata": {}, |
353 | 359 | "outputs": [ |
354 | 360 | { |
355 | 361 | "name": "stdout", |
356 | 362 | "output_type": "stream", |
357 | 363 | "text": [ |
358 | | - "match found: A_P000001\n" |
| 364 | + "match found: B_P000004\n", |
| 365 | + "match found: D_P000011\n", |
| 366 | + "match found: B_P000005\n", |
| 367 | + "match found: A_P000036\n", |
| 368 | + "match found: A_P000001\n", |
| 369 | + "match found: D_P000004\n", |
| 370 | + "match found: A_P000011\n", |
| 371 | + "match found: C_P000031\n", |
| 372 | + "match found: A_P000029\n", |
| 373 | + "match found: D_P000010\n", |
| 374 | + "match found: C_P000033\n", |
| 375 | + "match found: A_P000035\n", |
| 376 | + "match found: D_P000015\n", |
| 377 | + "match found: C_P000036\n", |
| 378 | + "match found: A_P000006\n", |
| 379 | + "match found: A_P000018\n", |
| 380 | + "match found: B_P000003\n", |
| 381 | + "match found: B_P000016\n", |
| 382 | + "match found: A_P000034\n", |
| 383 | + "match found: C_P000037\n", |
| 384 | + "match found: D_P000002\n", |
| 385 | + "match found: B_P000007\n", |
| 386 | + "match found: B_P000015\n", |
| 387 | + "match found: D_P000001\n", |
| 388 | + "match found: D_P000009\n", |
| 389 | + "match found: A_P000004\n", |
| 390 | + "match found: C_P000023\n", |
| 391 | + "match found: A_P000003\n", |
| 392 | + "match found: A_P000005\n", |
| 393 | + "match found: A_P000014\n", |
| 394 | + "match found: C_P000035\n", |
| 395 | + "match found: C_P000024\n", |
| 396 | + "match found: D_P000016\n", |
| 397 | + "match found: C_P000038\n", |
| 398 | + "match found: B_P000020\n", |
| 399 | + "match found: D_P000007\n", |
| 400 | + "match found: C_P000039\n", |
| 401 | + "match found: B_P000013\n", |
| 402 | + "match found: B_P000014\n", |
| 403 | + "match found: A_P000038\n", |
| 404 | + "match found: B_P000019\n", |
| 405 | + "match found: D_P000005\n", |
| 406 | + "match found: C_P000025\n", |
| 407 | + "match found: D_P000019\n", |
| 408 | + "match found: C_P000027\n", |
| 409 | + "match found: C_P000040\n", |
| 410 | + "match found: C_P000021\n", |
| 411 | + "match found: D_P000012\n", |
| 412 | + "match found: C_P000026\n", |
| 413 | + "match found: A_P000022\n", |
| 414 | + "match found: C_P000028\n", |
| 415 | + "match found: D_P000006\n", |
| 416 | + "match found: D_P000018\n", |
| 417 | + "match found: A_P000033\n", |
| 418 | + "match found: A_P000021\n", |
| 419 | + "match found: A_P000020\n", |
| 420 | + "match found: B_P000012\n", |
| 421 | + "match found: B_P000001\n", |
| 422 | + "match found: A_P000024\n", |
| 423 | + "match found: B_P000002\n", |
| 424 | + "match found: A_P000007\n", |
| 425 | + "match found: A_P000030\n", |
| 426 | + "match found: A_P000032\n", |
| 427 | + "match found: B_P000009\n", |
| 428 | + "match found: A_P000031\n", |
| 429 | + "match found: A_P000017\n", |
| 430 | + "match found: A_P000037\n", |
| 431 | + "match found: C_P000022\n", |
| 432 | + "match found: A_P000002\n", |
| 433 | + "match found: D_P000014\n", |
| 434 | + "match found: B_P000017\n", |
| 435 | + "match found: C_P000029\n", |
| 436 | + "match found: D_P000013\n", |
| 437 | + "match found: C_P000032\n", |
| 438 | + "match found: A_P000016\n", |
| 439 | + "match found: B_P000010\n", |
| 440 | + "match found: D_P000003\n", |
| 441 | + "match found: B_P000011\n", |
| 442 | + "match found: D_P000017\n", |
| 443 | + "match found: C_P000034\n", |
| 444 | + "match found: C_P000030\n" |
359 | 445 | ] |
360 | 446 | } |
361 | 447 | ], |
362 | 448 | "source": [ |
363 | | - "wsi_dir = r'./data_debug/images/pas-cpg'\n", |
364 | | - "wsa_dir = r'./data_debug/annotations_polygon/*_polygon.xml'\n", |
| 449 | + "wsi_dir = r'./data/monkey-data/images/pas-cpg' #r'./data_debug/images/pas-cpg'\n", |
| 450 | + "wsa_dir = r'./data/monkey-data/annotations_polygon/*_polygon.xml'\n", |
365 | 451 | "output_dir = r'./source/configs'\n", |
366 | | - "output_name = 'training_sample.yml'\n", |
| 452 | + "output_name = 'training_full.yml'\n", |
367 | 453 | "\n", |
368 | 454 | "folders_to_yml(wsi_dir, \n", |
369 | 455 | " wsa_dir,\n", |
|
0 commit comments