constants
tit.constants ¶
Project-wide constants for TI-Toolbox.
Centralises all hard-coded values, magic numbers, and configuration defaults used across the TI-Toolbox codebase. Constants are grouped by domain:
Sections¶
Directory Names
BIDS-compliant directory structure names (DIR_*).
File Names and Extensions
Configuration and NIfTI filenames (FILE_*) and EXT_CSV.
Subject and Naming Patterns
BIDS prefixes (PREFIX_*).
Environment Variables
Expected os.environ keys (ENV_*).
Docker and Mount Paths
Container-specific path constants.
Analysis Constants
Field names (FIELD_*), the output-field registry and the fsaverage
node counts.
Simulation Constants
Electrode-pair counts and brain tissue tags.
Numerical Constants
White-matter conductivity (S/m) for the DTI advisories.
QSI Integration
QSIPrep / QSIRecon Docker images, recon specs, atlases, and resource
defaults.
Telemetry Constants
GA4 Measurement Protocol settings and operation event names.
See Also¶
tit.paths : Uses many of these constants for BIDS path resolution.
FieldSpec
dataclass
¶
Metadata for one output field quantity (mesh/NIfTI field name).
Attributes¶
name : str
Exact on-disk / in-mesh field name (matches a FIELD_* constant).
label : str
Display name, X_{sub} for a subscript (TI_{max}, HF_{rms}): the desktop
app, the TetraVox scene and the docs render the braces as a subscript. Values, IDs
and file names always use name.
kind : str
FIELD_KIND_FUNCTIONAL or FIELD_KIND_SAFETY.
units : str
Physical units of the field values.
description : str
One-line tooltip text.
get_field_names ¶
Return registered field names in registry order.
Parameters¶
kind : str, optional
If given, restrict to FIELD_KIND_FUNCTIONAL or FIELD_KIND_SAFETY.
Source code in tit/constants.py
get_field_spec ¶
Look up a :class:FieldSpec by its exact field name.
Raises¶
KeyError
If name is not in :data:FIELD_REGISTRY.
Source code in tit/constants.py
is_valid_pair_count ¶
Is n an allowed electrode-pair (channel) count?
True for even counts of at least MIN_ELECTRODE_PAIRS: 2, 4, 6, 8, …
Odd counts leave a channel with nothing to beat against, and a single
pair is tACS, not TI.