patch_denoise.bindings.cli.main#
- patch_denoise.bindings.cli.main(input_file: ~typing.Annotated[~pathlib.Path, Parameter(validator=(Path(exists=True, file_okay=True, dir_okay=False, ext=()),))], output_file: ~typing.Annotated[~pathlib.Path | None, Parameter(validator=(Path(exists=False, file_okay=True, dir_okay=False, ext=()),), help='Output denoised NIfTI file (4D). Default is D<input_file>.')] = None, *, method: ~typing.Annotated[~patch_denoise.space_time.base.DenoiserName, Parameter(help='Denoising method.')] = DenoiserName.OPTIMAL_FRO, patch_shape: ~typing.Annotated[tuple[int, ...], Parameter(converter=<function parse_dims at 0x7f968cbf0b80>, alias=('-ps',), negative=(), help='Patch shape. Dimension separated by ",". Use -1 to use the entire dimension. Example: 11,11,11,-1.')] = (11, 11, 11, -1), patch_overlap: ~typing.Annotated[tuple[int, ...], Parameter(converter=<function parse_dims at 0x7f968cbf0b80>, alias=('-po',), negative=(), help='Patch overlap. Dimension separated by ",". Use -1 to use the entire dimension. Example: 11,11,11,-1.')] = (5, 5, 5, -1), recombination: ~typing.Annotated[~patch_denoise.space_time.base.Recombination, Parameter(name=('--recombination', '-r'), help='Recombination method.')] = Recombination.WEIGHTED, mask: ~typing.Annotated[~typing.Annotated[~pathlib.Path, Parameter(validator=(Path(exists=True, file_okay=True, dir_okay=False, ext=()),))] | None, Parameter(name=('--mask', '-k'), help='Mask NIfTI file (3D). if None, mask is computed automatically.')] = None, mask_threshold: ~typing.Annotated[int, Parameter(name=('--mask-threshold', '-t'), help='Min % of overlap between a patch and the mask to trigger computation.')] = 50, extras: ~typing.Annotated[dict[str, float | str] | None, Parameter(alias=('-e',), help='Extra parameters for the denoiser as -e.key=value')] = None, nan_to_num: ~typing.Annotated[float | None, Parameter(help='Replace any NaN in input-data with VALUE')] = None, verbose: ~typing.Annotated[int, Parameter(help='Repeat for increase verbosity (-vvv)', count=True)] = 0, gpu: ~typing.Annotated[bool, Parameter(name=('--gpu',), negative=('--cpu',), help='Use GPU or CPU for computation. Requires patch_denoise.gpu module. GPU is enabled by default if available')] = False, gpu_batch_size: ~typing.Annotated[int, Parameter(name=('--gpu-batch-size',), help='Number of patches processed per GPU batch. If 0, measure the fastest size for this GPU/method/patch-shape once and cache it (~/.cache/patch_denoise/gpu_batch_size.json) for future runs. Ignored on CPU.')] = 0, outmap_extra: ~typing.Annotated[~patch_denoise.space_time.base.ExtraOutput, Parameter(name=('--outmap',), negative=(), consume_multiple=(0, None))] = <ExtraOutput: 0>, input_phase: ~typing.Annotated[~typing.Annotated[~pathlib.Path, Parameter(validator=(Path(exists=True, file_okay=True, dir_okay=False, ext=()),))] | None, Parameter(alias=('-ip',), help='Input phase NIfTI file (4D). If provided, process complex data.')] = None, noise_std_map: ~typing.Annotated[~typing.Annotated[~pathlib.Path, Parameter(validator=(Path(exists=True, file_okay=True, dir_okay=False, ext=()),))] | None, Parameter(help='Input Noise std map')] = None, noise_std_map_phase: ~typing.Annotated[~typing.Annotated[~pathlib.Path, Parameter(validator=(Path(exists=True, file_okay=True, dir_okay=False, ext=()),))] | None, Parameter(help='Input Noise std map, phase component.')] = None)[source]#
Perform local-low-rank denoising on 4D MRI data.