scene
tit.analyzer.scene ¶
The one scene an analysis leaves behind: the field masked to its ROI.
An analysis folder is data plus exactly one scene.tetravox.json::
results.csv, analysis.json the numbers
roi_overlay.nii.gz voxel: the field, zero outside the ROI
roi_overlay.msh (+ .msh.opt) mesh: the surface with ``<field>_ROI`` node data
scene.tetravox.json this: the overlay over the anatomy, cursor on the ROI
The scene is a few kilobytes and points at the overlay the analysis wrote anyway -- it copies nothing and rasterises nothing. The overlay is the dataset because it is the analysis's own product: a picture drawn from a different file than the table came from would be a picture that could contradict it.
Voxel: the subject's T1 under the overlay, inferno scaled from the field's
display floor to its p99.9 inside the ROI (never the max: the max is one voxel),
zeros hidden so nothing but the ROI is painted. Mesh: the whole cortex once,
translucent and unpickable, and once more coloured by <field>_ROI with every
node outside the ROI (exactly 0) hidden -- so what shows is the ROI's field
inside a see-through cortex, which transparency: peel renders in order. A
bare .msh open cannot carry that intent (Tetravox ignores View[n].Visible
on open), which is why it travels in the scene.
Framing reuses :mod:tit.figures.roi_plate -- the cursor lands on the ROI's
centroid, snapped into it, and the zoom fills the panel -- and the file is
assembled by the same function the ROI scene uses, so both look alike. Like
every artefact a person looks at, this never fails a job: a failure is one log
line.
write_voxel_scene ¶
write_voxel_scene(*, out_dir: str, anatomy: str, overlay: str, roi_mask, affine, roi_values, field_name: str, region_name: str, meta: dict) -> str | None
The scene for a voxel analysis: T1 plus roi_overlay.nii.gz.
roi_mask/affine/roi_values are the analysis's own, so the cursor
is placed on the voxels the table was computed from and the window is read
off the same numbers.
Source code in tit/analyzer/scene.py
write_mesh_scene ¶
write_mesh_scene(*, out_dir: str, mesh: str, roi_coords, node_coords, roi_values, field_name: str, region_name: str, meta: dict, normal_max: float | None = None) -> str | None
The scene for a mesh analysis: roi_overlay.msh twice over.
roi_coords are the ROI's node coordinates (the cursor), node_coords
every node's (the camera fit), roi_values the field at the ROI's nodes.
normal_max (the ROI's largest positive TI_normal) adds a hidden
third layer for the TI_normal_ROI node data the overlay carries.
Source code in tit/analyzer/scene.py
152 153 154 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 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 | |