当前位置:网站首页>VTK volume rendering program design of 3D scanned volume data
VTK volume rendering program design of 3D scanned volume data
2022-07-07 00:19:00 【biyezuopinvip】
Resource download address :https://download.csdn.net/download/sheziqiong/85926449
Resource download address :https://download.csdn.net/download/sheziqiong/85926449
pick want
With the continuous development of science and Technology , electronic technique 、 Computer technology 、 The wide application of network technology in the field of Surveying and mapping , The ability and means to obtain data have been greatly enriched . In the face of explosive growth in the amount of data , How to display and process these data more effectively on the basis of preserving the original details of the data , It has become the focus of future research . The main content of this paper is to introduce the scientific visualization method of volume rendering , Its advantages over traditional bin rendering methods are analyzed , Then several different volume rendering algorithms and their characteristics are introduced . Then it introduces VTK The relevant structure and functions of the visualization software package , And use VTK Write a program to realize volume rendering , Finally, the obtained result image is analyzed .
key word : Volume rendering ; Scientific visualization ; 3D volume data
ABSTRACT
With the continuous development of science and technology, electronic technology, computer technology, network technology is widely used in the field of surveying and mapping, data acquisition capability and means has been greatly enriched. To deal with those amount of data became more and more significant, how to be more effective in retaining the original details of the data on the display and processing of these data, it would be the focus of future research. The main content of this paper is to introduce the scientific visualization volume rendering method, analyzes its advantages compared to the traditional method of drawing bins, and then introduces several different volume rendering algorithm and its characteristics. Then introduced the VTK visualization related structure and function packages, and volume rendering using VTK write a program to be realized, the final analysis result of the image obtained.
Keywords: Volume data; Volume Render; scientific visualization
Objective record
1 The introduction 1
1.1 Research status and development trend of volume rendering 1
1.2 The source and significance of the research 2
1.3 The main content of the study 3
1.4 The main structure of the paper 4
2 Volume rendering principle 5
2.1 Shortcomings of traditional rendering methods 5
2.2 Introduction to several algorithms of volume rendering 6
2.2.1 Ray casting 6
2.2.2 Snowball throwing method 7
2.2.3 Crosscutting — Deformation method 8
2.2.4 Hardware based 3D texture mapping 9
2.3 Comparison of four volume rendering algorithms 10
2.3.1 Ray casting 10
2.3.2 Snowball algorithm 10
2.3.3 Crosscutting - Deformation method 10
2.3.4 Hardware based 3D texture mapping 10
3 Visualization Toolkit VTK 12
3.1 VTK Introduce 12
3.2 VTK Application architecture 12
3.2.1 VTK The main structure of 12
3.2.2 Visual pipeline 14
3.2.3 VTK Volume rendering visualization pipeline 15
3.3 VTK Reading and writing data of 15
3.3.1 VTK Data read / write structure 15
3.3.2 VTK The main steps of data reading and writing 16
3.3.3 VTK Introduction to specific classes of data reading and writing 16
3.3.4 Type conversion of image data 17
3.4 A simple VTK engineering 18
4 VTK Lower body rendering practice 20
4.1 Environment configuration 20
4.1.1 obtain VTK Source code 20
4.1.2 compile VTK Preparatory work 20
4.1.3 compile VTK Step by step 20
4.2 Program operation process 23
4.2.1 23
Main program Python Code 23
4.2.2 Program flow chart 26
4.3 Result analysis 26
4.3.1 Experimental data description 26
4.3.2 Program function description 27
4.3.3 Program result image 28
5 Conclusion 32
5.1 summary 32
5.2 expectation 32
reference 34
Cause thank 35
This paper is about volume rendering algorithm in scientific visualization , And the use of VTK Research on the implementation method of volume rendering program based on software library . The main work is to analyze the shortcomings of traditional bin rendering methods compared with volume rendering methods and the characteristics of various volume rendering algorithms , It introduces VTK The program architecture and main functions of the software library , The corresponding functions of its various modules , And the transfer relationship of its data flow in the visualization pipeline and rendering engine , Finally, use the latest VTK6.3.0 Version to build the programming environment and write the volume rendering program , The results obtained are analyzed .
This paper is roughly divided into five chapters :
The first chapter is the introduction , This paper introduces the research status of this topic at home and abroad , The source and significance of the topic and the main research content .
The second chapter analyzes the shortcomings of traditional bin rendering methods , And four main algorithm principles of volume rendering are introduced , The differences between these methods are discussed .
The third chapter is right VTK Introduction of software library , Its architecture and main functions are introduced , The function of each module and the characteristics of data reading and writing , Finally, with the help of a simple VTK The program introduces the structure of its volume rendering program code .
The fourth chapter is about using VTK Practice of Programming Volume Rendering , Use CMAKE The latest version of VTK The construction of programming environment , To write Python The program realizes the basic functions of volume rendering program , Finally, the result image of 3D data processing with the program is analyzed .
The fifth chapter is the conclusion , The content of the full text is sorted out and summarized , Put forward some prospects .
Volume rendering program code :
```csharp
#!/usr/bin/env python
# *-* coding:utf-8 *-*
from vtk import *
# Read , It uses vtkMetaImageReader Class read MHD Format
file_name = r"G:\graduate project\VolumeRenderData\backpack8.raw\backpack8.mhd"
reader = vtkMetaImageReader()
reader.SetFileName(file_name)
#vtkImageCast Data type conversion , Here it's converted into unsignedShort
cast = vtkImageCast()
cast.SetInputConnection(reader.GetOutputPort())
cast.SetOutputScalarTypeToUnsignedShort()
cast.Update()
output = cast.GetOutputPort()
'''
# Or use vtk Format read directly
file_name = r"mummy.128.vtk"
reader = vtkStructuredPointsReader()
reader.SetFileName(file_name)
reader.Update()
output = reader.GetOutputPort()
'''
# Define volume rendering algorithm functions
##rayCastFun = vtkVolumeRayCastCompositeFunction() # Ray casting
##rayCastFun = vtkVolumeRayCastMIPFunction() # Maximum density method
rayCastFun = vtkVolumeRayCastIsosurfaceFunction() # Specific isosurface method
rayCastFun.SetIsoValue(100) # Value of specific isosurface
# Set volume painting Mapper, There are two inputs
volumeMapper = vtkVolumeRayCastMapper()
volumeMapper.SetInputConnection(output) # The first is to input image data
volumeMapper.SetVolumeRayCastFunction(rayCastFun) # The other is to set the ray casting function of volume rendering
######### Next, it's time to set various attributes of volume painting www############################
'''
# Set the ray sampling distance
volumeMapper.SetSampleDistance(volumeMapper.GetSampleDistance()*4)
# Set the image sampling step
volumeMapper.SetAutoAdjustSampleDistances(0)
volumeMapper.SetImageSampleDistance(4)
'''
# Volume painting attribute settings
volumeProperty = vtkVolumeProperty()
volumeProperty.SetInterpolationTypeToLinear()
volumeProperty.ShadeOn() # Turn shadow testing on or off
volumeProperty.SetAmbient(0.4)
volumeProperty.SetDiffuse(0.6)
volumeProperty.SetSpecular(0.2)
# Gray opacity function
compositeOpacity = vtkPiecewiseFunction()
compositeOpacity.AddPoint(70, 0.00)
compositeOpacity.AddPoint(90, 0.40)
compositeOpacity.AddPoint(180, 0.60)
volumeProperty.SetScalarOpacity(compositeOpacity) # Gray opacity function imports volume rendering attributes
# Color transfer function
color = vtkColorTransferFunction()
color.AddRGBPoint(0.000, 0.00, 0.00, 0.00)
color.AddRGBPoint(64.00, 1.00, 0.52, 0.30)
color.AddRGBPoint(190.0, 1.00, 1.00, 1.00)
color.AddRGBPoint(220.0, 0.20, 0.20, 0.20)
volumeProperty.SetColor(color) # Import color function
# Gradient opacity function
volumeGradientOpacity = vtkPiecewiseFunction()
volumeGradientOpacity.AddPoint(10, 0.0)
volumeGradientOpacity.AddPoint(90, 0.5)
volumeGradientOpacity.AddPoint(110, 1.0)
##volumeProperty.SetGradientOpacity(volumeGradientOpacity)# Import gradient opacity effect
#vtkVolume type , is equivalent to vtkActor, Accept two inputs
volume = vtkVolume()
volume.SetMapper(volumeMapper) # Set up Mapper object
volume.SetProperty(volumeProperty) # Set the property object
###################################### Render engine settings ############################
ren = vtkRenderer()
ren.SetBackground(1.0, 1.0, 1.0)
ren.AddVolume(volume)
renWin = vtkRenderWindow()
renWin.AddRenderer(ren)
renWin.Render()
renWin.SetWindowName("VolumeRenderingApp")
iren = vtkRenderWindowInteractor()
iren.SetRenderWindow(renWin)
ren.ResetCamera()
renWin.Render()
iren.Start()
Resource download address :https://download.csdn.net/download/sheziqiong/85926449
Resource download address :https://download.csdn.net/download/sheziqiong/85926449
Resource download address :https://download.csdn.net/download/sheziqiong/85926449
Resource download address :https://download.csdn.net/download/sheziqiong/85926449
边栏推荐
- 沉浸式投影在线下展示中的三大应用特点
- PostgreSQL高可用之repmgr(1主2从+1witness)+Pgpool-II实现主从切换+读写分离
- 37頁數字鄉村振興智慧農業整體規劃建設方案
- 37页数字乡村振兴智慧农业整体规划建设方案
- web渗透测试是什么_渗透实战
- Compile logisim
- 37 pages Digital Village revitalization intelligent agriculture Comprehensive Planning and Construction Scheme
- Automatic test tool katalon (WEB) test operation instructions
- 2022 PMP project management examination agile knowledge points (9)
- Use package FY in Oracle_ Recover_ Data. PCK to recover the table of truncate misoperation
猜你喜欢
Testers, how to prepare test data
What is AVL tree?
Wind chime card issuing network source code latest version - commercially available
1000 words selected - interface test basis
The programmer resigned and was sentenced to 10 months for deleting the code. Jingdong came home and said that it took 30000 to restore the database. Netizen: This is really a revenge
2022/2/12 summary
准备好在CI/CD中自动化持续部署了吗?
DAY THREE
pytest多进程/多线程执行测试用例
Cas d'essai fonctionnel universel de l'application
随机推荐
Use type aliases in typescript
Huawei mate8 battery price_ Huawei mate8 charges very slowly after replacing the battery
《LaTex》LaTex数学公式简介「建议收藏」
Devops can help reduce technology debt in ten ways
Random类的那些事
C语言输入/输出流和文件操作【二】
MIT 6.824 - raft Student Guide
How to answer the dualistic opposition of Zhihu
三句话简要介绍子网掩码
Command line kills window process
After leaving a foreign company, I know what respect and compliance are
【精品】pinia 基于插件pinia-plugin-persist的 持久化
ldap创建公司组织、人员
陀螺仪的工作原理
PostgreSQL使用Pgpool-II实现读写分离+负载均衡
Oracle EMCC 13.5 environment in docker every minute
kubernetes部署ldap
How rider uses nuget package offline
谷歌百度雅虎都是中国公司开发的通用搜索引擎_百度搜索引擎url
MySQL learning notes (mind map)