---
title: "2026-09-16 Mask pyramid reuse assessment"
description: "PR 343 shares level storage but duplicates pyramid geometry policy."
image: "https://docs.virdx.dev/img/virdx-social-card.png"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.virdx.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# 2026-09-16 Mask pyramid reuse assessment

## Work Done

Inspected [histo PR 343](https://github.com/virdx/histo/pull/343) and local branch. `write_mask_pyramid` samples each output level directly from a coarse binary mask. Existing `ZarrImage.make_pyramidal` reads the previous stored level through Dask. The PR already extracts shared allocation and metadata into `ZarrImage.add_level`. Remaining reuse opportunity: centralize level shapes, factors and stopping rule in virdx-ome without replacing the direct coarse-source sampling. No histo files changed; tests inspected, not executed.

## Pitfalls

Existing `data.ome_reading.downsample_mask` uses endpoint-aligned linspace indices, not this writer's floor-scaled grid, and materializes its output. It is not a drop-in replacement.

## Improvements

Keep pyramid geometry policy in virdx-ome while preserving the coarse-mask fast path. The current equivalence test compares pixels and level resolutions against make_pyramidal.

Source: https://docs.virdx.dev/knowledge/inbox/2026-09-16-histo-mask-pyramid-reuse/index.mdx
