MedianDenoising¶
Purpose¶
MedianDenoising applies SAIRPICO median filtering through simgmedian2d,
simgmedian3d, or simgmedian4d. It is a simple restoration and preprocessing
tool for removing sparse impulse-like noise before segmentation, spot
detection, or deconvolution.
Inputs¶
input_image: intensity image inpng,tif, ortiffformat.denoising_type:2D,3D, or4D. Default2D.radius_x: median-filter radius in X. Default2.radius_y: median-filter radius in Y. Default2.radius_z: median-filter radius in Z for3Dand4Dmodes. Default1.radius_t: median-filter radius in time for4Dmode. Default1.padding: whether to process border pixels using padding. DefaultFalse.
Outputs¶
output_image: median-filtered intensity image. The default template is{input_image.stem}_filtered{ext}.
Assumptions¶
The selected dimensional mode matches the input image layout.
Radius values are tuned to preserve objects of interest.
radius_zis ignored in2Dmode andradius_tis used only in4Dmode.
Dependencies and Core Libraries¶
BioImageFlow core tool abstractions.
SAIRPICO
simglibenvironment withbioimageit::simglib==0.1.2.External commands:
simgmedian2d,simgmedian3d, andsimgmedian4d.
Minimal Example¶
from bioimageflow_core import Arguments
from bioimageflow_sairpico_tools import MedianDenoising
result = MedianDenoising().process_row(
Arguments(
input_image="input.tif",
denoising_type="2D",
radius_x=1,
radius_y=1,
radius_z=1,
radius_t=1,
padding=True,
output_image="median.tif",
)
)
Expected Results¶
The wrapper writes median.tif and returns that path. The example invokes
simgmedian2d with -rx 1, -ry 1, and -padding true.
Failure Modes¶
The selected
simgmedian*command is missing.Image dimensionality does not match the selected mode.
Radius values remove desired structures or create excessive smoothing.
The subprocess exits non-zero or cannot write the output.