Skip to main content

Module bias_correction

Module bias_correction 

Source
Expand description

Bias field correction (homogeneity correction)

Implements the makehomogeneous algorithm for correcting RF receive field inhomogeneities. This uses the “boxsegment” approach with box filter Gaussian approximation.

Reference: Eckstein, K., Trattnig, S., Robinson, S.D. (2019). “A Simple Homogeneity Correction for Neuroimaging at 7T.” Proc. ISMRM 27th Annual Meeting.

Reference implementation: https://github.com/korbinian90/MriResearchTools.jl

Structs§

HomogeneityParams
Parameters for inhomogeneity correction (bias field removal).

Functions§

box_filter_line 🔒
1D box filter on a line (in-place), matching Julia’s boxfilterline!
box_filter_line_weighted 🔒
1D weighted box filter on a line (in-place), matching Julia’s weighted boxfilterline!
box_segment 🔒
Box segmentation for finding tissue regions
check_box_sizes 🔒
Check and adjust box sizes to fit image dimensions
fill_and_smooth 🔒
Fill holes and smooth the lowpass field with weighted smoothing
fill_holes
Fill holes in a binary mask
flood_fill_component 🔒
Find connected component using flood fill (6-connectivity in 3D)
gaussian_smooth_3d
3D Gaussian smoothing using box filter approximation
gaussian_smooth_3d_boxsizes
Simplified smoothing with explicit box sizes (for robustmask post-processing)
get_box_sizes 🔒
Calculate box sizes to approximate Gaussian with given sigma using n box filters
get_sensitivity
Get sensitivity (bias field) from magnitude
idx3d 🔒
Index into 3D array (Fortran/column-major order)
makehomogeneous
Make magnitude homogeneous by dividing by bias field
nan_box_filter_line 🔒
1D box filter with NaN handling (for masked smoothing) Matches Julia’s nanboxfilterline!
robust_mask
Create robust mask from magnitude using quantile-based thresholding
rss_combine
RSS (Root Sum of Squares) magnitude combination