Creating configuration files¶
PyJAMAS uses configuration files to save settings for options under the Options menu, including key bindings. Configuration files can be created and modified in PyJAMAS, or using a text editor.
Option 1: create a config file in PyJAMAS
Edit any options you wish to be set through the Options menu.
Select Save config … in the I/O menu.
Give the config a name. Note: for the config to be loaded on startup it needs to be saved in the PyJAMAS directory as “config.toml”. It is not recommended to name the file “default_config.toml” as that will overwrite the default file.
Config files that are not named “config.toml” or that are in other directories can be loaded after startup by selecting Load config … from the I/O menu. Only one config file can be loaded at a time.
Option 2: create a config file using a text editor
Configuration files are saved using the TOML format, making them accessible through standard text editors.
Open a config file in a text editor (e.g. the default config file “default_config.toml”).
Locate the option you wish to change. In the config file, general options are located under the “[options]” heading, while key bindings are located under the “[key bindings]” heading. Each option is represented as a “key = value” pair where the key is the name of the option and the value is what that option is set to. It is important that the headings and keys are not changed, or PyJAMAS will not be able to find all values when loading a config.
Edit the value of the option you wish to change to your desired value. Formatting must match the TOML format. A few common example formats are outlined here. Note: PyJAMAS does not check if the values in a loaded config file make sense, so you may encounter unexpected errors if you set unreasonable values, e.g. by changing the type of a value from a number to text.
Common TOML value formats
Boolean values: can be either true or false (no quotation marks, no uppercase). (e.g. display_fiducial_ids = false)
Numbers: a single number without quotation marks. Integers should have no decimal, while floats should always have a decimal, even if followed by a zero. (e.g. livewire_gaussian_sigma = 5.0)
Text: the text, surrounded by double quotation marks. Case-sensitive. (e.g. cwd = “/user/home/PyJAMAS”)
Key bindings: key bindings are a special case of text which follow the PyQt6 QKeySequence naming convention. Keys are represented by case-sensitive names and can be modified by preceding them with the name of a modifier key (e.g. “Shift”, “Ctrl”, “Alt”) separated by a “+”. (e.g. load_annotations = “Shift+L”)
Save the config file. It is not recommended to overwrite the default config file. Instead, the config file should be saved with a new name. Note: for the config to be loaded on startup it needs to be saved in the PyJAMAS directory as “config.toml”.
Load the config file by restarting PyJAMAS (if the config file is named config.toml and is located in the PyJAMAS directory) or by selecting Load config … from the I/O menu.