hello,
I have some trouble importing files using vtkVRMLImporter.The details are as follows
This is the exported reconstruction result
This is the imported reconstruction result
I also cannot modify any camera properties, otherwise the result will be a black frame
Below is the code snippet
def get_actors1(img, tf=[], spacing=[1.0, 1.0, 1.0]):
reader, num_labels, labels = numpy2VTK_new(img, spacing)
colors = vtkNamedColors()
actors = []
color_ = ['red', 'lightgreen', 'yellow', 'blue']
for label, c in zip(labels, color_):
extractor = vtkDiscreteMarchingCubes()
extractor.SetInputConnection(reader.GetOutputPort())
extractor.SetValue(0, label)
smooth = smooth_functions(extractor, 1)
smooth.Update()
stripper = vtkStripper()
stripper.SetInputConnection(smooth.GetOutputPort())
mapper = vtkPolyDataMapper()
mapper.SetInputData(smooth.GetOutput())
mapper.ScalarVisibilityOff()
actor = vtkActor()
actor.SetMapper(mapper)
actor.GetProperty().SetColor(colors.GetColor3d(c))
actors.append(actor)
return actors
self.lb3.GetRenderWindow().AddRenderer(self.ren)
self.iren = self.lb3.GetRenderWindow().GetInteractor()
self.lb3.SetSize(500,500)
for a in actors:
self.ren.AddActor(a)
self.lb3.GetRenderWindow().Render()
self.iren.Start()
How can I make the import result the same as the export result?
Thanks for your help