API Reference
Displays
- class gui4us.cfg.display.ViewCfg(displays: Sequence[Display1D | Display2D], grid_spec: GridSpec | None = None)
Bases:
objectGUI4us view configuration.
- Parameters:
displays – displays to use
layers – display grid layout; by default dispalys will be presented in a single row
- class gui4us.cfg.display.Display2D(title: str, layers: Sequence[Layer2D], extents: tuple | None = None, ax_labels: tuple | None = None)
Bases:
object2D display settings.
- Parameters:
title – display title
layers – layers to display
extents – physical extents: a tuple (min azimuth, max azimuth, min depth, max depth) Optional, if not provided, the extents will be determined from the metadata provided by the environemnt.
ax_labels – axis labels to use; default: no labels
- class gui4us.cfg.display.Layer2D(input: StreamDataId, cmap: str, value_range: tuple | None = None)
Bases:
object2D image layer settings.
Currently the only supported inputs are
StreamDataId("default", i), whereiis the pipeline output number.- Parameters:
input – input id
cmap – color map to use; see color map names available in matplotlib
value_range – dynamic range to apply (min, max) pair
- class gui4us.cfg.display.GridSpec(n_rows: int, n_columns: int, locations: Sequence[DisplayLocation])
Bases:
objectGrid view layout specfication.
This class allows to specify the non-standard way of arranging multiple displays presented in the GUI4us.
Each display can occupy one or multiple cells in the grid. The cells occupied by which displays can be defined via the
locationsparameter.- Parameters:
n_rows – number of rows
n_columns – number of columns
locations – grid cell - display assigments
- class gui4us.cfg.display.DisplayLocation(rows: int | Tuple[int, int], columns: int | Tuple[int, int], display_id: str | None = None)
Bases:
objectDefines a location of a single display in the grid.
- Parameters:
rows – which rows should be occuped by the display
columns – which columns should be occuped by the display
display_id – display identifier
Environment
ARRUS environment
- class gui4us.model.envs.arrus.UltrasoundEnv(session_cfg: str, configure: Callable[[Session], ArrusEnvConfiguration], log_file_level=2, log_file: str | None = None)
Bases:
EnvARRUS ultrasound environment.
This user class should provide a path to the .prototxt session configuration file and a factory function
configure, with the implementation of ultrasound environment, in particular: arrus Scheme(TX/RX sequence and processing in particular) and default settings like TX voltage.- Parameters:
session_cfg – path to the session configuration file
configure – ARRUS scheme factory function
log_file_level – ARRUS logging level (output: file)
log_file – output log file
- class gui4us.model.envs.arrus.ArrusEnvConfiguration(scheme: Scheme, tgc: Curve, medium: Medium | None = None, voltage: float | None = 5)
Bases:
objectARRUS environment configuration.
The instance of this class should be returned by the factory function configure.
- Parameters:
scheme – arrus Scheme (TX/RX sequence and processing)
tgc – tgc settings to apply
medium – the assumed ARRUS medium
voltage – initial voltage [V]
- class gui4us.model.envs.arrus.Curve(points: Iterable[float], values: Iterable[float])
Bases:
objectTGC curve defintion.
- Parameters:
points – depth points [m]
values – curve values [dB]