Skip to content

Commit

Permalink
Added visualisation for Friedman
Browse files Browse the repository at this point in the history
  • Loading branch information
thompson318 committed Jan 18, 2022
1 parent 90ed349 commit a27bbbe
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
3 changes: 2 additions & 1 deletion glenoidplanefitting/ui/glenoidplanefitting_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def run_demo(model_file_name, planes="", fried_points="", vault_points="",
plane_size = configuration.get('plane size' , 200.0)
vary_plane_colour = configuration.get('vary plane colour', True)
point_size = configuration.get('point size', 3.0)
line_width = configuration.get('line width', 5)

model = VTKSurfaceModel(model_file_name, model_colour)
version = None
Expand Down Expand Up @@ -111,7 +112,7 @@ def run_demo(model_file_name, planes="", fried_points="", vault_points="",
posterior_glenoid)
if visualise:
vis_fried(model, anterior_glenoid, posterior_glenoid,
glenoid_centre, result)
glenoid_centre, result, line_width = line_width)


if vault_points !="":
Expand Down
17 changes: 14 additions & 3 deletions glenoidplanefitting/widgets/visualisation.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ def vis_planes(bone, planes, points1 = [], points2 = [],

render_window_common(renderer, "Fitted Planes")

def vis_fried(bone, cross1, cross2, glenoid1, result, resolution = 1, plane_size = 200.0):
def vis_fried(bone, cross1, cross2, glenoid1, result, resolution = 1, plane_size = 200.0,
line_width = 5):
"""
Visualise the lines resulting from the friedman
method.
Expand All @@ -114,10 +115,20 @@ def vis_fried(bone, cross1, cross2, glenoid1, result, resolution = 1, plane_size
renderer = renderer_common(bone)

glenoid_line = make_friedman_model(cross1,cross2)
add_vtk_source(renderer, glenoid_line, linewidth = 10 )
colour = bang_list()[0]
add_vtk_source(renderer, glenoid_line, linewidth = line_width, colour = colour )

sphere_source = make_sphere_model(cross1)
add_vtk_source(renderer, sphere_source, colour = colour)
sphere_source = make_sphere_model(cross2)
add_vtk_source(renderer, sphere_source, colour = colour)

colour = bang_list()[1]
sphere_source = make_sphere_model(glenoid1)
add_vtk_source(renderer, sphere_source, colour = colour)

friedman_line = make_friedman_model(glenoid1,result)
add_vtk_source(renderer, friedman_line)
add_vtk_source(renderer, friedman_line, linewidth = line_width, colour = colour)

render_window_common(renderer, "Friedman Lines")

Expand Down
3 changes: 2 additions & 1 deletion vis_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"plane resolution" : 1,
"plane size" : 200.0,
"vary plane colour" : true,
"point size" : 3.0
"point size" : 3.0,
"line width" : 4
}

0 comments on commit a27bbbe

Please sign in to comment.