Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
32d352c
update to zarr python v3
lorenzocerrone Nov 8, 2025
8d00be5
implement ngff 0.5
lorenzocerrone Nov 8, 2025
4e0454e
fix some testing issues
lorenzocerrone Nov 8, 2025
28e97b4
fix bugs in attributes wrtiting
lorenzocerrone Nov 9, 2025
b9fde3f
add dimensio separator and derive to new version of ngff
lorenzocerrone Nov 9, 2025
2b0421f
cleanuo
lorenzocerrone Nov 9, 2025
ce8475f
minor api update
lorenzocerrone Nov 9, 2025
ef03dea
clean up zarr utils
lorenzocerrone Nov 17, 2025
dc18a08
cleanup custom cache implementation
lorenzocerrone Nov 18, 2025
e892ebf
cleanup zarr utils
lorenzocerrone Nov 18, 2025
b1475da
fix open table permissions
lorenzocerrone Nov 25, 2025
7843084
Merge branch 'main' into zarr_python_v3
lorenzocerrone Nov 25, 2025
e90f1f2
cleanup zarr handler
lorenzocerrone Nov 26, 2025
c7efc04
make table backend code more zarr v3 native
lorenzocerrone Nov 26, 2025
8bf450f
clean up annadata io
lorenzocerrone Nov 28, 2025
91515e3
expand ngio zarr utils
lorenzocerrone Nov 28, 2025
64aba38
add testing for new group functionality
lorenzocerrone Nov 28, 2025
c238c18
add group delete test
lorenzocerrone Nov 28, 2025
d0b66a5
add testing for dering
lorenzocerrone Nov 28, 2025
9851bb5
remove logging module
lorenzocerrone Nov 28, 2025
b206158
minor warning clean up
lorenzocerrone Nov 28, 2025
556877f
clean up create API
lorenzocerrone Nov 28, 2025
86a402c
refactor meta data handling
lorenzocerrone Dec 1, 2025
05c4d7d
cleanup
lorenzocerrone Dec 1, 2025
ca15f47
formatting
lorenzocerrone Dec 1, 2025
3cbae73
clean up imports
lorenzocerrone Dec 1, 2025
599699a
cleanup hcs models
lorenzocerrone Dec 1, 2025
9c2ea2d
minor refactor
lorenzocerrone Dec 1, 2025
b28a48c
add new v05 test data
lorenzocerrone Dec 1, 2025
81f0817
adapt to new roi api
lorenzocerrone Dec 1, 2025
097421a
fix minor adaptations
lorenzocerrone Dec 2, 2025
f33e0c8
add more 0.5 tests
lorenzocerrone Dec 2, 2025
b3b4c3e
fix minor formatting
lorenzocerrone Dec 2, 2025
b9ec6dd
minor formatting
lorenzocerrone Dec 2, 2025
90cb1f2
add union testing
lorenzocerrone Dec 2, 2025
d7c44d5
update change log
lorenzocerrone Dec 2, 2025
40a3fa2
replace pyramid building logic
lorenzocerrone Dec 2, 2025
e96ab5f
fix error type
lorenzocerrone Dec 2, 2025
1742630
finalized new ome-zarr creation API
lorenzocerrone Dec 4, 2025
bf90594
cleanup doc strings
lorenzocerrone Dec 4, 2025
dd35338
add store grid testing
lorenzocerrone Dec 5, 2025
943f5a6
skip store pytest on mac ci
lorenzocerrone Dec 5, 2025
d06252f
only upload coverage from ubuntu
lorenzocerrone Dec 5, 2025
803a0fb
switch to py arrow backend
lorenzocerrone Dec 5, 2025
dcef8e3
cleanup pyarrow implementation
lorenzocerrone Dec 5, 2025
0c60b9f
clean up anndata backend
lorenzocerrone Dec 5, 2025
97c47a4
change s3 supported backends
lorenzocerrone Dec 5, 2025
a6f8fc6
test to fix #127 #126
lorenzocerrone Dec 8, 2025
1bdfbb2
add more testing for #124
lorenzocerrone Dec 8, 2025
9daa37f
make labels group v05 compatible
lorenzocerrone Dec 8, 2025
f62ee9d
clean up supported stores
lorenzocerrone Dec 10, 2025
8b29ee9
implement feat #133 & #113
lorenzocerrone Dec 10, 2025
9f669ca
add unit tests
lorenzocerrone Dec 10, 2025
2be1bcd
add new feature in change log
lorenzocerrone Dec 10, 2025
21489cb
add handler delete api testing
lorenzocerrone Dec 10, 2025
e26eed6
test 0.5 plate well meta
lorenzocerrone Dec 10, 2025
9044d12
fix minor bug in derivation with sharding
lorenzocerrone Dec 12, 2025
6458f8b
add base test for sharding
lorenzocerrone Dec 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
python -m pip install -U pip
# if running a cron job, we add the --pre flag to test against pre-releases
python -m pip install .[test] ${{ github.event_name == 'schedule' && '--pre' || '' }}

- name: Restore shared data cache
id: cache-data
uses: actions/cache@v4
Expand Down Expand Up @@ -79,6 +79,7 @@ jobs:
update_existing: true

- name: Coverage
if: success() && matrix.platform == 'ubuntu-latest'
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down Expand Up @@ -118,4 +119,4 @@ jobs:
- uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: './dist/*'
files: "./dist/*"
20 changes: 19 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
# Changelog

## [v0.5.0]

### Features
- Add support for OME-NGFF v0.5
- Move to zarr-python v3
- API to delete labels and tables from OME-Zarr containers and HCS plates.

### API Breaking Changes

- New `Roi` models, now supporting arbitrary axes.
- The `compressor` argument has been renamed to `compressors` in all relevant functions and methods to reflect the support for multiple compressors in zarr v3.
- The `version` argument has been renamed to `ngff_version` in all relevant functions and methods to specify the OME-NGFF version.
- Remove the `parallel_safe` argument from all zarr related functions and methods. The locking mechanism is now handled internally and only depends on the
`cache`.
- Remove the unused `parent` argument from `ZarrGroupHandler`.
- Internal changes to `ZarrGroupHandler` to support cleanup unused apis.
- Remove `ngio_logger` in favor of standard warnings module.

## [v0.4.6]

### Bug Fixes
- Fix channel selection from `wavelenght_id`
- Fix channel selection from `wavelength_id`
- Fix table opening mode to stop wrtiting groups when opening in append mode.

## [v0.4.5]
Expand Down
22 changes: 17 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ classifiers = [
dependencies = [
"numpy",
"filelock",
"zarr<3",
"anndata>=0.8.0,<0.11.4", # To be removed when we transition to zarr v3
"zarr>3",
"anndata",
"pydantic",
"pandas>=1.2.0",
"requests",
Expand All @@ -54,14 +54,23 @@ dependencies = [
# https://peps.python.org/pep-0621/#dependencies-optional-dependencies
# "extras" (e.g. for `pip install .[test]`)
[project.optional-dependencies]
test = ["pytest", "pytest-cov", "scikit-image"]
test = [
"pytest",
"pytest-cov",
"scikit-image",
"moto[server]",
"boto",
"pytest_httpserver",
"devtools",
"s3fs",
]

dev = [
"zarrs",
"Pympler",
"napari",
"pyqt5",
"matplotlib",
"devtools",
"notebook",
"mypy",
"pdbpp", # https://github.com/pdbpp/pdbpp
Expand Down Expand Up @@ -155,7 +164,9 @@ minversion = "7.0"
testpaths = ["tests"]
filterwarnings = [
"error",
"ignore::FutureWarning", # TODO remove after zarr-python v3
"ignore::zarr.errors.ZarrUserWarning", # required for anndata
"ignore::UserWarning", # from ngio.utils._zarr_utils
"ignore::DeprecationWarning", # temporary ignore deprecation warnings
]
addopts = [
"-vv",
Expand Down Expand Up @@ -224,6 +235,7 @@ test13 = { features = ["py13", "test"], solve-group = "py13" }

# dev env
dev = { features = ["dev", "test"], solve-group = "py11" }
test = { features = ["test"], solve-group = "py11" }

[tool.pixi.tasks]
serve_docs = "mkdocs serve"
Expand Down
7 changes: 5 additions & 2 deletions src/ngio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
__author__ = "Lorenzo Cerrone"
__email__ = "[email protected]"

from ngio.common import Dimensions, Roi, RoiPixels
from ngio.common import Dimensions, Roi, RoiSlice
from ngio.hcs import (
OmeZarrPlate,
OmeZarrWell,
Expand Down Expand Up @@ -37,6 +37,7 @@
NgffVersions,
PixelSize,
)
from ngio.utils import NgioSupportedStore, StoreOrGroup

__all__ = [
"AxesSetup",
Expand All @@ -47,12 +48,14 @@
"ImageInWellPath",
"Label",
"NgffVersions",
"NgioSupportedStore",
"OmeZarrContainer",
"OmeZarrPlate",
"OmeZarrWell",
"PixelSize",
"Roi",
"RoiPixels",
"RoiSlice",
"StoreOrGroup",
"create_empty_ome_zarr",
"create_empty_plate",
"create_empty_well",
Expand Down
17 changes: 11 additions & 6 deletions src/ngio/common/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,27 @@

from ngio.common._dimensions import Dimensions
from ngio.common._masking_roi import compute_masking_roi
from ngio.common._pyramid import consolidate_pyramid, init_empty_pyramid, on_disk_zoom
from ngio.common._roi import (
Roi,
RoiPixels,
from ngio.common._pyramid import (
ChunksLike,
ImagePyramidBuilder,
ShardsLike,
consolidate_pyramid,
on_disk_zoom,
)
from ngio.common._roi import Roi, RoiSlice
from ngio.common._zoom import InterpolationOrder, dask_zoom, numpy_zoom

__all__ = [
"ChunksLike",
"Dimensions",
"ImagePyramidBuilder",
"InterpolationOrder",
"Roi",
"RoiPixels",
"RoiSlice",
"ShardsLike",
"compute_masking_roi",
"consolidate_pyramid",
"dask_zoom",
"init_empty_pyramid",
"numpy_zoom",
"on_disk_zoom",
]
53 changes: 12 additions & 41 deletions src/ngio/common/_masking_roi.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import scipy.ndimage as ndi
from dask.delayed import delayed

from ngio.common._roi import Roi, RoiPixels
from ngio.common._roi import Roi
from ngio.ome_zarr_meta import PixelSize
from ngio.utils import NgioValueError

Expand Down Expand Up @@ -135,52 +135,23 @@ def compute_masking_roi(
rois = []
for label, slice_ in slices.items():
if len(slice_) == 2:
min_t, max_t = None, None
min_z, max_z = None, None
min_y, min_x = slice_[0].start, slice_[1].start
max_y, max_x = slice_[0].stop, slice_[1].stop
slices = {"y": slice_[0], "x": slice_[1]}
elif len(slice_) == 3:
min_t, max_t = None, None
min_z, min_y, min_x = slice_[0].start, slice_[1].start, slice_[2].start
max_z, max_y, max_x = slice_[0].stop, slice_[1].stop, slice_[2].stop
slices = {"z": slice_[0], "y": slice_[1], "x": slice_[2]}
elif len(slice_) == 4:
min_t, min_z, min_y, min_x = (
slice_[0].start,
slice_[1].start,
slice_[2].start,
slice_[3].start,
)
max_t, max_z, max_y, max_x = (
slice_[0].stop,
slice_[1].stop,
slice_[2].stop,
slice_[3].stop,
)
slices = {
"t": slice_[0],
"z": slice_[1],
"y": slice_[2],
"x": slice_[3],
}
else:
raise ValueError("Invalid slice length.")

if max_t is None:
t_length = None
else:
t_length = max_t - min_t

if max_z is None:
z_length = None
else:
z_length = max_z - min_z

roi = RoiPixels(
name=str(label),
x_length=max_x - min_x,
y_length=max_y - min_y,
z_length=z_length,
t_length=t_length,
x=min_x,
y=min_y,
z=min_z,
label=label,
roi = Roi.from_values(
name=str(label), slices=slices, label=label, space="pixel"
)

roi = roi.to_roi(pixel_size)
roi = roi.to_world(pixel_size=pixel_size)
rois.append(roi)
return rois
Loading
Loading