Commit Graph

4 Commits

Author SHA1 Message Date
AlbertoPMDM ef2f3dbf39 window_selection and spikes, legacy and modern
- legacy: seleccion.seleccionar and candidatos_punta.de_estudio +
  indicadores vendored unchanged, run on the contract adapter with the
  sleep_state labels as the vigilancia table.
- modern: the director's detector functions copied by name into
  _detector.py with three substitutions (MNE band-pass, channel lists from
  the study, a private port of the seleccion gate); a modern
  window_selection on the same port.
- synthetic builder: optional focal spike-and-wave (the director's own
  _punta shape) with a field on the neighbours.

Modern equals legacy exactly on window verdicts and spike indicators; the
C3 focus is found; contract suites pass.
2026-11-18 22:02:57 -06:00
AlbertoPMDM 4987629e8b slow_wave_staging and slow_waves, legacy and modern
- legacy: ondas_lentas.detectar on F3 F4 Fz over the whole recording,
  union_intervalos + estadificar for the 'sueno' windows (the cluster
  route's fases_sueno), ondas_lentas.resumen for the features; vendored
  unchanged.
- modern: the same zero-crossing detector on an MNE band-pass, the same 20%
  of 30 s N3 rule, the same summary definitions.

Legacy waves equal the submodule's exactly; modern equals legacy on the
synthetic study; contract suites pass.
2026-11-18 21:47:39 -06:00
AlbertoPMDM f870ee9f14 spindle_detection and spindles, legacy and modern
- legacy: husos.detectar / husos.resumen vendored unchanged, run on the
  'sueno' windows as medidas_director does; the wake rhythm that sets the
  'rhythm near sigma' flag is computed inside the process (no biomarker
  dependency).
- modern: the same detector on MNE (sigma band-pass) and SciPy (Hilbert,
  Welch narrowness, phase stability); summary with the director's
  definitions; one baseline per feature.
- privacy.group_size understands per-feature baseline dicts.

Legacy equals the submodule's cluster route exactly (spindle count and the
six summary measures); modern equals legacy on the synthetic study.
2026-11-18 20:57:24 -06:00
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