📄 migwindowbase.h
字号:
/*=========================================================================
Program: My ITK GUI - A Foundation for Pipeline Visualization in ITK
Module: $RCSfile: migWindowBase.h,v $
Language: C++
Date: $Date: 2004/03/04 19:03:29 $
Version: $Revision: 1.4 $
Copyright (c) 2003 Damion Shelton
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef _migWindowBase_h
#define _migWindowBase_h
#include <stdio.h>
// Native ITK stuff
#include "itkSize.h"
#include "itkIndex.h"
#include "itkImage.h"
// For importing ITK images into VTK
#include <vtkImageImport.h>
#include "itkVTKImageExport.h"
// here we have all the usual VTK stuff that we need for our pipeline
#include <vtkRenderer.h>
#include <vtkRenderWindow.h>
#include <vtkActor.h>
#include <vtkActorCollection.h>
// for hooking into FLTK
#include "vtkFlRenderWindowInteractor.h"
// For the cutting planes
#include <vtkImagePlaneWidget.h>
// For hooking up pipelines
#include "itkCommand.h"
class migWindowBase
{
public:
/** Type of input image (we read META format data*/
typedef itk::Image<unsigned char, 3> InputImageType;
// This is included in case we're using VTK 4.2, where the floating
// point type is undefined
#ifndef SWIG
# ifndef vtkFloatingPointType
# define vtkFloatingPointType float
# endif
#endif
/** Type of image exported from ITK to VTK */
typedef itk::VTKImageExport<InputImageType> itkVTKImageExportType;
/** Type of image imported from ITK into VTK */
typedef itkVTKImageExportType::Pointer itkVTKImageExportPointerType;
/** Set the ITK image we're going to display */
void SetImage(InputImageType::Pointer p) {m_InputImage = p;}
/** Puts the image planes in the center of the volume */
void CreateImagePlanes();
/** Put the image planes back at the center of the volume */
void ResetImagePlaneWidgets();
/** Cause the local render window to update */
void Render();
/** Gets the render window actor, for creating widgets */
virtual vtkFlRenderWindowInteractor* GetFLInteractor() = 0;
/** Constructor - not much to see */
migWindowBase();
/** Destructor - not much to see */
virtual ~migWindowBase();
protected:
/** The image we're going to display */
InputImageType::Pointer m_InputImage;
/** VTK rendering architecture */
vtkRenderWindow * m_RenderWindow;
vtkRenderer * m_Renderer;
/** Converter from ITK to VTK */
itkVTKImageExportPointerType itkVTKExporter;
vtkImageImport* vtkImporter;
/** Slices through the volume */
vtkImagePlaneWidget* m_ImagePlaneX;
vtkImagePlaneWidget* m_ImagePlaneY;
vtkImagePlaneWidget* m_ImagePlaneZ;
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -