Submodules#
Summary#
Submodule for Bloch simulations that implements T2 start weighting by accumulating a phase per particle. |
Submodule for Bloch simulations that evaluates the concomitant field variation in z-direction (field variation in direction of the main magnetic field) at all particle positions contained in the trajectories according to: |
Submodule for Bloch simulations that evaluates the off-resonance phase according to: |
Modules#
- class T2starDistributionModel(device='GPU')[source]#
Submodule for Bloch simulations that implements T2 start weighting by accumulating a phase per particle. The particle properties should be assigned randomly according to a Lorentzian distribution. The phase difference is evaluated according to:
\[\delta \phi = \omega_{T_2^\*} \delta t\]- Parameters:
device (
str
) – name for device placing
Methods:
__call__
(omega_t2s, dt, **kwargs)Evaluates the module equation for given inputs.
Attributes:
Tuple of names specifying the input quantities (datasets) to run this submodule
- __call__(omega_t2s: Tensor, dt: Tensor, **kwargs) Tensor [source]#
Evaluates the module equation for given inputs.
- Parameters:
omega_t2s (
Tensor
) – (#particles, ) angular frequency contribution per particle by T2star effect This should be sampled using a distribution as implemented in cmrsim.utils.particle_properties.t2star_lorentzian.dt (
Tensor
) – (, ) angular frequency contribution per particle by T2star effect
- Return type:
Tensor
- Returns:
(1, #particles, 1) phase increment per timestep due to T2star effects
- class ConcomitantFields(gamma, b0, device='GPU')[source]#
Submodule for Bloch simulations that evaluates the concomitant field variation in z-direction (field variation in direction of the main magnetic field) at all particle positions contained in the trajectories according to:
\[r = (x, y, z)^T \ G = (G_x, G_y, G_z)^T \ \Delta \phi = (\gamma \Delta t / 2B_0) \cdot \left[ (G_x z + G_z x/2)^2 + (G_y z - G_z y/2)^2 \right]\]Methods:
__call__
(gradient_wave_form, trajectories, ...)Evaluates the module equation for given inputs.
- __call__(gradient_wave_form: Tensor, trajectories: Tensor, dt: Tensor, **kwargs) Tensor [source]#
Evaluates the module equation for given inputs.
- Parameters:
gradient_wave_form (
Tensor
) – (#reps, #time, 3) in mT/mtrajectories (
Tensor
) – (Optional[#reps/1], #batch, #time, 3) in mdt (
Tensor
) – float -> delta time on which the gradient waveform is defined (usually ms)
- Return type:
Tensor
- Returns:
phase increment per time-step (#reps, #batch, #time)
- class OffResonance(gamma, device='GPU')[source]#
Submodule for Bloch simulations that evaluates the off-resonance phase according to:
\[\delta \phi = \gamma \Delta B \delta t\]Note
This function currently does not support jit-compilation due to reshape inside conditionals. (Tensorflow 2.9.1)
Methods:
__call__
(off_res, dt, **kwargs)Evaluates the phase increment per time-step for given off resonances.
- __call__(off_res: Tensor, dt: Tensor, **kwargs) Tensor [source]#
Evaluates the phase increment per time-step for given off resonances.
- Parameters:
off_res (
Tensor
) – (Optional[#reps], #particles, Optional[#steps], 1) in mT. If #reps dimension is not present, expands the first dimension to yield consistent output.dt (
Tensor
) – timestep in milliseconds
- Return type:
Tensor
- Returns:
(#reps/1, #particles, #steps)