engine
tit.opt.ex.engine ¶
Single-class exhaustive search engine.
Replaces: runner.py (5 classes), roi_utils.py (4 functions). Direct SimNIBS usage — ROI metrics are computed inline.
ExSearchEngine ¶
ExSearchEngine(leadfield_hdf: str, roi_file: str | tuple[str, int] | list[str | tuple[str, int]], roi_name: str, logger: Logger)
Exhaustive TI electrode search engine.
Owns the full pipeline: leadfield loading, ROI resolution, simulation loop, and ROI CRUD.
Source code in tit/opt/ex/engine.py
initialize ¶
initialize(roi_radius: float = 3.0) -> None
Load leadfield, resolve the ROI (CSV/mask/atlas), find ROI + GM elements.
Source code in tit/opt/ex/engine.py
compute_ti_field ¶
compute_ti_field(e1_plus: str, e1_minus: str, current_ch1_mA: float, e2_plus: str, e2_minus: str, current_ch2_mA: float) -> dict[str, float]
Compute TI field for one montage and return ROI metrics.
Source code in tit/opt/ex/engine.py
run ¶
run(e1_plus: list[str], e1_minus: list[str], e2_plus: list[str], e2_minus: list[str], current_ratios: list[tuple[float, float]], all_combinations: bool, output_dir: str) -> dict[str, dict[str, float]]
Run the full simulation loop. Returns {mesh_key: metrics}.
Source code in tit/opt/ex/engine.py
253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 | |
get_available_rois
staticmethod
¶
List ROI CSV files for a subject.
Source code in tit/opt/ex/engine.py
create_roi
staticmethod
¶
Create an ROI CSV from coordinates.
Source code in tit/opt/ex/engine.py
delete_roi
staticmethod
¶
Delete an ROI file and remove from roi_list.txt.
Source code in tit/opt/ex/engine.py
get_roi_coordinates
staticmethod
¶
Read ROI center coordinates from CSV.