版权声明:本文为博主原创文章,转载请注明出处 https://blog.csdn.net/heliucs/article/details/71006144
在运行《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());
即可。