VTK
|
Display a 2D image. More...
#include <vtkImageViewer2.h>
Public Types | |
typedef vtkObject | Superclass |
![]() | |
typedef vtkObjectBase | Superclass |
Public Member Functions | |
virtual int | IsA (const char *type) |
vtkImageViewer2 * | NewInstance () const |
void | PrintSelf (ostream &os, vtkIndent indent) |
virtual const char * | GetWindowName () |
virtual void | Render (void) |
virtual void | UpdateDisplayExtent () |
virtual void | SetupInteractor (vtkRenderWindowInteractor *) |
virtual void | SetInputData (vtkImageData *in) |
virtual vtkImageData * | GetInput () |
virtual void | SetInputConnection (vtkAlgorithmOutput *input) |
virtual int | GetSlice () |
virtual void | SetSlice (int s) |
virtual int | GetSliceMin () |
virtual int | GetSliceMax () |
virtual void | GetSliceRange (int range[2]) |
virtual void | GetSliceRange (int &min, int &max) |
virtual int * | GetSliceRange () |
virtual double | GetColorWindow () |
virtual double | GetColorLevel () |
virtual void | SetColorWindow (double s) |
virtual void | SetColorLevel (double s) |
virtual void | SetDisplayId (void *a) |
virtual void | SetWindowId (void *a) |
virtual void | SetParentId (void *a) |
virtual int * | GetPosition () |
virtual void | SetPosition (int a, int b) |
virtual void | SetPosition (int a[2]) |
virtual int * | GetSize () |
virtual void | SetSize (int a, int b) |
virtual void | SetSize (int a[2]) |
virtual vtkRenderWindow * | GetRenderWindow () |
virtual vtkRenderer * | GetRenderer () |
virtual vtkImageActor * | GetImageActor () |
virtual vtkImageMapToWindowLevelColors * | GetWindowLevel () |
virtual vtkInteractorStyleImage * | GetInteractorStyle () |
virtual void | SetRenderWindow (vtkRenderWindow *arg) |
virtual void | SetRenderer (vtkRenderer *arg) |
virtual void | SetOffScreenRendering (int) |
virtual int | GetOffScreenRendering () |
virtual void | OffScreenRenderingOn () |
virtual void | OffScreenRenderingOff () |
![]() | |
vtkObject * | NewInstance () const |
virtual void | DebugOn () |
virtual void | DebugOff () |
bool | GetDebug () |
void | SetDebug (bool debugFlag) |
virtual void | Modified () |
virtual unsigned long | GetMTime () |
unsigned long | AddObserver (unsigned long event, vtkCommand *, float priority=0.0f) |
unsigned long | AddObserver (const char *event, vtkCommand *, float priority=0.0f) |
vtkCommand * | GetCommand (unsigned long tag) |
void | RemoveObserver (vtkCommand *) |
void | RemoveObservers (unsigned long event, vtkCommand *) |
void | RemoveObservers (const char *event, vtkCommand *) |
int | HasObserver (unsigned long event, vtkCommand *) |
int | HasObserver (const char *event, vtkCommand *) |
void | RemoveObserver (unsigned long tag) |
void | RemoveObservers (unsigned long event) |
void | RemoveObservers (const char *event) |
void | RemoveAllObservers () |
int | HasObserver (unsigned long event) |
int | HasObserver (const char *event) |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f) |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
int | InvokeEvent (unsigned long event, void *callData) |
int | InvokeEvent (const char *event, void *callData) |
int | InvokeEvent (unsigned long event) |
int | InvokeEvent (const char *event) |
![]() | |
const char * | GetClassName () const |
virtual void | Delete () |
virtual void | FastDelete () |
void | Print (ostream &os) |
virtual void | Register (vtkObjectBase *o) |
virtual void | UnRegister (vtkObjectBase *o) |
void | SetReferenceCount (int) |
void | PrintRevisions (ostream &) |
virtual void | PrintHeader (ostream &os, vtkIndent indent) |
virtual void | PrintTrailer (ostream &os, vtkIndent indent) |
int | GetReferenceCount () |
Static Public Member Functions | |
static vtkImageViewer2 * | New () |
static int | IsTypeOf (const char *type) |
static vtkImageViewer2 * | SafeDownCast (vtkObjectBase *o) |
![]() | |
static int | IsTypeOf (const char *type) |
static vtkObject * | SafeDownCast (vtkObjectBase *o) |
static vtkObject * | New () |
static void | BreakOnError () |
static void | SetGlobalWarningDisplay (int val) |
static void | GlobalWarningDisplayOn () |
static void | GlobalWarningDisplayOff () |
static int | GetGlobalWarningDisplay () |
![]() | |
static int | IsTypeOf (const char *name) |
static vtkObjectBase * | New () |
Protected Member Functions | |
virtual vtkObjectBase * | NewInstanceInternal () const |
vtkImageViewer2 () | |
~vtkImageViewer2 () | |
virtual void | InstallPipeline () |
virtual void | UnInstallPipeline () |
virtual void | UpdateOrientation () |
vtkAlgorithm * | GetInputAlgorithm () |
vtkInformation * | GetInputInformation () |
![]() | |
vtkObject () | |
virtual | ~vtkObject () |
virtual void | RegisterInternal (vtkObjectBase *, int check) |
virtual void | UnRegisterInternal (vtkObjectBase *, int check) |
void | InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL) |
void | InternalReleaseFocus () |
![]() | |
vtkObjectBase () | |
virtual | ~vtkObjectBase () |
virtual void | CollectRevisions (ostream &) |
virtual void | ReportReferences (vtkGarbageCollector *) |
vtkObjectBase (const vtkObjectBase &) | |
void | operator= (const vtkObjectBase &) |
Protected Attributes | |
vtkImageMapToWindowLevelColors * | WindowLevel |
vtkRenderWindow * | RenderWindow |
vtkRenderer * | Renderer |
vtkImageActor * | ImageActor |
vtkRenderWindowInteractor * | Interactor |
vtkInteractorStyleImage * | InteractorStyle |
int | SliceOrientation |
int | FirstRender |
int | Slice |
![]() | |
bool | Debug |
vtkTimeStamp | MTime |
vtkSubjectHelper * | SubjectHelper |
![]() | |
vtkAtomicInt32 | ReferenceCount |
vtkWeakPointerBase ** | WeakPointers |
Friends | |
class | vtkImageViewer2Callback |
enum | { SLICE_ORIENTATION_YZ = 0, SLICE_ORIENTATION_XZ = 1, SLICE_ORIENTATION_XY = 2 } |
virtual int | GetSliceOrientation () |
virtual void | SetSliceOrientation (int orientation) |
virtual void | SetSliceOrientationToXY () |
virtual void | SetSliceOrientationToYZ () |
virtual void | SetSliceOrientationToXZ () |
Display a 2D image.
vtkImageViewer2 is a convenience class for displaying a 2D image. It packages up the functionality found in vtkRenderWindow, vtkRenderer, vtkImageActor and vtkImageMapToWindowLevelColors into a single easy to use class. This class also creates an image interactor style (vtkInteractorStyleImage) that allows zooming and panning of images, and supports interactive window/level operations on the image. Note that vtkImageViewer2 is simply a wrapper around these classes.
vtkImageViewer2 uses the 3D rendering and texture mapping engine to draw an image on a plane. This allows for rapid rendering, zooming, and panning. The image is placed in the 3D scene at a depth based on the z-coordinate of the particular image slice. Each call to SetSlice() changes the image data (slice) displayed AND changes the depth of the displayed slice in the 3D scene. This can be controlled by the AutoAdjustCameraClippingRange ivar of the InteractorStyle member.
It is possible to mix images and geometry, using the methods:
viewer->SetInputConnection( imageSource->GetOutputPort() ); or viewer->SetInputData ( image ); viewer->GetRenderer()->AddActor( myActor );
This can be used to annotate an image with a PolyData of "edges" or or highlight sections of an image or display a 3D isosurface with a slice from the volume, etc. Any portions of your geometry that are in front of the displayed slice will be visible; any portions of your geometry that are behind the displayed slice will be obscured. A more general framework (with respect to viewing direction) for achieving this effect is provided by the vtkImagePlaneWidget .
Note that pressing 'r' will reset the window/level and pressing shift+'r' or control+'r' will reset the camera.
Definition at line 77 of file vtkImageViewer2.h.
typedef vtkObject vtkImageViewer2::Superclass |
Definition at line 81 of file vtkImageViewer2.h.
anonymous enum |
Set/get the slice orientation BTX
Enumerator | |
---|---|
SLICE_ORIENTATION_YZ | |
SLICE_ORIENTATION_XZ | |
SLICE_ORIENTATION_XY |
Definition at line 99 of file vtkImageViewer2.h.
|
protected |
|
protected |
|
static |
|
static |
|
virtual |
Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.
Reimplemented from vtkObject.
Reimplemented in vtkResliceImageViewer.
|
static |
|
protectedvirtual |
Reimplemented from vtkObject.
Reimplemented in vtkResliceImageViewer.
vtkImageViewer2* vtkImageViewer2::NewInstance | ( | ) | const |
|
virtual |
Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.
Reimplemented from vtkObject.
Reimplemented in vtkResliceImageViewer.
|
virtual |
Get the name of rendering window.
|
virtual |
Render the resulting image.
Reimplemented in vtkResliceImageViewer.
|
virtual |
Set/Get the input image to the viewer.
Reimplemented in vtkResliceImageViewer.
|
virtual |
Set/Get the input image to the viewer.
|
virtual |
Set/Get the input image to the viewer.
Reimplemented in vtkResliceImageViewer.
|
virtual |
Set/get the slice orientation BTX
|
virtual |
Set/get the slice orientation BTX
|
inlinevirtual |
Set/get the slice orientation BTX
Definition at line 108 of file vtkImageViewer2.h.
|
inlinevirtual |
Set/get the slice orientation BTX
Definition at line 110 of file vtkImageViewer2.h.
|
inlinevirtual |
Set/get the slice orientation BTX
Definition at line 112 of file vtkImageViewer2.h.
|
virtual |
Set/Get the current slice to display (depending on the orientation this can be in X, Y or Z).
|
virtual |
Set/Get the current slice to display (depending on the orientation this can be in X, Y or Z).
|
virtual |
Update the display extent manually so that the proper slice for the given orientation is displayed. It will also try to set a reasonable camera clipping range. This method is called automatically when the Input is changed, but most of the time the input of this class is likely to remain the same, i.e. connected to the output of a filter, or an image reader. When the input of this filter or reader itself is changed, an error message might be displayed since the current display extent is probably outside the new whole extent. Calling this method will ensure that the display extent is reset properly.
Reimplemented in vtkResliceImageViewer.
|
virtual |
Return the minimum and maximum slice values (depending on the orientation this can be in X, Y or Z).
|
virtual |
Return the minimum and maximum slice values (depending on the orientation this can be in X, Y or Z).
|
inlinevirtual |
Return the minimum and maximum slice values (depending on the orientation this can be in X, Y or Z).
Definition at line 139 of file vtkImageViewer2.h.
Return the minimum and maximum slice values (depending on the orientation this can be in X, Y or Z).
|
virtual |
Return the minimum and maximum slice values (depending on the orientation this can be in X, Y or Z).
|
virtual |
Set window and level for mapping pixels to colors.
|
virtual |
Set window and level for mapping pixels to colors.
|
virtual |
Set window and level for mapping pixels to colors.
Reimplemented in vtkResliceImageViewer.
|
virtual |
Set window and level for mapping pixels to colors.
Reimplemented in vtkResliceImageViewer.
|
virtual |
These are here when using a Tk window.
|
virtual |
These are here when using a Tk window.
|
virtual |
These are here when using a Tk window.
|
virtual |
Set/Get the position in screen coordinates of the rendering window.
Set/Get the position in screen coordinates of the rendering window.
|
inlinevirtual |
Set/Get the position in screen coordinates of the rendering window.
Definition at line 164 of file vtkImageViewer2.h.
|
virtual |
Set/Get the size of the window in screen coordinates in pixels.
Set/Get the size of the window in screen coordinates in pixels.
|
inlinevirtual |
Set/Get the size of the window in screen coordinates in pixels.
Definition at line 171 of file vtkImageViewer2.h.
|
virtual |
Get the internal render window, renderer, image actor, and image map instances.
|
virtual |
Get the internal render window, renderer, image actor, and image map instances.
|
virtual |
Get the internal render window, renderer, image actor, and image map instances.
|
virtual |
Get the internal render window, renderer, image actor, and image map instances.
|
virtual |
Get the internal render window, renderer, image actor, and image map instances.
|
virtual |
Set your own renderwindow and renderer
|
virtual |
Set your own renderwindow and renderer
|
virtual |
Attach an interactor for the internal render window.
|
virtual |
Create a window in memory instead of on the screen. This may not be supported for every type of window and on some windows you may need to invoke this prior to the first render.
|
virtual |
Create a window in memory instead of on the screen. This may not be supported for every type of window and on some windows you may need to invoke this prior to the first render.
|
virtual |
Create a window in memory instead of on the screen. This may not be supported for every type of window and on some windows you may need to invoke this prior to the first render.
|
virtual |
Create a window in memory instead of on the screen. This may not be supported for every type of window and on some windows you may need to invoke this prior to the first render.
|
protectedvirtual |
Reimplemented in vtkResliceImageViewer.
|
protectedvirtual |
Reimplemented in vtkResliceImageViewer.
|
protectedvirtual |
Reimplemented in vtkResliceImageViewer.
|
protected |
|
protected |
|
friend |
Definition at line 225 of file vtkImageViewer2.h.
|
protected |
Definition at line 209 of file vtkImageViewer2.h.
|
protected |
Definition at line 210 of file vtkImageViewer2.h.
|
protected |
Definition at line 211 of file vtkImageViewer2.h.
|
protected |
Definition at line 212 of file vtkImageViewer2.h.
|
protected |
Definition at line 213 of file vtkImageViewer2.h.
|
protected |
Definition at line 214 of file vtkImageViewer2.h.
|
protected |
Definition at line 216 of file vtkImageViewer2.h.
|
protected |
Definition at line 217 of file vtkImageViewer2.h.
|
protected |
Definition at line 218 of file vtkImageViewer2.h.