SimulationViewerStats Class Reference

View/save a bunch of stats about the saliency map. More...

#include <Neuro/SimulationViewerStats.H>

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

List of all members.

Public Member Functions

Constructors and destructors

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

Protected Member Functions

 SIMCALLBACK_DECLARE (SimulationViewerStats, SimEventSaveOutput)
 Callback for every time we should save our outputs.
virtual void start2 ()
 Get started:
virtual void stop2 ()
 Get stopped:
void lockFile (const std::string fileName, int &fd, struct flock &fl) const
 apply an advisory lock on a file
void unlockFile (const std::string fileName, const int fd, struct flock &fl) const
 remove an advisory lock on a file
virtual void save1 (const ModelComponentSaveInfo &sinfo)
 Save our various results.
virtual void computeAGStats (SimEventQueue &q)
 Compute and save target stats with mask and AttentionGate?
virtual void computeLAMStats (const Image< float > &img)
 Compute Last Attention Map stats from AttentionGate?
virtual void saveCompat (const Image< float > &img, const std::string suffix=".final.txt", const int frameOffset=0)
 Save our various results in a channel compatable format used in SingleChannel.C.
virtual void saveAGMaskStats (const Image< float > &img, const std::string caller, const std::string suffix=".final-AGmask.txt")
 Save Attention Gate stats if requested.

Protected Attributes

OModelParam< std::stringitsStatsFname
 Filename for the stats.
OModelParam< bool > itsSaveXcombo
 Save images too.
OModelParam< bool > itsSaveYcombo
 Save images too.
OModelParam< bool > itsComputeAGStats
 Save Attention Gate Stats.
OModelParam< int > itsAGTargetFrame
 Which frame is the target?
OModelParam< std::stringitsAGMaskFile
 Which file has the Ground Truth.
OModelParam< std::stringitsAGStatsSaveFile
 File save AG stats to.
Compatable statistics with SingleChannels stats

OModelParam< bool > itsGetSingleChannelStats
 Save basic single channel stats.
OModelParam< std::stringitsGetSingleChannelStatsFile
 File name for single channel stats.
OModelParam< bool > itsSaveStatsPerChannelFreq
 Should we save frequency information using 2D FFT?

Detailed Description

View/save a bunch of stats about the saliency map.

This SimulationViewer's purpose is mainly to save a variety of stats about the saliency map, including about locations of highest peak, mean/variance of saliency, number of peaks, etc.

Definition at line 49 of file SimulationViewerStats.H.


Constructor & Destructor Documentation

SimulationViewerStats::SimulationViewerStats ( OptionManager mgr,
const std::string descrName = "Simulation Viewer Stats",
const std::string tagName = "SimulationViewerStats" 
)

Constructor. See ModelComponent.H.

Definition at line 63 of file SimulationViewerStats.C.

SimulationViewerStats::~SimulationViewerStats (  )  [virtual]

Destructor.

Definition at line 82 of file SimulationViewerStats.C.


Member Function Documentation

void SimulationViewerStats::computeAGStats ( SimEventQueue q  )  [protected, virtual]

Compute and save target stats with mask and AttentionGate?

This method requires a mask file for ground truth. If none is avialable, then use computeLAMStats to save basic attention gate stats only

Definition at line 476 of file SimulationViewerStats.C.

References Image< T >::begin(), Image< T >::beginw(), SimEventQueue::check(), Image< T >::end(), Image< T >::endw(), Image< T >::getHeight(), getMinMaxAvg(), OModelParam< T >::getVal(), Image< T >::getWidth(), Image< T >::initialized(), itsAGMaskFile, itsAGTargetFrame, max(), min(), Raster::ReadRGB(), rescale(), Image< T >::resize(), saveAGMaskStats(), and saveCompat().

Referenced by save1().

void SimulationViewerStats::computeLAMStats ( const Image< float > &  img  )  [protected, virtual]

Compute Last Attention Map stats from AttentionGate?

Definition at line 454 of file SimulationViewerStats.C.

References Image< T >::beginw(), Image< T >::endw(), rescale(), saveAGMaskStats(), and saveCompat().

Referenced by save1().

void SimulationViewerStats::lockFile ( const std::string  fileName,
int &  fd,
struct flock &  fl 
) const [protected]

apply an advisory lock on a file

Definition at line 109 of file SimulationViewerStats.C.

Referenced by save1().

void SimulationViewerStats::save1 ( const ModelComponentSaveInfo sinfo  )  [protected, virtual]
void SimulationViewerStats::saveAGMaskStats ( const Image< float > &  img,
const std::string  caller,
const std::string  suffix = ".final-AGmask.txt" 
) [protected, virtual]

Save Attention Gate stats if requested.

Definition at line 724 of file SimulationViewerStats.C.

References getMinMaxAvgEtc(), OModelParam< T >::getVal(), itsGetSingleChannelStatsFile, max(), and min().

Referenced by computeAGStats(), and computeLAMStats().

void SimulationViewerStats::saveCompat ( const Image< float > &  img,
const std::string  suffix = ".final.txt",
const int  frameOffset = 0 
) [protected, virtual]
SimulationViewerStats::SIMCALLBACK_DECLARE ( SimulationViewerStats  ,
SimEventSaveOutput   
) [protected]

Callback for every time we should save our outputs.

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

Get started:

Reimplemented from ModelComponent.

Definition at line 86 of file SimulationViewerStats.C.

void SimulationViewerStats::stop2 (  )  [protected, virtual]

Get stopped:

Reimplemented from ModelComponent.

Definition at line 96 of file SimulationViewerStats.C.

void SimulationViewerStats::unlockFile ( const std::string  fileName,
const int  fd,
struct flock &  fl 
) const [protected]

remove an advisory lock on a file

Definition at line 142 of file SimulationViewerStats.C.

Referenced by save1().


Member Data Documentation

Which file has the Ground Truth.

Definition at line 73 of file SimulationViewerStats.H.

Referenced by computeAGStats().

File save AG stats to.

Definition at line 74 of file SimulationViewerStats.H.

Which frame is the target?

Definition at line 72 of file SimulationViewerStats.H.

Referenced by computeAGStats().

Save Attention Gate Stats.

Definition at line 71 of file SimulationViewerStats.H.

Referenced by save1().

Save basic single channel stats.

we also save final saliency stats using the same format

Definition at line 80 of file SimulationViewerStats.H.

Referenced by save1().

File name for single channel stats.

we also save final saliency stats using the same format

Definition at line 84 of file SimulationViewerStats.H.

Referenced by saveAGMaskStats(), and saveCompat().

Should we save frequency information using 2D FFT?

Definition at line 87 of file SimulationViewerStats.H.

Referenced by saveCompat().

Save images too.

Definition at line 69 of file SimulationViewerStats.H.

Referenced by save1().

Save images too.

Definition at line 70 of file SimulationViewerStats.H.

Referenced by save1().

Filename for the stats.

Definition at line 68 of file SimulationViewerStats.H.

Referenced by save1().


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