Parameter Reference
This page describes all parameters for the bm3d_ring_artifact_removal function.
Mode Selection
Parameter |
Default |
Description |
|---|---|---|
|
|
Operation mode. Use |
Note
For ring artifact removal in tomography sinograms, always use mode="streak".
The streak mode is specifically optimized for vertical artifacts caused by detector
pixel response variations.
Noise Parameters
Parameter |
Default |
Description |
|---|---|---|
|
|
Estimated noise standard deviation. Higher values = more aggressive denoising. |
Guidelines for sigma_random:
Light artifacts:
0.02 - 0.05Moderate artifacts:
0.05 - 0.10Heavy artifacts:
0.10 - 0.20
Tip
Start with a low value and increase gradually. Check the difference image (input - output) to ensure you’re removing artifacts, not signal.
Block Matching Parameters
Parameter |
Default |
Description |
|---|---|---|
|
|
Size of patches for block matching. Use 7 or 8 for best results. |
|
|
Stride for patch extraction. Lower = better quality but slower. |
|
|
Maximum search distance for finding similar patches. |
|
|
Maximum number of similar patches per 3D group. |
Quality vs Speed Tradeoffs:
Faster processing:
step_size=6-8,max_matches=8Higher quality:
step_size=2-3,max_matches=32
Streak Mode Parameters
These parameters only apply when mode="streak":
Parameter |
Default |
Description |
|---|---|---|
|
|
Sigma for Gaussian smoothing in streak profile estimation. |
|
|
Number of iterations for robust streak estimation. |
|
|
Sigma for smoothing the spatially-varying noise map. |
|
|
Scale factor for streak sigma estimation. |
|
|
PSD Gaussian width for streak mode filtering. |
Advanced Parameters
Parameter |
Default |
Description |
|---|---|---|
|
|
Hard thresholding coefficient for the first BM3D stage. |
|
|
Chunk size for 3D stack processing (controls memory usage). |
|
|
Optional pre-computed sigma map for 3D processing. |
Multiscale Mode (Experimental)
Warning
Multiscale mode is experimental. It works well for wide ring artifacts (>39 pixels) but may over-process regular sinograms.
Parameter |
Default |
Description |
|---|---|---|
|
|
Enable multi-scale BM3D for wide streaks. Only works with |
|
|
Override automatic scale calculation. If None, uses |
|
|
Multiplier for BM3D filtering intensity. |
|
|
Iterations for cubic spline debinning. |
Example Usage
Basic streak removal:
from bm3dornl import bm3d_ring_artifact_removal
denoised = bm3d_ring_artifact_removal(
sinogram,
mode="streak",
sigma_random=0.05,
)
High quality processing:
denoised = bm3d_ring_artifact_removal(
sinogram,
mode="streak",
sigma_random=0.05,
step_size=2,
max_matches=32,
)
Fast processing for large datasets:
denoised = bm3d_ring_artifact_removal(
sinogram_stack,
mode="streak",
sigma_random=0.05,
step_size=6,
max_matches=8,
batch_size=16, # Reduce memory usage
)