linumpy.gpu.bias_field#
GPU-accelerated helpers for N4 bias field correction pre/post-processing.
Provides block-mean downsampling, bias field upsampling, and chunked
element-wise division on GPU (CuPy + PyTorch). All functions fall back to
CPU (NumPy + SciPy) when GPU_AVAILABLE is False.
Functions#
|
Block-mean spatial downsampling by an integer factor. |
|
Trilinear upsampling of a low-resolution bias field to target_shape. |
|
Element-wise division |
Module Contents#
- linumpy.gpu.bias_field.downsample_gpu(vol, shrink_factor, use_gpu=True)[source]#
Block-mean spatial downsampling by an integer factor.
- linumpy.gpu.bias_field.upsample_bias_gpu(bias_low, target_shape, use_gpu=True)[source]#
Trilinear upsampling of a low-resolution bias field to target_shape.
- Parameters:
- Returns:
Upsampled float32 bias field of shape target_shape.
- Return type:
np.ndarray