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 filenames (FILE_*), NIfTI filenames, and common
extensions (EXT_*).
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_*), default percentiles, and focality cutoffs.
Simulation Constants
Simulation types (SIM_TYPE_*), modes, electrode shapes, and default
electrode parameters.
Atlas Names
Cortical (ATLAS_DK40, ATLAS_A2009S) and subcortical atlas
identifiers.
Logging Constants
Log levels (LOG_LEVEL_*) and format strings (LOG_FORMAT_*).
Numerical Constants
Floating-point tolerances and tissue conductivities (S/m) with
literature references.
Tissue Conductivity Table
TISSUE_PROPERTIES lookup list mapping SimNIBS tissue tag numbers
to names, conductivities, and references.
GUI Constants
Window dimensions, tab names, and console buffer sizes.
QSI Integration
QSIPrep / QSIRecon Docker images, recon specs, atlases, and resource
defaults.
Validation Bounds
Min/max ranges for frontend and API input validation.
Default Parameters
DEFAULT_ELECTRODE, DEFAULT_OPTIMIZATION,
DEFAULT_STATISTICS dictionaries.
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
Short label for UI widgets (checkboxes, combo boxes).
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_fields_by_kind ¶
output_fields_help_text ¶
output_fields_help_text() -> str
Compose the output-field help popup text.
States each field's definition, equation and reference. Deliberately does not group the fields into "functional" and "safety" -- which of them bear on efficacy and which on exposure is still debated, so the popup gives the definitions and leaves the interpretation to the reader.
Source code in tit/constants.py
get_selectable_output_field_specs ¶
Return :class:FieldSpec entries for the four selectable output fields.
Order matches :data:SELECTABLE_OUTPUT_FIELDS (registry order). Used by
the GUI to build output-field checkboxes without hardcoding labels.