• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python vtk.vtkTimerLog函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中vtk.vtkTimerLog函数的典型用法代码示例。如果您正苦于以下问题:Python vtkTimerLog函数的具体用法?Python vtkTimerLog怎么用?Python vtkTimerLog使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了vtkTimerLog函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: main

def main(cases):
    """ Pass a list of tuples containing test classes and the starting
    string of the functions used for testing.

    Example:

    main ([(vtkTestClass, 'test'), (vtkTestClass1, 'test')])
    """

    processCmdLine()

    timer = vtk.vtkTimerLog()
    s_time = timer.GetCPUTime()
    s_wall_time = time.time()    

    # run the tests
    result = test(cases)

    tot_time = timer.GetCPUTime() - s_time
    tot_wall_time = float(time.time() - s_wall_time)

    # output measurements for Dart
    print "<DartMeasurement name=\"WallTime\" type=\"numeric/double\">",
    print " %f </DartMeasurement>"%tot_wall_time
    print "<DartMeasurement name=\"CPUTime\" type=\"numeric/double\">",
    print " %f </DartMeasurement>"%tot_time

    # Delete these to eliminate debug leaks warnings.
    del cases, timer
    
    if result.wasSuccessful():
        sys.exit(0)
    else:
        sys.exit(1)
开发者ID:SRabbelier,项目名称:Casam,代码行数:34,代码来源:Testing.py


示例2: showPointCloud

def showPointCloud(modelNodeID):

    model = slicer.mrmlScene.GetNodeByID(modelNodeID)
    polydata = model.GetPolyData()

    # Reuse the locator
    locator = vtk.vtkStaticPointLocator()
    locator.SetDataSet(polydata)
    locator.BuildLocator()

    # Remove isolated points
    removal = vtk.vtkRadiusOutlierRemoval()
    removal.SetInputData(polydata)
    removal.SetLocator(locator)
    removal.SetRadius(10)
    removal.SetNumberOfNeighbors(2)
    removal.GenerateOutliersOn()

    # Time execution
    timer = vtk.vtkTimerLog()
    timer.StartTimer()
    removal.Update()
    timer.StopTimer()
    time = timer.GetElapsedTime()
    print("Time to remove points: {0}".format(time))
    print("   Number removed: {0}".format(removal.GetNumberOfPointsRemoved()),
          " (out of: {}".format(polydata.GetNumberOfPoints()))

    # First output are the non-outliers
    remMapper = vtk.vtkPointGaussianMapper()
    remMapper.SetInputConnection(removal.GetOutputPort())
    remMapper.EmissiveOff()
    remMapper.SetScaleFactor(0.0)

    remActor = vtk.vtkActor()
    remActor.SetMapper(remMapper)
    
    lm = slicer.app.layoutManager()
    tdWidget = lm.threeDWidget(0)
    tdView = tdWidget.threeDView()
    rWin = tdView.renderWindow()
    rCollection = rWin.GetRenderers()
    renderer = rCollection.GetItemAsObject(0)

    # Add the actors to the renderer, set the background and size
    #
    renderer.AddActor(remActor)
开发者ID:tokjun,项目名称:SlicerPointCloudTest,代码行数:47,代码来源:SlicerPointCloudTest.py


示例3:

dist = vtk.vtkUnsignedDistance()
dist.SetInputData(polyData)
dist.SetRadius(0.25) #how far out to propagate distance calculation
dist.SetDimensions(res,res,res)
dist.CappingOn()
dist.AdjustBoundsOn()
dist.SetAdjustDistance(0.01)

# Extract the surface with modified flying edges
fe = vtk.vtkFlyingEdges3D()
fe.SetInputConnection(dist.GetOutputPort())
fe.SetValue(0, 0.075)
fe.ComputeNormalsOff()

# Time the execution
timer = vtk.vtkTimerLog()
timer.StartTimer()
fe.Update()
timer.StopTimer()
time = timer.GetElapsedTime()
print("Points processed: {0}".format(NPts))
print("   Time to generate and extract distance function: {0}".format(time))
print(dist)

feMapper = vtk.vtkPolyDataMapper()
feMapper.SetInputConnection(fe.GetOutputPort())

feActor = vtk.vtkActor()
feActor.SetMapper(feMapper)

# Create an outline
开发者ID:ElsevierSoftwareX,项目名称:SOFTX-D-15-00004,代码行数:31,代码来源:TestUnsignedDistanceFilter.py


示例4: __init__

 def __init__(self, renderer):
     self._renderer = renderer
     self._timerLog = vtkTimerLog()
     self._numberOfTrials = 10
开发者ID:abdulahad07,项目名称:application,代码行数:4,代码来源:Benchmarking.py


示例5: print

closest = vtk.vtkIdList()
closest.SetNumberOfIds(numProbes)
staticClosest = vtk.vtkIdList()
staticClosest.SetNumberOfIds(numProbes)

# Print initial statistics
print("Processing NumPts: {0}".format(numPts))
print("\n")

# Time the creation and building of the incremental point locator
locator = vtk.vtkPointLocator()
locator.SetDataSet(polydata)
locator.SetNumberOfPointsPerBucket(5)
locator.AutomaticOn()

timer = vtk.vtkTimerLog()
timer.StartTimer()
locator.BuildLocator()
timer.StopTimer()
time = timer.GetElapsedTime()
print("Build Point Locator: {0}".format(time))

# Probe the dataset with FindClosestPoint() and time it
timer.StartTimer()
for i in range (0,numProbes):
    closest.SetId(i, locator.FindClosestPoint(probePoints.GetPoint(i)))
timer.StopTimer()
opTime = timer.GetElapsedTime()
print("    Closest point probing: {0}".format(opTime))
print("    Divisions: {0}".format( locator.GetDivisions() ))
开发者ID:jpouderoux,项目名称:VTK,代码行数:30,代码来源:TestStaticPointLocator.py



注:本文中的vtk.vtkTimerLog函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python vtk.vtkTransform函数代码示例发布时间:2022-05-26
下一篇:
Python vtk.vtkThreshold函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap