Skip to content

Commit b9559f8

Browse files
Moved text cells above code cells
1 parent c24c840 commit b9559f8

1 file changed

Lines changed: 34 additions & 33 deletions

File tree

notebooks/collections_demos/bonemarrowwsi_pediatricleukemia.ipynb

Lines changed: 34 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"colab": {
66
"provenance": [],
77
"toc_visible": true,
8-
"authorship_tag": "ABX9TyOo2IUHQcuW5Dtanxe/Wiqr",
8+
"authorship_tag": "ABX9TyMp4/gGxQcu3ybm3Suc/Pv5",
99
"include_colab_link": true
1010
},
1111
"kernelspec": {
@@ -787,6 +787,20 @@
787787
"id": "WHvZRtVE5ByF"
788788
}
789789
},
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+
},
790804
{
791805
"cell_type": "code",
792806
"source": [
@@ -845,20 +859,6 @@
845859
"execution_count": 21,
846860
"outputs": []
847861
},
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-
},
862862
{
863863
"cell_type": "code",
864864
"source": [
@@ -1317,6 +1317,23 @@
13171317
}
13181318
]
13191319
},
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+
},
13201337
{
13211338
"cell_type": "code",
13221339
"source": [
@@ -1381,6 +1398,7 @@
13811398
" cells = pd.DataFrame(rows)\n",
13821399
" return cells\n",
13831400
"\n",
1401+
"\n",
13841402
"def get_annotation_session(ann: hd.ann.sop.MicroscopyBulkSimpleAnnotations) -> str:\n",
13851403
" if 'unlabeled' in ann.SeriesDescription.lower():\n",
13861404
" return 'n/a'\n",
@@ -1392,23 +1410,6 @@
13921410
"execution_count": 22,
13931411
"outputs": []
13941412
},
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-
},
14121413
{
14131414
"cell_type": "code",
14141415
"source": [
@@ -2426,7 +2427,7 @@
24262427
{
24272428
"cell_type": "markdown",
24282429
"source": [
2429-
"## How to use the `BoneMarrowWSI-PediatricLeukemia` annotations"
2430+
"## How to use the `BoneMarrowWSI-PediatricLeukemia` annotations\n"
24302431
],
24312432
"metadata": {
24322433
"id": "eKSnU4dyXkiR"

0 commit comments

Comments
 (0)