Skip to content

Commit

Permalink
Merge pull request #660 from Radiomics/issue-658
Browse files Browse the repository at this point in the history
BUG: Allow specification of full mask.
  • Loading branch information
JoostJM authored Nov 17, 2020
2 parents 08bea70 + 3064793 commit 9ccbec1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion radiomics/imageoperations.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def getMask(mask, **kwargs):
mask = sitk.Cast(mask, sitk.sitkUInt32)

labels = numpy.unique(sitk.GetArrayFromImage(mask))
if len(labels) == 1:
if len(labels) == 1 and labels[0] == 0:
raise ValueError('No labels found in this mask (i.e. nothing is segmented)!')
if label not in labels:
raise ValueError('Label (%g) not present in mask. Choose from %s' % (label, labels[labels != 0]))
Expand Down

0 comments on commit 9ccbec1

Please sign in to comment.