Commit c3d920f1 authored by Stephen Thompson's avatar Stephen Thompson

Issue #4 model to world works now

parent 36d3cc96
reference_to_model.txt.no_rot
\ No newline at end of file
0.0000000 -0.9396926 -0.3420201 75.0000000
-0.9986295 0.0179000 -0.0491797 60.0000000
0.0523360 0.3415514 -0.9384048 -100.0000000
0.0000000 0.0000000 0.0000000 1.0000000
0.0000000 -0.9396926 -0.3420201 75.0000000
-0.9986295 0.0179000 -0.0491797 60.0000000
0.0523360 0.3415514 -0.9384048 -100.0000000
0.0000000 0.0000000 0.0000000 1.0000000
1.0 0.0 0.0 0.0
0.0 1.0 0.0 0.0
0.0 0.0 1.0 0.0
0.0000000 0.0000000 0.0000000 1.0000000
1.000000 0.0 -0.0 75.0000000
-0.0 1.0 -0.0 60.0000000
0.0 0.0 1.0 -100.0000000
0.0000000 0.0000000 0.0000000 1.0000000
......@@ -14,6 +14,7 @@ from sksurgerycore.configuration.configuration_manager import \
from sksurgerycore.transforms.transform_manager import TransformManager
from sksurgeryvtk.models.vtk_sphere_model import VTKSphereModel
from sksurgeryvtk.utils.matrix_utils import create_vtk_matrix_from_numpy
class OverlayApp(OverlayBaseApp):
"""Inherits from OverlayBaseApp, and adds methods to
......@@ -241,7 +242,21 @@ def run_demo(config_file):
# to render and optionally a colours.txt defining the
# colours to render in.
model_dir = models_path
#here we want to move the models so they're in reference coords
viewer.add_vtk_models_from_dir(model_dir)
matrix=create_vtk_matrix_from_numpy(reference2model)
for actor in viewer.vtk_overlay_window.foreground_renderer.GetActors():
actor.SetUserMatrix(matrix);
#print (actor)
#vtk_matrix = mu.create_vtk_matrix_from_numpy(matrix)
# names = self.get_surface_model_names()
# for name in names:
# model = self.surface_model_loader.get_surface_model(name)
# model.actor.SetUserMatrix(vtk_matrix)
#here we add some spheres to represent the ref grid
spheres=VTKSphereModel(ref_data[:,1:4],radius=5.0)
viewer.vtk_overlay_window.add_vtk_actor(spheres.actor)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment