Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve documentation of surface_hausdorff_distance. #456

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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