signal_to_conc
signal_to_conc
¶
DSC signal-to-concentration conversion.
This module converts DSC-MRI T2-weighted signal to contrast agent concentration via delta-R2 (OSIPI: Q.EL1.009), the change in transverse relaxation rate.
The TE (OSIPI: Q.MS1.005) is required for the conversion from signal intensity to delta-R2*.
GPU/CPU agnostic using the xp array module pattern. NO scipy dependency - uses custom Levenberg-Marquardt implementation.
References
.. [1] OSIPI CAPLEX, https://osipi.github.io/OSIPI_CAPLEX/ .. [2] Rosen BR et al. (1990). Contrast agents and cerebral hemodynamics. Magn Reson Med 14(2):249-265. .. [3] Ostergaard L et al. (1996). High resolution measurement of cerebral blood flow using intravascular tracer bolus passages. Magn Reson Med 36(5):715-725. .. [4] Dickie BR et al. MRM 2024. doi:10.1002/mrm.30101
DSCAcquisitionParams
dataclass
¶
Acquisition parameters for DSC-MRI.
| ATTRIBUTE | DESCRIPTION |
|---|---|
te |
Echo time TE (OSIPI: Q.MS1.005) in milliseconds.
TYPE:
|
tr |
Repetition time (TR) in milliseconds.
TYPE:
|
field_strength |
Main magnetic field strength in Tesla.
TYPE:
|
r2_star |
T2* relaxivity of contrast agent (1/s/mM). Default is for Gd-DTPA at 1.5T.
TYPE:
|
signal_to_delta_r2
¶
Convert DSC signal intensity to delta-R2* (OSIPI: Q.EL1.009).
The conversion uses the relationship: S(t) = S0 * exp(-TE * dR2*(t))
Therefore: dR2*(t) = -ln(S(t)/S0) / TE
where TE is the echo time (OSIPI: Q.MS1.005).
| PARAMETER | DESCRIPTION |
|---|---|
signal
|
DSC signal intensity, shape (..., n_timepoints). Last dimension is time.
TYPE:
|
te
|
Echo time (OSIPI: Q.MS1.005) in milliseconds.
TYPE:
|
baseline_frames
|
Number of initial frames to use for baseline estimation. Ignored if baseline_indices or baseline_end is provided.
TYPE:
|
baseline_indices
|
Specific indices to use for baseline calculation. Overrides baseline_frames if provided.
TYPE:
|
baseline_end
|
End index for baseline (uses frames 0 to baseline_end). Alias for baseline_frames. Overrides baseline_frames if provided.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
NDArray[floating]
|
Delta-R2* values in 1/s, same shape as input. |
| RAISES | DESCRIPTION |
|---|---|
DataValidationError
|
If signal contains invalid values. |
References
.. [1] OSIPI CAPLEX, https://osipi.github.io/OSIPI_CAPLEX/
Examples:
delta_r2_to_concentration
¶
Convert ΔR2* to contrast agent concentration.
Assumes a linear relationship: C(t) = ΔR2(t) / r2
where r2* is the transverse relaxivity of the contrast agent.
| PARAMETER | DESCRIPTION |
|---|---|
delta_r2
|
ΔR2* values in s⁻¹.
TYPE:
|
r2_star
|
T2* relaxivity in s⁻¹ mM⁻¹. Default is 32 s⁻¹ mM⁻¹ (typical for Gd-DTPA at 1.5T).
TYPE:
|
field_strength
|
Field strength in Tesla. Used to scale relaxivity if significantly different from 1.5T.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
NDArray[floating]
|
Contrast agent concentration in mM. |
Notes
The relaxivity scales approximately linearly with field strength for T2 effects: r2(B) ≈ r2*(1.5T) × (B / 1.5)
Examples:
gamma_variate_fit
¶
Fit gamma-variate function for recirculation removal.
The gamma-variate function models the first-pass bolus: C(t) = K × (t - t0)^α × exp(-(t - t0)/β) for t > t0 C(t) = 0 for t ≤ t0
This allows separation of the first-pass bolus from recirculation.
Uses the shared LevenbergMarquardtFitter via BoundGammaVariateModel.
| PARAMETER | DESCRIPTION |
|---|---|
concentration
|
Concentration-time curve, shape (n_timepoints,).
TYPE:
|
time
|
Time points in seconds.
TYPE:
|
baseline_end
|
Index of baseline end. If None, auto-detected.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
tuple[NDArray[floating], dict[str, float]]
|
First-pass concentration curve and fitted parameters dict. |
References
Thompson HK et al. (1964). Indicator Transit Time Considered as a Gamma Variate. Circ Res 14:502-515.
Examples: