args = parser.parse_args() rh_lines = get_streamlines(load_streamlines_poyldata(args.rh_tracking)) lh_lines = get_streamlines(load_streamlines_poyldata(args.lh_tracking)) lines = [rh_lines, lh_lines] print "Read .vtk surface file" rh_mesh = TriMesh_Vtk(args.rh_surface, None) lh_mesh = TriMesh_Vtk(args.lh_surface, None) tris = [rh_mesh.get_triangles(), lh_mesh.get_triangles()] vts = [rh_mesh.get_vertices(), lh_mesh.get_vertices()] print "Generate OBB-Tree" #tree = vtk.vtkModifiedBSPTree() rh_tree = vtk.vtkOBBTree() rh_tree.SetDataSet(rh_mesh.get_polydata()) rh_tree.BuildLocator() lh_tree = vtk.vtkOBBTree() lh_tree.SetDataSet(lh_mesh.get_polydata()) lh_tree.BuildLocator() tree = [rh_tree, lh_tree] # report info [rh, lh] start_count = [len(rh_lines), len(lh_lines)] bad_start_count = [0, 0] bad_pft_count = [0, 0] end_count = [0, 0] swap_end_count = [0, 0] bad_end_count = [0, 0]
# option parser.add_argument('-nuclei', nargs='+' , default=None, help='input nuclei surface (hard stop)') parser.add_argument('-nuclei_soft', nargs='+' , default=None, help='input nuclei surface (soft stop)') parser.add_argument('-report', type=str, default=None, help='output intersection report') args = parser.parse_args() print "Read .vtk surface file" rh_mesh = TriMesh_Vtk(args.rh_surface, None) lh_mesh = TriMesh_Vtk(args.lh_surface, None) print "Generate OBB-Tree" #tree = vtk.vtkModifiedBSPTree() rh_tree = vtk.vtkOBBTree() rh_tree.SetDataSet(rh_mesh.get_polydata()) rh_tree.BuildLocator() lh_tree = vtk.vtkOBBTree() lh_tree.SetDataSet(lh_mesh.get_polydata()) lh_tree.BuildLocator() wm_trees = [rh_tree, lh_tree] print "Read out_surface .vtk surface file and OBB-Tree" rh_out_mesh = TriMesh_Vtk(args.rh_out_surface, None) rh_out_tree = vtk.vtkOBBTree() rh_out_tree.SetDataSet(rh_out_mesh.get_polydata()) rh_out_tree.BuildLocator() lh_out_mesh = TriMesh_Vtk(args.lh_out_surface, None) lh_out_tree = vtk.vtkOBBTree()