itk2vtk、vtk2itk
//---------------------------------------------------------------------------------------------
typedef itk::ImageToVTKImageFilter<ImageType> itkVtkConverter;
itkVtkConverter::Pointer conv=itkVtkConverter::New();
conv->SetInput(Thresholdfilter->GetOutput());
conv->Update();///////////////////////////////
vtkSmartPointer<vtkImageData> image2=vtkSmartPointer<vtkImageData>::New();
image2->ShallowCopy(conv->GetOutput());/////////////////
--------------------------------------------------------------------------------
typedef itk::VTKImageToImageFilter<ImageType> VTKImageToImageType;
VTKImageToImageType::Pointer vtkImageToImageFilter = VTKImageToImageType::New();
vtkImageToImageFilter->SetInput(openClose->GetOutput());
vtkImageToImageFilter->Update();
本文介绍如何使用ITK库中的ImageToVTKImageFilter和VTK库中的VTKImageToImageFilter进行图像格式的转换。具体实现包括将ITK图像转换为VTK图像并完成更新操作,以及将VTK图像转换回ITK图像的过程。
7889

被折叠的 条评论
为什么被折叠?



