Skip to content
Snippets Groups Projects
Commit 16c38a31 authored by Joshua Steer's avatar Joshua Steer
Browse files

Use Modified function on the vtk points so the vtk renderer updates

parent 3a85bbc2
No related branches found
No related tags found
No related merge requests found
......@@ -81,8 +81,9 @@ class AmpScanGUI(QMainWindow):
def analyse(self):
#self.RegObj.plot_slices()
self.AmpObj.rotate([50, 50, 10], ang='deg')
self.vtkWidget.render()
self.AmpObj.vert[:, 0] *= 2
self.AmpObj.actor.points.Modified()
#self.renWin.renderActors([self.AmpObj.actor,])
#self.AmpObj.vert[0,0] = 1
#self.AmpObj._v = numpy_support.numpy_to_vtk(self.AmpObj.vert)
......
......@@ -237,7 +237,8 @@ class visMixin(object):
self.actor.setVert(self.vert)
self.actor.setFaces(self.faces)
#self.actor.setNorm()
if self.values is not None:
# Test if values array is non-zero
if self.values.any():
self.actor.setValues(self.values)
self.actor.setCMap(CMap, bands)
self.actor.setScalarRange(sRange)
......
......@@ -46,7 +46,6 @@ class AmpObject(trimMixin, smoothMixin, analyseMixin,
def __init__(self, data=None, stype='limb'):
self.stype = stype
self.values = None
self.createCMap()
if isinstance(data, str):
if stype is 'FE':
......@@ -109,6 +108,7 @@ class AmpObject(trimMixin, smoothMixin, analyseMixin,
self.faces = faces
self.vert = vert
self.norm = norm
self.values = np.zeros([len(self.vert)])
# Call function to unify vertices of the array
if unify is True:
self.unifyVert()
......
......@@ -106,7 +106,7 @@ def registration(baseline, target, method='default', steps=5, direct=True):
values = np.linalg.norm(regObj.vert - baseline.vert, axis=1)
return values
regObj.values = calcError(baseline, regObj, False)
regObj.values[:] = calcError(baseline, regObj, False)
return regObj
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment