服务热线
178 0020 3020
方法:
ThresholdByUpper(double thresh) #阈值大于thresh的都被移除 ThresholdByLower(double thresh) #阈值小于thresh的都被移除 ThresholdBetween(double lower, double upper) #获得中间范围
代码:
threshold = vtk.vtkImageThreshold () threshold.SetInputConnection(reader.GetOutputPort()) threshold.ThresholdByLower(400) threshold.ReplaceInOn() threshold.SetInValue(0) # set all values below 400 to 0 threshold.ReplaceOutOn() threshold.SetOutValue(1) # set all values above 400 to 1 threshold.Update()
附件