Skip to content

Commit 63a198a

Browse files
4966 fix deepedit get clicks (#4969)
Fixes #4966 ### 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. - [x] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [x] 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: wojiazaiyugang <[email protected]>
1 parent d3aeec3 commit 63a198a

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

monai/apps/deepedit/transforms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ def __call__(self, data):
673673
# Creating guidance for all clicks
674674
all_guidances = {}
675675
for key_label in self.label_names.keys():
676-
clicks = d.get(key_label, [])
676+
clicks = d[self.guidance].get(key_label, [])
677677
clicks = list(np.array(clicks).astype(int))
678678
all_guidances[key_label] = self._apply(clicks, factor)
679679
d[self.guidance] = all_guidances

tests/test_deepedit_transforms.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
"current_label": "spleen",
8080
"probability": 1.0,
8181
"label_names": LABEL_NAMES,
82-
"spleen": [[0, 4, 3], [0, 0, 3], [0, 1, 3]],
82+
"guidance": {"spleen": [[0, 4, 3], [0, 0, 3], [0, 1, 3]]},
8383
"sids": {"spleen": []},
8484
"pred": PRED,
8585
}
@@ -140,7 +140,6 @@
140140

141141
DATA_11 = {"image": IMAGE, "label": LABEL, "label_names": LABEL_NAMES, "pred": PRED}
142142

143-
144143
ADD_GUIDANCE_FROM_POINTS_TEST_CASE = [
145144
{"ref_image": "image", "guidance": "guidance", "label_names": LABEL_NAMES}, # arguments
146145
DATA_4, # input_data

0 commit comments

Comments
 (0)