Python vtk.vtkRenderer() Examples
The following are 27
code examples of vtk.vtkRenderer().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
vtk
, or try the search function
.
Example #1
Source File: utility.py From ILCC with BSD 2-Clause "Simplified" License | 6 votes |
def vis_segments(ind=1): renderer = vtk.vtkRenderer() seg_folder = os.path.join(params['base_dir'], "output/pcd_seg/" + str(ind).zfill(params["file_name_digits"])) + "/" seg_list = os.listdir(seg_folder) for seg in seg_list: if seg.split(".")[-1] == "txt": color_tup = (np.random.randint(1, 255, 3)).tolist() points_ls = list() jdcs_collection = cPickle.load(open(os.path.abspath(seg_folder + seg), 'rb')) if len(jdcs_collection) > 0: # filter for jdc in jdcs_collection: points_ls.extend(jdc) # print points_ls actor = vis_pcd_color_arr(np.array(points_ls), color_tup) renderer.AddActor(actor) vis_with_renderer(renderer)
Example #2
Source File: utility.py From ILCC with BSD 2-Clause "Simplified" License | 6 votes |
def vis_segments_only_chessboard_color(ind=1): renderer = vtk.vtkRenderer() seg_folder = os.path.join(params['base_dir'], "output/pcd_seg/" + str(ind).zfill(params["file_name_digits"])) + "/" seg_list = os.listdir(seg_folder) chessboard_file_name = \ cPickle.load(open(os.path.join(params['base_dir'], "output/pcd_seg/") + str(ind).zfill( params["file_name_digits"]) + "_pcd_result.pkl", "r"))[ -1].split("/")[-1] for seg in seg_list: if seg.split(".")[-1] == "txt": if seg == chessboard_file_name: color_tup = np.array([0, 255, 0]) else: color_tup = np.array([0, 0, 0]) points_ls = list() jdcs_collection = cPickle.load(open(os.path.abspath(seg_folder + seg), 'rb')) if len(jdcs_collection) > 0: # filter for jdc in jdcs_collection: points_ls.extend(jdc) # print points_ls actor = vis_pcd_color_arr(np.array(points_ls), color_tup) renderer.AddActor(actor) vis_with_renderer(renderer)
Example #3
Source File: visualization_3d.py From gempy with GNU Lesser General Public License v3.0 | 6 votes |
def create_ren_list(self): """ Create a list of the 4 renderers we use. One general view and 3 cartersian projections Returns: list: list of renderers """ # viewport dimensions setup xmins = [0, 0.6, 0.6, 0.6] xmaxs = [0.6, 1, 1, 1] ymins = [0, 0, 0.33, 0.66] ymaxs = [1, 0.33, 0.66, 1] # create list of renderers, set vieport values ren_list = [] for i in range(self.n_ren): # append each renderer to list of renderers ren_list.append(vtk.vtkRenderer()) # add each renderer to window self.renwin.AddRenderer(ren_list[-1]) # set viewport for each renderer ren_list[-1].SetViewport(xmins[i], ymins[i], xmaxs[i], ymaxs[i]) return ren_list
Example #4
Source File: vtkpointcloud.py From deep-prior-pp with GNU General Public License v3.0 | 6 votes |
def viewer(pointclouds): assert all([isinstance(p, VtkPointCloud) for p in pointclouds]) # Renderer renderer = vtk.vtkRenderer() renderer.SetBackground(1.0, 1.0, 1.0) for p in pointclouds: renderer.AddActor(p.vtkActor) renderer.ResetCamera() # Render Window renderWindow = vtk.vtkRenderWindow() renderWindow.AddRenderer(renderer) # Interactor renderWindowInteractor = vtk.vtkRenderWindowInteractor() renderWindowInteractor.SetRenderWindow(renderWindow) # Begin Interaction renderWindow.Render() renderWindow.SetWindowName("XYZ Data Viewer") renderWindowInteractor.Start()
Example #5
Source File: test_vtk.py From panel with BSD 3-Clause "New" or "Revised" License | 6 votes |
def make_render_window(): #cone actor cone = vtk.vtkConeSource() coneMapper = vtk.vtkPolyDataMapper() coneMapper.SetInputConnection(cone.GetOutputPort()) coneActor = vtk.vtkActor() coneActor.SetMapper(coneMapper) #text actor following camera text = vtk.vtkVectorText() text.SetText("Origin") textMapper = vtk.vtkPolyDataMapper() textMapper.SetInputConnection(text.GetOutputPort()) textActor = vtk.vtkFollower() textActor.SetMapper(textMapper) ren = vtk.vtkRenderer() ren.AddActor(coneActor) ren.AddActor(textActor) textActor.SetCamera(ren.GetActiveCamera()) renWin = vtk.vtkRenderWindow() renWin.AddRenderer(ren) return renWin
Example #6
Source File: helpers.py From pyvista with MIT License | 5 votes |
def check_depth_peeling(number_of_peels=100, occlusion_ratio=0.0): """Check if depth peeling is available. Attempts to use depth peeling to see if it is available for the current environment. Returns ``True`` if depth peeling is available and has been successfully leveraged, otherwise ``False``. """ # Try Depth Peeling with a basic scene source = vtk.vtkSphereSource() mapper = vtk.vtkPolyDataMapper() mapper.SetInputConnection(source.GetOutputPort()) actor = vtk.vtkActor() actor.SetMapper(mapper) # requires opacity < 1 actor.GetProperty().SetOpacity(0.5) renderer = vtk.vtkRenderer() renderWindow = vtk.vtkRenderWindow() renderWindow.AddRenderer(renderer) renderWindow.SetOffScreenRendering(True) renderWindow.SetAlphaBitPlanes(True) renderWindow.SetMultiSamples(0) renderer.AddActor(actor) renderer.SetUseDepthPeeling(True) renderer.SetMaximumNumberOfPeels(number_of_peels) renderer.SetOcclusionRatio(occlusion_ratio) renderWindow.Render() return renderer.GetLastRenderingUsedDepthPeeling() == 1
Example #7
Source File: QVTKRenderWindowInteractor.py From Det3D with Apache License 2.0 | 5 votes |
def QVTKRenderWidgetConeExample(): """A simple example that uses the QVTKRenderWindowInteractor class.""" # every QT app needs an app app = QApplication(["QVTKRenderWindowInteractor"]) # create the widget widget = QVTKRenderWindowInteractor() widget.Initialize() widget.Start() # if you dont want the 'q' key to exit comment this. widget.AddObserver("ExitEvent", lambda o, e, a=app: a.quit()) ren = vtk.vtkRenderer() widget.GetRenderWindow().AddRenderer(ren) cone = vtk.vtkConeSource() cone.SetResolution(8) coneMapper = vtk.vtkPolyDataMapper() coneMapper.SetInputConnection(cone.GetOutputPort()) coneActor = vtk.vtkActor() coneActor.SetMapper(coneMapper) ren.AddActor(coneActor) # show the widget widget.show() # start event processing app.exec_()
Example #8
Source File: visualizercontrol.py From Det3D with Apache License 2.0 | 5 votes |
def __init__(self, parent=None): "Create a wiget with a VTK Visualizer Control in it" self.pointObjects = [] self.renderer = vtk.vtkRenderer() self.renderWidget = RenderWidget(self.renderer, parent) self.renderWindow = self.renderWidget.renderWindow self.widget = self.renderWidget.widget
Example #9
Source File: renderwidget.py From Det3D with Apache License 2.0 | 5 votes |
def __init__(self, renderer=None, parent=None): # Every QT app needs a QApplication self.app = QApplication.instance() if self.app is None: self.app = QApplication(sys.argv) # Create the widget if renderer is None: self.renderer = vtk.vtkRenderer() else: self.renderer = renderer self.widget = QVTKRenderWindowInteractor(parent) self.widget.Initialize self.widget.Start() # Set the interactor style self.widget.SetInteractorStyle(vtk.vtkInteractorStyleTrackballCamera()) # Get the render window from the widget self.renderWindow = self.widget.GetRenderWindow() self.renderWindow.AddRenderer(self.renderer) # show the widget self.widget.show()
Example #10
Source File: gui_viewer.py From voxel-dcgan with MIT License | 5 votes |
def __init__(self, parent, opt_engine): QVTKRenderWindowInteractor.__init__(self, parent) self.opt_engine = opt_engine self.resetCamera = True self.renderer = vtk.vtkRenderer() self.GetRenderWindow().AddRenderer(self.renderer) self.interactor = self.GetRenderWindow().GetInteractor() self.create_actor() self.renderer.AddActor(self.actor) self.renderer.SetBackground(0, 0, 0)
Example #11
Source File: visualizer_3d.py From sanet_relocal_demo with GNU General Public License v3.0 | 5 votes |
def __init__(self, h=800, w=600): self.renderer = vtk.vtkRenderer() self.renderer.SetBackground(0.1, 0.1, 0.1) # Add axes axes = vtk.vtkAxesActor() axes.GetXAxisCaptionActor2D().SetHeight(0.05) axes.GetYAxisCaptionActor2D().SetHeight(0.05) axes.GetZAxisCaptionActor2D().SetHeight(0.05) axes.SetCylinderRadius(0.03) axes.SetShaftTypeToCylinder() self.renderer.AddActor(axes) # Add render window self.renwin = vtk.vtkRenderWindow() self.renwin.SetWindowName("Point Cloud Viewer") self.renwin.SetSize(h, w) self.renwin.AddRenderer(self.renderer) # An interactor self.interactor = vtk.vtkRenderWindowInteractor() interstyle = vtk.vtkInteractorStyleTrackballCamera() self.interactor.SetInteractorStyle(interstyle) self.interactor.SetRenderWindow(self.renwin) self.camera_actors = []
Example #12
Source File: show_vtk.py From pyrealsense with Apache License 2.0 | 5 votes |
def __init__(self, threadLock, actorWrapper, axis=True,): super(VTKVisualisation, self).__init__() self.threadLock = threadLock self.ren = vtk.vtkRenderer() self.ren.AddActor(actorWrapper.actor) self.axesActor = vtk.vtkAxesActor() self.axesActor.AxisLabelsOff() self.axesActor.SetTotalLength(1, 1, 1) self.ren.AddActor(self.axesActor) self.renWin = vtk.vtkRenderWindow() self.renWin.AddRenderer(self.ren) ## IREN self.iren = vtk.vtkRenderWindowInteractor() self.iren.SetRenderWindow(self.renWin) self.iren.Initialize() self.style = vtk.vtkInteractorStyleTrackballCamera() self.iren.SetInteractorStyle(self.style) self.iren.AddObserver("TimerEvent", self.update_visualisation) dt = 30 # ms timer_id = self.iren.CreateRepeatingTimer(dt)
Example #13
Source File: tessagon_vtk_demo.py From tessagon with Apache License 2.0 | 5 votes |
def __init__(self): self.ren = vtk.vtkRenderer() self.renWin = vtk.vtkRenderWindow() self.renWin.AddRenderer(self.ren) self.iren = vtk.vtkRenderWindowInteractor() self.iren.SetRenderWindow(self.renWin) self.lut = vtk.vtkLookupTable() self.lut.SetHueRange(0.6, 0.6) self.lut.SetSaturationRange(.5, .5) self.lut.SetValueRange(0.2, 1.0) self.lut.SetNumberOfColors(256) self.lut.Build()
Example #14
Source File: vtk.py From panel with BSD 3-Clause "New" or "Revised" License | 5 votes |
def make_ren_win(self): import vtk ren = vtk.vtkRenderer() ren_win = vtk.vtkRenderWindow() ren_win.AddRenderer(ren) return ren_win
Example #15
Source File: vis.py From DeepV2D with BSD 3-Clause "New" or "Revised" License | 5 votes |
def run(self): renderer = vtk.vtkRenderer() renderer.SetBackground(0, 0, 0) camera = vtk.vtkCamera() camera.SetPosition((1, -1, -2)); camera.SetViewUp((0, -1, 0)); camera.SetFocalPoint((0, 0, 2)); renderer.SetActiveCamera(camera) renwin = vtk.vtkRenderWindow() renwin.SetWindowName("Point Cloud Viewer") renwin.SetSize(800,600) renwin.AddRenderer(renderer) interactor = vtk.vtkRenderWindowInteractor() interstyle = vtk.vtkInteractorStyleTrackballCamera() interactor.SetInteractorStyle(interstyle) interactor.SetRenderWindow(renwin) interactor.Initialize() cb = vtkTimerCallback(self.cinematic, self.render_path, self.clear_points) cb.queue = self.queue interactor.AddObserver('TimerEvent', cb.execute) timerId = interactor.CreateRepeatingTimer(100); #start the interaction and timer interactor.Start()
Example #16
Source File: vis.py From DeepV2D with BSD 3-Clause "New" or "Revised" License | 5 votes |
def visualize_prediction(pointcloud, colors, poses=None, renwin=None): """ render point cloud and cameras """ renderer = vtk.vtkRenderer() renderer.SetBackground(0, 0, 0) pointcloud_actor = create_pointcloud_actor(points=pointcloud, colors=colors) pointcloud_actor.GetProperty().SetPointSize(2) renderer.AddActor(pointcloud_actor) for pose in poses: R, t = pose[:3, :3], pose[:3, 3] cam_actor = create_camera_actor(R,t) cam_actor.GetProperty().SetColor((255, 255, 0)) renderer.AddActor(cam_actor) camera = vtk.vtkCamera() camera.SetPosition((1, -1, -2)); camera.SetViewUp((0, -1, 0)); camera.SetFocalPoint((0, 0, 2)); renderer.SetActiveCamera(camera) renwin = vtk.vtkRenderWindow() renwin.SetWindowName("Point Cloud Viewer") renwin.SetSize(800,600) renwin.AddRenderer(renderer) # An interactor interactor = vtk.vtkRenderWindowInteractor() interstyle = vtk.vtkInteractorStyleTrackballCamera() interactor.SetInteractorStyle(interstyle) interactor.SetRenderWindow(renwin) # Render and interact renwin.Render() interactor.Initialize() interactor.Start()
Example #17
Source File: Q7VTKRenderWindowInteractor.py From pyCGNS with GNU Lesser General Public License v2.1 | 5 votes |
def QVTKRenderWidgetConeExample(): """A simple example that uses the QVTKRenderWindowInteractor class.""" # every QT app needs an app app = QApplication(['QVTKRenderWindowInteractor']) # create the widget widget = QVTKRenderWindowInteractor() widget.Initialize() widget.Start() # if you don't want the 'q' key to exit comment this. widget.AddObserver("ExitEvent", lambda o, e, a=app: a.quit()) ren = vtk.vtkRenderer() widget.GetRenderWindow().AddRenderer(ren) cone = vtk.vtkConeSource() cone.SetResolution(8) coneMapper = vtk.vtkPolyDataMapper() coneMapper.SetInputConnection(cone.GetOutputPort()) coneActor = vtk.vtkActor() coneActor.SetMapper(coneMapper) ren.AddActor(coneActor) # show the widget widget.show() # start event processing app.exec_()
Example #18
Source File: graphics.py From robopy with MIT License | 5 votes |
def __init__(self, background=(0.15, 0.15, 0.15), total_time_steps=None, timer_rate=60, gif_file=None): self.ren = vtk.vtkRenderer() self.ren.SetBackground(background[0], background[1], background[2]) self.ren_win = vtk.vtkRenderWindow() self.ren_win.AddRenderer(self.ren) self.iren = vtk.vtkRenderWindowInteractor() self.iren.SetRenderWindow(self.ren_win) self.iren.SetInteractorStyle(vtk.vtkInteractorStyleTrackballCamera()) self.actor_list = [] self.mapper_list = [] self.source_list = [] self.screenshot_count = 0 self.timer_rate = timer_rate self.gif_data = [] if gif_file is not None: try: assert type(gif_file) is str except AssertionError: gif_file = str(gif_file) self.gif_file = gif_file else: self.gif_file = None if total_time_steps is not None: assert type(total_time_steps) is int self.timer_count = 0 self.total_time_steps = total_time_steps
Example #19
Source File: vtkhelpers.py From pcloudpy with BSD 3-Clause "New" or "Revised" License | 5 votes |
def display_from_actor(actor): renderer = vtkRenderer() renderWindow = vtkRenderWindow() renderWindow.AddRenderer(renderer) renderer.AddActor(actor) # enable user interface interactor iren = vtkRenderWindowInteractor() iren.SetRenderWindow(renderWindow) iren.Initialize() renderWindow.Render() iren.Start()
Example #20
Source File: QVTKWidget.py From pcloudpy with BSD 3-Clause "New" or "Revised" License | 5 votes |
def __init__(self, parent=None): super(QVTKWidget, self).__init__(parent) self._enable_axis = False self._Iren.SetInteractorStyle (vtkInteractorStyleTrackballCamera ()) self.renderer = vtkRenderer() self.renderer.GradientBackgroundOn() self.renderer.SetBackground2(255.0,255.0,255.0) self.renderer.SetBackground(37/255.0, 85/255.0,152/255.0) self.GetRenderWindow().AddRenderer(self.renderer) self.Initialize() self.Start() self.add_axes()
Example #21
Source File: QVTKRenderWindowInteractor.py From pcloudpy with BSD 3-Clause "New" or "Revised" License | 5 votes |
def QVTKRenderWidgetConeExample(): """A simple example that uses the QVTKRenderWindowInteractor class.""" # every QT app needs an app app = QtGui.QApplication(['QVTKRenderWindowInteractor']) # create the widget widget = QVTKRenderWindowInteractor() widget.Initialize() widget.Start() # if you dont want the 'q' key to exit comment this. widget.AddObserver("ExitEvent", lambda o, e, a=app: a.quit()) ren = vtkRenderer() widget.GetRenderWindow().AddRenderer(ren) cone = vtkConeSource() cone.SetResolution(8) coneMapper = vtkPolyDataMapper() coneMapper.SetInput(cone.GetOutput()) coneActor = vtkActor() coneActor.SetMapper(coneMapper) ren.AddActor(coneActor) # show the widget widget.show() # start event processing app.exec_()
Example #22
Source File: gui_viewer.py From pix2vox with GNU General Public License v3.0 | 5 votes |
def __init__(self, parent, opt_engine): QVTKRenderWindowInteractor.__init__(self, parent) self.opt_engine = opt_engine self.renderer = vtk.vtkRenderer() self.GetRenderWindow().AddRenderer(self.renderer) self.interactor = self.GetRenderWindow().GetInteractor() self.create_actor() self.renderer.AddActor(self.actor) self.renderer.SetBackground(0, 0, 0)
Example #23
Source File: vtkVisualization.py From MOTSFusion with MIT License | 5 votes |
def __init__(self): self.renderer = vtk.vtkRenderer() self.renderer.SetBackground(0.5, 0.5, 0.5) self.renderer.ResetCamera() axes_actor = vtk.vtkAxesActor() axes_actor.AxisLabelsOff() self.renderer.AddActor(axes_actor) self.window = vtk.vtkRenderWindow() self.window.AddRenderer(self.renderer) self.interactor = vtk.vtkRenderWindowInteractor() self.interactor.SetInteractorStyle(vtk.vtkInteractorStyleTrackballCamera()) self.interactor.SetRenderWindow(self.window) self.camera = vtk.vtkCamera() self.camera.SetViewUp(0.0, -1.0, 0.0) self.camera.SetPosition(0.0, 0.0, -5) self.camera.SetFocalPoint(0.0, 0.0, 0.0) # self.camera.SetClippingRange(0.0, 100000) self.renderer.SetActiveCamera(self.camera)
Example #24
Source File: utility.py From ILCC with BSD 2-Clause "Simplified" License | 5 votes |
def vis_csv_pcd(ind=1, color_style="monochrome"): pcd_arr = np.genfromtxt( os.path.join(params['base_dir'], "pcd/" + str(ind).zfill(params["file_name_digits"])) + ".csv", delimiter=",", skip_header=1) # actor = vis_3D_points(pcd_arr, color_style="intens") actor = vis_3D_points(pcd_arr, color_style=color_style) renderer = vtk.vtkRenderer() renderer.AddActor(actor) vis_with_renderer(renderer)
Example #25
Source File: vtk_helpers.py From NURBS-Python with MIT License | 4 votes |
def create_render_window(actors, callbacks, **kwargs): """ Creates VTK render window with an interactor. :param actors: list of VTK actors :type actors: list, tuple :param callbacks: callback functions for registering custom events :type callbacks: dict """ # Get keyword arguments figure_size = kwargs.get('figure_size', (800, 600)) camera_position = kwargs.get('camera_position', (0, 0, 100)) # Find camera focal point center_points = [] for actor in actors: center_points.append(actor.GetCenter()) camera_focal_point = linalg.vector_mean(*center_points) # Create camera camera = vtk.vtkCamera() camera.SetPosition(*camera_position) camera.SetFocalPoint(*camera_focal_point) # Create renderer renderer = vtk.vtkRenderer() renderer.SetActiveCamera(camera) renderer.SetBackground(1.0, 1.0, 1.0) # Add actors to the scene for actor in actors: renderer.AddActor(actor) # Render window render_window = vtk.vtkRenderWindow() render_window.AddRenderer(renderer) render_window.SetSize(*figure_size) # Render window interactor window_interactor = vtk.vtkRenderWindowInteractor() window_interactor.SetRenderWindow(render_window) # Add event observers for cb in callbacks: window_interactor.AddObserver(cb, callbacks[cb][0], callbacks[cb][1]) # cb name, cb function ref, cb priority # Render actors render_window.Render() # Set window name after render() is called render_window.SetWindowName("geomdl") # Use trackball camera interactor_style = vtk.vtkInteractorStyleTrackballCamera() window_interactor.SetInteractorStyle(interactor_style) # Start interactor window_interactor.Start() # Return window interactor instance return window_interactor
Example #26
Source File: volumerendering.py From Medical-Image-Analysis-IPython-Tutorials with Apache License 2.0 | 4 votes |
def vtk_basic( actors, embed=False, magnification=1.0 ): """ Create a window, renderer, interactor, add the actors and start the thing Parameters ---------- actors : list of vtkActors Returns ------- nothing """ # create a rendering window and renderer ren = vtk.vtkRenderer() renWin = vtk.vtkRenderWindow() renWin.AddRenderer(ren) renWin.SetSize(600,600) # ren.SetBackground( 1, 1, 1) # create a renderwindowinteractor iren = vtk.vtkRenderWindowInteractor() iren.SetRenderWindow(renWin) for a in actors: move( a, np.dot(Ry(-180),Rx(-180)) ) # assign actor to the renderer ren.AddActor(a ) # render renWin.Render() if embed: renWin.SetSize(300,300) grabber = vtk.vtkWindowToImageFilter() grabber.SetInput( renWin ) grabber.SetMagnification( magnification ) grabber.Update() writer = vtk.vtkPNGWriter() writer.SetInput( grabber.GetOutput() ) writer.SetFileName( "screenshot.png" ) writer.Write() return display.Image("screenshot.png") else: # enable user interface interactor iren.Initialize() iren.Start()
Example #27
Source File: pcd_corners_est.py From ILCC with BSD 2-Clause "Simplified" License | 4 votes |
def show_pcd_ndarray(array_data, color_arr=[0, 255, 0]): all_rows = array_data.shape[0] Colors = vtk.vtkUnsignedCharArray() Colors.SetNumberOfComponents(3) Colors.SetName("Colors") Points = vtk.vtkPoints() Vertices = vtk.vtkCellArray() for k in xrange(all_rows): point = array_data[k, :] id = Points.InsertNextPoint(point[0], point[1], point[2]) Vertices.InsertNextCell(1) Vertices.InsertCellPoint(id) if vtk.VTK_MAJOR_VERSION > 6: Colors.InsertNextTuple(color_arr) else: Colors.InsertNextTupleValue(color_arr) dis_tmp = np.sqrt((point ** 2).sum(0)) # Colors.InsertNextTupleValue([0,255-dis_tmp/max_dist*255,0]) # Colors.InsertNextTupleValue([255-abs(point[0]/x_max*255),255-abs(point[1]/y_max*255),255-abs(point[2]/z_max*255)]) # Colors.InsertNextTupleValue([255-abs(point[0]/x_max*255),255,255]) polydata = vtk.vtkPolyData() polydata.SetPoints(Points) polydata.SetVerts(Vertices) polydata.GetPointData().SetScalars(Colors) polydata.Modified() mapper = vtk.vtkPolyDataMapper() if vtk.VTK_MAJOR_VERSION <= 5: mapper.SetInput(polydata) else: mapper.SetInputData(polydata) mapper.SetColorModeToDefault() actor = vtk.vtkActor() actor.SetMapper(mapper) actor.GetProperty().SetPointSize(5) # Renderer renderer = vtk.vtkRenderer() renderer.AddActor(actor) renderer.SetBackground(.2, .3, .4) renderer.ResetCamera() # Render Window renderWindow = vtk.vtkRenderWindow() renderWindow.AddRenderer(renderer) # Interactor renderWindowInteractor = vtk.vtkRenderWindowInteractor() renderWindowInteractor.SetRenderWindow(renderWindow) # Begin Interaction renderWindow.Render() renderWindowInteractor.Start() # determine whether a segment is the potential chessboard's point cloud