Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ This project was developed by the [Mahmood Lab](https://faisal.ai/) at Harvard M
Optional install profiles:
- `pip install -e ".[patch-encoders]"` for CONCH/MUSK/CTransPath-related extras.
- `pip install -e ".[slide-encoders]"` for PRISM/GigaPath/Madeleine-related extras.
- `pip install -e ".[omezarr]"` for OME Zarr WSI reader support
- `pip install -e ".[convert]"` for slide conversion dependencies.
- `pip install -e ".[full]"` to install all pip-installable optional dependencies.

Expand Down Expand Up @@ -232,7 +233,7 @@ main()
- **A**: Yes using the `--custom_list_of_wsis` argument. Provide a list of WSI names in a CSV (with slide extension, `wsi`). Optionally, provide the mpp (field `mpp`)

- **Q**: Do I need to install any additional packages to use Trident?
- **A**: `pip install -e .` installs core dependencies. Some optional components still require extra installs. Use profiles (`.[patch-encoders]`, `.[slide-encoders]`, `.[convert]`, or `.[full]`) and run `trident-doctor` for preflight checks.
- **A**: `pip install -e .` installs core dependencies. Some optional components still require extra installs. Use profiles (`.[patch-encoders]`, `.[slide-encoders]`, `.[convert]`, `.[omezarr]` or `.[full]`) and run `trident-doctor` for preflight checks.

## License and Terms of Use

Expand Down
2 changes: 1 addition & 1 deletion docs/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ WSI discovery and reading
- ``--search_nested``: recursively discover slides in nested subfolders.
- ``--custom_list_of_wsis``: CSV subset list to process selected slides only.
- ``--custom_mpp_keys``: metadata keys to read MPP from non-standard slide headers.
- ``--reader_type``: force backend reader (``openslide``, ``cucim``, ``image``, ``sdpc``).
- ``--reader_type``: force backend reader (``openslide``, ``cucim``, ``image``, ``sdpc``, ``omezarr``).

When to change:

Expand Down
10 changes: 10 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ musk = { git = "https://github.com/lilab-stanford/MUSK", optional = true }
gigapath = { git = "https://github.com/prov-gigapath/prov-gigapath.git", optional = true }
madeleine = { git = "https://github.com/mahmoodlab/MADELEINE.git", optional = true }
pylibCZIrw = { version = "*", optional = true }
cf-units = { version = ">=3.1", optional = true }
ngff-zarr = { version = ">=0.12", optional = true }
zarr = { version = ">=3.0.0a0", optional = true }
dask = { version = ">=2024.10", optional = true }

[tool.poetry.extras]
patch-encoders = [
Expand Down Expand Up @@ -82,6 +86,12 @@ full = [
"madeleine",
"pylibCZIrw",
]
omezarr = [
"ngff-zarr",
"dask",
"cf-units",
"zarr"
]

[tool.poetry.dev-dependencies]
# Optional development dependencies
Expand Down
4 changes: 2 additions & 2 deletions run_batch_of_slides.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ def build_parser() -> argparse.ArgumentParser:
help='Custom keys used to store the resolution as MPP (micron per pixel) in your list of whole-slide image.')
parser.add_argument('--custom_list_of_wsis', type=str, default=None,
help='Custom list of WSIs specified in a csv file.')
parser.add_argument('--reader_type', type=str, choices=['openslide', 'image', 'cucim', 'sdpc'], default=None,
help='Force the use of a specific WSI image reader. Options are ["openslide", "image", "cucim", "sdpc"]. Defaults to None (auto-determine which reader to use).')
parser.add_argument('--reader_type', type=str, choices=['openslide', 'image', 'cucim', 'sdpc', 'omezarr'], default=None,
help='Force the use of a specific WSI image reader. Options are ["openslide", "image", "cucim", "sdpc", "omezarr"]. Defaults to None (auto-determine which reader to use).')
parser.add_argument("--search_nested", action="store_true",
help=("If set, recursively search for whole-slide images (WSIs) within all subdirectories of "
"`wsi_source`. Uses `os.walk` to include slides from nested folders. "
Expand Down
6 changes: 3 additions & 3 deletions trident/Processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from trident import load_wsi, WSIReaderType
from trident.IO import create_lock, remove_lock, is_locked, update_log, collect_valid_slides, splitext
from trident.Maintenance import deprecated
from trident.wsi_objects.WSIFactory import OPENSLIDE_EXTENSIONS, PIL_EXTENSIONS, SDPC_EXTENSIONS
from trident.wsi_objects.WSIFactory import OPENSLIDE_EXTENSIONS, PIL_EXTENSIONS, SDPC_EXTENSIONS, OMEZARR_EXTENSIONS


class Processor:
Expand Down Expand Up @@ -74,7 +74,7 @@ def __init__(
Maximum number of workers for data loading. If None, the default behavior will be used.
Defaults to None.
reader_type (WSIReaderType, optional):
Force the image reader engine to use. Options are are ["openslide", "image", "cucim"]. Defaults to None
Force the image reader engine to use. Options are are ["openslide", "image", "cucim", "sdpc", "omezarr"]. Defaults to None
(auto-determine the right engine based on image extension).
search_nested (bool, optional):
If True, the processor will recursively search for WSIs within all subdirectories of `wsi_source`.
Expand Down Expand Up @@ -108,7 +108,7 @@ def __init__(

self.job_dir = job_dir
self.wsi_source = wsi_source
self.wsi_ext = wsi_ext or (list(PIL_EXTENSIONS) + list(OPENSLIDE_EXTENSIONS) + list(SDPC_EXTENSIONS))
self.wsi_ext = wsi_ext or (list(PIL_EXTENSIONS) + list(OPENSLIDE_EXTENSIONS) + list(SDPC_EXTENSIONS) + list(OMEZARR_EXTENSIONS))
self.skip_errors = skip_errors
self.custom_mpp_keys = custom_mpp_keys
self.max_workers = max_workers
Expand Down
2 changes: 2 additions & 0 deletions trident/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from trident.wsi_objects.CuCIMWSI import CuCIMWSI
from trident.wsi_objects.ImageWSI import ImageWSI
from trident.wsi_objects.SDPCWSI import SDPCWSI
from trident.wsi_objects.OMEZarrWSI import OMEZarrWSI
from trident.wsi_objects.WSIFactory import load_wsi, WSIReaderType
from trident.wsi_objects.WSIPatcher import OpenSlideWSIPatcher, WSIPatcher
from trident.wsi_objects.WSIPatcherDataset import WSIPatcherDataset
Expand All @@ -28,6 +29,7 @@
"ImageWSI",
"CuCIMWSI",
"SDPCWSI",
"OMEZarrWSI",
"WSIPatcher",
"OpenSlideWSIPatcher",
"WSIPatcherDataset",
Expand Down
Loading
Loading