Sampling (ADC)#
Module containing the implementation of sampling blocks
Classes:
|
ADC-specific extension to the SequenceBaseBlock, serves as base class for all ADC implementations. |
|
ADC with instantaneous encoding events at k-space positions. |
|
Defines an oversampling adc-block on system adc_raster_time |
- class ADC(system_specs, name, adc_timing, adc_center, frequency_offset, phase_offset)[source]#
Bases:
SequenceBaseBlock
ADC-specific extension to the SequenceBaseBlock, serves as base class for all ADC implementations.
- Parameters:
system_specs (
SystemSpec
) – System Limits specification objectname (
str
) –adc_timing (
Quantity
) – Quantity array of dimension time, containing all sampling event timings.adc_center (
Quantity
) – Time point defining the center of the ADC objectphase_offset (
Quantity
) – Phase-offset for all adc-samples, added when computing the adc-phase.frequency_offset (
Quantity
) – Frequency offset for all adc-samples, converted to an additional phase offset per sample
Attributes:
Timing of ADC-sampling events.
Time defining the center of the adc-events.
Frequency offset for all adc-samples, converted to an additional phase offset per sample and added when computing the adc-phase property.
Phase-offset for all adc-samples, added when computing the adc-phase property.
Returns the phase \(\phi_s\) at each adc sample \(s\) in radians given the phase offset \(\phi_0\) and frequency offset \(\delta f\) according to the formular:
Calculates the smallest time occuring in all contained definitions.
Calculates the largest time occuring in all contained definitions.
Methods:
validate
(system_specs)Should raise a ValueError if subclass logic is not met by definition :type system_specs:
SystemSpec
:param system_specs: :return:shift
(time_shift)Adds the time-shift to all adc definition points and the adc-center
flip
([time_flip])Flips block around specified time point
snap_to_raster
(system_specs)- rtype:
None
-
adc_timing:
Quantity
# Timing of ADC-sampling events. Exact definition of the meaning of that sampling time is delegated to subclass implementation. Quantity[ms]
-
adc_center:
Quantity
# Time defining the center of the adc-events. Meant to synchronize the ADC block with echo times. Quantity[ms]
-
frequency_offset:
Quantity
# Frequency offset for all adc-samples, converted to an additional phase offset per sample and added when computing the adc-phase property. Quantity[Hz]
-
phase_offset:
Quantity
# Phase-offset for all adc-samples, added when computing the adc-phase property. Quantity[rad]
- property adc_phase: Quantity#
Returns the phase \(\phi_s\) at each adc sample \(s\) in radians given the phase offset \(\phi_0\) and frequency offset \(\delta f\) according to the formular:
\[\phi_s = \phi_0 + 2 * \pi * \delta f\]
- property tmin: Quantity#
Calculates the smallest time occuring in all contained definitions. :return: Quantity[time]
- property tmax: Quantity#
Calculates the largest time occuring in all contained definitions. :return: Quantity[time]
- validate(system_specs)[source]#
Should raise a ValueError if subclass logic is not met by definition :type system_specs:
SystemSpec
:param system_specs: :return:- Parameters:
system_specs (SystemSpec) –
- shift(time_shift)[source]#
Adds the time-shift to all adc definition points and the adc-center
- Return type:
None
- Parameters:
time_shift (Quantity) –
- flip(time_flip=None)[source]#
Flips block around specified time point
- Parameters:
time_flip (Quantity | None) –
- snap_to_raster(system_specs)[source]#
- Return type:
None
- Parameters:
system_specs (SystemSpec) –
-
name:
str
#
- class SymmetricADC(system_specs, num_samples, dwell=None, duration=None, delay=None, frequency_offset=<Quantity(0.0, 'hertz')>, phase_offset=<Quantity(0.0, 'radian')>, name='adc')[source]#
Bases:
ADC
ADC with instantaneous encoding events at k-space positions.
Defines an ADC with sampling events uniformly distributed over the given duration. The central time point is allways contained as sampling event.
Note
For even number of samples the left border of the dwell time interval is defined as sampling events. For odd number of samples, the events are symmetric around center time.
- Parameters:
num_samples (
int
) – number of sampling events over durationsystem_specs (
SystemSpec
) – cmrseq.SystemSpec objectdwell (
Optional
[Quantity
]) – Quantity[time] Interval length associated with 1 sampling event. Corresponds to kspace extend in readout-direction (1/FOV_kx).duration (
Optional
[Quantity
]) – Quantity[time] Total sampling duration corresponding to (1 / Delta kx). Usually is the same as flat_duration of accompanying trapezoidal gradient.delay (
Optional
[Quantity
]) – Quantity[time] Leading time without sampling eventsfrequency_offset (
Quantity
) – Adds a linearly increasing phase over the ADC duration, used for e.g. RF-spoiling or in-plane FOV shift.phase_offset (
Quantity
) – Adds a constant phase offset to the adc, e.g. in RF spoilingname (str) –
Attributes:
Returns the time of the first sampling event.
Returns the time of the last sampling event.
Methods:
from_centered_valid
(system_specs, ...[, ...])Creates an ADC block with valid duration (dwell time on raster) where the stated duration
- property tmin: Quantity#
Returns the time of the first sampling event. Behavior varies for odd/even number of samples:
- odd: Returns the time of the first sampling event minus half a dwell time on
gradient raster time.
even: Returns the time of the first sampling event
In both cases this corresponds to the start of the plateau of a readout gradient
- property tmax: Quantity#
Returns the time of the last sampling event. Behavior varies for odd/even number of samples:
odd: Returns the time of the last sampling event plus half a dwell time.
even: Returns the time of the last sampling event plus a full dwell time.
In both cases this corresponds to the end of the plateau of a readout gradient
- classmethod from_centered_valid(system_specs, num_samples, duration, delay=None, frequency_offset=<Quantity(0.0, 'hertz')>, phase_offset=<Quantity(0.0, 'radian')>, name='adc')[source]#
- Creates an ADC block with valid duration (dwell time on raster) where the stated duration
is the upper bound (altered by at max num_samples * adc_raster_time). The difference in
duration is padded around at the start and end of the block to maintain the center.
Guarantees to have a sample at the exact half duration of the ADC block.
- Parameters:
num_samples (
int
) – number of sampling events over durationsystem_specs (
SystemSpec
) – cmrseq.SystemSpec objectduration (
Quantity
) – target duration that is modified such that the resulting dwell time is on the adc rasterdelay (
Optional
[Quantity
]) – Quantity[time] Leading time without sampling eventsfrequency_offset (
Quantity
) – Adds a linearly increasing phase over the ADC duration, used for e.g. RF-spoiling or in-plane FOV shift.phase_offset (
Quantity
) – Adds a constant phase offset to the adc, e.g. in RF spoiling
- Return type:
- class GridSamplingADC(system_specs, duration, delay=<Quantity(0, 'millisecond')>, frequency_offset=<Quantity(0.0, 'hertz')>, phase_offset=<Quantity(0.0, 'radian')>, name='adc')[source]#
Bases:
ADC
Defines an oversampling adc-block on system adc_raster_time
Attributes:
Calculates the smallest time occuring in all contained definitions.
Calculates the largest time occuring in all contained definitions.
- Parameters:
system_specs (SystemSpec) –
duration (Quantity) –
delay (Quantity) –
frequency_offset (Quantity) –
phase_offset (Quantity) –
name (str) –
- property tmin: Quantity#
Calculates the smallest time occuring in all contained definitions. :return: Quantity[time]
- property tmax: Quantity#
Calculates the largest time occuring in all contained definitions. :return: Quantity[time]
This module contains definition of a simple delay building block
Classes:
|
Defines a gradient with zero magnitude and given duration |
- class Delay(system_specs, duration, delay=<Quantity(0.0, 'millisecond')>, name='delay')[source]#
Defines a gradient with zero magnitude and given duration
- Parameters:
system_specs (SystemSpec) –
duration (Quantity) –
delay (Quantity) –
name (str) –