Skip to content

Statistics

Source

Compute and resolve normalization statistics from patch data.

resolve_normalization_config(norm_config, patching_strategy, input_extractor, target_extractor=None, channels=None)

Resolve a normalization config by computing any missing statistics.

If statistics are already provided in the config, they are preserved. If statistics are missing (None), they are computed from the data.

Parameters:

  • norm_config (NormalizationConfig) –

    The normalization configuration (may have missing statistics).

  • patching_strategy (PatchingStrategy) –

    Strategy for iterating over patches.

  • input_extractor (PatchExtractor) –

    Extractor for input data.

  • target_extractor (PatchExtractor, default: None ) –

    Extractor for target data.

  • channels (sequence of int or None, default: None ) –

    Channels to compute statistics for; None for all.

Returns:

  • NormalizationConfig

    A resolved configuration with all statistics populated.