Skip to content

Commit

Permalink
More detailed model- cast risk only comes from unsigned long
Browse files Browse the repository at this point in the history
  • Loading branch information
HastingsGreer committed Aug 1, 2024
1 parent 22c030d commit 1698789
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/unigradicon/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,8 @@ def maybe_cast(img: itk.Image):

if str((type(img), itk.D)) not in itk.NearestNeighborInterpolateImageFunction.GetTypesAsList():

if type(img) in (itk.Image[itk.SL, 3], itk.Image[itk.UL, 3]):
raise Exception("Label maps of type long or unsigned long may have values that cannot be represented in a double")
if type(img) in (itk.Image[itk.ULL, 3], itk.Image[itk.UL, 3]):
raise Exception("Label maps of type unsigned long may have values that cannot be represented in a double")

maybe_cast_back = itk.CastImageFilter[itk.Image[itk.D, 3], type(img)].New()

Expand Down

0 comments on commit 1698789

Please sign in to comment.