ex
tit.opt.ex ¶
TI Exhaustive Search Module.
ExConfig
dataclass
¶
ExConfig(subject_id: str, project_dir: str, leadfield_hdf: str, roi_name: str, electrodes: BucketElectrodes | PoolElectrodes, total_current: float = 2.0, current_step: float = 0.5, channel_limit: float | None = None, roi_radius: float = 3.0, run_name: str | None = None)
Full configuration for exhaustive search optimization.
BucketElectrodes
dataclass
¶
Separate electrode lists for each bipolar channel position.
ExResult
dataclass
¶
ExResult(success: bool, output_dir: str, n_combinations: int, results_csv: str | None = None, config_json: str | None = None)
Result from an exhaustive search run.
ExSearchEngine ¶
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, parse ROI CSV, find ROI + GM elements.
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
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 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 | |
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.
Source code in tit/opt/ex/engine.py
run_ex_search ¶
Run exhaustive search from a typed config object.