---
title: "2026-09-14 Reusable benign mask computation"
description: "Added the array-based benign mask helper and identified mono job prerequisites."
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-14 Reusable benign mask computation

## Work Done

- Opened draft [histo PR #335](https://github.com/virdx/histo/pull/335), commit `9bfb69bb`: public `histo.mask_transforms.compute_benign_mask(cancer_masks, ignore_masks, *, output_shape)`; histo version 0.0.120.
- Full output extent is assumed tissue. Complement of all cancer/ignore masks; nonzero foreground; boolean result; endpoint-index resizing for common-extent grids; no input mutation or I/O. Tests: 13 pass; lint/format/Linux mypy and wheel build pass. Native macOS mypy retains existing Linux-only os errors. CI pending.
- Mono job research paused: existing generation code lived only in a histo experiment, whereas training consumes already-generated mask paths from a manifest. Proposed job publishes normal/refined benign maps to object storage, then registers HistoMaps with source provenance; CACHE_DIR only for temporary files.
- Existing mono kuberun path needs resolution: installed CLI selects root Dockerfile.argo, not the vxdata-jobs Dockerfile via context-dir. No production job, uploads, or resource creation performed. Isolated mono worktree remains clean.

## Pitfalls

- Registering a HistoMap with a mounted path does not upload its data. Upload first and record durable object-storage URLs.
- Normal/refined cancer masks imply different benign masks; pair source profiles explicitly. Refinement-excluded cancer pixels become benign under the current full-crop assumption.

## Improvements

- Keep mask arithmetic array-based and storage/datasource policy in the job. Existing virdx-ome handles raster I/O; no new generic writer wrapper is needed for this helper PR.

Source: https://docs.virdx.dev/knowledge/inbox/2026-09-14-histo-benign-mask-helper/index.mdx
