Skip to content

Commit 5bdef46

Browse files
KumoLiupre-commit-ci[bot]bhashemianNic-Ma
authored
Add CalculateInstanceSegmentationMap Transform (#5173)
Fixes #5310 . ### Description Add a post transform to process NP branch output(an output branch in HoVerNet) which turns the probability map from the network into the instance segmentation result. ### 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). - [x] 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`. - [x] In-line docstrings updated. - [x] Documentation updated, tested `make html` command in the `docs/` folder. Signed-off-by: KumoLiu <yunl@nvidia.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Behrooz Hashemian <3968947+drbeh@users.noreply.github.com> Co-authored-by: Nic Ma <nma@nvidia.com>
1 parent e766401 commit 5bdef46

15 files changed

+1419
-0
lines changed

docs/source/apps.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,30 @@ Applications
130130
.. autoclass:: TileOnGridd
131131
:members:
132132

133+
.. automodule:: monai.apps.pathology.transforms.post.array
134+
.. autoclass:: Watershed
135+
:members:
136+
.. autoclass:: GenerateWatershedMask
137+
:members:
138+
.. autoclass:: GenerateInstanceBorder
139+
:members:
140+
.. autoclass:: GenerateDistanceMap
141+
:members:
142+
.. autoclass:: GenerateWatershedMarkers
143+
:members:
144+
145+
.. automodule:: monai.apps.pathology.transforms.post.dictionary
146+
.. autoclass:: Watershedd
147+
:members:
148+
.. autoclass:: GenerateWatershedMaskd
149+
:members:
150+
.. autoclass:: GenerateInstanceBorderd
151+
:members:
152+
.. autoclass:: GenerateDistanceMapd
153+
:members:
154+
.. autoclass:: GenerateWatershedMarkersd
155+
:members:
156+
133157
`Detection`
134158
-----------
135159

monai/apps/pathology/transforms/__init__.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,30 @@
99
# See the License for the specific language governing permissions and
1010
# limitations under the License.
1111

12+
from .post.array import (
13+
GenerateDistanceMap,
14+
GenerateInstanceBorder,
15+
GenerateWatershedMarkers,
16+
GenerateWatershedMask,
17+
Watershed,
18+
)
19+
from .post.dictionary import (
20+
GenerateDistanceMapD,
21+
GenerateDistanceMapd,
22+
GenerateDistanceMapDict,
23+
GenerateInstanceBorderD,
24+
GenerateInstanceBorderd,
25+
GenerateInstanceBorderDict,
26+
GenerateWatershedMarkersD,
27+
GenerateWatershedMarkersd,
28+
GenerateWatershedMarkersDict,
29+
GenerateWatershedMaskD,
30+
GenerateWatershedMaskd,
31+
GenerateWatershedMaskDict,
32+
WatershedD,
33+
Watershedd,
34+
WatershedDict,
35+
)
1236
from .spatial.array import SplitOnGrid, TileOnGrid
1337
from .spatial.dictionary import SplitOnGridd, SplitOnGridD, SplitOnGridDict, TileOnGridd, TileOnGridD, TileOnGridDict
1438
from .stain.array import ExtractHEStains, NormalizeHEStains
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Copyright (c) MONAI Consortium
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
# http://www.apache.org/licenses/LICENSE-2.0
6+
# Unless required by applicable law or agreed to in writing, software
7+
# distributed under the License is distributed on an "AS IS" BASIS,
8+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9+
# See the License for the specific language governing permissions and
10+
# limitations under the License.
11+
12+
from .array import (
13+
GenerateDistanceMap,
14+
GenerateInstanceBorder,
15+
GenerateWatershedMarkers,
16+
GenerateWatershedMask,
17+
Watershed,
18+
)
19+
from .dictionary import (
20+
GenerateDistanceMapD,
21+
GenerateDistanceMapd,
22+
GenerateDistanceMapDict,
23+
GenerateInstanceBorderD,
24+
GenerateInstanceBorderd,
25+
GenerateInstanceBorderDict,
26+
GenerateWatershedMarkersD,
27+
GenerateWatershedMarkersd,
28+
GenerateWatershedMarkersDict,
29+
GenerateWatershedMaskD,
30+
GenerateWatershedMaskd,
31+
GenerateWatershedMaskDict,
32+
WatershedD,
33+
Watershedd,
34+
WatershedDict,
35+
)

0 commit comments

Comments
 (0)