feat(n4): GPU-accelerated N4 bias field correction#116
Open
FIrgolitsch wants to merge 3 commits intopr-3-slice-interpolationfrom
Open
feat(n4): GPU-accelerated N4 bias field correction#116FIrgolitsch wants to merge 3 commits intopr-3-slice-interpolationfrom
FIrgolitsch wants to merge 3 commits intopr-3-slice-interpolationfrom
Conversation
This was referenced Apr 30, 2026
d941b23 to
df76137
Compare
d86f321 to
2063ff7
Compare
df76137 to
247fcc0
Compare
2063ff7 to
c737d27
Compare
247fcc0 to
e7894cc
Compare
c737d27 to
bed6f69
Compare
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.
PR #109 — N4 Bias Field Correction (CPU + GPU)
Adds N4 bias-field correction with CPU/GPU backends, replacing the previous z-intensity normalization.
Library
linumpy/intensity/bias_field.py— high-level APIlinumpy/intensity/normalization.py— extended for N4 backend, plusfix(normalize): zero agarose per slice while preserving inter-slice brightness(per-slice subtraction of the agarose-median floor pins background voxels to exactly 0 in the normalized output, restoring pre-n4 visualization behavior; global divisor preserves the 2:1 inter-section brightness invariant)linumpy/gpu/{bias_field,bspline,n4}.py— GPU kernels (CuPy)linumpy/gpu/normalization.py(superseded)Scripts
scripts/linum_correct_bias_field.py— replaceslinum_normalize_z_intensityscripts/diagnostics/linum_benchmark_n4_gpu.pyscripts/diagnostics/linum_n4_gpu_visual_compare.pyTests
linumpy/tests/test_bias_field*.py,test_gpu_{bspline,n4}.pylinumpy/tests/test_n4_gpu_{equivalency,perf}.pytest_intensity_normalization.pywithtest_normalize_volume_agarose_floor_at_zeroWorkflow integration
workflows/reconst_3d/soct_3d_reconst.nf: addscorrect_bias_fieldprocessworkflows/reconst_3d/nextflow.config: N4 parametersBuild
pyproject.toml: entry-point swap (linum_normalize_z_intensity→linum_correct_bias_field),scipy-stubs/networkx-stubsdev deps, lint exemptions forlinumpy/gpu/*and N4 diagnostic scripts