Skip to content

Commit

Permalink
changed to warnings.warn for generate_sparse_mask
Browse files Browse the repository at this point in the history
Former-commit-id: 1aec56d
  • Loading branch information
fishingguy456 committed Jun 13, 2022
1 parent 6ea648c commit e73ae50
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion imgtools/modules/segmentation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from functools import wraps
import warnings

import numpy as np
import SimpleITK as sitk
Expand Down Expand Up @@ -127,7 +128,7 @@ def generate_sparse_mask(self, verbose=False) -> SparseMask:
sparsemask = SparseMask(sparsemask_arr, roi_names)
if verbose:
if len(voxels_with_overlap) != 0:
raise Warning(f"{len(voxels_with_overlap)} voxels have overlapping contours.")
warnings.warn(f"{len(voxels_with_overlap)} voxels have overlapping contours.")
return sparsemask

def _max_adder(self, arr_1: np.ndarray, arr_2: np.ndarray) -> Tuple[np.ndarray, Set[Tuple[int, int, int]]]:
Expand Down

0 comments on commit e73ae50

Please sign in to comment.