mprage_sim#
- torchsim.mprage_sim(TI, flip, TRspgr, nshots, T1, diff=None, inv_efficiency=1.0, M0=1.0, chunk_size=None, device=None)[source]#
MPRAGE simulator wrapper.
- Parameters:
TI (float | npt.ArrayLike, optional) – Inversion time (s) in milliseconds.
flip (float | npt.ArrayLike) – Flip angle train in degrees of shape
(2,). If scalar, assume same angle for both blocks.TRspgr (float) – Repetition time in milliseconds for each SPGR readout.
nshots (int | npt.ArrayLike) – Number of SPGR readout within the inversion block of shape
(npre, npost)If scalar, assumenpre == npost == 0.5 * nshots. Usually, this is the number of slice encoding lines(nshots = nz / Rz), i.e., the number of slices divided by the total acceleration factor alongz.T1 (float | npt.ArrayLike) – Longitudinal relaxation time in milliseconds.
diff (str | tuple[str], optional) – Arguments to get the signal derivative with respect to. The default is
None(no differentation).inv_efficiency (float | npt.ArrayLike, optional) – Inversion efficiency map, default is
1.0.M0 (float or array-like, optional) – Proton density scaling factor, default is
1.0.TI – Inversion time in milliseconds. The default is
0.0.chunk_size (int, optional) – Number of atoms to be simulated in parallel. The default is
None.device (str | torch.device, optional) – Computational device for simulation. The default is
None(infer from input).
- Returns:
sig (npt.ArrayLike) – Signal evolution of shape
(...,).jac (npt.ArrayLike) – Derivatives of signal wrt
diffparameters, of shape(..., len(diff)). Not returned ifdiffisNone.