|
5 | 5 | "colab": { |
6 | 6 | "provenance": [], |
7 | 7 | "toc_visible": true, |
8 | | - "authorship_tag": "ABX9TyOo2IUHQcuW5Dtanxe/Wiqr", |
| 8 | + "authorship_tag": "ABX9TyMp4/gGxQcu3ybm3Suc/Pv5", |
9 | 9 | "include_colab_link": true |
10 | 10 | }, |
11 | 11 | "kernelspec": { |
|
787 | 787 | "id": "WHvZRtVE5ByF" |
788 | 788 | } |
789 | 789 | }, |
| 790 | + { |
| 791 | + "cell_type": "markdown", |
| 792 | + "source": [ |
| 793 | + "The following two code cells define and use `get_roi_annotations()` to select all DICOM ANNs in the `BoneMarrowWSI-PediatricLeukemia` collection that contain ROI annotations of the monolayer area.\n", |
| 794 | + "The resulting pandas DataFrame contains\n", |
| 795 | + "- **'reference_SeriesInstanceUID'** and **'reference_SOPInstanceUID'**: the SeriesInstanceUID and SOPInstanceUID of the slide level the annotations refer to\n", |
| 796 | + "- **'roi_id'**: the ID of the ROI\n", |
| 797 | + "- **'roi_label'**: its label \n", |
| 798 | + "- **'roi_coordinates'**: the 2D coordinates in the image coordinate system of the referenced slide level.\n" |
| 799 | + ], |
| 800 | + "metadata": { |
| 801 | + "id": "XKzx9B1fU9ed" |
| 802 | + } |
| 803 | + }, |
790 | 804 | { |
791 | 805 | "cell_type": "code", |
792 | 806 | "source": [ |
|
845 | 859 | "execution_count": 21, |
846 | 860 | "outputs": [] |
847 | 861 | }, |
848 | | - { |
849 | | - "cell_type": "markdown", |
850 | | - "source": [ |
851 | | - "The following cell uses `get_roi_annotations()` to select all DICOM ANNs in the `BoneMarrowWSI-PediatricLeukemia` collection that contain ROI annotations of the monolayer area.\n", |
852 | | - "The resulting pandas DataFrame contains\n", |
853 | | - "- **'reference_SeriesInstanceUID'** and **'reference_SOPInstanceUID'**: the SeriesInstanceUID and SOPInstanceUID of the slide level the annotations refer to\n", |
854 | | - "- **'roi_id'**: the ID of the ROI\n", |
855 | | - "- **'roi_label'**: its label \n", |
856 | | - "- **'roi_coordinates'**: the 2D coordinates in the image coordinate system of the referenced slide level.\n" |
857 | | - ], |
858 | | - "metadata": { |
859 | | - "id": "XKzx9B1fU9ed" |
860 | | - } |
861 | | - }, |
862 | 862 | { |
863 | 863 | "cell_type": "code", |
864 | 864 | "source": [ |
|
1317 | 1317 | } |
1318 | 1318 | ] |
1319 | 1319 | }, |
| 1320 | + { |
| 1321 | + "cell_type": "markdown", |
| 1322 | + "source": [ |
| 1323 | + "The following code cells define and use `get_cell_annotations()` to select all DICOM ANNs in the `BoneMarrowWSI-PediatricLeukemia` collection that contain cell annotations. By setting the parameter 'subset' to either 'labeled', 'unlabeled' or 'both', it's possible to extract either only labeled, unlabeled or all cell annotations.\n", |
| 1324 | + "The resulting pandas DataFrame contains\n", |
| 1325 | + "- **'reference_SeriesInstanceUID'** and **'reference_SOPInstanceUID'**: the SeriesInstanceUID and SOPInstanceUID of the slide level the annotations refer to\n", |
| 1326 | + "- **'annotation_session'**: 'n/a' for the unlabeled cells, otherwise the number of the annotation session or 'consensus' for the final consensus.\n", |
| 1327 | + "- **'cell_id'**: the ID of the cell\n", |
| 1328 | + "- **'roi_id'**: if applicable, the ID of the monolayer ROI, the cell is located within\n", |
| 1329 | + "- **'cell_label_code_scheme'**: Tuple of code of the cell label and designator of the coding scheme, e.g. (414387006, SCT) which is code 414387006 from SNOMED CT ontology\n", |
| 1330 | + "- **'cell_label'**: Code meaning of the cell label e.g. 'Structure of haematological system'\n", |
| 1331 | + "- **'cell_coordinates'**: the 2D coordinates in the image coordinate system of the referenced slide level" |
| 1332 | + ], |
| 1333 | + "metadata": { |
| 1334 | + "id": "gpDVBwjYWz-w" |
| 1335 | + } |
| 1336 | + }, |
1320 | 1337 | { |
1321 | 1338 | "cell_type": "code", |
1322 | 1339 | "source": [ |
|
1381 | 1398 | " cells = pd.DataFrame(rows)\n", |
1382 | 1399 | " return cells\n", |
1383 | 1400 | "\n", |
| 1401 | + "\n", |
1384 | 1402 | "def get_annotation_session(ann: hd.ann.sop.MicroscopyBulkSimpleAnnotations) -> str:\n", |
1385 | 1403 | " if 'unlabeled' in ann.SeriesDescription.lower():\n", |
1386 | 1404 | " return 'n/a'\n", |
|
1392 | 1410 | "execution_count": 22, |
1393 | 1411 | "outputs": [] |
1394 | 1412 | }, |
1395 | | - { |
1396 | | - "cell_type": "markdown", |
1397 | | - "source": [ |
1398 | | - "The following cell uses `get_cell_annotations()` to select all DICOM ANNs in the `BoneMarrowWSI-PediatricLeukemia` collection that contain cell annotations. By setting the parameter 'subset' to either 'labeled', 'unlabeled' or 'both', it's possible to extract either only labeled, unlabeled or all cell annotations.\n", |
1399 | | - "The resulting pandas DataFrame contains\n", |
1400 | | - "- **'reference_SeriesInstanceUID'** and **'reference_SOPInstanceUID'**: the SeriesInstanceUID and SOPInstanceUID of the slide level the annotations refer to\n", |
1401 | | - "- **'annotation_session'**: 'n/a' for the unlabeled cells, otherwise the number of the annotation session or 'consensus' for the final consensus.\n", |
1402 | | - "- **'cell_id'**: the ID of the cell\n", |
1403 | | - "- **'roi_id'**: if applicable, the ID of the monolayer ROI, the cell is located within\n", |
1404 | | - "- **'cell_label_code_scheme'**: Tuple of code of the cell label and designator of the coding scheme, e.g. (414387006, SCT) which is code 414387006 from SNOMED CT ontology\n", |
1405 | | - "- **'cell_label'**: Code meaning of the cell label e.g. 'Structure of haematological system'\n", |
1406 | | - "- **'cell_coordinates'**: the 2D coordinates in the image coordinate system of the referenced slide level" |
1407 | | - ], |
1408 | | - "metadata": { |
1409 | | - "id": "gpDVBwjYWz-w" |
1410 | | - } |
1411 | | - }, |
1412 | 1413 | { |
1413 | 1414 | "cell_type": "code", |
1414 | 1415 | "source": [ |
|
2426 | 2427 | { |
2427 | 2428 | "cell_type": "markdown", |
2428 | 2429 | "source": [ |
2429 | | - "## How to use the `BoneMarrowWSI-PediatricLeukemia` annotations" |
| 2430 | + "## How to use the `BoneMarrowWSI-PediatricLeukemia` annotations\n" |
2430 | 2431 | ], |
2431 | 2432 | "metadata": { |
2432 | 2433 | "id": "eKSnU4dyXkiR" |
|
0 commit comments