Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Brain Class Reference

#include <Neuro/Brain.H>

Inheritance diagram for Brain:

Inheritance graph
[legend]
Collaboration diagram for Brain:

Collaboration graph
[legend]
List of all members.

Detailed Description

This is the brain, a holder for various vision objects.

It contains a retina (input image), a VisualCortex, a SaliencyMap, a WinnerTakeAll, a visual field (image that keeps track of attended locations), and lots of interconnections between those.

Definition at line 76 of file Brain.H.

Public Member Functions

nub::ref< PrefrontalCortexgetPFC () const
 Get the PFC.
nub::ref< RetinagetRET () const
 Get the Retina.
nub::ref< VisualCortexgetVC () const
 Get the VisualCortex.
nub::ref< EyeHeadControllergetEHC () const
 Get the EyeHeadController.
nub::ref< SimulationViewergetSV () const
 Get the SimulationViewer.
nub::ref< ShapeEstimatorgetSE () const
 Get the ShapeEstimator.
nub::ref< SaliencyMapgetSM () const
 Get the SaliencyMap.
nub::ref< TaskRelevanceMapgetTRM () const
 Get the TaskRelevanceMap.
nub::ref< AttentionGuidanceMapgetAGM () const
 Get the AttentionGuidanceMap.
nub::ref< AttentionGategetAG () const
 Get the AttentionGate.
nub::ref< WinnerTakeAllgetWTA () const
 Get the WinnerTakeAll.
nub::ref< InferoTemporalgetIT () const
 Get the InferoTemporal.
nub::ref< GistEstimatorgetGE () const
 Get the GistEstimator.
nub::ref< TargetCheckergetTC () const
 Get the TargetChecker.
nub::ref< RetinaToWorldgetRTW () const
 Get the RetinaToWorld.
void drawResults (Image< PixRGB< byte > > &traj, const Rectangle &foa)
 Pass along to our subcomponents (VisualCortex in particular).
Constructors, destructors, and run-time "modules"
Typically, you instantiate a IRoomBrain and then add various plug-in "modules" to it (using setRET(), setVC(), etc.). If you decide so, each module you add may become a subcomponent of your IRoomBrain object; if so, you should not do a ModelManager::addSubComponent() on them, but just do it once for all on your IRoomBrain object instead.

 Brain (OptionManager &mgr, const std::string &descrName="Brain", const std::string &tagName="Brain")
 Constructor.
virtual ~Brain ()
 Virtual destructor for safe inheritance.
Module setters
Each call takes a reference to an appropriate ModelComponent derivative object, which must furthermore be the appropriate specific derived type for the module type.

Each call takes a boolean parameter 'makeSubComp'. If true, the object passed as argument will become a subcomponent of us, thus you will not need to separately register it with ModelManager. Yields a fatal error if we already have one module of that type (name). Typically, you want to set this flag to true in models where the Brain is your top-level (root) component; in models that contains objects for whom the Brain is a subcomponent, typically they will also have our modules as subcomponents, so we should not set this flag to true

HISTORICAL NOTE: For now, these replace the old addModule() function -- the reason was that everybody who called addModule() was doing it with a type known at compile time (i.e., they called it with a literal "VisualCortex" string and a nub::soft_ref<VisualCortex>), so it's more straightforward to just have separate functions for each type. This approach also avoids a round of up+down casting (with addModule, you might have a VisualCortex object, which then got casted to ModuleComponent for the addModule() call, only to be dynamic-casted back to VisualCortex inside addModule()). If, in the future, we end up with a system in which Brain doesn't need to know the actual types of all its modules (e.g., it just has a bag of BrainModule objects), then it could make sense to go back to the addModule() system.

void setPFC (nub::ref< PrefrontalCortex > mod, bool makeSubComp=false)
 Set the PrefrontalCortex.
void setRET (nub::ref< Retina > mod, bool makeSubComp=false)
 Set the Retina.
void setVC (nub::ref< VisualCortex > mod, bool makeSubComp=false)
 Set the VisualCortex.
void setEHC (nub::ref< EyeHeadController > mod, bool makeSubComp=false)
 Set the EyeHeadController.
void setSV (nub::ref< SimulationViewer > mod, bool makeSubComp=false)
 Set the SimulationViewer.
void setSE (nub::ref< ShapeEstimator > mod, bool makeSubComp=false)
 Set the ShapeEstimator.
void setSM (nub::ref< SaliencyMap > mod, bool makeSubComp=false)
 Set the SaliencyMap.
void setTRM (nub::ref< TaskRelevanceMap > mod, bool makeSubComp=false)
 Set the TaskRelevanceMap.
void setAGM (nub::ref< AttentionGuidanceMap > mod, bool makeSubComp=false)
 Set the AttentionGuidanceMap.
void setAG (nub::ref< AttentionGate > mod, bool makeSubComp=false)
 Set the AttentionGate.
void setWTA (nub::ref< WinnerTakeAll > mod, bool makeSubComp=false)
 Set the WinnerTakeAll.
void setIT (nub::ref< InferoTemporal > mod, bool makeSubComp=false)
 Set the InferoTemporal.
void setGE (nub::ref< GistEstimator > mod, bool makeSubComp=false)
 Set the GistEstimator.
void setTC (nub::ref< TargetChecker > mod, bool makeSubComp=false)
 Set the TargetChecker.
void setRTW (nub::ref< RetinaToWorld > mod, bool makeSubComp=false)
 Set the RetinaToWorld.
Brain simulation functions
void setTargetMask (const Image< byte > &targets)
 Specify a target mask.
void input (const Image< PixRGB< byte > > &inp, nub::soft_ref< SimEventQueue > q)
 Load a new frame and pass it through visual cortex.
virtual void evolve (SimEventQueue &q)
 Evolve all of our modules.
SimStatus evolve (bool useLowMem)
 Evolve all of our modules.

Protected Member Functions

virtual void start1 ()
 do some additional config at start time; see ModelComponent.H

Classes

struct  Impl
 Private implementation struct for Brain. More...


Constructor & Destructor Documentation

Brain::Brain OptionManager mgr,
const std::string descrName = "Brain",
const std::string tagName = "Brain"
 

Constructor.

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

Definition at line 122 of file Brain.C.

References ModelComponent::addSubComponent(), Brain::Impl::AG, Brain::Impl::AGM, Brain::Impl::EHC, Brain::Impl::GE, Brain::Impl::IT, Brain::Impl::PFC, Brain::Impl::RET, Brain::Impl::RTW, Brain::Impl::SE, Brain::Impl::SM, Brain::Impl::SV, Brain::Impl::TC, Brain::Impl::TRM, Brain::Impl::VC, and Brain::Impl::WTA.

Brain::~Brain  )  [virtual]
 

Virtual destructor for safe inheritance.

Definition at line 149 of file Brain.C.


Member Function Documentation

void Brain::drawResults Image< PixRGB< byte > > &  traj,
const Rectangle foa
 

Pass along to our subcomponents (VisualCortex in particular).

Definition at line 386 of file Brain.C.

References Brain::Impl::VC.

Referenced by SimulationViewerStd::attentionShift(), and SimulationViewerNerdCam::attentionShift().

SimStatus Brain::evolve bool  useLowMem  ) 
 

Evolve all of our modules.

Returns:
a status flag indicating whether to continue or break
After calling evolve(), you can query gotCovertShift() and gotOvertShift() to see if any attention movement or eye movement was made, and if so you can query getLastCovertPos() and getLastCovertAgmV() to get details of the covert shift, and getLastOvertPos() for details of the overt shift.

void Brain::evolve SimEventQueue q  )  [virtual]
 

Evolve all of our modules.

Returns:
a status flag indicating whether to continue or break
After calling evolve(), you can query gotCovertShift() and gotOvertShift() to see if any attention movement or eye movement was made, and if so you can query getLastCovertPos() and getLastCovertAgmV() to get details of the covert shift, and getLastOvertPos() for details of the overt shift.

Implements SimModule.

Definition at line 331 of file Brain.C.

References Brain::Impl::AG, Brain::Impl::AGM, Brain::Impl::EHC, Brain::Impl::GE, Brain::Impl::IT, Brain::Impl::PFC, Brain::Impl::RET, Brain::Impl::RTW, Brain::Impl::SE, Brain::Impl::SM, Brain::Impl::SV, Brain::Impl::TC, Brain::Impl::TRM, Brain::Impl::VC, and Brain::Impl::WTA.

Referenced by GetSaliency::compute().

nub::ref< AttentionGate > Brain::getAG  )  const
 

Get the AttentionGate.

Definition at line 310 of file Brain.C.

References Brain::Impl::AG.

Referenced by start1().

nub::ref< AttentionGuidanceMap > Brain::getAGM  )  const
 

Get the AttentionGuidanceMap.

Definition at line 309 of file Brain.C.

References Brain::Impl::AGM.

Referenced by Brain_Init().

nub::ref< EyeHeadController > Brain::getEHC  )  const
 

Get the EyeHeadController.

Definition at line 304 of file Brain.C.

References Brain::Impl::EHC.

Referenced by Brain_Init(), and SimulationViewerEyeSim::start1().

nub::ref< GistEstimator > Brain::getGE  )  const
 

Get the GistEstimator.

Definition at line 313 of file Brain.C.

References Brain::Impl::GE.

Referenced by Brain_Init().

nub::ref< InferoTemporal > Brain::getIT  )  const
 

Get the InferoTemporal.

Definition at line 312 of file Brain.C.

References Brain::Impl::IT.

Referenced by Brain_Init(), and start1().

nub::ref< PrefrontalCortex > Brain::getPFC  )  const
 

Get the PFC.

Definition at line 301 of file Brain.C.

References Brain::Impl::PFC.

nub::ref< Retina > Brain::getRET  )  const
 

Get the Retina.

Definition at line 302 of file Brain.C.

References Brain::Impl::RET.

Referenced by Brain_Init(), VisualBuffer::bufferToRetinal(), SimulationViewerEyeMvt2::eyeStatus(), SimulationViewerCompress::getTraj(), and VisualBuffer::retinalToBuffer().

nub::ref< RetinaToWorld > Brain::getRTW  )  const
 

Get the RetinaToWorld.

Definition at line 315 of file Brain.C.

References Brain::Impl::RTW.

nub::ref< ShapeEstimator > Brain::getSE  )  const
 

Get the ShapeEstimator.

Definition at line 306 of file Brain.C.

References Brain::Impl::SE.

Referenced by Brain_Init(), and start1().

nub::ref< SaliencyMap > Brain::getSM  )  const
 

Get the SaliencyMap.

Definition at line 307 of file Brain.C.

References Brain::Impl::SM.

Referenced by Brain_Init().

nub::ref< SimulationViewer > Brain::getSV  )  const
 

Get the SimulationViewer.

Definition at line 305 of file Brain.C.

References Brain::Impl::SV.

Referenced by Brain_Init(), and start1().

nub::ref< TargetChecker > Brain::getTC  )  const
 

Get the TargetChecker.

Definition at line 314 of file Brain.C.

References Brain::Impl::TC.

nub::ref< TaskRelevanceMap > Brain::getTRM  )  const
 

Get the TaskRelevanceMap.

Definition at line 308 of file Brain.C.

References Brain::Impl::TRM.

Referenced by Brain_Init().

nub::ref< VisualCortex > Brain::getVC  )  const
 

Get the VisualCortex.

Definition at line 303 of file Brain.C.

References Brain::Impl::VC.

Referenced by InferoTemporalStd::attentionShift(), Brain_Init(), InferoTemporalSalBayes::buildRawDV(), GetSaliency::compute(), SimulationViewerStd::drawMegaCombo(), SimulationViewerNerdCam::drawMegaCombo(), SimulationViewerStd::drawMotionSixPack(), GetSaliency::getSubMaps(), SimulationViewerCompress::getTraj(), SimulationViewerStats::save1(), SimulationViewerNerdCam::saveResults(), SimulationViewerSurpCont::setBrain(), InferoTemporalSalBayes::start1(), SimulationViewerStats::start2(), and SimulationViewerNerdCam::writeChannelPage().

nub::ref< WinnerTakeAll > Brain::getWTA  )  const
 

Get the WinnerTakeAll.

Definition at line 311 of file Brain.C.

References Brain::Impl::WTA.

Referenced by Brain_Init().

void Brain::input const Image< PixRGB< byte > > &  inp,
nub::soft_ref< SimEventQueue q
 

Load a new frame and pass it through visual cortex.

This will yield a new input to the saliency map.

Parameters:
inp input color image

Definition at line 324 of file Brain.C.

References LFATAL.

Referenced by Brain_Init().

void Brain::setAG nub::ref< AttentionGate mod,
bool  makeSubComp = false
 

Set the AttentionGate.

Definition at line 245 of file Brain.C.

References ModelComponent::addSubComponent(), Brain::Impl::AG, and ModelComponent::removeSubComponent().

void Brain::setAGM nub::ref< AttentionGuidanceMap mod,
bool  makeSubComp = false
 

Set the AttentionGuidanceMap.

Definition at line 236 of file Brain.C.

References ModelComponent::addSubComponent(), Brain::Impl::AGM, and ModelComponent::removeSubComponent().

Referenced by Brain_Init(), and StdBrain::start1().

void Brain::setEHC nub::ref< EyeHeadController mod,
bool  makeSubComp = false
 

Set the EyeHeadController.

Definition at line 191 of file Brain.C.

References ModelComponent::addSubComponent(), Brain::Impl::EHC, and ModelComponent::removeSubComponent().

Referenced by Brain_Init(), and StdBrain::start1().

void Brain::setGE nub::ref< GistEstimator mod,
bool  makeSubComp = false
 

Set the GistEstimator.

Definition at line 272 of file Brain.C.

References ModelComponent::addSubComponent(), Brain::Impl::GE, and ModelComponent::removeSubComponent().

Referenced by Brain_Init(), and StdBrain::start1().

void Brain::setIT nub::ref< InferoTemporal mod,
bool  makeSubComp = false
 

Set the InferoTemporal.

Definition at line 263 of file Brain.C.

References ModelComponent::addSubComponent(), Brain::Impl::IT, and ModelComponent::removeSubComponent().

Referenced by Brain_Init(), and StdBrain::start1().

void Brain::setPFC nub::ref< PrefrontalCortex mod,
bool  makeSubComp = false
 

Set the PrefrontalCortex.

Definition at line 165 of file Brain.C.

References ModelComponent::addSubComponent(), Brain::Impl::PFC, and ModelComponent::removeSubComponent().

Referenced by StdBrain::start1().

void Brain::setRET nub::ref< Retina mod,
bool  makeSubComp = false
 

Set the Retina.

Definition at line 174 of file Brain.C.

References ModelComponent::addSubComponent(), ModelComponent::removeSubComponent(), and Brain::Impl::RET.

Referenced by Brain_Init(), and StdBrain::start1().

void Brain::setRTW nub::ref< RetinaToWorld mod,
bool  makeSubComp = false
 

Set the RetinaToWorld.

Definition at line 290 of file Brain.C.

References ModelComponent::addSubComponent(), ModelComponent::removeSubComponent(), and Brain::Impl::RTW.

void Brain::setSE nub::ref< ShapeEstimator mod,
bool  makeSubComp = false
 

Set the ShapeEstimator.

Definition at line 209 of file Brain.C.

References ModelComponent::addSubComponent(), ModelComponent::removeSubComponent(), and Brain::Impl::SE.

Referenced by Brain_Init().

void Brain::setSM nub::ref< SaliencyMap mod,
bool  makeSubComp = false
 

Set the SaliencyMap.

Definition at line 218 of file Brain.C.

References ModelComponent::addSubComponent(), ModelComponent::removeSubComponent(), and Brain::Impl::SM.

Referenced by Brain_Init(), and StdBrain::start1().

void Brain::setSV nub::ref< SimulationViewer mod,
bool  makeSubComp = false
 

Set the SimulationViewer.

Definition at line 200 of file Brain.C.

References ModelComponent::addSubComponent(), ModelComponent::removeSubComponent(), and Brain::Impl::SV.

Referenced by Brain_Init(), and StdBrain::start1().

void Brain::setTargetMask const Image< byte > &  targets  ) 
 

Specify a target mask.

Parameters:
targets binary map of the same size as the input, in which targets for the focus of attention are 255 and the rest is zero. Pass an uninitialized image if you have no targets to look for.

Definition at line 318 of file Brain.C.

References Brain::Impl::TC.

Referenced by Brain_Init().

void Brain::setTC nub::ref< TargetChecker mod,
bool  makeSubComp = false
 

Set the TargetChecker.

Definition at line 281 of file Brain.C.

References ModelComponent::addSubComponent(), ModelComponent::removeSubComponent(), and Brain::Impl::TC.

void Brain::setTRM nub::ref< TaskRelevanceMap mod,
bool  makeSubComp = false
 

Set the TaskRelevanceMap.

Definition at line 227 of file Brain.C.

References ModelComponent::addSubComponent(), ModelComponent::removeSubComponent(), and Brain::Impl::TRM.

Referenced by Brain_Init(), and StdBrain::start1().

void Brain::setVC nub::ref< VisualCortex mod,
bool  makeSubComp = false
 

Set the VisualCortex.

Definition at line 182 of file Brain.C.

References ModelComponent::addSubComponent(), ModelComponent::removeSubComponent(), and Brain::Impl::VC.

Referenced by Brain_Init(), and StdBrain::start1().

void Brain::setWTA nub::ref< WinnerTakeAll mod,
bool  makeSubComp = false
 

Set the WinnerTakeAll.

Definition at line 254 of file Brain.C.

References ModelComponent::addSubComponent(), ModelComponent::removeSubComponent(), and Brain::Impl::WTA.

Referenced by Brain_Init(), and StdBrain::start1().

void Brain::start1  )  [protected, virtual]
 

do some additional config at start time; see ModelComponent.H

Reimplemented from ModelComponent.

Reimplemented in StdBrain.

Definition at line 155 of file Brain.C.

References getAG(), getIT(), getSE(), and getSV().

Referenced by StdBrain::start1().


The documentation for this class was generated from the following files:
Generated on Fri Oct 10 10:46:58 2008 for iLab Neuromorphic Vision Toolkit by  doxygen 1.4.4