figures
tit.figures ¶
Artefacts TI-Toolbox leaves behind without being asked.
Today that is one thing: the ROI scene (:mod:tit.figures.roi_plate) — one
small roi.tetravox.json per target, written by every optimizer run, so a
person can open the voxels the search is about before trusting a number about
them. An analysis instead writes one scene.tetravox.json of its field
masked to the ROI (:mod:tit.analyzer.scene), built on the same helpers. A
scene references files that already exist and draws nothing itself; the
optional PNG is made on the host by Tetravox (desktop/src/main/roiPlates.ts).
plan_framing ¶
plan_framing(mask, affine, *, names=None, spheres=None, span_limit_mm: float = SPAN_LIMIT_MM) -> FramingPlan
Decide the cursor and the zoom for mask (a 3-D array in a RAS grid).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mask
|
integer array. Non-zero is in the ROI. Distinct positive values are treated as distinct regions; a binary mask is split into connected components instead. |
required | |
affine
|
the array's voxel-to-world (RAS, millimetres) affine. |
required | |
names
|
optional |
None
|
|
spheres
|
optional |
None
|
|
span_limit_mm
|
float
|
above this union span the plate gets one row per region. |
SPAN_LIMIT_MM
|
Returns:
| Name | Type | Description |
|---|---|---|
A |
FramingPlan
|
class: |
Source code in tit/figures/roi_plate.py
337 338 339 340 341 342 343 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 | |
plan_surface ¶
plan_surface(groups, *, names=None, span_limit_mm: float = SPAN_LIMIT_MM) -> FramingPlan
The same framing for a cortical target, from its surface vertices.
groups is one (N, 3) array of world-millimetre vertices per region --
the labelled vertices of the hemisphere's central surface. A cortical target
is a set of vertices, not voxels, and this is what lets the scene reference
the .annot itself instead of a rasterisation of it: nothing is written to
get a cursor.
Half a millimetre of half-extent per vertex, because a vertex is a point and a zero-span bounding box would make the zoom infinite.
Source code in tit/figures/roi_plate.py
write_roi_scene ¶
write_roi_scene(*, out_dir: str, anatomy: str, roi_layers: list[dict], plan: FramingPlan, meta: dict, title: str = '') -> dict | None
Write one ROI scene and announce it. Never raises.
Returns the meta block as written, or None when the scene was
switched off or could not be written -- a job must not fail over an artefact
a person looks at.