SimulationViewerStd Class Reference

This class provides a standard set of visualization tools. More...

#include <Neuro/SimulationViewerStd.H>

Inheritance diagram for SimulationViewerStd:
Inheritance graph
[legend]
Collaboration diagram for SimulationViewerStd:
Collaboration graph
[legend]

List of all members.

Public Member Functions

Constructors and destructors

 SimulationViewerStd (OptionManager &mgr, const std::string &descrName="Simulation Viewer Std", const std::string &tagName="SimulationViewerStd")
 Constructor. See ModelComponent.H.
virtual ~SimulationViewerStd ()
 Destructor.

Protected Member Functions

 SIMCALLBACK_DECLARE (SimulationViewerStd, SimEventSaccadeStatusEye)
 Callback for when the eye moves.
 SIMCALLBACK_DECLARE (SimulationViewerStd, SimEventSaccadeStatusHead)
 Callback for when the head moves.
 SIMCALLBACK_DECLARE (SimulationViewerStd, SimEventSaveOutput)
 Callback for every time we should save our outputs.
 SIMCALLBACK_DECLARE (SimulationViewerStd, SimEventITOutput)
 Callbacks for when a IT Output is available.
virtual void doEventRetinaImage (SimEventQueue &q, rutz::shared_ptr< SimEventRetinaImage > &e)
 process retinal images
virtual void doEventWTAwinner (SimEventQueue &q, rutz::shared_ptr< SimEventWTAwinner > &e)
virtual void start2 ()
 Get started:
virtual void reset1 ()
 Reset SimulationViewerStd.
virtual void save1 (const ModelComponentSaveInfo &sinfo)
 Save our various results.
Image< PixRGB< byte > > getTraj (SimEventQueue &q)
 Get the attention/eye/head trajectory image.
Derived classes should overload those to fit their cosmetic needs

void drawFOA ()
 Draw the focus of covert attention.
void linkFOAs ()
 Link previous focus of attention to current one.
void drawEye ()
 Draw current eye position.
void linkEyes ()
 Link previous eye position to current one.
void drawHead ()
 Draw current head position.
void linkHeads ()
 Link previous head position to current one.
void drawTime (Image< PixRGB< byte > > &image)
 Draw current time onto given image.
void drawHighlights ()
 Draw highlights around a given position.
Image< PixRGB< byte > > drawMegaCombo (SimEventQueue &q, const Image< PixRGB< byte > > &in)
 Draw mega combo for X display.
Image< PixRGB< byte > > drawMotionSixPack (const Image< PixRGB< byte > > &in)
 Draw motion sixpack.
void drawMaskOutline (Image< PixRGB< byte > > &traj, const Image< byte > mask, const PixRGB< byte > &col, const int thick, const Point2D< int > &pos, const int radius)
 Draw outline of a mask (used by drawFOA, drawEye, etc).
void getMegaComboMaps (const rutz::shared_ptr< ChannelMaps > &chm, ImageSet< PixRGB< byte > > &cmaps, const uint depth=0)
 recurse to get all maps to display in a megacombo
Image< PixRGB< byte > > prepMapForDisplay (const NamedImage< float > &m) const
 Prepare a map for display.

Protected Attributes

OModelParam< SimTimeitsTimeStep
 Simulation time step.
OModelParam< LevelSpecitsLevelSpec
 the model's LevelSpec
nub::ref< SpatialMetricsitsMetrics
 metrics that depend on the input size:
OModelParam< uintitsFontSize
OModelParam< bool > itsSaveTraj
OModelParam< bool > itsSaveXcombo
OModelParam< bool > itsSaveYcombo
OModelParam< bool > itsSaveTRMXcombo
OModelParam< bool > itsSaveTRMYcombo
OModelParam< bool > itsSaveTRMmegaCombo
OModelParam< bool > itsWarp3D
OModelParam< bool > itsMegaCombo
OModelParam< uintitsMegaComboZoom
OModelParam< bool > itsMegaComboTopCMapsOnly
OModelParam< DimsitsCropFOA
OModelParam< bool > itsFoveateTraj
OModelParam< bool > itsDisplayFOA
OModelParam< bool > itsDisplayPatch
OModelParam< bool > itsDisplayFOAnum
OModelParam< bool > itsDisplayFOALinks
OModelParam< bool > itsDisplayEye
OModelParam< bool > itsDisplayEyeLinks
OModelParam< bool > itsDisplayHead
OModelParam< bool > itsDisplayHeadLinks
OModelParam< bool > itsDisplayTime
OModelParam< bool > itsDisplayAdditive
OModelParam< bool > itsDisplayHighlights
OModelParam< bool > itsDisplaySMmodulate
OModelParam< bool > itsDisplayBoring
NModelParam< bool > itsDisplayShapeEstimator
NModelParam< PixRGB< byte > > itsColorNormal
NModelParam< PixRGB< byte > > itsColorBoring
 subtracted when boring
NModelParam< PixRGB< byte > > itsColorBlink
NModelParam< PixRGB< byte > > itsColorSaccade
NModelParam< PixRGB< byte > > itsColorSmoothPursuit
NModelParam< PixRGB< byte > > itsColorLink
NModelParam< PixRGB< byte > > itsColorText
NModelParam< int > itsHighlightMax
NModelParam< float > itsShapeEstimatorBaseContrast
NModelParam< int > itsShapeEstimatorBaseBright
NModelParam< float > itsWarp3Dpitch
NModelParam< float > itsWarp3Dyaw
NModelParam< float > itsWarp3DpitchRate
NModelParam< float > itsWarp3DyawRate
NModelParam< float > itsWarp3DpitchMax
NModelParam< float > itsWarp3DyawMax
OModelParam< int > itsHeadRadius
OModelParam< int > itsMultiRetinaDepth
NModelParam< int > itsFOApsiz
 half-size of (filled square) FOA patch
NModelParam< int > itsFOAthick
 line thickness for FOA outline
NModelParam< int > itsFOAlinkThick
 line thickness for links bewteen FOAs
NModelParam< int > itsFOVpsiz
 half-size of (hollow square) FOV patch
NModelParam< int > itsFOVpthick
 line thickness for FOV patch
NModelParam< int > itsFOVthick
 line thickness for FOV outline
NModelParam< int > itsFOVlinkThick
 line thickness for links btw FOVs
NModelParam< int > itsHEDpsiz
 half-size of (hollow-square) head patch
NModelParam< int > itsHEDpthick
 line thickness for head patch
NModelParam< int > itsHEDthick
 line thickness for head outline
NModelParam< int > itsHEDlinkThick
 line thickness for links btw heads
OModelParam< bool > itsUseLargerDrawings
 use larger drawings?
OModelParam< bool > itsObsolete1

Friends

class SimulationViewerEyeSim

Detailed Description

This class provides a standard set of visualization tools.

Its typical usage is with a model that generates shifts of attention, eye and head movements. This class will handle visualizing those events. There are three ways of customizing it to your specific needs: 1) by changing the values of some of its internal ModelParam parameters, either via the command-line or via a config file for those that do not have command-line options; 2) by overloading (in a derived class) the low-level drawing functions in the protected section of the class definition; 3) by overloading the trigger functions in the public section of the class definition.

Definition at line 63 of file SimulationViewerStd.H.


Constructor & Destructor Documentation

SimulationViewerStd::SimulationViewerStd ( OptionManager mgr,
const std::string descrName = "Simulation Viewer Std",
const std::string tagName = "SimulationViewerStd" 
)

Constructor. See ModelComponent.H.

Parameters:
mgr our ModelManager (see ModelManager.H)
descrName descriptive name for human usage
tagName name for ParamMap usage

Definition at line 66 of file SimulationViewerStd.C.

References ModelComponent::addSubComponent(), and itsMetrics.

SimulationViewerStd::~SimulationViewerStd (  )  [virtual]

Destructor.

Definition at line 165 of file SimulationViewerStd.C.


Member Function Documentation

void SimulationViewerStd::doEventRetinaImage ( SimEventQueue q,
rutz::shared_ptr< SimEventRetinaImage > &  e 
) [protected, virtual]

process retinal images

Reimplemented from SimulationViewerAdapter.

Definition at line 219 of file SimulationViewerStd.C.

References buildPyrGaussian(), Image< T >::getDims(), OModelParam< T >::getVal(), and Image< T >::resize().

void SimulationViewerStd::drawEye (  )  [protected]
void SimulationViewerStd::drawFOA (  )  [protected]
void SimulationViewerStd::drawHead (  )  [protected]
void SimulationViewerStd::drawHighlights (  )  [protected]

Draw highlights around a given position.

void SimulationViewerStd::drawMaskOutline ( Image< PixRGB< byte > > &  traj,
const Image< byte mask,
const PixRGB< byte > &  col,
const int  thick,
const Point2D< int > &  pos,
const int  radius 
) [protected]

Draw outline of a mask (used by drawFOA, drawEye, etc).

if the mask is initialized, revert to drawing a circle centered at "pos" an of radius "radius"

Definition at line 859 of file SimulationViewerStd.C.

References contour2D(), drawDisk(), Image< T >::getVal(), Point2D< T >::i, and inplaceLowThresh().

Referenced by drawEye(), drawFOA(), and drawHead().

Image< PixRGB< byte > > SimulationViewerStd::drawMegaCombo ( SimEventQueue q,
const Image< PixRGB< byte > > &  in 
) [protected]
Image< PixRGB<byte> > SimulationViewerStd::drawMotionSixPack ( const Image< PixRGB< byte > > &  in  )  [protected]

Draw motion sixpack.

void SimulationViewerStd::drawTime ( Image< PixRGB< byte > > &  image  )  [protected]

Draw current time onto given image.

Definition at line 714 of file SimulationViewerStd.C.

References image, SimTime::msecs(), sformat(), and writeText().

Referenced by getTraj().

void SimulationViewerStd::getMegaComboMaps ( const rutz::shared_ptr< ChannelMaps > &  chm,
ImageSet< PixRGB< byte > > &  cmaps,
const uint  depth = 0 
) [protected]

recurse to get all maps to display in a megacombo

Definition at line 810 of file SimulationViewerStd.C.

References OModelParam< T >::getVal(), Image< T >::initialized(), SimulationViewerAdapter::inverseMap(), prepMapForDisplay(), and Image< T >::resize().

Referenced by drawMegaCombo().

Image< PixRGB< byte > > SimulationViewerStd::getTraj ( SimEventQueue q  )  [protected]
void SimulationViewerStd::linkEyes (  )  [protected]

Link previous eye position to current one.

Definition at line 662 of file SimulationViewerStd.C.

References NModelParam< T >::getVal(), Point2D< T >::isValid(), and itsFOVlinkThick.

void SimulationViewerStd::linkFOAs (  )  [protected]

Link previous focus of attention to current one.

Definition at line 620 of file SimulationViewerStd.C.

References Point2D< T >::distance(), drawArrow(), NModelParam< T >::getVal(), WTAwinner::isValid(), itsFOAlinkThick, and WTAwinner::p.

void SimulationViewerStd::linkHeads (  )  [protected]

Link previous head position to current one.

Definition at line 701 of file SimulationViewerStd.C.

References NModelParam< T >::getVal(), Point2D< T >::isValid(), and itsHEDlinkThick.

Image< PixRGB< byte > > SimulationViewerStd::prepMapForDisplay ( const NamedImage< float > &  m  )  const [protected]
void SimulationViewerStd::reset1 (  )  [protected, virtual]

Reset SimulationViewerStd.

See the base function in ModelComponent.H for info.

Reimplemented from SimulationViewerAdapter.

Definition at line 169 of file SimulationViewerStd.C.

References Image< T >::freeMem(), ImageSet< T >::reset(), and SimTime::ZERO().

void SimulationViewerStd::save1 ( const ModelComponentSaveInfo sinfo  )  [protected, virtual]

Save our various results.

Reimplemented from ModelComponent.

Definition at line 565 of file SimulationViewerStd.C.

References getTraj(), OModelParam< T >::getVal(), and SRC_POS.

SimulationViewerStd::SIMCALLBACK_DECLARE ( SimulationViewerStd  ,
SimEventITOutput   
) [protected]

Callbacks for when a IT Output is available.

SimulationViewerStd::SIMCALLBACK_DECLARE ( SimulationViewerStd  ,
SimEventSaveOutput   
) [protected]

Callback for every time we should save our outputs.

SimulationViewerStd::SIMCALLBACK_DECLARE ( SimulationViewerStd  ,
SimEventSaccadeStatusHead   
) [protected]

Callback for when the head moves.

SimulationViewerStd::SIMCALLBACK_DECLARE ( SimulationViewerStd  ,
SimEventSaccadeStatusEye   
) [protected]

Callback for when the eye moves.

void SimulationViewerStd::start2 (  )  [protected, virtual]

Member Data Documentation

subtracted when boring

Definition at line 136 of file SimulationViewerStd.H.

Referenced by drawEye(), drawFOA(), and drawHead().

line thickness for links bewteen FOAs

Definition at line 162 of file SimulationViewerStd.H.

Referenced by linkFOAs().

half-size of (filled square) FOA patch

Definition at line 160 of file SimulationViewerStd.H.

Referenced by drawFOA(), and start2().

line thickness for FOA outline

Definition at line 161 of file SimulationViewerStd.H.

Referenced by drawFOA().

line thickness for links btw FOVs

Definition at line 166 of file SimulationViewerStd.H.

Referenced by linkEyes().

half-size of (hollow square) FOV patch

Definition at line 163 of file SimulationViewerStd.H.

Referenced by drawEye(), and start2().

line thickness for FOV patch

Definition at line 164 of file SimulationViewerStd.H.

Referenced by drawEye(), and start2().

line thickness for FOV outline

Definition at line 165 of file SimulationViewerStd.H.

Referenced by drawEye().

line thickness for links btw heads

Definition at line 170 of file SimulationViewerStd.H.

Referenced by linkHeads().

half-size of (hollow-square) head patch

Definition at line 167 of file SimulationViewerStd.H.

Referenced by drawHead(), and start2().

line thickness for head patch

Definition at line 168 of file SimulationViewerStd.H.

Referenced by drawHead(), and start2().

line thickness for head outline

Definition at line 169 of file SimulationViewerStd.H.

Referenced by drawHead().

the model's LevelSpec

Definition at line 98 of file SimulationViewerStd.H.

metrics that depend on the input size:

Definition at line 101 of file SimulationViewerStd.H.

Referenced by drawEye(), drawFOA(), and SimulationViewerStd().

Simulation time step.

Definition at line 95 of file SimulationViewerStd.H.

Referenced by getTraj().

use larger drawings?

Definition at line 172 of file SimulationViewerStd.H.

Referenced by start2().


The documentation for this class was generated from the following files:
Generated on Sun May 8 08:43:49 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3