SpinPhysics#
- class torchsim.model.SpinPhysics(properties=<factory>, operators=<factory>, fixed=<factory>, definitions=<factory>)[source]#
Bases:
objectWhich properties a voxel has, and what each kind of event does to it.
- properties#
{public name: tissue field}. A field left unnamed is never given to the tissue, and the kernels leave its term out – so this is how a model asks for off-resonance, diffusion, flow or a second pool. A name mapped toNoneis the model’s own and reaches the signal without reaching the tissue.- Type:
mapping
- operators#
What each kind of event plays.
- Type:
- fixed#
Tissue fields the model pins rather than exposes, as
{field: value}.- Type:
mapping
- definitions#
The RF resources the events name. The default is one ideal hard pulse at id 0; a model whose excitation is slice-selective supplies a shaped definition here instead.
- Type:
mapping
Methods
Build the tissue, leaving everything undeclared at its identity.
- tissue(properties)[source]#
Build the tissue, leaving everything undeclared at its identity.
A property the model does not expose, and one it exposes that the caller left out, are both simply absent – so each reaches the gate as the scalar default
TissuePropertiesholds and the kernels leave its term out.- Raises:
ValueError – If a name is mapped to a field the tissue does not have.
- property fields#
The public-name to tissue-field map, checked against the tissue.
Every field a voxel has can be named, whether or not this model asked for it: the vocabulary is the same for all of them, and giving a value is what turns a term on. What
propertiesadds is a model’s own spelling – a name of its own for a field, or a name it answers to and the tissue does not.