Repository navigation
Rendering realism fixes - #12
Draft
marktsuchida wants to merge 3 commits into
Draft
marktsuchida wants to merge 3 commits into
marktsuchida wants to merge 3 commits into
Conversation
- q() now returns F instead of float.
- ForwardFilter / BackwardFilter are rewritten with index loops, so they
no longer create pointers outside the array. The existing tests for
them, including the nullptr, 0 cases, pass unchanged.
- DirectGaussian2D is new in gaussian_internal. It blurs rows then
columns with a sampled Gaussian kernel that reaches out to max(1,
ceil(3σ)) and is scaled to sum to 1. Edge pixels are repeated at the
borders, and a single line buffer is reused.
- FastGaussian2D:
- It returns early unless sigma > 0.
- It uses DirectGaussian2D when sigma < 1, with a rationale comment.
- Otherwise it goes to SIMD or scalar, now using #else.
- New tests:
- DirectGaussian2D at σ=0.7: a single-pixel spike blurs to a total of
≈1, the result is mirror- and diagonal-symmetric, the center value
equals w0², and a constant image stays constant.
- FastGaussian2D-small-sigma for σ ∈ {0.1, 0.3, 0.7}: no negative
values, a total of ≈1, and a constant image stays constant.
(Assisted by Claude Code; any errors are mine.)
Blur when (close to) in focus; magnification-dependent filament thickness/brightness. - Image readback: rows are now addressed with the byte stride, which works whichever direction Blend2D stores the image. The image is created with img.create(...), and if that fails the signal is filled with zeros. - Blur now depends on NA: GaussianSigmaForDefocus takes the emission wavelength. The in-focus width is 0.21 λ / NA and the defocus width is 0.5 · NA · |dz| / n; the two combine as a root sum of squares. There's a new EMISSION_WAVELENGTH_UM = 0.52f constant. - Filament width: filaments are 0.025 µm wide. They're drawn at least 1 px wide, with intensity scaled down by filamentWidthUm_ / strokeWidth. The origin marker gets the same intensity scaling. - relativeBrightness_ manually set to be reasonable-ish. (Assisted by Claude Code; any errors are mine.)
With the current filament intensity, filaments aren't visible at 10x under default settings. (Assisted by Claude Code; any errors are mine.)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I'm not going to merge these right now because (1) they need further thought and review and (2) the changes may throw off @gselzer's data-driven acquisition example for our I2K/BINA2026 workshop.