two_compartment
two_compartment
¶
Two-Compartment Exchange Model (2CXM) (OSIPI: M.IC1.009).
This module implements the Two-Compartment Exchange Model for DCE-MRI, which provides a more complete description of tracer kinetics with separate plasma and EES compartments.
GPU/CPU agnostic using the xp array module pattern. NO scipy dependency - uses xp.linalg operations.
References
.. [1] OSIPI CAPLEX, https://osipi.github.io/OSIPI_CAPLEX/ .. [2] Dickie BR et al. MRM 2024. doi:10.1002/mrm.30101 .. [3] Sourbron SP, Buckley DL. MRM 2011;66(3):735-745. .. [4] Brix G et al. MRM 2004;52(2):420-429.
TwoCompartmentParams
dataclass
¶
Bases: ModelParameters
Parameters for Two-Compartment Exchange Model (OSIPI: M.IC1.009).
| ATTRIBUTE | DESCRIPTION |
|---|---|
fp |
Plasma flow (OSIPI: Q.PH1.002) in mL/min/100mL.
TYPE:
|
ps |
Permeability-surface area product (OSIPI: Q.PH1.004) in mL/min/100mL.
TYPE:
|
ve |
Extravascular extracellular volume fraction (OSIPI: Q.PH1.001), mL/100mL.
TYPE:
|
vp |
Plasma volume fraction (OSIPI: Q.PH1.001), mL/100mL.
TYPE:
|
TwoCompartmentModel
¶
Bases: BasePerfusionModel[TwoCompartmentParams]
Two-Compartment Exchange Model (OSIPI: M.IC1.009).
Implements the 2CXM with explicit plasma and EES compartments connected by bidirectional exchange.
| ATTRIBUTE | DESCRIPTION |
|---|---|
Fp |
Plasma flow (OSIPI: Q.PH1.002), mL/min/100mL.
TYPE:
|
PS |
Permeability-surface area product (OSIPI: Q.PH1.004), mL/min/100mL.
TYPE:
|
ve |
Extravascular extracellular volume fraction (OSIPI: Q.PH1.001), mL/100mL.
TYPE:
|
vp |
Plasma volume fraction (OSIPI: Q.PH1.001), mL/100mL.
TYPE:
|
Notes
The tissue concentration is the bi-exponential convolution: Ct(t) = Fp * [A1exp(λ1t) + A2exp(λ2t)] ⊛ Ca(t)
where λ1, λ2 are eigenvalues of the rate matrix and the amplitudes A_i = Fp(λ_i + β)/(λ_i - λ_j) with β = PS/ve + PS/vp account for tracer in both plasma (vpCp) and EES (ve*Ce).
Derived from the coupled ODEs: vpdCp/dt = Fp(Ca - Cp) - PS(Cp - Ce) vedCe/dt = PS*(Cp - Ce)
where: - Cp, Ce are plasma and EES concentrations - Ca is arterial concentration (AIF) - Fp is plasma flow (OSIPI: Q.PH1.002) - PS is permeability-surface area product (OSIPI: Q.PH1.004) - vp, ve are volume fractions (OSIPI: Q.PH1.001)
GPU/CPU agnostic - operates on same device as input arrays.
References
.. [1] OSIPI CAPLEX, https://osipi.github.io/OSIPI_CAPLEX/ .. [2] Dickie BR et al. MRM 2024. doi:10.1002/mrm.30101 .. [3] Sourbron SP, Buckley DL. MRM 2011;66(3):735-745.
get_initial_guess_batch
¶
Compute vectorized initial guesses for a batch of voxels.
| PARAMETER | DESCRIPTION |
|---|---|
ct_batch
|
Tissue concentration curves, shape (n_timepoints, n_voxels).
TYPE:
|
aif
|
Arterial input function, shape (n_timepoints,).
TYPE:
|
t
|
Time points in seconds, shape (n_timepoints,).
TYPE:
|
xp
|
Array module (numpy or cupy).
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
NDArray[floating]
|
Initial parameter guesses, shape (4, n_voxels). |
get_initial_guess
¶
Compute initial parameter guess.
GPU/CPU agnostic - converts to numpy for scalar extraction.
| PARAMETER | DESCRIPTION |
|---|---|
ct
|
Tissue concentration curve.
TYPE:
|
aif
|
Arterial input function.
TYPE:
|
t
|
Time points in seconds.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
TwoCompartmentParams
|
Initial parameter estimates. |