Skip to main content

config

Config for the scan reduce step (v1).

Classes​

ScanReduceConfig​

class ScanReduceConfig(**data: Any):

Config for the scan reduce step.

Attributes

  • strategy: latest keeps the newest scans per group; all is the identity reduction, which lets a template carry the step while a trial opts out of reducing at all.
  • num_latest: How many scans to keep per group. A ceiling, not a quota.
  • group_by: What to subdivide a patient by — nothing (latest N per patient), their laterality (latest N per eye), or their protocol.
  • min_scans: How many selected scans a patient must hold to be inferred at all. 1, the default, keeps every patient.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Variables​

  • static min_scans : int
  • static model_config
  • static num_latest : int

ScanReduceGroupKey​

class ScanReduceGroupKey(*args, **kwds):

Scan attributes a reduction may subdivide a patient by.

Drawn from scan_metadata's own columns, so a key here needs no new extraction. The patient is always part of the group; these are what may be added beside them.

Variables​

  • static LATERALITY
  • static PROTOCOL

ScanReduceStrategy​

class ScanReduceStrategy(*args, **kwds):

Valid reduction strategies.

StrEnum keeps values JSON/YAML-friendly and comparable to plain strings, as ScanFilterStrategy does.

Variables​

  • static ALL
  • static LATEST