Skip to main content

CFT Zarr codecs for 12-bit fluorescence and RGB compression

Project description

CFT Zarr Custom Codecs

Custom codecs for Zarr v3 optimized for CFT (Cryo-Fluorescence Tomography) data storage.

Codecs

This package provides custom Zarr v3 codecs:

  • cft_zarr.jpeg_compressor: JPEG compressor for RGB images (BytesBytesCodec - supports incremental updates)
  • cft_zarr.shift12jls_compressor: JPEG-LS compressor for 12-bit fluorescent data (BytesBytesCodec - supports incremental updates)
  • cft_zarr.jpeg: JPEG codec for RGB images (ArrayBytesCodec)
  • cft_zarr.shift12jls: JPEG-LS codec for 12-bit fluorescent data (ArrayBytesCodec)
  • cft_zarr.jpegxl: JPEG XL codec (ArrayBytesCodec)

Installation

pip install cft-zarr

Usage

Reading Zarr Files

Important: You must import cft_zarr before opening Zarr files that use these codecs. This registers the codecs with Zarr.

import cft_zarr  # This registers the codecs
import zarr

# Now you can open Zarr files that use custom codecs
arr = zarr.open('rgb.zarr', mode='r')

Using with napari

When opening Zarr files in napari, cft_zarr can be auto-registered via the napari plugin system (installed in the same environment as napari). If you still have trouble, import cft_zarr first:

import cft_zarr  # Register codecs before opening files
import napari

# Now napari can read Zarr files with custom codecs
viewer = napari.Viewer()
viewer.open('path/to/file.zarr')  # Will work with custom codecs

Or in a Python script before launching napari:

import cft_zarr  # Must import before opening Zarr files
import napari

viewer = napari.Viewer()
viewer.open('rgb.zarr')
napari.run()

Creating Zarr Arrays with Custom Codecs

import cft_zarr
from cft_zarr import JPEGCompressor, Shift12JLSCompressor
import zarr

# Create RGB array with JPEG compression
rgb_array = zarr.create(
    shape=(100, 512, 512, 3),
    chunks=(4, 512, 512, 3),
    dtype='uint8',
    compressors=[JPEGCompressor(level=85)]
)

# Create fluorescent array with Shift12JLS compression
fl_array = zarr.create(
    shape=(100, 512, 512),
    chunks=(4, 512, 512),
    dtype='uint16',
    compressors=[Shift12JLSCompressor()]
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cft_zarr-0.0.8.tar.gz (16.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cft_zarr-0.0.8-py3-none-any.whl (23.6 kB view details)

Uploaded Python 3

File details

Details for the file cft_zarr-0.0.8.tar.gz.

File metadata

  • Download URL: cft_zarr-0.0.8.tar.gz
  • Upload date:
  • Size: 16.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.14.3 Darwin/25.3.0

File hashes

Hashes for cft_zarr-0.0.8.tar.gz
Algorithm Hash digest
SHA256 d8949770a8d9e4a4ae5d489ae587c7eee1b9b92656a3ca2d289e25d071dce26b
MD5 e6f2a1058916ebb789afdc12ac46cb2e
BLAKE2b-256 9d99b8da4dad733d359d82403f23b78a44b599a55d8116c14c2de538d85666f8

See more details on using hashes here.

File details

Details for the file cft_zarr-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: cft_zarr-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 23.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.14.3 Darwin/25.3.0

File hashes

Hashes for cft_zarr-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 1877c6907a060814a0adc4550acb66debde35dc3663a1c6fc9ff58a70be3cb8a
MD5 efe998a64f36beeef308f88a78c41752
BLAKE2b-256 4e3bbe273982c26b630759546a8ebf61dba4920fe1e3c41a4006329c44b98558

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page