After reading the CT data, if I use vtkImageThreshold
for threshold segmentation and then use vtkMarchingCubes
to generate the polydata
, the resulting polydata
has very noticeable staircase-like textures. However, when I directly use vtkMarchingCubes
, the generated polydata
is relatively smooth. I want to ask how this can be improved.
I checked the output data from imgreader
and vtkImageThreshold
, and the data size and format are exactly the same. If smoothing is required, the processing time is relatively long. Is there a better solution?
vtkNew marchingCubes;
marchingCubes->SetInputConnection(imgReader->GetOutputPort());
marchingCubes->SetValue(0, 500); // 设置等值面的阈值
marchingCubes->Update();
vtkNew thresholdFilter;
thresholdFilter->SetInputData(imgReader->GetOutput());
thresholdFilter->ThresholdBetween(500.0, 9000.0); // 设置阈值范围
thresholdFilter->SetInValue(100.0); // 阈值内的值设为 1.0
thresholdFilter->SetOutValue(0.0); // 阈值外的值设为 0.0
thresholdFilter->Update();
vtkNew marchingCubes;
marchingCubes->SetInputConnection(thresholdFilter->GetOutputPort());
marchingCubes->SetValue(0, 50); // 设置等值面的阈值
marchingCubes->Update();
During the two generation processes, both used 500 as the threshold for distinction. In the first case, marching cubes
was directly applied to the original imagedata
for isosurface reconstruction at 500. In the second case, vtkImageThreshold
was used to set values within the range of 500-9000 to 100, followed by applying marching cubes
for isosurface reconstruction at 50. The results were significantly different.