.. THIS FILE WAS AUTOGENERATED USING docs/source/parameters_doc.py. DO NOT EDIT MANUALLY. .. _config: Config ====== This page documents the ``zea`` configuration system. Configs are YAML files that control data loading, preprocessing, model settings, and scan parameters. .. note:: Configs are used to initialize :doc:`zea.Models ` and the :doc:`pipeline`. For the data format and file I/O, see :doc:`data-acquisition`. Configs are written in YAML format and can be loaded, edited, and saved using the ``zea`` API. ------------------------------- How to Load and Save a Config ------------------------------- Here is a minimal example of how to load and save a config file using zea: .. doctest:: >>> from zea import Config >>> from zea.config import check_config >>> # Load a config from file >>> config = Config.from_path("../configs/config_picmus_rf.yaml") >>> # or some predefined from Hugging Face Hub >>> config = Config.from_path("hf://zeahub/configs/config_picmus_rf.yaml") >>> # We can check if the config has valid parameters (zea compliance) >>> config = check_config(config) >>> # Access or change parameters >>> config.scan.sampling_frequency = 8e6 >>> print(config.scan.sampling_frequency) 8000000.0 >>> # Save the config back to file >>> config.to_yaml("my_new_config.yaml") .. testcleanup:: import os os.remove("my_new_config.yaml") ------------------------------- Parameter List ------------------------------- Below is a hierarchical list of all configuration parameters, grouped by section. Descriptions are shown for each parameter. .. contents:: :local: :depth: 2 ------------------------------- Parameters Reference ------------------------------- .. list-table:: :header-rows: 1 :widths: 20 80 * - **Parameter** - **Description** * - ``data`` - The data section contains the parameters for the data. * - ``data.apodization`` - The receive apodization to use. * - ``data.dataset_folder`` - The path of the folder to load data files from (relative to the user data root as set in users.yaml) * - ``data.dtype`` - The form of data to load (raw_data, rf_data, iq_data, beamformed_data, envelope_data, image, image_sc) * - ``data.dynamic_range`` - The dynamic range for showing data in db [min, max] * - ``data.file_path`` - The path of the file to load when running the UI (either an absolute path or one relative to the dataset folder) * - ``data.frame_no`` - The frame number to load when running the UI (null, int, 'all') * - ``data.input_range`` - The range of the input data in db (null, [min, max]) * - ``data.local`` - true: use local data on this device, false: use data from NAS * - ``data.output_range`` - The output range to which the data should be mapped (e.g. [0, 1]). * - ``data.resolution`` - The spatial resolution of the data in meters per pixel (float, optional). * - ``data.to_dtype`` - The type of data to convert to (raw_data, aligned_data, beamformed_data, envelope_data, image, image_sc) * - ``data.user`` - The user to use when loading data (null, dict) * - ``device`` - The device to run on ('cpu', 'gpu:0', 'gpu:1', ...) * - ``git`` - The git commit hash or branch for reproducibility (string, optional). * - ``hide_devices`` - List of device indices to hide from selection (list of int, optional). * - ``pipeline`` - This section contains the necessary parameters for building the pipeline. * - ``pipeline.jit_kwargs`` - Additional keyword arguments for the JIT compiler. Defaults to None. * - ``pipeline.jit_options`` - The JIT options to use. Must be 'pipeline', 'ops', or None. 'pipeline' compiles the entire pipeline as a single function. 'ops' compiles each operation separately. None disables JIT compilation. Defaults to 'ops'. * - ``pipeline.name`` - The name of the pipeline. Defaults to 'pipeline'. * - ``pipeline.operations`` - The operations to perform on the data. This is a list of dictionaries, where each dictionary contains the parameters for a single operation. * - ``pipeline.validate`` - Whether to validate the pipeline. Defaults to True. * - ``pipeline.with_batch_dim`` - Whether operations should expect a batch dimension in the input. Defaults to True. * - ``plot`` - Settings pertaining to plotting when running the UI (`zea --config `) * - ``plot.fliplr`` - Set to true to flip the image left to right * - ``plot.fps`` - Frames per second for video output. * - ``plot.headless`` - Set to true to run the UI in headless mode * - ``plot.image_extension`` - The file extension to use when saving the image (png, jpg) * - ``plot.plot_lib`` - The plotting library to use (opencv, matplotlib) * - ``plot.save`` - Set to true to save the plots to disk, false to only display them in the UI * - ``plot.selector`` - Type of selector to use for ROI selection in the UI ('rectangle', 'lasso', or None). * - ``plot.selector_metric`` - Metric to use for evaluating selected regions (e.g., 'gcnr'). * - ``plot.tag`` - The name for the plot * - ``plot.video_extension`` - The file extension to use when saving the video (mp4, gif) * - ``scan`` - The scan section contains the parameters pertaining to the reconstruction. * - ``scan.apply_lens_correction`` - Set to true to apply lens correction in the time-of-flight calculation * - ``scan.center_frequency`` - The center frequency of the transmit pulse in Hz * - ``scan.demodulation_frequency`` - The demodulation frequency of the data in Hz. This is the assumed center frequency of the transmit waveform used to demodulate the rf data to iq data. * - ``scan.f_number`` - The receive f-number for apodization. Set to zero to disable masking. The f-number is the ratio between the distance from the transducer and the size of the aperture. * - ``scan.fill_value`` - Value to fill the image with outside the defined region (float, default 0.0). * - ``scan.grid_size_x`` - The number of pixels in the beamforming grid in the x-direction * - ``scan.grid_size_z`` - The number of pixels in the beamforming grid in the z-direction * - ``scan.lens_sound_speed`` - The speed of sound in the lens in m/s. Usually around 1000 m/s * - ``scan.lens_thickness`` - The thickness of the lens in meters * - ``scan.n_ax`` - The number of samples in a receive recording per channel. * - ``scan.n_ch`` - The number of channels in the raw data (1 for rf data, 2 for iq data) * - ``scan.phi_range`` - The range of phi values in radians for 3D scan conversion (null, [min, max]). * - ``scan.resolution`` - The resolution for scan conversion in meters per pixel (float, optional). * - ``scan.rho_range`` - The range of rho values in meters for scan conversion (null, [min, max]). * - ``scan.sampling_frequency`` - The sampling frequency of the data in Hz * - ``scan.selected_transmits`` - The number of transmits in a frame. Can be 'all' for all transmits, an integer for a specific number of transmits selected evenly from the transmits in the frame, or a list of integers for specific transmits to select from the frame. * - ``scan.theta_range`` - The range of theta values in radians for scan conversion (null, [min, max]). * - ``scan.xlims`` - The limits of the x-axis in the scan in meters (null, [min, max]) * - ``scan.ylims`` - The limits of the y-axis in the scan in meters (null, [min, max]) * - ``scan.zlims`` - The limits of the z-axis in the scan in meters (null, [min, max])