VTK三维重建(1)-使用VTK读取DICOM,并动态输出
来源:互联网 发布:mic是什么软件 编辑:程序博客网 时间:2024/05/21 19:48
原文地址:http://blog.csdn.net/chinamming/article/details/16829351
[效果显示]
将脚部骨骼扫描的CT照片进行的连续读取, 运行结果存为了两个动态gif, 不知道能不能正常显示
[主程序实现]
int main(int argc, char* argv[]){ // Verify input arguments if ( argc != 2 ) { std::cout << "Usage: " << argv[0] << " FolderName" << std::endl; return EXIT_FAILURE; } std::string folder = argv[1]; // Read all the DICOM files in the specified directory. vtkSmartPointer<vtkDICOMImageReader> reader = vtkSmartPointer<vtkDICOMImageReader>::New(); reader->SetDirectoryName(folder.c_str()); reader->Update(); // Visualize vtkSmartPointer<vtkImageViewer2> imageViewer = vtkSmartPointer<vtkImageViewer2>::New(); imageViewer->SetInputConnection(reader->GetOutputPort()); // slice status message vtkSmartPointer<vtkTextProperty> sliceTextProp = vtkSmartPointer<vtkTextProperty>::New(); sliceTextProp->SetFontFamilyToCourier(); sliceTextProp->SetFontSize(20); sliceTextProp->SetVerticalJustificationToBottom(); sliceTextProp->SetJustificationToLeft(); vtkSmartPointer<vtkTextMapper> sliceTextMapper = vtkSmartPointer<vtkTextMapper>::New(); std::string msg = StatusMessage::Format(imageViewer->GetSliceMin(), imageViewer->GetSliceMax()); sliceTextMapper->SetInput(msg.c_str()); sliceTextMapper->SetTextProperty(sliceTextProp); vtkSmartPointer<vtkActor2D> sliceTextActor = vtkSmartPointer<vtkActor2D>::New(); sliceTextActor->SetMapper(sliceTextMapper); sliceTextActor->SetPosition(15, 10); // usage hint message vtkSmartPointer<vtkTextProperty> usageTextProp = vtkSmartPointer<vtkTextProperty>::New(); usageTextProp->SetFontFamilyToCourier(); usageTextProp->SetFontSize(14); usageTextProp->SetVerticalJustificationToTop(); usageTextProp->SetJustificationToLeft(); vtkSmartPointer<vtkTextMapper> usageTextMapper = vtkSmartPointer<vtkTextMapper>::New(); usageTextMapper->SetInput("- Slice with mouse wheel\n or Up/Down-Key\n- Zoom with pressed right\n mouse button while dragging"); usageTextMapper->SetTextProperty(usageTextProp); vtkSmartPointer<vtkActor2D> usageTextActor = vtkSmartPointer<vtkActor2D>::New(); usageTextActor->SetMapper(usageTextMapper); usageTextActor->GetPositionCoordinate()->SetCoordinateSystemToNormalizedDisplay(); usageTextActor->GetPositionCoordinate()->SetValue( 0.05, 0.95); vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor = vtkSmartPointer<vtkRenderWindowInteractor>::New(); vtkSmartPointer<myVtkInteractorStyleImage> myInteractorStyle = vtkSmartPointer<myVtkInteractorStyleImage>::New(); myInteractorStyle->SetImageViewer(imageViewer); myInteractorStyle->SetStatusMapper(sliceTextMapper); imageViewer->SetupInteractor(renderWindowInteractor); renderWindowInteractor->SetInteractorStyle(myInteractorStyle); imageViewer->GetRenderer()->AddActor2D(sliceTextActor); imageViewer->GetRenderer()->AddActor2D(usageTextActor); imageViewer->Render(); imageViewer->GetRenderer()->ResetCamera(); imageViewer->Render(); renderWindowInteractor->Start(); return EXIT_SUCCESS;}
原文地址:http://blog.csdn.net/chinamming/article/details/16829351
- VTK三维重建(1)-使用VTK读取DICOM,并动态输出
- ITK&&VTK读取DICOM数据并渲染
- 3 vtk读取并显示dicom文件
- VTK读取DICOM图像
- VS2008、QT及VTK实现DICOM图像三维重建之二:VS2008下VTK的安装使用
- 读取并可视化DICOM图像(VTK & OpenCV)
- VC++ VTK 读取序列CT图片三维重建
- ITK/VTK对DICOM文件的读取
- VTK读取序列的Dicom医学图片,用Marchingcube进行重建,并保存为obj文件
- VTK 三维重建 面绘制
- VTK三维重建方法总结
- vtk医学图像三维重建
- VTK读取序列JPG图片MC算法进行三维重建
- ITK+VTK+QT 读取DICOM序列图像遇到的问题(1)
- vtk实战(十三)——读取DICOM影像文件
- ITK、VTK、Qt读取与显示DICOM文件------代码部分
- VTK 读取dicom 出错 : vtkDICOMImageReader returned failure for request: vtkInformation
- VTK实现Dicom文件的读取及显示
- Search in Rotated Sorted Array
- windows下安装lxml
- Robotium第一天:搭建环境测试微信
- 为tomcat8配置BeanManger。
- JNI 之二 :java & c/c++ 相互通信及调用
- VTK三维重建(1)-使用VTK读取DICOM,并动态输出
- UVA - 12554 A Special "Happy Birthday" Song!!!
- 如何停止JAVA线程
- Qt中如何使用QtDesigner创建UI文件
- cc1: error: unrecognized command line option "-m64" 需要添加上ARCH=arm
- android手机抓wireshark包的步骤-tcpdump(很牛逼的工具)
- 面试历程——实时更新到找到工作
- jquery小例子--简单易懂的图片展示
- CCLabelTTF 、CCLabelBMFont 和CCLabelAtlas以及汉字中文的显示