acquisition_parameter
acquisition_parameter
Interface class for acquisition parameters.
AcquisitionParameter
dataclass
AcquisitionParameter(larmor_frequency: float = 2000000.0, b1_scaling: float = 1.0, gradient_offset: Dimensions = _gradient_offset_factory(), fov_scaling: Dimensions = _fov_scaling_factory(), channel_assignment: Dimensions = _channel_factory(), ddc_method: DDCMethod = FIR, num_averages: int = 1, averaging_delay: float = 0.0, state_filepath: str = str(home() / 'nexus-console/acquisition-parameter.state'), _initialized: bool = False)
Runtime parameters of an acquisition.
In contrast to the static device configuration, acquisition parameters describe the state of a
measurement session (e.g. calibrated Larmor frequency and B1 scaling) and are passed to
AcquisitionControl.set_sequence for each acquisition.
The parameter state is persisted as JSON: it is written to state_filepath on instantiation and on
every mutation of an attribute (including mutations of nested Dimensions attributes). Assignments are
type-checked against the field annotations. On import of the console package, the last saved state is
loaded and exposed as console.parameter.
larmor_frequency
class-attribute
instance-attribute
larmor_frequency: float = 2000000.0
Larmor frequency in Hz.
b1_scaling
class-attribute
instance-attribute
b1_scaling: float = 1.0
Scaling of the B1 field (RF transmit power).
gradient_offset
class-attribute
instance-attribute
gradient_offset: Dimensions = field(default_factory=_gradient_offset_factory)
Static gradient offsets (e.g. for linear shimming) in mV.
Given per physical output channel (x: channel 1, y: channel 2, z: channel 3) and applied as hardware DC offset of the transmit card for the duration of an acquisition.
fov_scaling
class-attribute
instance-attribute
fov_scaling: Dimensions = field(default_factory=_fov_scaling_factory)
Scaling factor of the logical gradient waveforms gx, gy and gz.
channel_assignment
class-attribute
instance-attribute
channel_assignment: Dimensions = field(default_factory=_channel_factory)
Assignment of the logical gradients x, y, z to the physical transmit channels 1, 2, 3.
Must be a permutation of {1, 2, 3}.
ddc_method
class-attribute
instance-attribute
Decimation filter method.
num_averages
class-attribute
instance-attribute
num_averages: int = 1
Number of acquisition averages.
averaging_delay
class-attribute
instance-attribute
averaging_delay: float = 0.0
Delay in seconds between acquisition averages.
state_filepath
class-attribute
instance-attribute
Default file path for acquisition parameter state.
Don't enforce a Path object here to prevent conflicts when sending acquisition parameter instances between different OS.
to_dict
Return acquisition parameters as dictionary.
Parameters:
-
use_strings(bool, default:False) –boolean flag indicating if values of dictionary should be represented as strings, by default False
Returns:
-
Acquisition parameter dictionary–
Source code in src/console/interfaces/acquisition_parameter.py
save
Save current acquisition parameter state.
Parameters:
-
filepath(str or Path or None, default:None) –Path to the JSON state file. If None,
state_filepathis used (default<home>/nexus-console/acquisition-parameter.state). If the path does not end with.state, it is interpreted as directory and the filenameacquisition-parameter.stateis appended.
Source code in src/console/interfaces/acquisition_parameter.py
load
classmethod
load(filepath: Path | str | None = None) -> Optional[AcquisitionParameter]
Load and return acquisition parameter state.
Parameters:
-
filepath(Path or str or None, default:None) –Path to acquisition parameter state file. If the path does not end with
.state, the filenameacquisition-parameter.stateis appended.
Returns:
-
AcquisitionParameter or None–Instance of acquisition parameters with state loaded from the provided path, or None if the state file does not exist or cannot be parsed (the error is logged).