Skip to content

Commit 384505f

Browse files
small cosmetic changes
1 parent 30d5c31 commit 384505f

1 file changed

Lines changed: 13 additions & 15 deletions

File tree

notebooks/collections_demos/bonemarrowwsi_pediatricleukemia.ipynb

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@
145145
"id": "0HEq03G4EFtv"
146146
},
147147
"source": [
148-
"First, we count the number of slides (=distinct SeriesInstanceUIDs of SM modality) available in the `BoneMarrowWSI-PediatricLeukemia` collection:"
148+
"First, we count the number of slides (=distinct SeriesInstanceUIDs of SM modality) available in the `BoneMarrowWSI-PediatricLeukemia` collection."
149149
]
150150
},
151151
{
@@ -185,14 +185,12 @@
185185
"id": "1-ZR8MkhFqKX"
186186
},
187187
"source": [
188-
"Next, we have a look at the available annotation (ANN) files. The following query collects information about ANN files on series-level from idc-index's `ann_index`.\n",
189-
"\n",
190-
"# TOdO: explain why join on SeriesInstanceUID"
188+
"Let's have a look at the available annotation (ANN) files. The following query collects information about ANN files on series-level from idc-index's `ann_index` joining it with the general index table on `SeriesInstanceUID`."
191189
]
192190
},
193191
{
194192
"cell_type": "code",
195-
"execution_count": 5,
193+
"execution_count": null,
196194
"metadata": {
197195
"colab": {
198196
"base_uri": "https://localhost:8080/",
@@ -519,14 +517,14 @@
519517
"source": [
520518
"query_anns = '''\n",
521519
"SELECT\n",
522-
" ann_index.SeriesInstanceUID,\n",
523-
" ann_index.referenced_SeriesInstanceUID,\n",
520+
" ann_index.SeriesInstanceUID, -- SeriesInstanceUID of the annotation object\n",
521+
" ann_index.referenced_SeriesInstanceUID, -- SeriesInstanceUID of the slide that the annotation is associated with\n",
524522
" index.SeriesDescription,\n",
525523
" index.StudyInstanceUID,\n",
526524
"FROM\n",
527525
" ann_index\n",
528526
"JOIN index\n",
529-
" ON index.SeriesInstanceUID = ann_index.SeriesInstanceUID\n",
527+
" ON index.SeriesInstanceUID = ann_index.SeriesInstanceUID \n",
530528
"WHERE\n",
531529
" index.collection_id = 'bonemarrowwsi_pediatricleukemia'\n",
532530
"ORDER BY\n",
@@ -548,7 +546,7 @@
548546
"* For some slides, there is one ANN Series with \"Unlabeled cell bounding boxes\", while for others, there are multiple ANN Series containing \"Cell bounding boxes with cell type labels\" for different annotation sessions and the consensus labels.\n",
549547
"\n",
550548
"ANN files contain one or multiple \"AnnotationGroups\" (for more explanation see the aforementioned [tutorial notebook]((https://github.com/ImagingDataCommons/IDC-Tutorials/blob/master/notebooks/pathomics/microscopy_dicom_ann_intro.ipynb)) on DICOM ANNs).\n",
551-
"Using `ann_group_index` we can get a little more information on what the individual annotation groups contain exactly. The following code cell queries the AnnotationGroupLabel - a human-readable label for the annotation group - as well as coded values from controlled vocabularies like SNOMED-CT for the category and type of the annotation.\n"
549+
"Using `ann_group_index` we can get a little more information on what the individual annotation groups contain exactly. The following code cell queries the AnnotationGroupLabel - a human-readable label for the annotation group - as well as [coded values from controlled vocabularies](https://learn.canceridc.dev/dicom/coding-schemes) like SNOMED-CT for the category and type of the annotation.\n"
552550
]
553551
},
554552
{
@@ -1352,7 +1350,7 @@
13521350
"- \"Unlabeled cell bounding boxes\" contain only annotations with property type \"Structure of haematological system\" and the human-readable label \"haematological_structure\"\n",
13531351
"- all other ANN Series contain various different AnnotatedPropertyTypes and human-readable labels.\n",
13541352
"\n",
1355-
"We will use this information below to filter for the monolayer regions of interest and labeled vs. unlabeled cell annotations."
1353+
"We will use this information below to filter for the monolayer ROIs and labeled vs. unlabeled cell annotations."
13561354
]
13571355
},
13581356
{
@@ -1489,13 +1487,13 @@
14891487
"source": [
14901488
"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",
14911489
"The resulting pandas DataFrame contains\n",
1492-
"- **'SeriesInstanceUID'**: SeriesInstanceUID of the DICOM ANN Series containing the ROI annotation.\n",
1490+
"- **'SeriesInstanceUID'**: SeriesInstanceUID of the DICOM ANN Series containing the ROI annotation\n",
14931491
"- **'roi_id'**: the ID of the ROI\n",
14941492
"- **'roi_human_label'**: its human-readable label \n",
1495-
"- **'roi_label_code_scheme'**: Tuple of code of the ROI label and designator of the coding scheme used, e.g. (111099, DCM) which is code 111099 from DICOM coding scheme\n",
1493+
"- **'roi_label_code_scheme'**: Tuple of code of the ROI label and designator of the coding scheme used, e.g. (111099, DCM) which is code 111099 from the DICOM controlled terminology\n",
14961494
"- **'roi_label'**: Code meaning of the ROI label\n",
14971495
"- **'roi_coordinates'**: the 2D coordinates in the image coordinate system of the referenced slide level\n",
1498-
"- **'reference_SeriesInstanceUID'** and **'reference_SOPInstanceUID'**: the SeriesInstanceUID and SOPInstanceUID of the slide level the annotations refer to. reference_SeriesInstanceUID can either be obtained from ann_index or read from the ANN file directly - for consistency with reference_SOPInstanceUID the later approach was chosen here.\n"
1496+
"- **'reference_SeriesInstanceUID'** and **'reference_SOPInstanceUID'**: the SeriesInstanceUID and SOPInstanceUID of the slide level the annotations refer to. reference_SeriesInstanceUID can either be obtained from `ann_index` or read from the ANN file directly - for consistency with reference_SOPInstanceUID the later approach was chosen here.\n"
14991497
]
15001498
},
15011499
{
@@ -2183,8 +2181,8 @@
21832181
"source": [
21842182
"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",
21852183
"The resulting pandas DataFrame contains\n",
2186-
"- **'SeriesInstanceUID'**: SeriesInstanceUID of the DICOM ANN Series containing the cell annotation.\n",
2187-
"- **'annotation_session'**: 'n/a' for the unlabeled cells, otherwise the number of the annotation session or 'consensus' for the final consensus.\n",
2184+
"- **'SeriesInstanceUID'**: SeriesInstanceUID of the DICOM ANN Series containing the cell annotation\n",
2185+
"- **'annotation_session'**: 'n/a' for the unlabeled cells, otherwise the number of the annotation session or 'consensus' for the final consensus\n",
21882186
"- **'cell_id'**: the ID of the cell\n",
21892187
"- **'roi_id'**: if applicable, the ID of the monolayer ROI, that the cell is located within\n",
21902188
"- **'cell_human_label'**: Human-readable label of the cell\n",

0 commit comments

Comments
 (0)