Skip to content
Discussion options

You must be logged in to vote

Debugging the issue I found that the thresholded image in RandCropByLabelClassesd was responsible for my problem.

In summary

  • it had nothing to do with the rotation/zoom transforms
  • for some reason (tbd) my image>image_threshold (where image_threshold=0) did not overlap with the mask for my labels:
    label_flat = img_flat & label_flat if img_flat is not None else label_flat is ZERO
  • therefore monai.transforms.utils.map_classes_to_indices returned an empty list of indices
  • monai.transforms.utils.generate_label_classes_crop_centers then tries to sample with probabilities:
    classes = rand_state.choice(len(ratios_), size=num_samples, p=np.asarray(ratios_) / np.sum(ratios_))
  • but ratios_ is ZERO, so …

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@saruarlive
Comment options

@dyollb
Comment options

Answer selected by dyollb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants