Skip to content

Commit 3691984

Browse files
restructuring text
1 parent c7c92c5 commit 3691984

1 file changed

Lines changed: 13 additions & 9 deletions

File tree

notebooks/pathomics/microscopy_dicom_ann_intro.ipynb

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -245,11 +245,7 @@
245245
"\n",
246246
"Each ANN object contains one or more \"Annotation Groups\" consisting of many similar graphical annotations, optionally accompanied by one or several numerical measurements belonging to those graphical annotations as well as some required and some optional metadata that describe the contents of the group. These include an annotation group identifier, a human-readable label but also coded values that describe the category and the type of the annotated structure (see [here](https://highdicom.readthedocs.io/en/latest/package.html#highdicom.ann.AnnotationGroup) for a complete documentation). \n",
247247
"\n",
248-
"The following code uses the Python library [highdicom](https://github.com/ImagingDataCommons/highdicom) to extract annotation groups, corresponding measurements and metadata from a single DICOM ANN.\n",
249-
"\n",
250-
"In highdicom, the graphic annotation data are encoded as a list of numpy arrays, each of the shape (N x D). N is the number of coordinates which depends on the graphic type, e.g. a `POINT` will have one coordinate, while a `POLYGON` has >= 3 coordinates. Coordinates are either defined in the 2D image coordinate system (D=2), or in the frame-of-reference coordinate system (D=3).\n",
251-
"\n",
252-
"More explanations and guidance through implementation details for ANN objects in highdicom can be found [here](https://highdicom.readthedocs.io/en/latest/ann.html#microscopy-bulk-simple-annotation-ann-objects)."
248+
"The following code uses [highdicom](https://github.com/ImagingDataCommons/highdicom) to extract annotation groups and metadata from a single DICOM ANN. More helpful explanations and guidance through implementation details for ANN objects in highdicom can be found [here](https://highdicom.readthedocs.io/en/latest/ann.html#microscopy-bulk-simple-annotation-ann-objects)."
253249
]
254250
},
255251
{
@@ -305,9 +301,17 @@
305301
"print(f'Unique identifier of the annotation group: {ann_group.annotation_group_uid}')\n",
306302
"print(f'Human-readable label of the annotation group: {ann_group.label}')\n",
307303
"print(f'Coded label of the annotated property category: {ann_group.annotated_property_category}')\n",
308-
"print(f'Coded label of the annotated property type: {ann_group.annotated_property_category}') \n",
304+
"print(f'Coded label of the annotated property type: {ann_group.annotated_property_type}') \n",
309305
"print(f'Graphic type of annotations: {ann_group.graphic_type}')\n",
310-
"print(f'Number of annotations: {ann_group.number_of_annotations}')"
306+
"print(f'Number of annotations: {ann_group.number_of_annotations}')\n",
307+
"print(f'Algorithm type used to generate the annotations: {ann_group.algorithm_type}')"
308+
]
309+
},
310+
{
311+
"cell_type": "markdown",
312+
"metadata": {},
313+
"source": [
314+
"In highdicom, the graphic annotation data are encoded as a list of numpy arrays, each of the shape (N x D). N is the number of coordinates which depends on the graphic type, e.g. a `POINT` will have one coordinate, while a `POLYGON` has >= 3 coordinates. Coordinates are either defined in the 2D image coordinate system (D=2), or in the frame-of-reference coordinate system (D=3)."
311315
]
312316
},
313317
{
@@ -331,7 +335,7 @@
331335
],
332336
"source": [
333337
"# The actual graphical annotation can be accessed as follows:\n",
334-
"nuclei_annotations = ann_group.get_graphic_data(coordinate_type='2D')\n",
338+
"nuclei_annotations = ann_group.get_graphic_data(coordinate_type=ann.annotation_coordinate_type)\n",
335339
"first_ann = nuclei_annotations[0].tolist()\n",
336340
"print(f'First annotation: {first_ann}')"
337341
]
@@ -342,7 +346,7 @@
342346
"id": "AfxGQ-WXNGkj"
343347
},
344348
"source": [
345-
"As previously mentioned, annotations can be accompanied by one or multiple measurements. For the Pan-Cancer-Nuclei-Seg-DICOM collection these are each nuclei's area given in µm²."
349+
"As previously mentioned, annotations can be accompanied by one or multiple measurements. In highdicom, they are returned as tuple of `(names, values, units)` each of them being a list of coded values. For the Pan-Cancer-Nuclei-Seg-DICOM collection these are each nuclei's area given in µm²."
346350
]
347351
},
348352
{

0 commit comments

Comments
 (0)