common
tit.reporting.generators.common ¶
What the simulator, flex-search and ex-search reports share: the montage on the EEG cap, the ROI's name and writing the file.
The cap figure is the app's own overlay (:func:tit.tools.montage_visualizer.visualize_montage,
the image a simulation writes to montage_imgs/), converted to WebP; nothing here draws a head.
per_channel ¶
"1" when every channel carries the same current, else "0.7 / 1.3" (mA).
electrode_name ¶
An electrode as the reports name it: its cap label, or its position (subject-space mm,
rounded to the millimetre) as "(74, -19, 39)" for a flex-free or free-hand montage.
Source code in tit/reporting/generators/common.py
polar_pair ¶
"F7(+)–P7(−)": tit.sim gives a channel's first electrode +I and its second −I
(tdcs.currents = [I, -I]), so a negative current swaps the signs.
Source code in tit/reporting/generators/common.py
and_list ¶
number_word ¶
"four" for 4: numbers under ten as words, larger ones as digits.
Source code in tit/reporting/generators/common.py
channel_electrodes ¶
"E1+ AF3 · E1- PO10" for channel index 0: channel k is electrodes Ek+ and Ek-, the one
naming the app and every report use (never "A"/"B").
Source code in tit/reporting/generators/common.py
channel_rows ¶
("Channel 1 (blue)", "E1+ AF3 · E1- PO10, 1 mA") per channel, named and coloured as the
cap image's legend names them.
Source code in tit/reporting/generators/common.py
cap_figure ¶
cap_figure(num: int, pairs: list[list[str]], eeg_net: str, currents_mA: list[float], caption: str = '') -> str
The montage on the app's EEG-cap overlay, beside the channel list; the list alone when the net has no cap template.
Source code in tit/reporting/generators/common.py
roi_summary ¶
The target as the run's ROI confirmation recorded it (roi.tetravox.json), with label
names from the atlas's lookup table: {name, atlas, volume_mm3, centroid, gm_overlap}.
Source code in tit/reporting/generators/common.py
write_report ¶
write_report(html: str, project_dir: str | Path, subject_id: str, prefix: str, budget: int, out_dir: str | Path | None = None, t0: float | None = None, label: str = 'Report') -> Path
Write <reports>/sub-<id>/<prefix>_<timestamp>.html (or into out_dir), log its size and
time, and record it as a report artifact of the running job (a no-op outside a job).
One file per run: when the second's name is taken (two ex-search jobs for one subject
finishing together), the next free second is used, so the name keeps the
<prefix>_<YYYYMMDD>_<HHMMSS> grammar :func:tit.catalog.reports parses. The file is
created exclusively, so an existing report is never overwritten, and a write that fails
removes its partial file before the error propagates.