实例12:基于VTK对MHA格式文件三维感兴趣区域裁剪及MHA格式保存
#include "vtkAutoInit.h"
VTK_MODULE_INIT(vtkRenderingOpenGL2);
VTK_MODULE_INIT(vtkInteractionStyle);
#include <vtkSmartPointer.h>
#include <vtkImageData.h>
#include <vtkRenderWindow.h>
#include <vtkRenderWindowInteractor.h>
#include <vtkInteractorStyleImage.h>
#include <vtkRenderer.h>
#include <vtkImageActor.h>
#include <vtkBMPReader.h>
#include <vtkExtractVOI.h>
#include <vtkMetaImageReader.h>//mha、mad图像读取类
#include <vtkMetaImageWriter.h>mha、mad图像写入类
//测试图像:../data/lena.bmp
int main(int argc, char* argv[])
{
/*vtkSmartPointer<vtkBMPReader> reader =
vtkSmartPointer<vtkBMPReader>::New();
reader->SetFileName("lena.bmp");
reader->Update();*/
vtkSmartPointer<vtkMetaImageReader> reader = vtkSmartPointer<vtkMetaImageReader&g