-
Notifications
You must be signed in to change notification settings - Fork 521
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BUG: Fix issues caused by invalid Segmentation binary labelmap scalar…
… types Adds the functions ValidateSegmentationImageType and CastToSmallestUnsignedIntegerType to vtkOrientedImageDataResample. - IsImageScalarTypeValid: Returns True if the scalar type of the image is valid for representing segmentations. False otherwise. - CastToSmallestUnsignedIntegerType: Casts the contents of the image to the smallest unsigned integer type that can contain all values in the image. - ValidateSegmentationImageType: Checks to see if the scalar type of the image is a valid type, and casts the image to the smallest valid type if it is not. The function ValidateSegmentationImageType is used during binary labelmap read/import to automatically convert the labelmap. If a labelmap representation with an invalid scalar type is added to a segment, we only log a warning and don't automatically convert the labelmap. Before performing binary labelmap to closed surface conversion, we check that the scalar type is valid, and log/return an error if it is not. This should prevent errors from arising due to the use of floating point images for segmentations. Re #6941 Co-authored-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>
- Loading branch information
Showing
10 changed files
with
491 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.