Skip to content

Commit

Permalink
Release 0.13.0 (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
erikogabrielsson authored Nov 11, 2023
1 parent 41e07f7 commit 31c3c0c
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.13.0] - 2023-11-11

### Added

- Allow a `requests.Session` object to be passed to `WsiDicomWebClient.create_client()`.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "wsidicom"
version = "0.12.0"
version = "0.13.0"
description = "Tools for handling DICOM based whole scan images"
authors = ["Erik O Gabrielsson <[email protected]>"]
license = "Apache-2.0"
Expand Down
4 changes: 2 additions & 2 deletions wsidicom/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from wsidicom.wsidicom import WsiDicom
from wsidicom.config import settings
from wsidicom.graphical_annotations import (
Annotation,
Expand All @@ -29,5 +28,6 @@
from wsidicom.instance import ImageData, WsiDataset, WsiInstance
from wsidicom.series import Labels, Levels, Overviews
from wsidicom.web import WsiDicomWebClient
from wsidicom.wsidicom import WsiDicom

__version__ = "0.12.0"
__version__ = "0.13.0"
18 changes: 9 additions & 9 deletions wsidicom/web/wsidicom_web_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from typing import Any, Dict, Iterator, Optional, Sequence, Tuple, Union
from typing import Any, Dict, Iterator, List, Optional, Tuple, Union

from dicomweb_client.api import DICOMwebClient
from dicomweb_client.api import DICOMwebClient, DICOMfileClient
from dicomweb_client.session_utils import create_session_from_auth
from pydicom import Dataset
from pydicom.uid import (
Expand All @@ -34,13 +34,13 @@


class WsiDicomWebClient:
def __init__(self, client: DICOMwebClient):
def __init__(self, client: Union[DICOMwebClient, DICOMfileClient]):
"""Create a WsiDicomWebClient.
Parameters
----------
client: DICOMwebClient
The DICOMwebClient to use
client: Union[DICOMwebClient, DICOMfileClient]
The client to use
"""
self._client = client

Expand Down Expand Up @@ -68,10 +68,10 @@ def create_client(
inherits from requests.auth.AuthBase, or by passing a
requests.Session object.
"""
if isinstance(auth, Session) or auth is None:
session = auth
else:
if isinstance(auth, AuthBase):
session = create_session_from_auth(auth)
else:
session = auth

client = DICOMwebClient(
hostname,
Expand Down Expand Up @@ -102,7 +102,7 @@ def get_frames(
study_uid: UID,
series_uid: UID,
instance_uid: UID,
frame_indices: Sequence[int],
frame_indices: List[int],
transfer_syntax: UID,
) -> Iterator[bytes]:
return self._client.iter_instance_frames(
Expand Down
2 changes: 1 addition & 1 deletion wsidicom/web/wsidicom_web_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def __init__(
)
except StopIteration:
WsiDicomNotFoundError(
"No level instances found", f"{study_uid}, {series_uid}"
"No level instances found", f"{study_uid}, {series_uids}"
)

@property
Expand Down

0 comments on commit 31c3c0c

Please sign in to comment.