Skip to content

Commit 5c01f80

Browse files
fm3jstriebel
andauthored
Pims normalize extensions for assertion (#865)
* Pims normalize extensions for assertion * changelog * update directly in class --------- Co-authored-by: Jonathan Striebel <[email protected]>
1 parent 7b8925f commit 5c01f80

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

webknossos/Changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ For upgrade instructions, please check the respective *Breaking Changes* section
2020

2121
### Fixed
2222

23+
- Fixed a bug where some czi, dm3, dm4 images could not be converted to wkw due to a too-strict check. [#865](https://github.com/scalableminds/webknossos-libs/pull/865)
24+
2325

2426
## [0.12.0](https://github.com/scalableminds/webknossos-libs/releases/tag/v0.12.0) - 2023-02-10
2527
[Commits](https://github.com/scalableminds/webknossos-libs/compare/v0.11.4...v0.12.0)

webknossos/webknossos/dataset/_utils/pims_czi_reader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
class PimsCziReader(FramesSequenceND):
3838
@classmethod
3939
def class_exts(cls) -> Set[str]:
40-
return {".czi"}
40+
return {"czi"}
4141

4242
# class_priority is used in pims to pick the reader with the highest priority.
4343
# Default is 10, and bioformats priority (which is the only other reader supporting czi) is 2.

webknossos/webknossos/dataset/_utils/pims_dm_readers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
class PimsDm3Reader(FramesSequenceND):
2121
@classmethod
2222
def class_exts(cls) -> Set[str]:
23-
return {".dm3"}
23+
return {"dm3"}
2424

2525
# class_priority is used in pims to pick the reader with the highest priority.
2626
# Default is 10, and bioformats priority is 2.
@@ -52,7 +52,7 @@ def _get_frame(self, **ind: int) -> np.ndarray:
5252
class PimsDm4Reader(FramesSequenceND):
5353
@classmethod
5454
def class_exts(cls) -> Set[str]:
55-
return {".dm4"}
55+
return {"dm4"}
5656

5757
# class_priority is used in pims to pick the reader with the highest priority.
5858
# Default is 10, and bioformats priority is 2.

webknossos/webknossos/dataset/_utils/pims_images.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ def _get_all_pims_handlers() -> Iterable[
567567
def get_valid_pims_suffixes() -> Set[str]:
568568
valid_suffixes = set()
569569
for pims_handler in _get_all_pims_handlers():
570-
valid_suffixes.update(pims_handler.class_exts())
570+
valid_suffixes.update([ext.lstrip(".") for ext in pims_handler.class_exts()])
571571
return valid_suffixes
572572

573573

0 commit comments

Comments
 (0)