You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SlidingPatchWSIDataset builds ProbMapKeys.LOCATION with np.round(...) and never casts back to int, so the metadata is float64. ProbMapProducer uses it directly as an array index, which numpy 2.x rejects:
IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`)
and integer or boolean arrays are valid indices
MaskedPatchWSIDataset already calls .astype(int) on the same key, so the two datasets emit different dtypes.
Run sliding-window WSI inference with ProbMapProducer attached. It raises at monai/handlers/probability_maps.py:
self.prob_map[name][tuple(loc)] =prob
Expected behavior
ProbMapKeys.LOCATION should be an integer array, consistent with MaskedPatchWSIDataset, and ProbMapProducer should index the probability map without error.
Hi, I’d like to work on this. I can reproduce the cause on dev: SlidingPatchWSIDataset computes the mask locations with np.round(...), which leaves them as floats, while MaskedPatchWSIDataset already casts with .astype(int). I plan to add the same cast and a test that checks the locations are integers. Does that approach sound OK?
Activity
caitlin-leonard commentedon Oct 13, 2026
Hi, I’d like to work on this. I can reproduce the cause on dev: SlidingPatchWSIDataset computes the mask locations with np.round(...), which leaves them as floats, while MaskedPatchWSIDataset already casts with .astype(int). I plan to add the same cast and a test that checks the locations are integers. Does that approach sound OK?