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

JPEG-2000 compression based refactoring #32

Open
wants to merge 20 commits into
base: master
Choose a base branch
from

Conversation

chris-allan
Copy link
Member

@chris-allan chris-allan commented Oct 25, 2021

Refactors the codebase such that all compression is performed by imagecodecs using a JPEG-2000 codec for Zarr.

NOTE: Due to the Python 3.7+ requirements of some of the dependencies used in this PR and the availability of the iSyntax SDK for Python 3.7 currently being restricted to Windows it will only run on that platform.

This PR can be executed as regular isyntax2raw with the exception of the --psnr command line option. NOTE: This option is fed directly into imagecodecs and may need to be inversed depending on the version installed (--psnr=60 being equivalent to 40 PSNR). For example:

isyntax2raw write_tiles --psnr 60 --max_workers 8 1.isyntax 1.zarr

Testing of the result can be performed on the same platform and Python environemnt with napari; assuming 1.isyntax has been converted to 1.zarr as above. For example:

import isyntax2raw
import napari
with napari.gui_qt():
    viewer = napari.Viewer()
    viewer.open('path\\to\\1.zarr\\0')

This testing with napari can happen on any platform with Python 3.7+ utilizing the JPEG-2000 Codec factored out and published to PyPI as zarr-jpeg2k:

import zarr_jpeg2k
import napari
with napari.gui_qt():
    viewer = napari.Viewer()
    viewer.open('path\\to\\1.zarr\\0')

Latest wheel:

muhanadz and others added 20 commits August 26, 2021 16:01
Firstly, `NamedTemporaryFile` cannot be opened more than once on
Windows; the implementation was effectively broken completely on the
platform.  Consequently, temporary file usage has been moved to
`mkstemp()` and handled accordingly.  Furthermore, the `out` argument to
the JPEG-2000 codec `Codec.decode()` implementation was not being
handled correctly causing visual corruption with certain workflows
(noteably napari).

As of this commit glymur 0.9.4 is required and the constructor based API
is now in use.
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.

2 participants