CImgDenoising¶
Purpose¶
CImgDenoising wraps the SAIRPICO CImg denoise command for 2D+T denoising
with patch, neighborhood, noise-model, and algorithm controls. It is useful for
testing CImg denoising baselines without moving those command-line options into
workflow code.
Inputs¶
input_image: intensity image inpng,tif, ortiffformat.first: first image index;0uses the command default. Default0.last: last image index;-1uses the full depth or time range. Default-1.alpha: input/output alpha mixing. Default0.0.scale: volume resize factor. Default1.0.intensity_range: automatic intensity scaling with-1or manual scaling. Default1.0.algorithm: optional algorithm name such asBM3D,NLBayes,PEWA,Wiener,Bilateral,Median,TV,SV, orHV. DefaultNone.gaussian_noise: artificial Gaussian noise level before denoising. Default0.0.poisson_noise: add artificial Poisson noise before denoising. DefaultFalse.manual_sigma: manual assumed Gaussian noise standard deviation. Default0.0.stabilize_poisson: use variance stabilization for Poisson noise removal. DefaultFalse.patch: patch half-size. Default3.neighborhood: neighborhood half-size. Default7.denoising_parameter: algorithm-specific denoising parameter. Default-1.0.sparsity_parameter: SV/HV sparsity parameter. Default0.6.iterations: iteration count for NDSafir. Default4.
Outputs¶
output_image: denoised intensity image. The default template is{input_image.stem}_denoised{ext}.
Assumptions¶
The selected algorithm name is supported by the installed
denoisecommand.Boolean options are omitted unless enabled.
Parameter meaning is delegated to the CImg backend.
Dependencies and Core Libraries¶
BioImageFlow core processing abstractions.
SAIRPICO
cimgdenoisingenvironment withbioimageit::cimgdenoising==1.0.0.External command:
denoise.
Minimal Example¶
from bioimageflow_core import Arguments
from bioimageflow_sairpico_tools import CImgDenoising
result = CImgDenoising().process_row(
Arguments(
input_image="input.tif",
first=0,
last=-1,
alpha=0.0,
scale=1.0,
intensity_range=1.0,
algorithm="PEWA",
gaussian_noise=0.0,
poisson_noise=False,
manual_sigma=0.0,
stabilize_poisson=False,
patch=3,
neighborhood=7,
denoising_parameter=-1.0,
sparsity_parameter=0.6,
iterations=4,
output_image="denoised.tif",
)
)
Expected Results¶
The tool writes denoised.tif. When algorithm is set, the command ends with
-algo and the selected algorithm name; when poisson_noise or
stabilize_poisson are false, their flags are omitted.
Failure Modes¶
The
denoiseexecutable or its runtime libraries are missing.The selected algorithm is unsupported by the installed binary.
Parameter combinations are invalid for the input image.
The subprocess exits non-zero or cannot write the output.