实例11:基于VTK对MHD格式文件单张切片的鼠标滑动提取显示
#include "vtkAutoInit.h"
VTK_MODULE_INIT(vtkRenderingOpenGL2);
VTK_MODULE_INIT(vtkInteractionStyle);
#include <vtkSmartPointer.h>
#include <vtkImageReader2.h>
#include <vtkMatrix4x4.h>
#include <vtkImageReslice.h>
#include <vtkLookupTable.h>
#include <vtkImageMapToColors.h>
#include <vtkImageActor.h>
#include <vtkRenderer.h>
#include <vtkRenderWindow.h>
#include <vtkRenderWindowInteractor.h>
#include <vtkInteractorStyleImage.h>
#include <vtkCommand.h>
#include <vtkImageData.h>
#include <vtkMetaImageReader.h>
#include <vtkImageCast.h>
class vtkImageInteractionCallback : public vtkCommand
{
public:
static vtkImageInteractionCallback* New()
{
return new vtkImageInteractionCallback;
}
vtkImageInteractionCallback()
{
this->Slicing = 0;
this->ImageReslice = 0;
this->Interactor = 0;
}
void SetImageReslice(vtkImageReslice* reslice)
{
this->ImageReslice = reslice;
}
void SetImageMapToColors(vtkImageMapToColors* mapToColors)
{
this->mapToColors = mapToColors;
}
vtkImageReslice* GetImageReslice()
{
return this->ImageReslice;
}
void SetInteractor(vtkRenderWindowInteractor* interactor)
{
this->Interactor = interactor;
}
vtkRenderWindowInteractor* GetInteractor()
{
return this->Interactor;
}
virtual void Execute(vtkObject*, unsigned long event, void*)
{
vtkRenderWindowInteractor*