Skip to content

Commit

Permalink
Add Jpeg2k codec.
Browse files Browse the repository at this point in the history
  • Loading branch information
aacic committed Feb 4, 2025
1 parent e3d6129 commit ad8ed13
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tiatoolbox/wsicore/wsireader.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import tifffile
import zarr
from defusedxml import ElementTree
from imagecodecs.numcodecs import Jpeg
from imagecodecs.numcodecs import Jpeg, Jpeg2k
from numcodecs import register_codec
from packaging.version import Version
from PIL import Image
Expand Down Expand Up @@ -4244,8 +4244,13 @@ def __init__(
) -> None:
"""Initialize :class:`ZarrTIFFWSIReader`."""
super().__init__(input_img=input_img, mpp=mpp, power=power)

Check warning on line 4246 in tiatoolbox/wsicore/wsireader.py

View check run for this annotation

Codecov / codecov/patch

tiatoolbox/wsicore/wsireader.py#L4246

Added line #L4246 was not covered by tests

jpeg_codec = Jpeg()
register_codec(jpeg_codec, "imagecodecs_jpeg")

Check warning on line 4249 in tiatoolbox/wsicore/wsireader.py

View check run for this annotation

Codecov / codecov/patch

tiatoolbox/wsicore/wsireader.py#L4248-L4249

Added lines #L4248 - L4249 were not covered by tests

jpeg2k_codec = Jpeg2k()
register_codec(jpeg2k_codec, "imagecodecs_jpeg2k")

Check warning on line 4252 in tiatoolbox/wsicore/wsireader.py

View check run for this annotation

Codecov / codecov/patch

tiatoolbox/wsicore/wsireader.py#L4251-L4252

Added lines #L4251 - L4252 were not covered by tests

mapper = fsspec.get_mapper(

Check warning on line 4254 in tiatoolbox/wsicore/wsireader.py

View check run for this annotation

Codecov / codecov/patch

tiatoolbox/wsicore/wsireader.py#L4254

Added line #L4254 was not covered by tests
"reference://", fo=str(input_img), target_protocol="file"
)
Expand Down

0 comments on commit ad8ed13

Please sign in to comment.