results
tit.opt.ex.results ¶
Result persistence and visualization for TI exhaustive search.
Handles writing run metadata (JSON), per-montage CSV tables, and histogram / scatter-plot visualizations after an exhaustive search completes.
Public API¶
save_run_config
Serialize run parameters to a JSON file.
build_csv_rows
Convert the results dict into CSV-ready rows and metric arrays.
save_csv
Write final_output.csv.
generate_plots
Create histogram and scatter-plot PNGs.
process_and_save
Convenience wrapper that runs the full output pipeline.
See Also¶
tit.opt.ex.ex_search : Orchestrator that calls :func:process_and_save.
save_run_config ¶
Write run configuration metadata to JSON for reproducibility.
Parameters¶
config : ExConfig
Exhaustive-search configuration dataclass.
n_combinations : int
Total number of montage combinations evaluated.
output_dir : str
Directory where run_config.json will be written.
logger : logging.Logger
Logger instance for status messages.
Returns¶
str Path to the saved JSON file.
Source code in tit/opt/ex/results.py
build_csv_rows ¶
build_csv_rows(results: dict, roi_name: str) -> tuple[list[list], list[float], list[float], list[float], list[float]]
Build CSV rows and extract per-montage metric arrays.
Parameters¶
results : dict
Mapping of mesh filename to per-montage metric dict.
roi_name : str
ROI name prefix used to look up metric keys
(e.g. '{roi_name}_TImax_ROI').
Returns¶
rows : list of list
Rows suitable for csv.writer, including a header row.
timax_vals : list of float
TI-max values for each montage.
timean_vals : list of float
TI-mean values for each montage.
foc_vals : list of float
Focality values for each montage.
comp_vals : list of float
Composite index (timean * focality) for each montage.
Source code in tit/opt/ex/results.py
save_csv ¶
Write final_output.csv with one row per evaluated montage.
Parameters¶
results : dict Mapping of mesh filename to per-montage metric dict. roi_name : str ROI name prefix for metric key lookup. output_dir : str Directory where the CSV will be written. logger : logging.Logger Logger instance for status messages.
Returns¶
str Path to the saved CSV file.
Source code in tit/opt/ex/results.py
generate_plots ¶
generate_plots(results: dict, roi_name: str, output_dir: str, logger: Any, timax_vals: list[float], timean_vals: list[float], foc_vals: list[float]) -> list[str]
Generate histogram and scatter-plot PNGs for search results.
Parameters¶
results : dict Mapping of mesh filename to per-montage metric dict. roi_name : str ROI name prefix for metric key lookup. output_dir : str Directory where images will be saved. logger : logging.Logger Logger instance. timax_vals : list of float TI-max values across montages. timean_vals : list of float TI-mean values across montages. foc_vals : list of float Focality values across montages.
Returns¶
list of str Paths to the saved plot files.
Source code in tit/opt/ex/results.py
178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 | |
process_and_save ¶
Run the full post-search output pipeline (JSON + CSV + plots).
Parameters¶
results : dict Mapping of mesh filename to per-montage metric dict. config : ExConfig Exhaustive-search configuration. output_dir : str Root output directory for this search run. logger : logging.Logger Logger instance.
Returns¶
dict
Summary with keys 'config_json_path', 'csv_path',
'visualization_paths', and 'summary_stats'.