Skip to content

Commit 456caed

Browse files
authored
Deprecate Old Pathology Components (#4415)
* Deprecate pathology datasets Signed-off-by: Behrooz <3968947+drbeh@users.noreply.github.com> * Update min test exclusion Signed-off-by: Behrooz <3968947+drbeh@users.noreply.github.com> * Update test file names for deprecated component and update prob map deprecation Signed-off-by: Behrooz <3968947+drbeh@users.noreply.github.com>
1 parent 5d50618 commit 456caed

File tree

8 files changed

+406
-519
lines changed

8 files changed

+406
-519
lines changed

monai/apps/pathology/data/datasets.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@
1717

1818
from monai.data import Dataset, SmartCacheDataset
1919
from monai.data.image_reader import WSIReader
20-
from monai.utils import ensure_tuple_rep
20+
from monai.utils import deprecated, ensure_tuple_rep
2121

2222
__all__ = ["PatchWSIDataset", "SmartCachePatchWSIDataset", "MaskedInferenceWSIDataset"]
2323

2424

25+
@deprecated(since="0.8", msg_suffix="use `monai.data.PatchWSIDataset` instead.")
2526
class PatchWSIDataset(Dataset):
2627
"""
2728
This dataset reads whole slide images, extracts regions, and creates patches.
@@ -103,6 +104,7 @@ def __getitem__(self, index):
103104
return patches
104105

105106

107+
@deprecated(since="0.8", msg_suffix="use `monai.data.SmartCacheDataset` with `monai.data.PatchWSIDataset` instead.")
106108
class SmartCachePatchWSIDataset(SmartCacheDataset):
107109
"""Add SmartCache functionality to `PatchWSIDataset`.
108110
@@ -177,6 +179,7 @@ def __init__(
177179
)
178180

179181

182+
@deprecated(since="0.8", msg_suffix="use `monai.data.MaskedPatchWSIDataset` instead.")
180183
class MaskedInferenceWSIDataset(Dataset):
181184
"""
182185
This dataset load the provided foreground masks at an arbitrary resolution level,

monai/apps/pathology/handlers/prob_map_producer.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@
2727

2828
@deprecated(
2929
since="0.8",
30-
msg_suffix="use `monai.handler.ProbMapProducer` (with `monai.data.wsi_dataset.SlidingPatchWSIDataset`) instead.",
30+
msg_suffix=(
31+
"use `monai.handler.ProbMapProducer` (with `monai.data.wsi_dataset.MaskedPatchWSIDataset` or "
32+
"`monai.data.wsi_dataset.SlidingPatchWSIDataset`) instead."
33+
),
3134
)
3235
class ProbMapProducer:
3336
"""

monai/data/image_reader.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
orientation_ras_lps,
2929
)
3030
from monai.transforms.utility.array import EnsureChannelFirst
31-
from monai.utils import MetaKeys, SpaceKeys, ensure_tuple, ensure_tuple_rep, optional_import, require_pkg
31+
from monai.utils import MetaKeys, SpaceKeys, deprecated, ensure_tuple, ensure_tuple_rep, optional_import, require_pkg
3232

3333
if TYPE_CHECKING:
3434
import itk
@@ -1218,6 +1218,7 @@ def _get_spatial_shape(self, img):
12181218
return np.asarray((img.width, img.height))
12191219

12201220

1221+
@deprecated(since="0.8", msg_suffix="use `monai.wsi_reader.WSIReader` instead.")
12211222
class WSIReader(ImageReader):
12221223
"""
12231224
Read whole slide images and extract patches.

tests/min_tests.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,6 @@ def run_testsuit():
162162
"test_vitautoenc",
163163
"test_write_metrics_reports",
164164
"test_wsireader",
165-
"test_wsireader_new",
166165
"test_zoom",
167166
"test_zoom_affine",
168167
"test_zoomd",

0 commit comments

Comments
 (0)