ITK  4.6.0
Insight Segmentation and Registration Toolkit
Public Member Functions | Private Attributes | List of all members
QuickView Class Reference

#include <QuickView.h>

+ Collaboration diagram for QuickView:

Detailed Description

A convenient class to render itk images with vtk.

This class presents a convenient and efficient mechanism to display ITK images in VTK render windows.

The AddImage and AddRGBImage methods collect ITK images to be rendered in a collection of VTK RenderWindow's. Each image can be flipped about the vertical axis. An optional description will be displayed at the bottom of each render window.

If m_ShareCamera is true, a single vtkCamera will be used for each render window (default is false).

Each image is rescaled to have a range between 0 and 255. Currently, the size of each render window is fixed at 300,300 and the text size for descriptions is fixed at 10.

The Visualize method displays the render windows and starts a vtkInteractorStyleImage. The layout and background color of each render window is fixed. The optional boolean for the constructor, if false, bypasses the interactor. This is useful for running tests.

Typical usage:

* QuickView viewer;
* viewer.AddImage(someFilter->GetOutput().
* true (to flip image) or false.
* "text to display with the image");
*
* viewer.AddRGBImage(someFilter->GetOutput().
* true (to flip image) or false.
* "text to display with the image");
*

Definition at line 105 of file QuickView.h.

Public Member Functions

template<typename TImage >
void AddImage (TImage *, bool FlipVertical=true, std::string Description="")
 
template<typename TImage >
void AddRGBImage (TImage *, bool FlipVertical=true, std::string Description="")
 
 QuickView ()
 
void SetSnapshotPath (const std::string &iPath)
 
void SetSnapshotPrefix (const std::string &iPrefix)
 
void ShareCameraOff ()
 
void ShareCameraOn ()
 
void SnapshotOff ()
 
void SnapshotOn ()
 
void Visualize (bool interact=true)
 
void SetSnapshotExtension (const std::string &iExtension)
 

Private Attributes

std::vector< ImageInfoImages
 
itk::IdentifierType m_Counter
 
bool m_ShareCamera
 
bool m_Snapshot
 
std::string m_SnapshotExtension
 
std::string m_SnapshotPath
 
std::string m_SnapshotPrefix
 
std::vector< RGBImageInfoRGBImages
 

Constructor & Destructor Documentation

QuickView::QuickView ( )
inline

Member Function Documentation

template<typename TImage >
void QuickView::AddImage ( TImage *  ,
bool  FlipVertical = true,
std::string  Description = "" 
)

Add an image to be rendered.

template<typename TImage >
void QuickView::AddRGBImage ( TImage *  ,
bool  FlipVertical = true,
std::string  Description = "" 
)

Add an RGB image to be rendered

void QuickView::SetSnapshotExtension ( const std::string &  iExtension)
inline

Provide the image format to be used when taking snapshot

Definition at line 170 of file QuickView.h.

References m_SnapshotExtension.

void QuickView::SetSnapshotPath ( const std::string &  iPath)
inline

Definition at line 159 of file QuickView.h.

References m_SnapshotPath.

void QuickView::SetSnapshotPrefix ( const std::string &  iPrefix)
inline

Definition at line 164 of file QuickView.h.

References m_SnapshotPrefix.

void QuickView::ShareCameraOff ( )
inline

Each render window will have its own camera

Definition at line 136 of file QuickView.h.

References m_ShareCamera.

void QuickView::ShareCameraOn ( )
inline

Each render window will use the same camera

Definition at line 142 of file QuickView.h.

References m_ShareCamera.

void QuickView::SnapshotOff ( )
inline

Each render window will take a snaphot

Definition at line 154 of file QuickView.h.

References m_Snapshot.

void QuickView::SnapshotOn ( )
inline

Each render window will take a snaphot

Definition at line 148 of file QuickView.h.

References m_Snapshot.

void QuickView::Visualize ( bool  interact = true)

Render the images. If interact is tru, start a vtk Interactor. If false, return after one render.

Member Data Documentation

std::vector<ImageInfo> QuickView::Images
private

Definition at line 182 of file QuickView.h.

itk::IdentifierType QuickView::m_Counter
private

Definition at line 184 of file QuickView.h.

Referenced by QuickView().

bool QuickView::m_ShareCamera
private

Definition at line 188 of file QuickView.h.

Referenced by QuickView(), ShareCameraOff(), and ShareCameraOn().

bool QuickView::m_Snapshot
private

Definition at line 189 of file QuickView.h.

Referenced by QuickView(), SnapshotOff(), and SnapshotOn().

std::string QuickView::m_SnapshotExtension
private

Definition at line 187 of file QuickView.h.

Referenced by QuickView(), and SetSnapshotExtension().

std::string QuickView::m_SnapshotPath
private

Definition at line 185 of file QuickView.h.

Referenced by QuickView(), and SetSnapshotPath().

std::string QuickView::m_SnapshotPrefix
private

Definition at line 186 of file QuickView.h.

Referenced by QuickView(), and SetSnapshotPrefix().

std::vector<RGBImageInfo> QuickView::RGBImages
private

Definition at line 183 of file QuickView.h.


The documentation for this class was generated from the following file: