nighres.filtering.total_variation_filtering(image, mask=None, lambda_scale=0.05, tau_step=0.125, max_dist=0.0001, max_iter=500, save_data=False, overwrite=False, output_dir=None, file_name=None)[source]

Total Variation Filtering

Total variation filtering.

  • image (niimg) – Input image to filter
  • mask (niimg, optional) – Data mask for processing
  • lambda_scale (float, optional) – Relative intensity scale for total variation smoothing (default is 0.5)
  • tau_step (float, optional) – Internal step parameter (default is 0.125)
  • max_dist (float, optional) – Maximum distance for convergence (default is 1e-4)
  • max_iter (int, optional) – Maximum number of iterations (default is 500)
  • save_data (bool) – Save output data to file (default is False)
  • overwrite (bool) – Overwrite existing results (default is False)
  • output_dir (str, optional) – Path to desired output directory, will be created if it doesn’t exist
  • file_name (str, optional) – Desired base name for output files with file extension (suffixes will be added)

Dictionary collecting outputs under the following keys (suffix of output files in brackets)

  • filtered (niimg): The filtered image (_tv-img)
  • residual (niimg): The image residuals (_tv-res)

Return type:



Original Java module by Pierre-Louis Bazin. Algorithm adapted from [1]


[1]Chambolle (2004). An Algorithm for Total Variation Minimization and Applications. doi:10.1023/B:JMIV.0000011325.36760.1e