#include <QuickView.h>
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:
Definition at line 111 of file QuickView.h.
Collaboration diagram for QuickView: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="") |
| void | InterpolateOff () |
| void | InterpolateOn () |
| QuickView () | |
| void | SetNumberOfColumns (const unsigned int columns) |
| void | SetSnapshotExtension (const std::string &iExtension) |
| void | SetSnapshotPath (const std::string &iPath) |
| void | SetSnapshotPrefix (const std::string &iPrefix) |
| void | SetViewPortSize (const unsigned int size) |
| void | ShareCameraOff () |
| void | ShareCameraOn () |
| void | SnapshotOff () |
| void | SnapshotOn () |
| void | Visualize (bool interact=true) |
Private Attributes | |
| std::vector< ImageInfo > | Images |
| itk::IdentifierType | m_Counter |
| bool | m_Interpolate |
| unsigned int | m_NumberOfColumns |
| bool | m_ShareCamera |
| bool | m_Snapshot |
| std::string | m_SnapshotExtension |
| std::string | m_SnapshotPath |
| std::string | m_SnapshotPrefix |
| unsigned int | m_ViewPortSize |
| std::vector< RGBImageInfo > | RGBImages |
|
inline |
Definition at line 114 of file QuickView.h.
References m_Counter, m_Interpolate, m_NumberOfColumns, m_ShareCamera, m_Snapshot, m_SnapshotExtension, m_SnapshotPath, m_SnapshotPrefix, and m_ViewPortSize.
| void QuickView::AddImage | ( | TImage * | , |
| bool | FlipVertical = true, | ||
| std::string | Description = "" ) |
Add an image to be rendered.
| void QuickView::AddRGBImage | ( | TImage * | , |
| bool | FlipVertical = true, | ||
| std::string | Description = "" ) |
Add an RGB image to be rendered
|
inline |
Use pixel replication in rendered image
Definition at line 159 of file QuickView.h.
References m_Interpolate.
|
inline |
Use pixel interpolation in rendered image
Definition at line 166 of file QuickView.h.
References m_Interpolate.
|
inline |
Set the number of columns, default 4.
Definition at line 210 of file QuickView.h.
References m_NumberOfColumns.
|
inline |
Provide the image format to be used when taking snapshot
Definition at line 199 of file QuickView.h.
References m_SnapshotExtension.
|
inline |
Definition at line 186 of file QuickView.h.
References m_SnapshotPath.
|
inline |
Definition at line 192 of file QuickView.h.
References m_SnapshotPrefix.
|
inline |
Set the viewport size, default 300.
Definition at line 217 of file QuickView.h.
References m_ViewPortSize.
|
inline |
Each render window will have its own camera
Definition at line 145 of file QuickView.h.
References m_ShareCamera.
|
inline |
Each render window will use the same camera
Definition at line 152 of file QuickView.h.
References m_ShareCamera.
|
inline |
Each render window will take a snapshot
Definition at line 180 of file QuickView.h.
References m_Snapshot.
|
inline |
Each render window will take a snapshot
Definition at line 173 of file QuickView.h.
References m_Snapshot.
| void QuickView::Visualize | ( | bool | interact = true | ) |
Render the images. If interact is true, start a vtk Interactor. If false, return after one render.
|
private |
Definition at line 223 of file QuickView.h.
|
private |
Definition at line 225 of file QuickView.h.
Referenced by QuickView().
|
private |
Definition at line 231 of file QuickView.h.
Referenced by InterpolateOff(), InterpolateOn(), and QuickView().
|
private |
Definition at line 232 of file QuickView.h.
Referenced by QuickView(), and SetNumberOfColumns().
|
private |
Definition at line 229 of file QuickView.h.
Referenced by QuickView(), ShareCameraOff(), and ShareCameraOn().
|
private |
Definition at line 230 of file QuickView.h.
Referenced by QuickView(), SnapshotOff(), and SnapshotOn().
|
private |
Definition at line 228 of file QuickView.h.
Referenced by QuickView(), and SetSnapshotExtension().
|
private |
Definition at line 226 of file QuickView.h.
Referenced by QuickView(), and SetSnapshotPath().
|
private |
Definition at line 227 of file QuickView.h.
Referenced by QuickView(), and SetSnapshotPrefix().
|
private |
Definition at line 233 of file QuickView.h.
Referenced by QuickView(), and SetViewPortSize().
|
private |
Definition at line 224 of file QuickView.h.