photon_mosaic.preprocessing.contrast#

Contrast enhancement preprocessing step.

This module provides functions to enhance the contrast of images.

Functions

run(dataset_folder, output_folder, tiff_name)

Enhance the contrast of an image.

photon_mosaic.preprocessing.contrast.run(dataset_folder, output_folder, tiff_name, percentile_low=1, percentile_high=99, **kwargs)[source]#

Enhance the contrast of an image.

Parameters:
  • dataset_folder (Path) – Path to the dataset folder containing the input TIFF files.

  • output_folder (Path) – Path to the output folder where the processed TIFF files will be saved.

  • tiff_name (str) – Name of the TIFF file to process.

  • percentile_low (float, optional) – Lower percentile for contrast stretching. Default is 1.

  • percentile_high (float, optional) – Upper percentile for contrast stretching. Default is 99.

  • **kwargs (dict) – Additional keyword arguments (unused).

Returns:

The function saves the enhanced image to the output folder with the prefix “enhanced_” and returns nothing.

Return type:

None

Notes

The function will search for the TIFF file using rglob if it’s not found at the expected location.