OMatrix#
Import: cmrseq.OMatrix
- class OMatrix(position, slice_normal, readout_direction, system_specs)[source]#
Bases:
object
Captures the transformation of a slice coordinate system (Readout, Phase encoding, Slice Normal) to XYZ scanner coordinates.
When applied to Gradient and corresponding RFPulse objects, a transformed definition of the waveforms is returned.
- Raises:
BuildingBlockArgumentError if slice_normal and readout_direction are not orthogonal
- Parameters:
position (
Quantity
) – Scalar length value for a positional offset along the slice-normal directionslice_normal (
ndarray
) – (3, ) 3D vector containing the slice normalreadout_direction (
ndarray
) – (3, ) 3D vector containing the readout directionsystem_specs (
SystemSpec
) –
Methods:
apply
(block)Applies the spatial transformation from Slice-coordinates to XYZ-coordinates to the specified block.
update
([position, slice_normal, ...])Updates all specified properties of the OMatrix.
Attributes:
Scalar positional offset in 3D
Return read-only view of the readout direction
Return read-only view of the slice-normal
Returns the (4x4) transformation matrix
- apply(block)[source]#
Applies the spatial transformation from Slice-coordinates to XYZ-coordinates to the specified block.
For a Gradient block this means a rotation of the vector defined as the gradient channels [gx, gy, gz], where the total gradient area on all channels is preserved. The returned values are the time-points (t, ) and transformed gradient-waveform (3, t).
For a RFPulse the application of the OMatrix only makes sense in presence of a corresponding Trapezoidal gradient defining the slice-selective excitation. If given a tuple containing (RFPulse, TrapezoidalGradient), the frequency-modulated RF waveform is returned as time-points (t, ) and complex-wf (t, ).
- Parameters:
block (
Union
[Gradient
,Tuple
[RFPulse
,TrapezoidalGradient
]]) – Either an instance of a Gradient, or a tuple containing an RFPulse as well as a corresponding TrapezoidalGradient object defining the slice-selective excitation- Return type:
Tuple
[Quantity
,Quantity
]
- update(position=None, slice_normal=None, readout_direction=None)[source]#
Updates all specified properties of the OMatrix.
- Parameters:
position (
Optional
[Quantity
]) – Scalar length value for a positional offset along the slice-normal directionslice_normal (
Optional
[ndarray
]) – (3, ) 3D vector containing the slice normalreadout_direction (
Optional
[ndarray
]) – (3, ) 3D vector containing the readout direction
- Return type:
None
- Returns:
- property pos_offset#
Scalar positional offset in 3D
- property readout_direction#
Return read-only view of the readout direction
- property slice_normal#
Return read-only view of the slice-normal
- property tmatrix#
Returns the (4x4) transformation matrix