-
Notifications
You must be signed in to change notification settings - Fork 90
Added a new DICOMWebWSI class to allow access to protected DICOMweb stores. #164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Steven-N-Hart
wants to merge
8
commits into
mahmoodlab:main
Choose a base branch
from
Steven-N-Hart:dicomweb
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
|
Hi @Steven-N-Hart, many thanks for this PR. DICOM web is quite specific. Some of the files/changes that you included would be best in a dedicated tutorial that people can check if they have a similar use case. for instance,
should be set at inference time for users that need it. Let me know if you have time to make these changes, thanks |
Author
|
Good idea. I can start on that next week.
FWIW, I recommend adopting dotenv for the entire library because of your own dependencies on HF_TOKEN. Adding it as a full fledged requirement would save the user from an unexpected crash later in the code if the value is not set when first invoked.
…________________________________
From: Guillaume Jaume ***@***.***>
Sent: Sunday, October 19, 2025 9:47:51 AM
To: mahmoodlab/TRIDENT ***@***.***>
Cc: Hart, Steven N., Ph.D. ***@***.***>; Mention ***@***.***>
Subject: [EXTERNAL] Re: [mahmoodlab/TRIDENT] Added a new DICOMWebWSI class to allow access to protected DICOMweb stores. (PR #164)
External Email Notice: This message was sent by someone outside Mayo Clinic.
[https://avatars.githubusercontent.com/u/8115947?s=20&v=4]guillaumejaume left a comment (mahmoodlab/TRIDENT#164)<#164 (comment)>
Hi @Steven-N-Hart<https://github.com/Steven-N-Hart>, many thanks for this PR.
DICOM web is quite specific. Some of the files/changes that you included would be best in a dedicated tutorial that people can check if they have a similar use case.
for instance,
* .env.example should be set per user (ok if in a dedicated tuto example)
* all additional dependencies should be optional for dicom web
* the code:
from dotenv import load_dotenv
load_dotenv()
should be set at inference time for users that need it.
Let me know if you have time to make these changes, thanks
—
Reply to this email directly, view it on GitHub<#164 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACBKURJTSKNBJ5WXJKC7N233YOQBPAVCNFSM6AAAAACI3FWG7SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTIMJZG4ZDGMJTGQ>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Author
|
Tutorial added. |
Add Hugging Face token to example environment file
Author
|
Any other changes? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation and Context
Currently, the TRIDENT library excels at processing whole-slide images from local file formats (like SVS, TIFF) but lacks native support for cloud-hosted DICOMs. As modern digital pathology workflows increasingly rely on cloud infrastructure and standardized formats, this limits TRIDENT's direct applicability in these environments. Accessing slides via DICOMweb is a critical feature for scalability and interoperability.
This pull request introduces the
DICOMWebWSIclass, a new WSI object that enables TRIDENT to directly read and process whole-slide images from any DICOMweb-compliant server, such as the Google Cloud Healthcare API or Orthanc. This eliminates the need for manual downloads, allowing for seamless integration with cloud-based pathology archives.Description
This PR adds the following key components:
DICOMWebWSIClass (trident/wsi_objects/DICOMWebWSI.py): A new WSI reader that inherits from the baseWSIclass. It connects to a DICOMweb server via a study/series URL and handles the complexities of the DICOM format for whole-slide imaging.WSIFactoryUpdate (trident/wsi_objects/WSIFactory.py): The factory has been updated to recognizehttp://orhttps://URLs and automatically instantiate theDICOMWebWSIclass.Key Features of
DICOMWebWSI:Metadata Parsing: Automatically fetches and parses metadata for all instances in a DICOM series to determine dimensions, tile sizes, and pyramid levels.
Pyramid Construction: Organizes DICOM instances into a logical pyramid, sorting them from highest to lowest resolution.
*Flexible Frame Handling: Supports both tiled (multi-frame) and non-tiled (single-frame) DICOM instances, which is crucial for handling vendor variability in how lower-resolution pyramid levels are stored.
Authentication: Includes logic to handle authentication for Google Cloud Healthcare API, with the ability to use gcloud credentials.
Efficient Tiling: Implements a
read_regionmethod that calculates the correct frame numbers to fetch, composites the tiles into the requested region, and includes an in-memory cache for fetched frames to improve performance.How Has This Been Tested?
The
DICOMWebWSIclass was tested extensively using therun_single_slide.pyscript against a whole-slide image hosted on a Google Cloud Healthcare API DICOMweb server.