Configuration (sigima.config)#
The sigima.config module provides a way to manage configuration options for the
sigima library, as well as to handle translations and data paths, and other
configuration-related tasks.
It allows users to set and retrieve options that affect the behavior of the library, such as whether to keep results of computations or not. The options are handled as in-memory objects with default values provided, and can be temporarily overridden using a context manager.
Typical usage:
from sigima.config import options
# Get an option
value = options.fft_shift_enabled.get(default=True)
# Set an option
options.fft_shift_enabled.set(False)
# Temporarily override an option
with options.fft_shift_enabled.context(True):
...
The following table lists the available options:
Name |
Default Value |
Description |
|---|---|---|
|
|
If True, the FFT operations will apply a shift to the zero frequency component to the center of the spectrum. This is useful for visualizing frequency components in a more intuitive way. |
|
|
If True, convolution kernels will be automatically normalized to sum to 1.0 before convolution. This ensures that the output signal or image has the same overall magnitude as the input when using smoothing kernels. Set to False to preserve the mathematical properties of the original kernel. |
|
|
List of supported image I/O formats. Each format is a tuple of
The To add a new file format, you may use the |
|
|
Backend library for visualization (sigima.viz module). Valid values:
This setting can also be overridden using the |
Note
The options are stored in an environment variable in JSON format, allowing for
synchronization with external configurations or other processes that may need to
read or modify the options. The environment variable name is defined by
sigima.config.OptionsContainer.ENV_VAR. This is especially useful for
applications such as DataLab (where the sigima library is used as a core
component) as computations may be run in separate processes.