From 0ea70047c1536dbadfca2c12a240939640960447 Mon Sep 17 00:00:00 2001 From: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com> Date: Tue, 29 Sep 2026 13:00:14 +0100 Subject: [PATCH 1/8] :arrow_up: Upgrade `wsidicom>=0.36.1` --- pyproject.toml | 2 +- tests/test_wsireader.py | 6 +++++- tiatoolbox/wsicore/wsireader/dicom.py | 5 +++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 05c9fd0cb..4e339141a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -55,7 +55,7 @@ dependencies = [ "tqdm>=4.64.1", "transformers>=5.15.0", "umap-learn>=0.5.3", - "wsidicom>=0.18.0", + "wsidicom>=0.36.1", "zarr>=3.2.1", ] diff --git a/tests/test_wsireader.py b/tests/test_wsireader.py index 12ebd7ac7..f451d9cb3 100644 --- a/tests/test_wsireader.py +++ b/tests/test_wsireader.py @@ -3322,8 +3322,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. diff --git a/tiatoolbox/wsicore/wsireader/dicom.py b/tiatoolbox/wsicore/wsireader/dicom.py index 5f12ddf6f..abcaec390 100644 --- a/tiatoolbox/wsicore/wsireader/dicom.py +++ b/tiatoolbox/wsicore/wsireader/dicom.py @@ -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"): @@ -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, @@ -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, ) From 6ad100b4405d5ed2bc5847f472654fcfaf7c5d67 Mon Sep 17 00:00:00 2001 From: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com> Date: Tue, 29 Sep 2026 13:38:32 +0100 Subject: [PATCH 2/8] :arrow_up: Upgrade `wsidicom>=0.36.0` --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 4e339141a..775b83b4f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -55,7 +55,7 @@ dependencies = [ "tqdm>=4.64.1", "transformers>=5.15.0", "umap-learn>=0.5.3", - "wsidicom>=0.36.1", + "wsidicom>=0.36.0", "zarr>=3.2.1", ] From ede44614d2b9a79cee3e4ee429b16609ebdf6ff7 Mon Sep 17 00:00:00 2001 From: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com> Date: Fri, 30 Oct 2026 16:40:56 +0000 Subject: [PATCH 3/8] :technologist: Force mamba to use fresh packages --- .github/workflows/conda-env-create.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/conda-env-create.yml b/.github/workflows/conda-env-create.yml index d6809f0c0..4b38866b2 100644 --- a/.github/workflows/conda-env-create.yml +++ b/.github/workflows/conda-env-create.yml @@ -37,6 +37,8 @@ jobs: # ✅ Install via micromamba - uses: mamba-org/setup-micromamba@v3 + env: + MAMBA_NO_CACHE: "true" # Forces libmamba to fetch completely fresh metadata with: environment-name: tiatoolbox environment-file: requirements/requirements.conda.generated.yml From 23dae6a29122d1daf832df58aa0457d0b9c0167d Mon Sep 17 00:00:00 2001 From: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com> Date: Fri, 30 Oct 2026 16:42:49 +0000 Subject: [PATCH 4/8] :technologist: Force mamba to use fresh packages --- .github/workflows/conda-env-create.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/conda-env-create.yml b/.github/workflows/conda-env-create.yml index 4b38866b2..c597b64b8 100644 --- a/.github/workflows/conda-env-create.yml +++ b/.github/workflows/conda-env-create.yml @@ -40,8 +40,10 @@ jobs: env: MAMBA_NO_CACHE: "true" # Forces libmamba to fetch completely fresh metadata with: - environment-name: tiatoolbox - environment-file: requirements/requirements.conda.generated.yml + environment-name: tiatoolbox + environment-file: requirements/requirements.conda.generated.yml + cache-environment: false # Force a clean solve instead of reusing previous action caches + cache-downloads: false # Do not reuse old downloaded tarballs # ✅ Validate environment - name: Test environment From 01f5bfba3810049a66f1874e2d65f4e27c9e5528 Mon Sep 17 00:00:00 2001 From: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com> Date: Fri, 30 Oct 2026 16:49:42 +0000 Subject: [PATCH 5/8] :technologist: Force mamba to use os-64 --- .github/workflows/conda-env-create.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/conda-env-create.yml b/.github/workflows/conda-env-create.yml index c597b64b8..62c9a021d 100644 --- a/.github/workflows/conda-env-create.yml +++ b/.github/workflows/conda-env-create.yml @@ -39,11 +39,11 @@ jobs: - uses: mamba-org/setup-micromamba@v3 env: MAMBA_NO_CACHE: "true" # Forces libmamba to fetch completely fresh metadata + # Force macOS runner to use Intel index (osx-64) so it can find pyjpegls + CONDA_SUBDIR: ${{ matrix.os == 'macos-latest' && 'osx-64' || '' }} with: environment-name: tiatoolbox environment-file: requirements/requirements.conda.generated.yml - cache-environment: false # Force a clean solve instead of reusing previous action caches - cache-downloads: false # Do not reuse old downloaded tarballs # ✅ Validate environment - name: Test environment From a7d9967be6775794f8479698eb1605f7b51112b0 Mon Sep 17 00:00:00 2001 From: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com> Date: Fri, 30 Oct 2026 17:01:34 +0000 Subject: [PATCH 6/8] :bug: Fix conda solve for win and linux --- .github/workflows/conda-env-create.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/conda-env-create.yml b/.github/workflows/conda-env-create.yml index 62c9a021d..8b680fd9d 100644 --- a/.github/workflows/conda-env-create.yml +++ b/.github/workflows/conda-env-create.yml @@ -40,7 +40,7 @@ jobs: env: MAMBA_NO_CACHE: "true" # Forces libmamba to fetch completely fresh metadata # Force macOS runner to use Intel index (osx-64) so it can find pyjpegls - CONDA_SUBDIR: ${{ matrix.os == 'macos-latest' && 'osx-64' || '' }} + CONDA_SUBDIR: ${{ matrix.os == 'macos-latest' && 'osx-64' || null }} with: environment-name: tiatoolbox environment-file: requirements/requirements.conda.generated.yml From 01aa826317bf3b1cdf9ab601ea89099626e78374 Mon Sep 17 00:00:00 2001 From: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com> Date: Fri, 30 Oct 2026 17:05:06 +0000 Subject: [PATCH 7/8] :bug: Fix conda solve for win and linux --- .github/workflows/conda-env-create.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/conda-env-create.yml b/.github/workflows/conda-env-create.yml index 8b680fd9d..71edac544 100644 --- a/.github/workflows/conda-env-create.yml +++ b/.github/workflows/conda-env-create.yml @@ -20,7 +20,13 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] + 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 python-version: ["3.12", "3.13", "3.14"] runs-on: ${{ matrix.os }} @@ -40,7 +46,7 @@ jobs: env: MAMBA_NO_CACHE: "true" # Forces libmamba to fetch completely fresh metadata # Force macOS runner to use Intel index (osx-64) so it can find pyjpegls - CONDA_SUBDIR: ${{ matrix.os == 'macos-latest' && 'osx-64' || null }} + CONDA_SUBDIR: ${{ matrix.conda-subdir }} # Native for Win/Linux, Rosetta for Mac with: environment-name: tiatoolbox environment-file: requirements/requirements.conda.generated.yml From 99f80fafe34583775057d503f8b956802c44f4b5 Mon Sep 17 00:00:00 2001 From: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com> Date: Fri, 30 Oct 2026 17:16:41 +0000 Subject: [PATCH 8/8] :bug: Fix matrix jobs --- .github/workflows/conda-env-create.yml | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/workflows/conda-env-create.yml b/.github/workflows/conda-env-create.yml index 71edac544..67d488704 100644 --- a/.github/workflows/conda-env-create.yml +++ b/.github/workflows/conda-env-create.yml @@ -20,15 +20,17 @@ jobs: strategy: fail-fast: false matrix: - 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 + 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 @@ -44,12 +46,11 @@ jobs: # ✅ Install via micromamba - uses: mamba-org/setup-micromamba@v3 env: - MAMBA_NO_CACHE: "true" # Forces libmamba to fetch completely fresh metadata - # Force macOS runner to use Intel index (osx-64) so it can find pyjpegls - CONDA_SUBDIR: ${{ matrix.conda-subdir }} # Native for Win/Linux, Rosetta for Mac + 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 + environment-name: tiatoolbox + environment-file: requirements/requirements.conda.generated.yml # ✅ Validate environment - name: Test environment