我正在使用 vtkResliceImageViewer
来显示图像(多平面重建)。如何垂直和水平翻转\镜像该图像?使用相机操作没有按预期工作,因为翻转还必须考虑相机旋转角度,所以它变得非常复杂。如果有一种方法可以更改图像的纹理坐标,那就太好了。这可能吗?
最佳答案
// Create an image
vtkSmartPointer<vtkImageMandelbrotSource> source =
vtkSmartPointer<vtkImageMandelbrotSource>::New();
source->Update();
// Flip the image
vtkSmartPointer<vtkImageFlip> flipYFilter =
vtkSmartPointer<vtkImageFlip>::New();
flipYFilter->SetFilteredAxis(1); // flip y axis
flipYFilter->SetInputConnection(source->GetOutputPort());
flipYFilter->Update();
// Create the Viewer
vtkSmartPointer<vtkResliceImageViewer> viewer =
vtkSmartPointer<vtkResliceImageViewer>::New();
viewer->SetInputData(flipYFilter->GetOutput())
关于c++ - VTK - 如何翻转\镜像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43659578/