Complete N4 bias field rescaling pipeline - #188
Merged
Conversation
… segmentation.smk, update n4_biasfield.py, and switch zarrnii to scale-and-offset branch
Copilot created this pull request from a session on behalf of
akhanf
July 23, 2026 03:14
View session
akhanf
marked this pull request as ready for review
July 23, 2026 03:15
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.
The N4 bias field correction pipeline had several incomplete TODOs: the
calc_n4_rescalingrule insegmentation.smkhad syntax errors and pointed to a non-existent script, andn4_biasfield.pyhad placeholder#TODOcomments for reading scale/offset values.Changes
pyproject.toml: Switch zarrnii to branchcopilot/add-scale-and-offset-options, which addsscaleandoffsetparameters toN4BiasFieldApplysegmentation.smk: Fixcalc_n4_rescalingrule — extra leading space beforeinput:, missing)closing themask=bids(...)call, addedresourcesblock, removed#TODOcommentscripts/calc_n4_rescaling.py(new): Computes the linear scale/offset to map the bias-corrected intensity range back to the original input min/max within the brain mask, and writes them to ascaleoffset.txtfile:scripts/n4_biasfield.py: Reads scale/offset from the txt file (with key-presence validation) and passes them toN4BiasFieldApply: