bSSFPModel#
- class torchsim.models.bSSFPModel(diff=None, chunk_size=None, device=None, *args, **kwargs)[source]#
Bases:
AbstractModel
bSSFPModel transverse signal at time TE after excitation.
This class models the transverse magnetization signal generated by the balanced steady state free precession (bSSFP) sequence, calculated at echo time (TE) following RF excitation.
- set_properties(T1, T2, M0=1.0, B0=0.0, chemshift=0.0):
Set tissue and system-specific properties for the SPGR model.
- set_sequence(flip, TR, TE=None, phase_inc=180.0):
Set sequence parameters including flip angle, repetition time (TR), echo time (TE) and RF phase increment.
- _engine(T1, T2, TR, TE, flip, M0=1.0, field_map=0.0, delta_cs=0.0):
Compute the bSSFP signal for given tissue, sequence, and field parameters.
Examples
from torchsim.models import bSSFPModel model = bSSFPModel() model.set_properties(T1=1000, T2=100) model.set_sequence(flip=60.0, TR=10.0, TE=5.0) signal = model()
Methods
__init__
Initialize the model with automatic parameter segregation and engine setup.
forward
Get forward method.
jacobian
Get Jacobian method.
Set tissue and system-specific properties for the SPGR model.
Set sequence parameters for the SPGR model.
- set_properties(T1, T2, M0=1.0, B0=0.0, chemshift=0.0)[source]#
Set tissue and system-specific properties for the SPGR model.
- Parameters:
T1 (float | npt.ArrayLike) – Longitudinal relaxation time in milliseconds.
T2 (float | npt.ArrayLike) – Transverse relaxation time in milliseconds.
M0 (float | npt.ArrayLike, optional) – Proton density scaling factor, default is
1.0
.B0 (float | npt.ArrayLike, optional) – Frequency offset map in Hz, default is
0.0.
chemshift (float | npt.ArrayLik, optional) – Chemical shift in Hz, default is
0.0
.
- set_sequence(flip, TR, phase_inc=180.0, TE=None)[source]#
Set sequence parameters for the SPGR model.
- Parameters:
flip (float | npt.ArrayLike) – Flip angle in degrees.
TR (float | npt.ArrayLike) – Repetition time in milliseconds.
phase_inc (float, optional) – Linear phase-cycle increment in degrees. The default is
180.0
TE (float | npt.ArrayLike, optional) – Echo time in milliseconds. The default is
None
(i.e.,TR/2
).
- static _engine(T1, T2, TR, TE, flip, M0=1.0, B0=0.0, chemshift=0.0, phase_inc=180.0)[source]#
Core computational function for the model.
- Parameters:
T1 (float | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes])
T2 (float | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes])
TR (float | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes])
TE (float | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes])
flip (float | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes])
M0 (float | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes])
B0 (float | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes])
chemshift (float | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes])
phase_inc (float)