visualizer
tit.analyzer.visualizer ¶
Stateless visualization helpers for the analyzer pipeline.
Four module-level functions that write output artifacts (mesh overlays, NIfTI overlays, histograms, CSV) without any shared mutable state.
save_mesh_roi_overlay ¶
save_mesh_roi_overlay(surface_mesh_path: Path, field_values: ndarray, roi_mask: ndarray, field_name: str, region_name: str, output_dir: Path, normal_mesh_path: Path | None = None) -> Path
Write .msh + .msh.opt overlay with ROI field highlighted.
Loads a fresh surface mesh copy, zeros everything outside the ROI, and writes both the mesh and a Gmsh options file for colour-map / range / transparency. When normal_mesh_path is given the TI_normal field is added as a second (initially hidden) view.
Source code in tit/analyzer/visualizer.py
save_nifti_roi_overlay ¶
save_nifti_roi_overlay(field_data: ndarray, roi_mask: ndarray, region_name: str, output_dir: Path, affine: ndarray) -> Path
Write NIfTI overlay with field values only inside ROI.
Source code in tit/analyzer/visualizer.py
save_histogram ¶
save_histogram(whole_head_values: ndarray, roi_values: ndarray, output_dir: Path, region_name: str, whole_head_weights: ndarray | None = None, roi_weights: ndarray | None = None, roi_mean: float | None = None) -> Path | None
Generate focality histogram PDF.
Delegates to :pyfunc:tit.plotting.focality.plot_whole_head_roi_histogram.
Returns the PDF path or None if the plotter declines (empty data).
Source code in tit/analyzer/visualizer.py
save_results_csv ¶
Write analysis result dict to a two-column CSV (Metric, Value).
Entries whose value is None are silently skipped.