Commit Graph

2 Commits

Author SHA1 Message Date
AlbertoPMDM 441113c7b7 legacy: annotation_mask, sleep_state and posterior_rhythm on the director's code
- contracts: Preprocessed.quality_spans (QC-unclean stretches at the QC's
  own resolution), so the director's state mask can be rebuilt exactly.
- legacy.preprocessing: annotations straight from the EDF (exact onsets, as
  edf_convert), quality_spans from his 4 s QC.
- legacy processes annotation_mask (intervalos_estado, estado_de_ventana) and
  sleep_state (vigilancia.rasgos with senal._mascara_excluir's mask,
  clasificar with the HK1K cut-offs or cohort cut-offs after train()).
- legacy biomarker posterior_rhythm (medidas_director.ritmo on
  ritmo.psd_de_ventanas + pico_dominante) with a private _baseline.py holding
  curvas.py and perfil_alteraciones' age-block z, copied verbatim.
- Each legacy module owns its adapter, which writes the study in the
  director's preprocessed format and opens it with his eeg_io.Estudio.

Identical to the submodule's cluster route on a synthetic study (window
labels and rhythm); contract suites pass.
2026-11-18 20:12:47 -06:00
AlbertoPMDM 25dd95a8ad legacy.validation: director's validation behind the Validator protocol
The director's scripts (biomarcadores-tea/preproceso @ 7dfc641) are vendored
unchanged except imports by tools/vendor_legacy.py, one copy per legacy
module; --check re-derives them from the pinned submodule.

LegacyValidation runs steps 1-4 of un_estudio.procesar for an EDF
(edf_convert, lote.excluidos_para_qc + qc_estudio + veredicto, triaje.triar,
60% clean windows) plus preproceso.MIN_CUERO, and returns an R4B FHIR Bundle
and 0/1. Tests: identical to the submodule on a synthetic EDF, contract
suite, not-valid case, vendor check.
2026-11-18 20:00:46 -06:00