ngff_zarr.rfc4_validationΒΆ

RFC 4 validation for anatomical orientation in OME-NGFF.

This module provides validation for RFC 4 anatomical orientation metadata against the JSON schema.

Module ContentsΒΆ

FunctionsΒΆ

load_rfc4_orientation_schema

Load the RFC 4 orientation JSON schema.

validate_rfc4_orientation

Validate RFC 4 anatomical orientation metadata against the JSON schema.

has_rfc4_orientation_metadata

Check if the axes contain RFC 4 anatomical orientation metadata.

APIΒΆ

ngff_zarr.rfc4_validation.load_rfc4_orientation_schema() dictΒΆ

Load the RFC 4 orientation JSON schema.

ngff_zarr.rfc4_validation.validate_rfc4_orientation(axes: list[dict[str, Any]]) NoneΒΆ

Validate RFC 4 anatomical orientation metadata against the JSON schema.

Parameters

axes : List[Dict[str, Any]] List of axis metadata dictionaries to validate

Raises

ImportError If jsonschema is not available jsonschema.ValidationError If the orientation metadata is invalid ValueError If orientation is inconsistently defined across spatial axes. The two messages carry stable marker substrings – "same type" for a mixed-type failure and "all spatial axes" for the all-or-none completeness failure – that :func:ngff_zarr.structural_validation.validate_axis_orientation reads to map each failure onto its :class:SpecRule. These markers are a load-bearing contract pinned by a message-stability test (test_rfc4_orientation_messages_carry_mapping_markers) so the mapping cannot silently break if the wording is later edited.

ngff_zarr.rfc4_validation.has_rfc4_orientation_metadata(axes: list[dict[str, Any]]) boolΒΆ

Check if the axes contain RFC 4 anatomical orientation metadata.

Parameters

axes : List[Dict[str, Any]] List of axis metadata dictionaries

Returns

bool True if any spatial axis has orientation metadata