
VTK-examples (python)
VTK学习
北方骑马的萝卜
一只:码农!
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
python VTK example (12)-- CT数据可视化渲染(3)
结果:源码:""""""import vtkdef main(): colors = vtk.vtkNamedColors() fileName = get_program_parameters() colors.SetColor("SkinColor", [255, 125, 64, 255]) colors.SetColor("BkgColor", [51, 77, 102, 255]) # Create the renderer, the原创 2021-05-08 11:27:37 · 452 阅读 · 0 评论 -
python VTK example (11)-- CT数据可视化渲染(2)
结果:源码:#!/usr/bin/env python""""""import vtkdef main(): colors = vtk.vtkNamedColors() fileName = get_program_parameters() colors.SetColor("SkinColor", [255, 125, 64, 255]) colors.SetColor("BkgColor", [51, 77, 102, 255]) # C原创 2021-05-08 11:25:33 · 512 阅读 · 0 评论 -
python VTK example (10)-- CT数据可视化渲染(1)
结果展示:源码:#!/usr/bin/env python""""""import vtkdef main(): colors = vtk.vtkNamedColors() fileName = get_program_parameters() colors.SetColor("BkgColor", [51, 77, 102, 255]) # Create the renderer, the render window, and the inter原创 2021-05-08 11:14:51 · 854 阅读 · 0 评论 -
python VTK example (9)-- 汉诺塔过程(动态)可视化
结果可视化(原图是动态的,这里只放某一时刻的截图):代码:#!/usr/bin/env python# Translated from Hanoi.cxx.import vtkclass GV(object): """ Used to store global variables. """ def __init__(self, numberOfPucks=5, numberOfSteps=5, puckResolution=48, configurati原创 2021-04-01 17:16:23 · 474 阅读 · 0 评论 -
python VTK example (8)--多窗口联动 & 平滑处理
结果展示:代码:#!/usr/bin/env python# -*- coding: utf-8 -*-from collections import OrderedDictimport vtkdef main(): colors = vtk.vtkNamedColors() fileName = '/home/jingzhi/AK/code/VTS-knee/knee-data/Rgg/Rgg_2.vtk'#get_program_parameters()原创 2021-04-01 16:21:47 · 725 阅读 · 0 评论 -
python VTK example (7)-- 对表面进行平滑处理
结果展示:python代码:#!/usr/bin/env pythonimport numpyimport vtkdef main(): nc = vtk.vtkNamedColors() # Make a 32 x 32 grid size = 32 rn = vtk.vtkMinimalStandardRandomSequence() rn.SetSeed(1) # Define z values for the topography原创 2021-04-01 16:13:32 · 1059 阅读 · 0 评论 -
python VTK example (7)-- 裁剪三维数据表面任意形状
结果示意:代码:"""converted from: - http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ExtractSelectionCells"""import vtkdef main(): colors = vtk.vtkNamedColors() colors.SetColor('leftBkg', [0.6, 0.5, 0.4, 1.0]) colors.SetColor('centreBkg', [原创 2021-04-01 16:09:48 · 647 阅读 · 0 评论 -
python VTK example (6)--在三维数据上画直线
结果展示:代码:#!/usr/bin/env python# -*- coding: utf-8 -*-import vtkdef main(): colors = vtk.vtkNamedColors() lineColor = colors.GetColor3d("peacock") modelColor = colors.GetColor3d("silver") backgroundColor = colors.GetColor3d("wheat")原创 2021-04-01 16:06:48 · 700 阅读 · 0 评论 -
python VTK example (5)-- bool运算(交,并,补)
核心代码: booleanOperation = vtk.vtkBooleanOperationPolyDataFilter() booleanOperation.SetOperationToUnion() #并 # booleanOperation.SetOperationToIntersection() #交 # booleanOperation.SetOperationToDifference() #补(差)sphereSource1,sphereSource2分原创 2021-03-22 14:18:14 · 1040 阅读 · 1 评论 -
python VTK example (4)--三维模型切割(.ply,.vtp,.obj,.stl,.vtk,.g)
三维模型(.vtk)切割代码 :#!/usr/bin/env pythonimport os.pathimport vtkdef get_program_parameters(): import argparse description = 'Clip polydata using a plane.' epilogue = ''' This is an example using vtkClipPolyData to clip input polydata, if原创 2021-03-12 11:06:36 · 3759 阅读 · 2 评论 -
python VTK example(3) -- 几何体拼接
代码链接:结果显示:原创 2021-03-12 10:54:49 · 527 阅读 · 1 评论 -
python VTK example(2) --.vtp文件加载、保存
ArraysGetValues.pydef main(): # setup sphere sphereSource = vtk.vtkSphereSource() sphereSource.Update() polydata = vtk.vtkPolyData() #print(sphereSource.GetOutput()) polydata.ShallowCopy(sphereSource.GetOutput()) normals = p原创 2021-03-12 10:39:38 · 2864 阅读 · 0 评论 -
python VTK example(1) -- 文字(二维/三维显示)
AnnotationMultiLineText.pyTextOrigin.py原创 2021-03-12 10:26:58 · 1356 阅读 · 2 评论