diff --git a/AmpScan/AmpScanGUI.py b/AmpScan/AmpScanGUI.py index 3035f0747c3cb311b7d5e41447d60d060e940af0..f7bc0dc4a07e4a039d1857f5d1f7274f132c0ff5 100644 --- a/AmpScan/AmpScanGUI.py +++ b/AmpScan/AmpScanGUI.py @@ -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) diff --git a/AmpScan/ampVis.py b/AmpScan/ampVis.py index 8879efda5e91104b7bde964d043d2796d22098c0..9568134a054ef26c11c084076d9dcae8f8baee5c 100644 --- a/AmpScan/ampVis.py +++ b/AmpScan/ampVis.py @@ -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) diff --git a/AmpScan/core.py b/AmpScan/core.py index 517a9c5c42f1ec283dec7cee5b6f070bc8c0f99f..78c62b4dfad9fab9416386386ee9ab87de692817 100644 --- a/AmpScan/core.py +++ b/AmpScan/core.py @@ -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() diff --git a/AmpScan/registration.py b/AmpScan/registration.py index c5db75e1f149d3fa4d66f4730e15d0d805d4e154..aa804b016754658f249efd9759a3d56dd13869b0 100644 --- a/AmpScan/registration.py +++ b/AmpScan/registration.py @@ -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