vtk-imageblend图像融合报错

来源:互联网 发布:60数据库海盗的帽子 编辑:程序博客网 时间:2024/06/06 02:03

参考:http://blog.csdn.net/u012526003/article/details/52066403

在运行《VTK图像开发进阶》中5.2_ImageBlendExample.cpp代码时,报错vtkCompositeDataPipeline (004A4880): Input for connection on index 0 input port index 1 for algorithm vtkImageBlend(004A1958) is of type vtkImageData, but a vtkImageStencilData is required.正在无解之际,找到了解决办法,感谢原博主。
只需将原程序中

imageBlend->SetInput(0,reader->GetOutput());imageBlend->SetInput(1,imageSource->GetOutput());

改为

imageBlend->AddInputData(reader->GetOutput());imageBlend->AddInputData(imageSource->GetOutput());

即可。

0 0