We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 354c9c2 commit f4992bdCopy full SHA for f4992bd
monai/transforms/utils.py
@@ -569,8 +569,9 @@ def generate_label_classes_crop_centers(
569
raise ValueError(f"ratios should not contain negative number, got {ratios_}.")
570
571
for i, array in enumerate(indices):
572
- if len(array) == 0 and warn:
573
- warnings.warn(f"no available indices of class {i} to crop, set the crop ratio of this class to zero.")
+ if len(array) == 0:
+ if warn:
574
+ warnings.warn(f"no available indices of class {i} to crop, set the crop ratio of this class to zero.")
575
ratios_[i] = 0
576
577
centers = []
0 commit comments