原文地址: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三维重建软件与VS2010结合,读取格式为Dicom的系列图像,并能显示三维重建结果,语言为C++语言
利用VTK三维重建软件与VS2010结合,读取格式为Dicom的系列图像,并能显示三维重建结果,语言为C++语言(Using VTK 3D reconstruction software and VS2010 combination, read the format of Dicom series of images, ...
摘要: 医 学图像三 维 重建技术利 用二维 医 学图像序列 重建 出三 维模型,为 医 生提供直观、全面、...实验结 果表明 本文提 出的 解决方 案和优化 方法 实 用可 靠, 为进一 步 开发 医学三维 图形 系统打 下 了基础。
VTK+MFC读取医学dicom图像及GPU三维重建(VTK MFC GPU)
基于VTK的三维医学图像虚拟切片提取 可以帮助大家提高么
读取硬盘的dicom图像文件夹,进行三维重建。鼠标控制旋转。
读取dicom 并显示 全部病人的信息 bmp图的 三维处理
vtk刚开始看,这里仅仅只是其最简单的读取显示功能。此处用到了vtk库,可自行百度安装方法。 下面附上代码: from vtk import * # reader the dicom file reader = vtkDICOMImageReader() reader....
利用ITK读取DICOM序列文件,然后转为VTK格式数据利用Marching cubes算法进行三维重建
读取DICOM文件,进行三维重建,并使用vtkwidgetbox添加3D框,程序可以直接运行。
将vTK、QT以及visual studio三者结合起来对医学DIc0M影像进行可视化分析,通过vTK读取医学DIcOM影像并进行三维重建后显示
使用vs2017 c++开发工具mfc+vtk技术实现读取CT医学影像dicom文件dcm,并进行三维重建可视化显示,源码中附带医学影像dcm数据文件和可执行程序以及程序运行截图。
利用VTK在三维重建及可视化方面的突出能力与ITK强大的图像处理功能,将它们集成起来,是开发医学影像 可视化系统的重要方法。介绍了在Visual C++环境中,VTK与ITK实现集成的方法与步骤,重点讨论了在读取DICOM 数据...