def __init__(self): """ """ self.filterGPA = vtk.vtkProcrustesAlignmentFilter() self.filterPCA = vtk.vtkPCAAnalysisFilter() self.vertexGrids = [] self.alignedGrids = [] self.analyzedGrids = [] self.meanShape = [] self.meanPositions = [] self.variationPositions = []
Actor2a.SetMapper(map2a) Actor2a.GetProperty().SetDiffuseColor(1.0000,0.3882,0.2784) map2b = vtk.vtkPolyDataMapper() map2b.SetInputData(procrustes.GetOutput().GetBlock(1)) Actor2b = vtk.vtkActor() Actor2b.SetMapper(map2b) Actor2b.GetProperty().SetDiffuseColor(0.3882,1.0000,0.2784) map2c = vtk.vtkPolyDataMapper() map2c.SetInputData(procrustes.GetOutput().GetBlock(2)) Actor2c = vtk.vtkActor() Actor2c.SetMapper(map2c) Actor2c.GetProperty().SetDiffuseColor(0.3882,0.2784,1.0000) #------------------------------------------------------------------ # pass the output of Procrustes to vtkPCAAnalysisFilter #------------------------------------------------------------------ pca = vtk.vtkPCAAnalysisFilter() pca.SetInputConnection(procrustes.GetOutputPort()) pca.Update() # we need to call Update because GetParameterisedShape is not # part of the normal SetInput/GetOutput pipeline #------------------------------------------------------------------ # map the first mode into the third renderer: # -3,0,3 standard deviations on the first mode # illustrate the extremes around the average shape #------------------------------------------------------------------ params = vtk.vtkFloatArray() params.SetNumberOfComponents(1) params.SetNumberOfTuples(1) params.SetTuple1(0,0.0) shapea = vtk.vtkPolyData() shapea.DeepCopy(sphere.GetOutput())
Actor2a.SetMapper(map2a) Actor2a.GetProperty().SetDiffuseColor(1.0000, 0.3882, 0.2784) map2b = vtk.vtkPolyDataMapper() map2b.SetInputData(procrustes.GetOutput().GetBlock(1)) Actor2b = vtk.vtkActor() Actor2b.SetMapper(map2b) Actor2b.GetProperty().SetDiffuseColor(0.3882, 1.0000, 0.2784) map2c = vtk.vtkPolyDataMapper() map2c.SetInputData(procrustes.GetOutput().GetBlock(2)) Actor2c = vtk.vtkActor() Actor2c.SetMapper(map2c) Actor2c.GetProperty().SetDiffuseColor(0.3882, 0.2784, 1.0000) #------------------------------------------------------------------ # pass the output of Procrustes to vtkPCAAnalysisFilter #------------------------------------------------------------------ pca = vtk.vtkPCAAnalysisFilter() pca.SetInputConnection(procrustes.GetOutputPort()) pca.Update() # we need to call Update because GetParameterisedShape is not # part of the normal SetInput/GetOutput pipeline #------------------------------------------------------------------ # map the first mode into the third renderer: # -3,0,3 standard deviations on the first mode # illustrate the extremes around the average shape #------------------------------------------------------------------ params = vtk.vtkFloatArray() params.SetNumberOfComponents(1) params.SetNumberOfTuples(1) params.SetTuple1(0, 0.0) shapea = vtk.vtkPolyData() shapea.DeepCopy(sphere.GetOutput())