1.51CTO讲解:
http://book.51cto.com/art/201504/474119.htm
2.升采样demo:
https://lorensen.github.io/VTKExamples/site/Cxx/Images/ImageMagnify/
关键代码:
// Increase the dimensions of the image
vtkSmartPointer<vtkImageMagnify> magnifyFilter =
vtkSmartPointer<vtkImageMagnify>::New();
magnifyFilter->SetInputConnection(reader->GetOutputPort());
magnifyFilter->SetMagnificationFactors(2,1,1);
magnifyFilter->Update();
3.降采样demo:
https://lorensen.github.io/VTKExamples/site/Cxx/Images/ImageShrink3D/
关键代码:
vtkSmartPointer<vtkImageShrink3D> shrinkFilter =
vtkSmartPointer<vtkImageShrink3D>::New();
shrinkFilter->SetInputConnection(source->GetOutputPort());
shrinkFilter->SetShrinkFactors(2,1,1);
shrinkFilter->Update();
4.对图像数据进行抽样
vtkSmartPointer<vtkImageResample> resamle = vtkSmartPointer<vtkImageResample> ::New();
resamle->SetInputData(dicomRead->GetOutput());
resamle->SetAxisMagnificationFactor(0,0.5);//x轴抽样0.5
resamle->SetAxisMagnificationFactor(1,0.5);//y轴抽样0.5
resamle->SetAxisMagnificationFactor(2,0.5);//z轴抽样0.5
resamle->Update();