Skip to content
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

Decoder #126

Merged
merged 71 commits into from
Nov 29, 2023
Merged

Decoder #126

merged 71 commits into from
Nov 29, 2023

Conversation

erikogabrielsson
Copy link
Collaborator

  • Add support for additional transfer syntaxes using pydicom pixel handlers, image codecs, and pylibjpeg-rle.
  • Change open_web() to take a list of acceptable transfer syntaxes.
  • Detect available transfer syntaxes when using DICOM web
  • Fix opening annotation instances with DICOM web

erikogabrielsson and others added 30 commits November 4, 2023 20:50
* Add option to provide web client a session

We would like to create the `requests.Session` object on our own
and pass it into `WsiDicomWebClient`, since we are not using an object
derived from `AuthBase` to create it.

This PR adds support to pass a session to `WsiDicomWebClient` directly.

Signed-off-by: Patrick Avery <[email protected]>

* Refactor __init__ method of WsiDicomWebClient

The `__init__` method now accepts a `DICOMwebClient` object.

The previous `__init__` method was moved into a `create_client()`
class method.

Signed-off-by: Patrick Avery <[email protected]>

* Remove `WsiDicomFileClient` and update README.md

Signed-off-by: Patrick Avery <[email protected]>

---------

Signed-off-by: Patrick Avery <[email protected]>
* Get multiple frames from dicom web
* Allow loading multiple series with DICOMweb

`WsiDicom.open_web()` was modified to be able to either take a single
series uid (as before) or a list of series uids. If a list of series
uids is passed, their instances are all loaded together. This can be
useful for cases where, for instance, different optical paths are located
in different series.

This also loosens the UID matching to only check the frame of references.

This also adds `TotalPixelMatrixOriginSequence` matching when comparing
datasets.

Fixes: imi-bigpicture#118

Signed-off-by: Patrick Avery <[email protected]>

* Fix `isinstance()` check for series uids

Signed-off-by: Patrick Avery <[email protected]>

* Fix logic in `SlideUids.matches()`

Signed-off-by: Patrick Avery <[email protected]>

* Remove unused import

Signed-off-by: Patrick Avery <[email protected]>

---------

Signed-off-by: Patrick Avery <[email protected]>
* Add property to count number of tile frames

The "NumberOfFrames" attribute on a dataset takes into account not just
the number of frames corresponding to tiles, but also the number of
focal planes and optical paths (for example, see [here](https://github.com/imi-bigpicture/wsidicom/blob/774fe3ca00096e3fd2556fc956520dbfabc81311/wsidicom/instance/dataset.py#L651-L655)).

When I was trying to view a dataset with multiple optical paths, I would
encounter errors in the `image_size` property since it did not distinguish
frames that came from optical paths and tiles.

This fixes viewing [this example](https://imagingdatacommons.github.io/slim/studies/2.25.23897195960526781231486877255455994829/series/2.25.83282858720704132758110891374375550907) via DICOMweb in [large_image](https://github.com/girder/large_image).

I am new to the field, so please feel free to correct any naming issues
or misconceptions...

Signed-off-by: Patrick Avery <[email protected]>

* Add option to provide a session to the web client (imi-bigpicture#117)

* Add option to provide web client a session

We would like to create the `requests.Session` object on our own
and pass it into `WsiDicomWebClient`, since we are not using an object
derived from `AuthBase` to create it.

This PR adds support to pass a session to `WsiDicomWebClient` directly.

Signed-off-by: Patrick Avery <[email protected]>

* Refactor __init__ method of WsiDicomWebClient

The `__init__` method now accepts a `DICOMwebClient` object.

The previous `__init__` method was moved into a `create_client()`
class method.

Signed-off-by: Patrick Avery <[email protected]>

* Remove `WsiDicomFileClient` and update README.md

Signed-off-by: Patrick Avery <[email protected]>

---------

Signed-off-by: Patrick Avery <[email protected]>

* Dicomweb get multiple frames (imi-bigpicture#121)

* Get multiple frames from dicom web

* Allow loading multiple series with DICOMweb (imi-bigpicture#122)

* Allow loading multiple series with DICOMweb

`WsiDicom.open_web()` was modified to be able to either take a single
series uid (as before) or a list of series uids. If a list of series
uids is passed, their instances are all loaded together. This can be
useful for cases where, for instance, different optical paths are located
in different series.

This also loosens the UID matching to only check the frame of references.

This also adds `TotalPixelMatrixOriginSequence` matching when comparing
datasets.

Fixes: imi-bigpicture#118

Signed-off-by: Patrick Avery <[email protected]>

* Fix `isinstance()` check for series uids

Signed-off-by: Patrick Avery <[email protected]>

* Fix logic in `SlideUids.matches()`

Signed-off-by: Patrick Avery <[email protected]>

* Remove unused import

Signed-off-by: Patrick Avery <[email protected]>

---------

Signed-off-by: Patrick Avery <[email protected]>

* Remove unsafe number_of_focal_planes and number_of_optical_paths properties

* FIx if

* Skip frame count check for concatenated instances

---------

Signed-off-by: Patrick Avery <[email protected]>
Co-authored-by: Erik O Gabrielsson <[email protected]>
Co-authored-by: Erik O Gabrielsson <[email protected]>
# Conflicts:
#	CHANGELOG.md
#	wsidicom/instance/image_data.py
#	wsidicom/web/wsidicom_web_client.py
#	wsidicom/web/wsidicom_web_image_data.py
@erikogabrielsson
Copy link
Collaborator Author

Closes #119 , #120, and #125.

@psavery
Copy link
Contributor

psavery commented Nov 29, 2023

@erikogabrielsson Awesome! Excited to try these changes out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants