Skip to content

Commit

Permalink
0.19.1 (#156)
Browse files Browse the repository at this point in the history
* Handle failing to parse image coordinate system by attribute error
  • Loading branch information
erikogabrielsson authored Feb 14, 2024
1 parent 4e211a2 commit f3d8a1c
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 7 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.19.1] - 2024-02-14

### Fixed

- Correct handling of missing image coordinate system when loading metadata.

## [0.19.0] - 2024-02-12

### Added
Expand Down Expand Up @@ -319,7 +325,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Initial release of wsidicom

[Unreleased]: https://github.com/imi-bigpicture/wsidicom/compare/0.19.0..HEAD
[Unreleased]: https://github.com/imi-bigpicture/wsidicom/compare/0.19.1..HEAD
[0.19.1]: https://github.com/imi-bigpicture/wsidicom/compare/v0.19.0..v0.19.1
[0.19.0]: https://github.com/imi-bigpicture/wsidicom/compare/v0.18.3..v0.19.0
[0.18.3]: https://github.com/imi-bigpicture/wsidicom/compare/v0.18.2..v0.18.3
[0.18.2]: https://github.com/imi-bigpicture/wsidicom/compare/v0.18.1..v0.18.2
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.19.0"
version = "0.19.1"
description = "Tools for handling DICOM based whole scan images"
authors = ["Erik O Gabrielsson <[email protected]>"]
license = "Apache-2.0"
Expand Down
5 changes: 5 additions & 0 deletions tests/metadata/dicom_schema/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ def dicom_image(image: Image, valid_dicom: bool):
origin.YOffsetInSlideCoordinateSystem = image.image_coordinate_system.origin.y

dataset.TotalPixelMatrixOriginSequence = [origin]
elif not valid_dicom:
dataset.ImageOrientationSlide = []
empty_origin = Dataset()
dataset.TotalPixelMatrixOriginSequence = [empty_origin]

if image.extended_depth_of_field is not None:
dataset.ExtendedDepthOfField = "YES"
dataset.NumberOfFocalPlanes = (
Expand Down
2 changes: 1 addition & 1 deletion wsidicom/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@
from wsidicom.web import WsiDicomWebClient
from wsidicom.wsidicom import WsiDicom

__version__ = "0.19.0"
__version__ = "0.19.1"
8 changes: 4 additions & 4 deletions wsidicom/metadata/schema/dicom/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def load_type(self) -> Type[ImageCoordinateSystem]:
def load(self, dataset: Dataset, **kwargs) -> Optional[ImageCoordinateSystem]:
try:
return super().load(dataset, **kwargs)
except TypeError:
except (TypeError, AttributeError):
return None


Expand Down Expand Up @@ -209,9 +209,9 @@ def pre_dump(self, image: Image, **kwargs):
focal_plane_spacing=image.focal_plane_spacing,
depth_of_field=image.depth_of_field,
),
"lossy_compressions": image.lossy_compressions
if image.lossy_compressions
else [],
"lossy_compressions": (
image.lossy_compressions if image.lossy_compressions else []
),
}

@post_load
Expand Down

0 comments on commit f3d8a1c

Please sign in to comment.