Skip to content

Commit

Permalink
Merge pull request #456 from zivy/updateDocs
Browse files Browse the repository at this point in the history
Improve documentation of surface_hausdorff_distance.
  • Loading branch information
zivy authored Sep 12, 2024
2 parents 0cb6436 + 811be4d commit 390ece0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
14 changes: 9 additions & 5 deletions Python/34_Segmentation_Evaluation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -490,11 +490,15 @@
" \"\"\"\n",
" Compute symmetric surface distances and take the maximum.\n",
" \"\"\"\n",
" # When the segmentation touches the image border we have corner case for the computation.\n",
" # The surface/contour computation yields a surface that is outside the image bounds and\n",
" # is thus not included in the computation. This is not correct for our use case. By padding\n",
" # the segmentations we ensure that we obtain the surface as expected and the distance computations\n",
" # are correct. Padding has no effect on results if the original segmentations did not touch the image\n",
" # When the segmentation reaches the image border, we have a corner case and we need to make an\n",
" # assumption with respect to the values outside the image's physical extent. We can assume\n",
" # (a) the region outside the segmentation image has the same values as inside, segmented region\n",
" # continues outside the image so no surface at the image border (b) the region outside the\n",
" # segmentation image is empty.\n",
" # The implementation of the LabelContourFilter appears to use assumption 'a' but we would like to\n",
" # use assumption 'b'. By padding the image with zeros we mimic the conditions of assumption\n",
" # 'b' which will yield a surface at the image border.\n",
" # Padding has no effect on results if the original segmentations did not touch the image\n",
" # border.\n",
" dim = reference_segmentation.GetDimension()\n",
" reference_segmentation = sitk.ConstantPad(\n",
Expand Down
1 change: 1 addition & 0 deletions tests/additional_dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ Kamath
LBFGS
LSMImageIO
LaTeX
LabelContourFilter
LabelContourImageFilter
LabelMapContourOverlayImageFilter
LabelOverlayImageFilter
Expand Down

0 comments on commit 390ece0

Please sign in to comment.