|
490 | 490 | " \"\"\"\n", |
491 | 491 | " Compute symmetric surface distances and take the maximum.\n", |
492 | 492 | " \"\"\"\n", |
493 | | - " # When the segmentation touches the image border we have corner case for the computation.\n", |
494 | | - " # The surface/contour computation yields a surface that is outside the image bounds and\n", |
495 | | - " # is thus not included in the computation. This is not correct for our use case. By padding\n", |
496 | | - " # the segmentations we ensure that we obtain the surface as expected and the distance computations\n", |
497 | | - " # are correct. Padding has no effect on results if the original segmentations did not touch the image\n", |
| 493 | + " # When the segmentation reaches the image border, we have a corner case and we need to make an\n", |
| 494 | + " # assumption with respect to the values outside the image's physical extent. We can assume\n", |
| 495 | + " # (a) the region outside the segmentation image has the same values as inside, segmented region\n", |
| 496 | + " # continues outside the image so no surface at the image border (b) the region outside the\n", |
| 497 | + " # segmentation image is empty.\n", |
| 498 | + " # The implementation of the LabelContourFilter appears to use assumption 'a' but we would like to\n", |
| 499 | + " # use assumption 'b'. By padding the image with zeros we mimic the conditions of assumption\n", |
| 500 | + " # 'b' which will yield a surface at the image border.\n", |
| 501 | + " # Padding has no effect on results if the original segmentations did not touch the image\n", |
498 | 502 | " # border.\n", |
499 | 503 | " dim = reference_segmentation.GetDimension()\n", |
500 | 504 | " reference_segmentation = sitk.ConstantPad(\n", |
|
0 commit comments