mprage_sim#
- torchsim.mprage_sim(TI, flip, TRspgr, nshots, T1, diff=None, inv_efficiency=1.0, M0=1.0, phases=0.0, device=None, **values)[source]#
MPRAGE simulator wrapper.
- Parameters:
TI (float) – 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.phases (float or array-like, optional) – Sequence phase schedule in degrees. The default is
0.0.**values (optional) – Additional call-time tissue, protocol or run settings accepted by
Simulator.simulate. Settings fixed only at simulator construction remain class-interface features.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.