mdreg.fit_spgr_vfa_lin#
- mdreg.fit_spgr_vfa_lin(signal: ndarray, FA=None, path=None, memdim=2, parallel=True, progress_bar=False)[source]#
Linear fit to a variable flip angle model.
\[S(\mathbf{r},\alpha)=S_0(\mathbf{r})\sin{\alpha} \frac{1-e^{-T_R/T_1(\mathbf{r})}}{1-\cos{\alpha}\,e^{-T_R/T_1(\mathbf{r})}}\]Here \(S(\alpha)\) is the signal at flip angle \(\alpha\), \(S_0\) a scaling factor, \(T_R\) the repetition time and \(T_1\) the longitudinal relaxation time.
- Parameters:
signal (numpy.ndarray | zarr.Array) – Array with signal intensities for different flip angles (FA). Dimensions are (x,y,FA) or (x,y,z,FA)
FA (array) – Flip Angles in degrees (required). This is a 1D array with the same length as the last dimension of the signal array. Defaults to None.
path (str, optional) – Path on disk where to save the results. If no path is provided, the results are not saved to disk. Defaults to None.
memdim (int) – For zarrays, the number of array dimensions to be held in memory at any one time. This keyword is ignored when the argument is a numpy array. Possible values for memdim range from 0 (pixel-by-pixel processing) to ydata.ndim-1 (process the whole array at once). With memdim=1, data are loaded and processed row-by-row, with memdim=2 the are processed slice-by-slice, and so on. Default is 2.
parallel (bool) – Option to perform fitting in parallel. This is only available for zarrays when memdim is provided.
progress_bar (bool) – Display a progress bar (default = False).
- Returns:
fit (numpy.ndarray | zarr.Array) – Fit to the signal data, with same dimensions as the signal array.
pars (numpy.ndarray | zarr.Array) – Fitted model parameters S0 and E. Dimensions are (x,y,2) or (x,y,z,2).
Notes
To derive the linear version of the model, the equation can be rewritten as:
\[Y(\alpha) = AX(\alpha)+B\]with the variables defined as:
\[X = S(\alpha/\sin{\alpha};~~~~Y=S(\alpha)\cos{\alpha} / \sin{\alpha}\]and the constants:
\[E=e^{-T_R/T_1};~~~~A=\frac{1}{E};~~~~B=-S_0\frac{1-E}{E}~\]Plotting \(Y(\alpha)\) against \(X(\alpha)\) produces a straight line with slope \(A\) and intercept \(B\). After solving for \(A, B\) these constants can then be used reconstruct the signal:
\[S(\alpha)=\frac{B\sin{\alpha}}{\cos{\alpha}-A}\]