code: def extractLargestRegion(actor):
      
      conn = vtk.vtkConnectivityFilter()
      conn.SetExtractionModeToLargestRegion()
      conn.ScalarConnectivityOff()
      poly = actor.GetMapper().GetInput()
      conn.SetInputData(poly)
      conn.Update()
      epoly = conn.GetOutput()
      eact = Actor(epoly)
      pr = vtk.vtkProperty()
      pr.DeepCopy(actor.GetProperty())
      eact.SetProperty(pr)
      return eact
docs: Keep only the largest connected part of a mesh and discard all the smaller pieces.
  
      .. hint:: |largestregion.py|_