Number of iterations for extreme streak attenuation.
extreme_detect_lambda: float
Consider streaks which are stronger than lambda * local_std as extreme.
extreme_detect_size: int
Half window size for extreme streak detection -- total (2*s + 1).
extreme_replace_size: int
Half window size for extreme streak replacement -- total (2*s + 1).
max_bin_iter_horizontal: int
The number of total horizontal scales (counting the full scale).
bin_vertical: int
The factor of vertical binning, e.g. bin_vertical=32 would perform denoising in 1/32th of the original vertical size.
filter_strength: float
Strength of BM4D denoising (>0), where 1 is the standard application, >1 is stronger, and <1 is weaker.
use_slices: bool
If True, the sinograms will be split horizontally across each binning iteration into overlapping.
slice_sizes: list
A list of horizontal sizes for use of the slicing if use_slices=True. By default, slice size is either 39 pixels or 1/5th of the total width of the current iteration, whichever is larger.
slice_step_sizes: list
List of number of pixels between slices obtained with use_slices=True, one for each binning iteration. By default 1/4th of the corresponding slice size.
denoise_indices: list
Indices of sinograms to denoise; by default, denoises the full stack provided.
Returns
-------
Radiograph stack with ring artifact removed.
Notes
-----
1. The parallel processing is handled at the bm3d level, and it is an intrinsic
slow correction algorithm running on CPU.
2. The underlying BM3D library uses stdout to print progress instead of a progress
# parameters passed to bm3dsr.extreme_streak_attenuation
extreme_streak_iterations=param.Integer(default=3,doc="Number of iterations for extreme streak attenuation.")
extreme_detect_lambda=param.Number(
default=4.0,
doc="Consider streaks which are stronger than lambda * local_std as extreme.",
)
extreme_detect_size=param.Integer(
default=9,
doc="Half window size for extreme streak detection -- total (2*s + 1).",
)
extreme_replace_size=param.Integer(
default=2,
doc="Half window size for extreme streak replacement -- total (2*s + 1).",
)
# parameters passed to bm3dsr.multiscale_streak_removal
max_bin_iter_horizontal=param.Integer(
default=0,
doc="The number of total horizontal scales (counting the full scale).",
bounds=(0,None),
)
bin_vertical=param.Integer(
default=0,
doc="The factor of vertical binning, e.g. bin_vertical=32 would perform denoising in 1/32th of the original vertical size.",
bounds=(0,None),
)
filter_strength=param.Number(
default=1.0,
doc="Strength of BM4D denoising (>0), where 1 is the standard application, >1 is stronger, and <1 is weaker.",
bounds=(0,None),
)
use_slices=param.Boolean(
default=True,
doc="If True, the sinograms will be split horizontally across each binning iteration into overlapping.",
)
slice_sizes=param.List(
default=None,
doc="A list of horizontal sizes for use of the slicing if use_slices=True. By default, slice size is either 39 pixels or 1/5th of the total width of the current iteration, whichever is larger.",
)
slice_step_sizes=param.List(
default=None,
doc="List of number of pixels between slices obtained with use_slices=True, one for each binning iteration. By default 1/4th of the corresponding slice size.",
)
denoise_indices=param.List(
default=None,
doc="Indices of sinograms to denoise; by default, denoises the full stack provided.",
)
# note: we are skipping the bm3d_profile_obj parameter as bm3d is not explicitly used in iMars3D.
def__call__(self,**params):
"""See class level documentation for help."""
ifnotbm3dsr:
logger.warning("To use method, make sure to install bm3d_streak_removal package via pip.")
raiseRuntimeError("BM3D suite not installed, please install with pip install bm3d_streak_removal")
else:
logger.info("Executing Filter: Remove Ring Artifact with BM3D")