Skip to content

Feature/better normalization#233

Open
minnerbe wants to merge 5 commits into
newsolverfrom
feature/better-normalization
Open

Feature/better normalization#233
minnerbe wants to merge 5 commits into
newsolverfrom
feature/better-normalization

Conversation

@minnerbe
Copy link
Copy Markdown
Collaborator

@minnerbe minnerbe commented Jun 1, 2026

This PR adds per-layer histogram normalization for multisem stacks, mimicking Michal's workflow. It runs at the individual-tile level (before stack assembly), making the whole process very efficient in terms of memory (no stack copy is needed, only filter metadata is written). Additions:

  • MichalLayerNorm: histogram-matches each z-layer to a reference layer and applies the resulting 256-entry LUT to every tile. Above-threshold pixels are mapped by CDF percentile lookup; below-threshold pixels are filled with a monotone cubic (PCHIP) interpolation from the lowest matched percentile to (0,0), biased toward leaving sub-threshold pixels unchanged.
  • LutFilter: new 8-bit Filter that applies a 256-entry LUT (clipped to [0,255]) via ImageJ's applyTable, serialized as a comma-separated parameter string.

One thing to note: The serialization takes about 1kb, which might add up to a significant amount since it's stored for each tile and it's the same for every tile in a given layer. I have no good intuition about how much the render database can reduce this redundancy automatically, though.

@minnerbe minnerbe requested a review from trautmane June 1, 2026 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant