Reporting & Visualization¶
TI-Toolbox writes one self-contained HTML report per pipeline run. There are five kinds:
SimNIBS's own charm report (copied from m2m_<id>/charm_report.html when charm finishes), and
DTI QC, simulator, flex-search and ex-search reports, which the pipelines write themselves when
they finish. There is no report object to build by hand: each generator reads what its run wrote,
and rebuilds a report from the command line (inside the container):
simnibs_python -m tit.reporting.generators.dti_qc /mnt/project 001 [--out DIR]
simnibs_python -m tit.reporting.generators.simulation /mnt/project 001 motor_cortex [--out DIR]
simnibs_python -m tit.reporting.generators.flex_search /mnt/project 001 <run folder> [--out DIR]
simnibs_python -m tit.reporting.generators.ex_search /mnt/project 001 <run name> [--out DIR]
or from Python:
from tit.reporting.generators.simulation import create_simulation_report
path = create_simulation_report("/mnt/project", "001", "motor_cortex")
A simulator report opens with the grey-matter envelope (99.9th percentile, median and where its
maximum is), the montage on the EEG cap with its dose, the conductivity model and the envelope in
three planes through the hot spot. Only the DTI QC report has checks; each shows its role (gate,
software check, advisory, reported) and citation, and the rules are in
tit.reporting.qc_rules.RULES.
Plotting Utilities¶
The tit.plotting module provides visualization functions used by the analysis and reporting pipelines:
from tit.analyzer.visualizer import save_histogram
from tit.plotting import (
plot_permutation_null_distribution,
plot_cluster_size_mass_correlation,
plot_montage_distributions,
plot_intensity_vs_focality,
)
Plotting Context
Most plotting functions are called internally by the Analyzer and report generators. You typically do not need to call them directly unless building custom visualizations.
Output Location¶
Reports are saved under the BIDS derivatives tree:
derivatives/ti-toolbox/reports/sub-001/
├── charm_report.html
├── dti_qc_20250101_120000.html
├── simulation_report_20250101_120000.html
├── flex_search_report_20250101_120000.html
└── ex_search_report_20250101_120000.html
API Reference¶
tit.reporting.generators.simulation.create_simulation_report ¶
create_simulation_report(project_dir: str | Path, subject_id: str, simulation_name: str, out_dir: str | Path | None = None) -> Path
Write the report for one simulation folder; into the project's reports unless out_dir.
Source code in tit/reporting/generators/simulation.py
tit.reporting.generators.flex_search.create_flex_search_report ¶
create_flex_search_report(project_dir: str | Path, subject_id: str, run_dir: str | Path, out_dir: str | Path | None = None) -> Path
Write the report for one flex-search run folder; into the project's reports unless out_dir.
Source code in tit/reporting/generators/flex_search.py
tit.reporting.generators.ex_search.create_ex_search_report ¶
create_ex_search_report(project_dir: str | Path, subject_id: str, run_dir: str | Path, out_dir: str | Path | None = None) -> Path
Write the report for one ex-search run folder; into the project's reports unless out_dir.
Source code in tit/reporting/generators/ex_search.py
tit.reporting.generators.dti_qc.create_dti_qc_report ¶
create_dti_qc_report(project_dir: str | Path, subject_id: str, qc: dict, vols, out_dir: str | Path | None = None) -> Path
Render the images from vols (:class:~tit.pre.qsi.dti_advisories.DtiVolumes) and write the report.
Written to derivatives/ti-toolbox/reports/sub-<id>/dti_qc_<timestamp>.html unless out_dir
is given. Works for a failed gate too: vols holds the tensor that was computed but not written.