Skip to content
Open
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
11 changes: 11 additions & 0 deletions .github/workflows/conda-env-create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ jobs:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.12", "3.13", "3.14"]

include:
- os: ubuntu-latest
conda-subdir: linux-64
- os: windows-latest
conda-subdir: win-64
- os: macos-latest
conda-subdir: osx-64 # Forces Rosetta emulation index on Apple Silicon

runs-on: ${{ matrix.os }}
timeout-minutes: 30

Expand All @@ -37,6 +45,9 @@ jobs:

# ✅ Install via micromamba
- uses: mamba-org/setup-micromamba@v3
env:
MAMBA_NO_CACHE: "true" # Forces libmamba to fetch completely fresh metadata
CONDA_SUBDIR: ${{ matrix.conda-subdir }} # Native for Win/Linux, Rosetta for Mac
with:
environment-name: tiatoolbox
environment-file: requirements/requirements.conda.generated.yml
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ dependencies = [
"tqdm>=4.64.1",
"transformers>=5.15.0",
"umap-learn>=0.5.3",
"wsidicom>=0.18.0, <0.36.0",
"wsidicom>=0.36.1",
"zarr>=3.2.1",
]

Expand Down
6 changes: 5 additions & 1 deletion tests/test_wsireader.py
Original file line number Diff line number Diff line change
Expand Up @@ -3323,8 +3323,12 @@ def test_read_dicom_with_metadata(remote_sample: Callable) -> None:
assert wsi.info.objective_power == 40.0

wsi = DICOMWSIReader(wsi_path)

# Trigger _optical_path_sequence access
_ = hasattr(wsi.wsi.levels.base_level.datasets[0], "_optical_path_sequence")

# Force delete attribute for objective power.
delattr(wsi.wsi.levels.base_level.datasets[0], "OpticalPathSequence")
delattr(wsi.wsi.levels.base_level.datasets[0], "_optical_path_sequence")
wsi._info()

# Assert objective power inferred from mpp.
Expand Down
5 changes: 3 additions & 2 deletions tiatoolbox/wsicore/wsireader/dicom.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def _info(self: DICOMWSIReader) -> WSIMeta:
mpp = (mm_per_pixel.width * 1e3, mm_per_pixel.height * 1e3)

objective_power = None
ops_seq = getattr(dataset, "OpticalPathSequence", None)
ops_seq = getattr(dataset, "_optical_path_sequence", None)
if ops_seq:
ops = ops_seq[0]
if hasattr(ops, "ObjectiveLensPower"):
Expand All @@ -73,6 +73,7 @@ def _info(self: DICOMWSIReader) -> WSIMeta:
mpp=mpp,
)

vendor = getattr(dataset.base_metadata.equipment, "manufacturer", "Unknown")
return WSIMeta(
slide_dimensions=level_dimensions[0],
level_dimensions=level_dimensions,
Expand All @@ -81,7 +82,7 @@ def _info(self: DICOMWSIReader) -> WSIMeta:
mpp=mpp,
objective_power=objective_power,
level_count=len(level_dimensions),
vendor=dataset.Manufacturer,
vendor=vendor,
file_path=self.input_path,
)

Expand Down
Loading