tomosipo.svg module

SVG support for tomosipo

class tomosipo.svg.LineItem(pos, width, color)

Bases: tuple

color

Alias for field number 2

pos

Alias for field number 0

width

Alias for field number 1

class tomosipo.svg.SVG(svg_str, height=200, width=320)[source]

Bases: object

save(path)[source]

Save svg to disk

tomosipo.svg.default_camera(height, width, angle=0.37037037037037035)[source]
tomosipo.svg.line_item(pos, width=1, color=(0.0, 0.0, 0.0, 1.0))[source]

Create a line item

Parameters:
  • pos – (N,3) array of floats specifying point locations.

  • width – width of the line in UNITS TODO

  • color – tuple of floats in [0.0-1.0] specifying a single color for the entire item in rgba format.

Returns:

a LineItem

Return type:

LineItem

tomosipo.svg.pg_to_line_items(pg, i)[source]
tomosipo.svg.project_lines(camera, line_items)[source]
tomosipo.svg.project_pos(camera, pos)[source]
tomosipo.svg.svg(*geoms, height=200, width=320, duration=3, camera=None, show_axes=True)[source]
tomosipo.svg.text_svg_animation(line_items, duration=10, height=100, width=100)[source]
tomosipo.svg.text_svg_frame(line_items, frame_begin, frame_end, total_duration, height=100, width=100)[source]
tomosipo.svg.to_line_items(g, i)[source]
tomosipo.svg.to_line_items(vg: VolumeVectorGeometry, i)
tomosipo.svg.to_line_items(g: VolumeGeometry, i)
tomosipo.svg.to_line_items(pg: ProjectionGeometry, i)
tomosipo.svg.vol_to_line_items(g, i)[source]
tomosipo.svg.vol_vec_to_line_items(vg, i)[source]