ITK  6.0.0
Insight Toolkit
Public Member Functions | Private Attributes | List of all members
QuickView Class Reference

#include <QuickView.h>

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");
Examples
SphinxExamples/src/Bridge/VtkGlue/VTKImageToITKImage/Code.cxx, SphinxExamples/src/Core/Common/DisplayImage/Code.cxx, SphinxExamples/src/Core/Common/IterateLineThroughImage/Code.cxx, SphinxExamples/src/Core/Common/IterateRegionWithAccessToIndexWithoutWriteAccess/Code.cxx, SphinxExamples/src/Core/Common/IterateRegionWithAccessToIndexWithWriteAccess/Code.cxx, SphinxExamples/src/Core/Common/MultiThreadOilPainting/Code.cxx, SphinxExamples/src/Core/SpatialObjects/ContourSpatialObject/Code.cxx, SphinxExamples/src/Core/Transform/GlobalRegistrationTwoImagesBSpline/Code.cxx, SphinxExamples/src/Developer/OilPaintingImageFilter.cxx, SphinxExamples/src/Filtering/AnisotropicSmoothing/SmoothImageWhilePreservingEdges/Code.cxx, SphinxExamples/src/Filtering/AnisotropicSmoothing/SmoothImageWhilePreservingEdges2/Code.cxx, SphinxExamples/src/Filtering/BinaryMathematicalMorphology/ClosingBinaryImage/Code.cxx, SphinxExamples/src/Filtering/BinaryMathematicalMorphology/OpeningBinaryImage/Code.cxx, SphinxExamples/src/Filtering/BinaryMathematicalMorphology/PruneBinaryImage/Code.cxx, SphinxExamples/src/Filtering/Convolution/ColorNormalizedCorrelation/Code.cxx, SphinxExamples/src/Filtering/Convolution/ConvolveImageWithKernel/Code.cxx, SphinxExamples/src/Filtering/Convolution/NormalizedCorrelation/Code.cxx, SphinxExamples/src/Filtering/CurvatureFlow/BinaryMinMaxCurvatureFlow/Code.cxx, SphinxExamples/src/Filtering/CurvatureFlow/SmoothImageUsingCurvatureFlow/Code.cxx, SphinxExamples/src/Filtering/CurvatureFlow/SmoothImageUsingMinMaxCurvatureFlow/Code.cxx, SphinxExamples/src/Filtering/CurvatureFlow/SmoothRGBImageUsingCurvatureFlow/Code.cxx, SphinxExamples/src/Filtering/CurvatureFlow/SmoothRGBImageUsingMinMaxCurvatureFlow/Code.cxx, SphinxExamples/src/Filtering/DistanceMap/ApproxDistanceMapOfBinary/Code.cxx, SphinxExamples/src/Filtering/DistanceMap/MaurerDistanceMapOfBinary/Code.cxx, SphinxExamples/src/Filtering/DistanceMap/MeanDistanceBetweenAllPointsOnTwoCurves/Code.cxx, SphinxExamples/src/Filtering/DistanceMap/SignedDistanceMapOfBinary/Code.cxx, SphinxExamples/src/Filtering/ImageFeature/ApplyAFilterToASpecifiedRegionOfAnImage/Code.cxx, SphinxExamples/src/Filtering/ImageFeature/BilateralFilterAnImage/Code.cxx, SphinxExamples/src/Filtering/ImageFeature/FindZeroCrossingsInSignedImage/Code.cxx, SphinxExamples/src/Filtering/ImageFeature/SharpenImage/Code.cxx, SphinxExamples/src/Filtering/ImageFeature/ZeroCrossingBasedEdgeDecor/Code.cxx, SphinxExamples/src/Filtering/ImageGrid/CropImageBySpecifyingRegion2/Code.cxx, SphinxExamples/src/Filtering/ImageGrid/RunImageFilterOnRegionOfImage/Code.cxx, SphinxExamples/src/Filtering/ImageIntensity/AbsValueOfImage/Code.cxx, SphinxExamples/src/Filtering/ImageIntensity/InvertImage/Code.cxx, SphinxExamples/src/Filtering/ImageIntensity/MaskImage/Code.cxx, SphinxExamples/src/Filtering/ImageIntensity/NormalizeImage/Code.cxx, SphinxExamples/src/Filtering/ImageLabel/ExtractBoundariesOfConnectedRegionsInBinaryImage/Code.cxx, SphinxExamples/src/Filtering/ImageLabel/ExtractInnerAndOuterBoundariesOfBlobsInBinaryImage/Code.cxx, SphinxExamples/src/Filtering/ImageLabel/LabelContoursOfConnectComponent/Code.cxx, SphinxExamples/src/Filtering/MathematicalMorphology/ErodeBinaryImageUsingFlatStruct/Code.cxx, SphinxExamples/src/Filtering/Smoothing/FindHigherDerivativesOfImage/Code.cxx, SphinxExamples/src/Filtering/Smoothing/SmoothImageWithDiscreteGaussianFilter/Code.cxx, SphinxExamples/src/Filtering/Thresholding/DemonstrateThresholdAlgorithms/Code.cxx, SphinxExamples/src/Filtering/Thresholding/SeparateGroundUsingOtsu/Code.cxx, SphinxExamples/src/Nonunit/Review/GeometricPropertiesOfRegion/Code.cxx, SphinxExamples/src/Segmentation/ConnectedComponents/AssignContiguousLabelsToConnectedRegions/Code.cxx, SphinxExamples/src/Segmentation/ConnectedComponents/ExtraLargestConnectComponentFromBinaryImage/Code.cxx, SphinxExamples/src/Segmentation/ConnectedComponents/LabelConnectComponentsInBinaryImage/Code.cxx, SphinxExamples/src/Segmentation/ConnectedComponents/LabelConnectComponentsInGrayscaleImage/Code.cxx, and SphinxExamples/src/Segmentation/RegionGrowing/SegmentPixelsWithSimilarStats/Code.cxx.

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 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)
 
void SetSnapshotExtension (const std::string &iExtension)
 

Private Attributes

std::vector< ImageInfoImages
 
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< RGBImageInfoRGBImages
 

Constructor & Destructor Documentation

◆ QuickView()

QuickView::QuickView ( )
inline

Definition at line 114 of file QuickView.h.

Member Function Documentation

◆ AddImage()

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

Add an image to be rendered.

Examples
SphinxExamples/src/Bridge/VtkGlue/VTKImageToITKImage/Code.cxx, SphinxExamples/src/Core/Common/DisplayImage/Code.cxx, SphinxExamples/src/Core/Common/IterateLineThroughImage/Code.cxx, SphinxExamples/src/Core/Common/IterateRegionWithAccessToIndexWithoutWriteAccess/Code.cxx, SphinxExamples/src/Core/Common/IterateRegionWithAccessToIndexWithWriteAccess/Code.cxx, SphinxExamples/src/Core/Common/MultiThreadOilPainting/Code.cxx, SphinxExamples/src/Core/SpatialObjects/ContourSpatialObject/Code.cxx, SphinxExamples/src/Core/Transform/GlobalRegistrationTwoImagesBSpline/Code.cxx, SphinxExamples/src/Developer/OilPaintingImageFilter.cxx, SphinxExamples/src/Filtering/BinaryMathematicalMorphology/ClosingBinaryImage/Code.cxx, SphinxExamples/src/Filtering/BinaryMathematicalMorphology/OpeningBinaryImage/Code.cxx, SphinxExamples/src/Filtering/BinaryMathematicalMorphology/PruneBinaryImage/Code.cxx, SphinxExamples/src/Filtering/Convolution/ColorNormalizedCorrelation/Code.cxx, SphinxExamples/src/Filtering/Convolution/ConvolveImageWithKernel/Code.cxx, SphinxExamples/src/Filtering/Convolution/NormalizedCorrelation/Code.cxx, SphinxExamples/src/Filtering/CurvatureFlow/BinaryMinMaxCurvatureFlow/Code.cxx, SphinxExamples/src/Filtering/CurvatureFlow/SmoothImageUsingCurvatureFlow/Code.cxx, SphinxExamples/src/Filtering/CurvatureFlow/SmoothImageUsingMinMaxCurvatureFlow/Code.cxx, SphinxExamples/src/Filtering/DistanceMap/ApproxDistanceMapOfBinary/Code.cxx, SphinxExamples/src/Filtering/DistanceMap/MaurerDistanceMapOfBinary/Code.cxx, SphinxExamples/src/Filtering/DistanceMap/MeanDistanceBetweenAllPointsOnTwoCurves/Code.cxx, SphinxExamples/src/Filtering/DistanceMap/SignedDistanceMapOfBinary/Code.cxx, SphinxExamples/src/Filtering/ImageFeature/ApplyAFilterToASpecifiedRegionOfAnImage/Code.cxx, SphinxExamples/src/Filtering/ImageFeature/BilateralFilterAnImage/Code.cxx, SphinxExamples/src/Filtering/ImageFeature/FindZeroCrossingsInSignedImage/Code.cxx, SphinxExamples/src/Filtering/ImageFeature/SharpenImage/Code.cxx, SphinxExamples/src/Filtering/ImageFeature/ZeroCrossingBasedEdgeDecor/Code.cxx, SphinxExamples/src/Filtering/ImageGrid/RunImageFilterOnRegionOfImage/Code.cxx, SphinxExamples/src/Filtering/ImageIntensity/AbsValueOfImage/Code.cxx, SphinxExamples/src/Filtering/ImageIntensity/InvertImage/Code.cxx, SphinxExamples/src/Filtering/ImageIntensity/MaskImage/Code.cxx, SphinxExamples/src/Filtering/ImageIntensity/NormalizeImage/Code.cxx, SphinxExamples/src/Filtering/ImageLabel/ExtractBoundariesOfConnectedRegionsInBinaryImage/Code.cxx, SphinxExamples/src/Filtering/ImageLabel/ExtractInnerAndOuterBoundariesOfBlobsInBinaryImage/Code.cxx, SphinxExamples/src/Filtering/ImageLabel/LabelContoursOfConnectComponent/Code.cxx, SphinxExamples/src/Filtering/MathematicalMorphology/ErodeBinaryImageUsingFlatStruct/Code.cxx, SphinxExamples/src/Filtering/Smoothing/FindHigherDerivativesOfImage/Code.cxx, SphinxExamples/src/Filtering/Smoothing/SmoothImageWithDiscreteGaussianFilter/Code.cxx, SphinxExamples/src/Filtering/Thresholding/DemonstrateThresholdAlgorithms/Code.cxx, SphinxExamples/src/Filtering/Thresholding/SeparateGroundUsingOtsu/Code.cxx, SphinxExamples/src/Nonunit/Review/GeometricPropertiesOfRegion/Code.cxx, SphinxExamples/src/Segmentation/ConnectedComponents/ExtraLargestConnectComponentFromBinaryImage/Code.cxx, SphinxExamples/src/Segmentation/ConnectedComponents/LabelConnectComponentsInBinaryImage/Code.cxx, SphinxExamples/src/Segmentation/ConnectedComponents/LabelConnectComponentsInGrayscaleImage/Code.cxx, and SphinxExamples/src/Segmentation/RegionGrowing/SegmentPixelsWithSimilarStats/Code.cxx.

◆ AddRGBImage()

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

◆ InterpolateOff()

void QuickView::InterpolateOff ( )
inline

Use pixel replication in rendered image

Examples
SphinxExamples/src/Nonunit/Review/GeometricPropertiesOfRegion/Code.cxx.

Definition at line 159 of file QuickView.h.

◆ InterpolateOn()

void QuickView::InterpolateOn ( )
inline

Use pixel interpolation in rendered image

Definition at line 166 of file QuickView.h.

◆ SetNumberOfColumns()

void QuickView::SetNumberOfColumns ( const unsigned int  columns)
inline

Set the number of columns, default 4.

Definition at line 208 of file QuickView.h.

◆ SetSnapshotExtension()

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

Provide the image format to be used when taking snapshot

Definition at line 199 of file QuickView.h.

◆ SetSnapshotPath()

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

Definition at line 186 of file QuickView.h.

◆ SetSnapshotPrefix()

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

Definition at line 192 of file QuickView.h.

◆ SetViewPortSize()

void QuickView::SetViewPortSize ( const unsigned int  size)
inline

Set the viewport size, default 300.

Definition at line 215 of file QuickView.h.

◆ ShareCameraOff()

void QuickView::ShareCameraOff ( )
inline

Each render window will have its own camera

Examples
SphinxExamples/src/Nonunit/Review/GeometricPropertiesOfRegion/Code.cxx.

Definition at line 145 of file QuickView.h.

◆ ShareCameraOn()

void QuickView::ShareCameraOn ( )
inline

Each render window will use the same camera

Definition at line 152 of file QuickView.h.

◆ SnapshotOff()

void QuickView::SnapshotOff ( )
inline

Each render window will take a snapshot

Definition at line 180 of file QuickView.h.

◆ SnapshotOn()

void QuickView::SnapshotOn ( )
inline

Each render window will take a snapshot

Definition at line 173 of file QuickView.h.

◆ Visualize()

void QuickView::Visualize ( bool  interact = true)

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

Examples
SphinxExamples/src/Bridge/VtkGlue/VTKImageToITKImage/Code.cxx, SphinxExamples/src/Core/Common/DisplayImage/Code.cxx, SphinxExamples/src/Core/Common/IterateLineThroughImage/Code.cxx, SphinxExamples/src/Core/Common/IterateRegionWithAccessToIndexWithoutWriteAccess/Code.cxx, SphinxExamples/src/Core/Common/IterateRegionWithAccessToIndexWithWriteAccess/Code.cxx, SphinxExamples/src/Core/Common/MultiThreadOilPainting/Code.cxx, SphinxExamples/src/Core/Transform/GlobalRegistrationTwoImagesBSpline/Code.cxx, SphinxExamples/src/Developer/OilPaintingImageFilter.cxx, SphinxExamples/src/Filtering/AnisotropicSmoothing/SmoothImageWhilePreservingEdges/Code.cxx, SphinxExamples/src/Filtering/AnisotropicSmoothing/SmoothImageWhilePreservingEdges2/Code.cxx, SphinxExamples/src/Filtering/BinaryMathematicalMorphology/ClosingBinaryImage/Code.cxx, SphinxExamples/src/Filtering/BinaryMathematicalMorphology/OpeningBinaryImage/Code.cxx, SphinxExamples/src/Filtering/BinaryMathematicalMorphology/PruneBinaryImage/Code.cxx, SphinxExamples/src/Filtering/Convolution/ColorNormalizedCorrelation/Code.cxx, SphinxExamples/src/Filtering/Convolution/ConvolveImageWithKernel/Code.cxx, SphinxExamples/src/Filtering/Convolution/NormalizedCorrelation/Code.cxx, SphinxExamples/src/Filtering/CurvatureFlow/BinaryMinMaxCurvatureFlow/Code.cxx, SphinxExamples/src/Filtering/CurvatureFlow/SmoothImageUsingCurvatureFlow/Code.cxx, SphinxExamples/src/Filtering/CurvatureFlow/SmoothImageUsingMinMaxCurvatureFlow/Code.cxx, SphinxExamples/src/Filtering/CurvatureFlow/SmoothRGBImageUsingCurvatureFlow/Code.cxx, SphinxExamples/src/Filtering/CurvatureFlow/SmoothRGBImageUsingMinMaxCurvatureFlow/Code.cxx, SphinxExamples/src/Filtering/DistanceMap/ApproxDistanceMapOfBinary/Code.cxx, SphinxExamples/src/Filtering/DistanceMap/MaurerDistanceMapOfBinary/Code.cxx, SphinxExamples/src/Filtering/DistanceMap/MeanDistanceBetweenAllPointsOnTwoCurves/Code.cxx, SphinxExamples/src/Filtering/DistanceMap/SignedDistanceMapOfBinary/Code.cxx, SphinxExamples/src/Filtering/ImageFeature/ApplyAFilterToASpecifiedRegionOfAnImage/Code.cxx, SphinxExamples/src/Filtering/ImageFeature/BilateralFilterAnImage/Code.cxx, SphinxExamples/src/Filtering/ImageFeature/FindZeroCrossingsInSignedImage/Code.cxx, SphinxExamples/src/Filtering/ImageFeature/SharpenImage/Code.cxx, SphinxExamples/src/Filtering/ImageFeature/ZeroCrossingBasedEdgeDecor/Code.cxx, SphinxExamples/src/Filtering/ImageGrid/CropImageBySpecifyingRegion2/Code.cxx, SphinxExamples/src/Filtering/ImageGrid/RunImageFilterOnRegionOfImage/Code.cxx, SphinxExamples/src/Filtering/ImageIntensity/AbsValueOfImage/Code.cxx, SphinxExamples/src/Filtering/ImageIntensity/InvertImage/Code.cxx, SphinxExamples/src/Filtering/ImageIntensity/MaskImage/Code.cxx, SphinxExamples/src/Filtering/ImageIntensity/NormalizeImage/Code.cxx, SphinxExamples/src/Filtering/ImageLabel/ExtractBoundariesOfConnectedRegionsInBinaryImage/Code.cxx, SphinxExamples/src/Filtering/ImageLabel/ExtractInnerAndOuterBoundariesOfBlobsInBinaryImage/Code.cxx, SphinxExamples/src/Filtering/ImageLabel/LabelContoursOfConnectComponent/Code.cxx, SphinxExamples/src/Filtering/MathematicalMorphology/ErodeBinaryImageUsingFlatStruct/Code.cxx, SphinxExamples/src/Filtering/Smoothing/FindHigherDerivativesOfImage/Code.cxx, SphinxExamples/src/Filtering/Smoothing/SmoothImageWithDiscreteGaussianFilter/Code.cxx, SphinxExamples/src/Filtering/Thresholding/DemonstrateThresholdAlgorithms/Code.cxx, SphinxExamples/src/Filtering/Thresholding/SeparateGroundUsingOtsu/Code.cxx, SphinxExamples/src/Nonunit/Review/GeometricPropertiesOfRegion/Code.cxx, SphinxExamples/src/Segmentation/ConnectedComponents/AssignContiguousLabelsToConnectedRegions/Code.cxx, SphinxExamples/src/Segmentation/ConnectedComponents/ExtraLargestConnectComponentFromBinaryImage/Code.cxx, SphinxExamples/src/Segmentation/ConnectedComponents/LabelConnectComponentsInBinaryImage/Code.cxx, SphinxExamples/src/Segmentation/ConnectedComponents/LabelConnectComponentsInGrayscaleImage/Code.cxx, and SphinxExamples/src/Segmentation/RegionGrowing/SegmentPixelsWithSimilarStats/Code.cxx.

Member Data Documentation

◆ Images

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

Definition at line 221 of file QuickView.h.

◆ m_Counter

itk::IdentifierType QuickView::m_Counter
private

Definition at line 223 of file QuickView.h.

◆ m_Interpolate

bool QuickView::m_Interpolate
private

Definition at line 229 of file QuickView.h.

◆ m_NumberOfColumns

unsigned int QuickView::m_NumberOfColumns
private

Definition at line 230 of file QuickView.h.

◆ m_ShareCamera

bool QuickView::m_ShareCamera
private

Definition at line 227 of file QuickView.h.

◆ m_Snapshot

bool QuickView::m_Snapshot
private

Definition at line 228 of file QuickView.h.

◆ m_SnapshotExtension

std::string QuickView::m_SnapshotExtension
private

Definition at line 226 of file QuickView.h.

◆ m_SnapshotPath

std::string QuickView::m_SnapshotPath
private

Definition at line 224 of file QuickView.h.

◆ m_SnapshotPrefix

std::string QuickView::m_SnapshotPrefix
private

Definition at line 225 of file QuickView.h.

◆ m_ViewPortSize

unsigned int QuickView::m_ViewPortSize
private

Definition at line 231 of file QuickView.h.

◆ RGBImages

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

Definition at line 222 of file QuickView.h.


The documentation for this class was generated from the following file:
QuickView::AddRGBImage
void AddRGBImage(TImage *, bool FlipVertical=true, std::string Description="")
QuickView::AddImage
void AddImage(TImage *, bool FlipVertical=true, std::string Description="")
QuickView
A convenient class to render itk images with vtk.
Definition: QuickView.h:111