self.SetOutputMembers([ ['Surface','o','vtkPolyData',1,'','the output surface containing the resampled vtkPolyLine cells','vmtksurfacewriter'] ]) def Execute(self): if self.Surface == None: self.PrintError('Error: No input surface.') cleaner = vtk.vtkCleanPolyData() cleaner.SetInputData(self.Surface) cleaner.Update() if self.Length == 0.0: self.Length = cleaner.GetOutput().GetLength() / 100.0 splineFilter = vtk.vtkSplineFilter() splineFilter.SetInputConnection(cleaner.GetOutputPort()) splineFilter.SetSubdivideToLength() splineFilter.SetLength(self.Length) splineFilter.Update() self.Surface = splineFilter.GetOutput() if __name__=='__main__': main = pypes.pypeMain() main.Arguments = sys.argv main.Execute()
]]) def Execute(self): if self.Image == None: self.PrintError('Error: Image not set.') activeTubes = vtkvmtk.vtkvmtkActiveTubeFilter() activeTubes.SetInputData(self.Centerline) activeTubes.SetPotentialImage(self.Image) activeTubes.SetRadiusArrayName(self.RadiusArrayName) activeTubes.SetConvergence(self.Convergence) activeTubes.SetPotentialWeight(self.PotentialWeight) activeTubes.SetStiffnessWeight(self.StiffnessWeight) activeTubes.SetNumberOfIterations(self.NumberOfIterations) activeTubes.SetCFLCoefficient(self.CFLCoefficient) activeTubes.SetMinimumRadius(self.MinimumRadius) activeTubes.SetNumberOfAngularEvaluations( self.NumberOfAngularEvaluations) activeTubes.SetNegativeNormWarnings(self.NegativeNormWarnings) activeTubes.Update() self.Centerline = activeTubes.GetOutput() if __name__ == '__main__': main = pypes.pypeMain() main.Arguments = sys.argv main.Execute()