Skip to content

Commit b2359b7

Browse files
authored
Fix bug in GenerateInstanceBorder (#5751)
Signed-off-by: KumoLiu <yunl@nvidia.com> Fixes #5750. ### Description Change dim in Sobel gradient which have been discussed in #5503. ### Types of changes <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [x] Non-breaking change (fix or new feature that would not break existing functionality). - [ ] Breaking change (fix or new feature that would cause existing functionality to change). - [ ] New tests added to cover the changes. - [ ] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [ ] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [ ] In-line docstrings updated. - [ ] Documentation updated, tested `make html` command in the `docs/` folder. Signed-off-by: KumoLiu <yunl@nvidia.com>
1 parent c10cdd2 commit b2359b7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • monai/apps/pathology/transforms/post

monai/apps/pathology/transforms/post/array.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,8 @@ def __call__(self, mask: NdarrayOrTensor, hover_map: NdarrayOrTensor) -> Ndarray
216216
raise ValueError("Not a valid hover map, please check your input")
217217
hover_h = (hover_h - hover_h_min) / (hover_h_max - hover_h_min)
218218
hover_v = (hover_v - hover_v_min) / (hover_v_max - hover_v_min)
219-
sobelh = self.sobel_gradient(hover_h)[0, ...]
220-
sobelv = self.sobel_gradient(hover_v)[1, ...]
219+
sobelh = self.sobel_gradient(hover_h)[1, ...]
220+
sobelv = self.sobel_gradient(hover_v)[0, ...]
221221
sobelh_min, sobelh_max = min(sobelh), max(sobelh)
222222
sobelv_min, sobelv_max = min(sobelv), max(sobelv)
223223
if (sobelh_max - sobelh_min) == 0 or (sobelv_max - sobelv_min) == 0:

0 commit comments

Comments
 (0)