主要应用vtkImageThreshold完成vtkImageData的阈值分割功能,示例代码如下:
vtkSmartPointer<vtkImageThreshold> thresholdFilter = vtkSmartPointer<vtkImageThreshold>::New();
thresholdFilter->SetInputData(VtkImageData);//输入vtkImageData
thresholdFilter->ThresholdBetween(nThresholdMin, nThresholdMax);//设置分割阈值
thresholdFilter->ReplaceInOn();