ti_metrics
tit.plotting.ti_metrics ¶
Simple TI-Toolbox metric visualizations (matplotlib).
Centralizes plots that were previously implemented in optimizer/analyzer modules.
plot_montage_distributions ¶
plot_montage_distributions(*, timax_values: Sequence[float], timean_values: Sequence[float], focality_values: Sequence[float], output_file: str, dpi: int = 300) -> str | None
Create 3 side-by-side histograms for TImax, TImean and Focality distributions.
Source code in tit/plotting/ti_metrics.py
plot_intensity_vs_focality ¶
plot_intensity_vs_focality(*, intensity: Sequence[float], focality: Sequence[float], composite: Sequence[float] | None, output_file: str, dpi: int = 300) -> str | None
Scatter plot of intensity vs focality, optionally colored by composite index.
Source code in tit/plotting/ti_metrics.py
plot_montage_score_map ¶
plot_montage_score_map(*, eeg_positions_csv: str, montage_scores: Sequence[dict], output_file: str, top_n: int = 50, dpi: int = 300, metric_key: str = 'composite', metric_label: str = 'Composite Index (TImean_ROI x Focality)', title_metric: str = 'Composite Score', cmap_name: str | tuple[str, str] = 'cividis', title_prefix: str = 'Ex-Search') -> str | None
Draw the top-top_n montages as electrode-pair curves on the EEG layout.
Every montage_scores record needs electrodes (4 or 8 labels as
consecutive pairs; the legacy e1_plus..e2_minus keys are also
accepted) and the requested metric_key. Curves are coloured by the
metric; the best montage's electrodes are highlighted and labelled.
Source code in tit/plotting/ti_metrics.py
248 249 250 251 252 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 332 333 334 335 336 337 338 339 340 341 | |
plot_electrode_score_heatmap ¶
plot_electrode_score_heatmap(*, eeg_positions_csv: str, montage_scores: Sequence[dict], output_file: str, top_n: int = 50, dpi: int = 300, title_prefix: str = 'Ex-Search') -> str | None
Plot electrode participation in the top-top_n montages.
Each electrode receives the sum of the composite index of the top montages it appears in (colour) and its frequency (marker size); the 12 highest-scoring electrodes are labelled.
Source code in tit/plotting/ti_metrics.py
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 | |