renderers¶
Renderer registry and render-config resolution for a dataset's JSON render block (visfem.models.RenderConfig).
RenderContext
dataclass
¶
RenderContext(
scene,
ctrl,
state,
ddir,
meta,
cfg,
xdmf_meta,
opacity,
palette,
cmap,
field=None,
step=0,
reset_camera=True,
)
Inputs for one renderer call, built per draw by the dispatch layer.
resolve_render_config
¶
Return a copy of meta.render whose renderer, and whose surface mesh_file, are inferred from ddir when unset.
resolve_mesh_file
¶
Return the surface filename in ddir that cfg selects, or None.
render_surface
¶
Render ctx's single solid-colour surface mesh and return the RenderResult.
render_region_id
¶
Render ctx's mesh coloured by the integer cell array cfg.region_array, with a per-region legend and the optional cfg.fiber overlay; return the RenderResult.
render_multi_part
¶
Render cfg.parts merged, categorically coloured and tubed per cfg.tube; return the RenderResult.
render_timeseries
¶
Render ctx's scalar-field time series at ctx.step from a flat VTK series (cfg.series, one file per step), an LS-DYNA database (cfg.database) or a PVD/XDMF manifest; return the RenderResult.
render_pvd_phase_series
¶
Render the region-coloured GRASP MRI phase surface at ctx.step for the patient dir ctx.ddir; return the RenderResult.
render_patient_organs
¶
Render the per-organ .vtk files (ircadb family) in the patient dir ctx.ddir; return the RenderResult.
render_scalar_field
¶
Render ctx's static mesh coloured by its field as a percentile-clamped ramp, or as discrete zones for cfg.categorical_fields; return the RenderResult.
dispatch_render
¶
Render ctx with the registry entry for cfg.renderer and return the RenderResult.
is_patient_renderer
¶
Return True when cfg.renderer draws on patient selection.
apply_result_to_state
¶
Write result's legend, mesh stats and scalar bar to Trame state.
populate_timeseries_state
¶
Populate the timeseries field and step state from ctx and return the default field.