当前位置:网站首页>vtk学习之PipelineExecute管线的执行过程
vtk学习之PipelineExecute管线的执行过程
2022-06-10 08:36:00 【Christo3】
1. 实践
#include <vtkSmartPointer.h>
#include <vtkBMPReader.h>
#include <vtkImageData.h>
#include <vtkRenderWindowInteractor.h>
#include <vtkImageViewer2.h>
#include <vtkRenderWindow.h>
//测试文件:data/VTK-logo.bmp
int main(int argc, char* argv[])
{
const char* str = "D:\\workshop\\VTK\\VTK\\vtk_source\\Examples\\Examples\\Chap02\\data\\VTK-logo.bmp";
vtkSmartPointer<vtkBMPReader> reader = vtkSmartPointer<vtkBMPReader>::New();
std::cout<<"Modification Time of reader (After New()): "<<reader->GetMTime()<<std::endl;
reader->SetFileName(str);
std::cout<<"Modification Time of reader (After SetFileName()): "<<reader->GetMTime()<<std::endl;
vtkImageData* imageData = reader->GetOutput();
std::cout<<"Modification Time of reader (After GetOutput()): "<<reader->GetMTime()<<std::endl;
//reader->Update();
std::cout<<"Modification Time of reader (After Update()): "<<reader->GetMTime()<<std::endl;
int extent[6];
imageData->GetExtent(extent);
std::cout<<"Extent of image: "<<extent[0]<<" "
<<extent[1]<<" "<<extent[2]<<" "<<extent[3]<<" "
<<extent[4]<<" "<<extent[5]<<" "<<std::endl;
vtkSmartPointer<vtkImageViewer2> viewer =
vtkSmartPointer<vtkImageViewer2>::New();
vtkSmartPointer<vtkRenderWindowInteractor> interactor =
vtkSmartPointer<vtkRenderWindowInteractor>::New();
viewer->SetupInteractor(interactor);
viewer->SetInputData(imageData);
viewer->Render();
viewer->SetSize(640, 480);
viewer->GetRenderWindow()->SetWindowName("vtkPipelineExecute");
interactor->Initialize();
interactor->Start();
return EXIT_SUCCESS;
}
- 没有进行
reader->Update()
- 进行了
reader->Update() 
2. 原理



边栏推荐
- How to prevent virus in business system
- What is unit testing and why
- HarmonyOS(鸿蒙)全网最全资源汇总,吐血整理,赶紧收藏!
- 2022.06.04 learning contents
- idea jdbc报错
- The R language catools package divides the data, the scale function scales the data, the KNN function of the class package constructs a k-nearest neighbor classifier, and compares the model accuracy a
- How much do you need to learn before you can find a job in the software test of zero foundation career transition
- [lingo] linear programming
- UART中的硬件流控RTS与CTS
- What objects are suitable for automated testing?
猜你喜欢

世界海洋日 | 徜徉于新泽西海洋生物水族馆,记录趣味纽约旅行

Pinctrl subsystem and GPIO subsystem

USB TYPE -A -B -C 接口
![[cryptography] AES encryption and decryption](/img/a5/ad3fed3004646ca894d59cc22d2f11.png)
[cryptography] AES encryption and decryption

泰國曼穀大城府被福布斯評為“後疫情時代最值得一去的城市”

pinctrl子系统和gpio子系统

What is L3? Why do we need L3? How to build?

If you want to change careers, why do you prefer software testing?

第2章 数据的表示和运算

"Minesweeping", a masterpiece abandoned by Microsoft, has been played out by Chinese players?
随机推荐
MMSegmention系列之六(训练技巧)
想转行,为什么首选软件测试?
SqlServer不同数据库名的还原
What tests are included in the functional test? What is the role of each?
Web page test of software test
Task06:秋招秘籍 C
R语言使用dplyr包的select函数自定义改变dataframe数据中两个数据列的顺序
R语言使用epiDisplay包的pyramid函数可视化金字塔图
STM32 MPU 开发者的十大工作准则
【Lingo】线性规划
MMSegmention系列之三(基本的网络架构和预训练模型)
Unzip the jar package and modify the configuration file (unzip, modify, compress and run)
Mmsegment SERIES V (custom model)
Common ports and services
Sslerror: ('the read operation timed out'), solution
La capitale thaïlandaise de Bangkok a été nommée par Forbes « la ville la plus digne d'être visitée après l'épidémie ».
How is the computer network often disconnected? Start with these questions
pinctrl子系统和gpio子系统
完美人生PerfectLife——角色:Chenyuxin
Service management and communication, basic principle analysis