pub fn r2prime(
r2star: &[f64],
r2: &[f64],
mask: &[u8],
r2_coverage: Option<&[u8]>,
) -> Result<R2PrimeMap, InputError>Expand description
Compute R2’ = R2* − R2, clamped at zero, over the region where R2 was measured.
R2* (from a gradient-echo acquisition) captures reversible + irreversible dephasing; R2 (from a
spin-echo acquisition) captures only the irreversible part. Their difference R2’ is the
reversible dephasing that chi-separation uses to constrain the paramagnetic/diamagnetic split.
Noise can make R2* < R2 in some voxels, so negative values are clamped to zero, as
r2primenet does: every R2′ QSM.rs makes is non-negative,
and the χ-separation methods are given that map.
R2’ is only defined where R2 exists. R2 comes from a multi-echo spin-echo acquisition, and
a MESE is routinely a slab — a band of slices rather than the whole head — because
whole-brain MESE is expensive. Subtracting over the whole brain mask would then compute
R2' = R2* − 0 = R2* outside the slab, overstating R2’ by roughly the tissue R2 (~10-20 Hz in
brain at 3 T) with nothing in the output to show it: the map looks plausible, and every
R2’-consuming method inherits the error. So this returns the coverage alongside the map, and
leaves R2’ at zero outside it; what to do with the remainder — restrict the downstream outputs
to it, or fill it with r2primenet — is a policy decision for
the caller, not this function.
Coverage is the intersection of three things:
mask— where an R2’ is wanted at all (the brain mask);r2_coverage, when given — where the R2 acquisition reached. Only the caller knows this; it is a geometric fact about the acquisition, not something the R2 map reveals;r2 > 0— a finite, positive R2. R2 = 0 means T2 = ∞, which no tissue has, so a zero is an absent measurement rather than a measured zero. This is exact for an R2 map fromr2_epg, which returns exactly zero outside its own fit mask; for an R2 map resampled from another grid, interpolation can leave small non-zero values just outside the acquired FOV, and only an explicitr2_coverageexcludes those.
Passing r2_coverage = None therefore falls back to the r2 > 0 heuristic — conservative, and
right for an EPG-derived R2, but weaker than telling the function where the acquisition was.
§Arguments
r2star- R2* map in Hz[nx*ny*nz]r2- R2 map in Hz[nx*ny*nz](co-registered tor2star)mask- Binary brain mask[nx*ny*nz]r2_coverage- Optional binary mask of where the R2 acquisition reached[nx*ny*nz]
§Returns
R2PrimeMap: the R2’ map in Hz and the coverage it is valid over.
§Errors
If r2, mask or r2_coverage is not the same length as r2star: R2 from a separate
spin-echo acquisition has to be resampled onto the R2* grid first.