nirspipe.pipeline.dpf#

The differential pathlength factor a run converts with: the numbers given, or one per wavelength from age.

Module Contents#

Functions#

age_dpf

DPF of the frontal head at one wavelength and age.

dpf_caveat

What of an age DPF lies outside the equation’s recommended range, as a page note, or None.

dpf_from_age

Whether --dpf asked for the age equation; the word mixed with numbers is refused.

wavelengths

The recording’s wavelengths in nm, ascending, the order MNE pairs factors with.

resolve_dpf

The factors a run converts with: the numbers given, or age_dpf() per wavelength.

dpf_text

The factors as the reports print them, naming where the age came from.

as_ppf

MNE’s ppf: one value for every wavelength, or the list.

Data#

API#

nirspipe.pipeline.dpf.logger = 'get_logger(...)'#
nirspipe.pipeline.dpf.AGE = 'age'#
nirspipe.pipeline.dpf.AGE_RANGE = (0.0, 70.0)#
nirspipe.pipeline.dpf.WAVELENGTH_RANGE = (690.0, 950.0)#
nirspipe.pipeline.dpf.age_dpf(wavelength_nm: float, age_years: float) → float#

DPF of the frontal head at one wavelength and age.

DPF(λ, A) = 223.3 + 0.05624 A^0.8493 − 5.723e-7 λ³ + 0.001245 λ² − 0.9025 λ, with λ in nm and A in years: Equation 7 of Scholkmann & Wolf (2013), J Biomed Opt 18(10):105004.

nirspipe.pipeline.dpf.dpf_caveat(age: float, wavelengths_nm: list[float]) → str | None#

What of an age DPF lies outside the equation’s recommended range, as a page note, or None.

nirspipe.pipeline.dpf.dpf_from_age(dpf: list) → bool#

Whether --dpf asked for the age equation; the word mixed with numbers is refused.

nirspipe.pipeline.dpf.wavelengths(raw: mne.io.Raw) → list[float]#

The recording’s wavelengths in nm, ascending, the order MNE pairs factors with.

nirspipe.pipeline.dpf.resolve_dpf(dpf: list, raw: mne.io.Raw, age: float | None) → list[float]#

The factors a run converts with: the numbers given, or age_dpf() per wavelength.

nirspipe.pipeline.dpf.dpf_text(dpf: list, wavelengths_nm: list[float], age: float | None, population: str | None = None) → str#

The factors as the reports print them, naming where the age came from.

age 30, adult         ->  "age 30 from --population adult (6.30, 5.23)"
age 19, participant   ->  "participant's age 19 (5.97, 4.91)"

population is the --population that filled the DPF, None when the age is the participant’s own.

nirspipe.pipeline.dpf.as_ppf(dpf: list[float]) → float | list[float]#

MNE’s ppf: one value for every wavelength, or the list.