SingleChannelBeo Class Reference

Wrapper to run a SingleChannel on a distant CPU. More...

#include <Neuro/SingleChannelBeo.H>

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

List of all members.

Public Member Functions

 SingleChannelBeo (const nub::ref< Beowulf > &beow)
 Constructor.
virtual ~SingleChannelBeo ()
 Virtual destructor ensures proper destruction of derived classes.
virtual void handleInput (SingleChannel &chan, const Image< float > &bwimg, const SimTime &t, const Image< byte > &clipMask, const rutz::shared_ptr< PyramidCache< float > > &cache)
 Send the input image off to the processing node.
virtual void waitForOutput (SingleChannel &chan)
 Have we received the results from our processing node yet?

Detailed Description

Wrapper to run a SingleChannel on a distant CPU.

This class is an InputHandler derivative, to be used as an add-on to SingleChannel or subclasses, by installing an object of this class with SingleChannel::setInputHandler(). It uses a Beowulf to delegate the actual feature map computations to a distant CPU. The distant CPU should run a SingleChannelBeoServer, like in the the beochannel-server program; see SingleChannelBeoServer.H and beochannel-server.C for details. When we get an input image, we will send it off to the processing node specified at construction (and possibly modified later using standard ModelParam access functions), using the Beowulf object given at construction. Before sending off our first input, we will contact our processing node and send it all of our associated SingleChannel's ModelParam values in a configuration message; this will allow it to build the actual SingleChannel which we are associated with.

The system can work in two modes: in full emulation mode, the output map, channel pyramid, submaps and clip pyramid are all returned by the processor node. This requires a lot of network bandwidth but should ensure results that are exactly identical to when using the normal channels. In quick mode, only the output submap is returned. This will work with standard processing that only deals with the output, but things like saving the submaps or biasing the visual cortex will break; so use the fast mode at your own risk ;-) Selection of which mode is used is made by the SingleChannelBeoServer; here we just store whatever the server sends us, be it full or partial results.

PROGRAMMER NOTE: See the examples in ChannelsBeo.{H,C} for how to use SingleChannelBeo.

Definition at line 83 of file SingleChannelBeo.H.


Constructor & Destructor Documentation

SingleChannelBeo::SingleChannelBeo ( const nub::ref< Beowulf > &  beow  ) 

Constructor.

Parameters:
beow the Beowulf to use for data transfers

Definition at line 49 of file SingleChannelBeo.C.

SingleChannelBeo::~SingleChannelBeo (  )  [virtual]

Virtual destructor ensures proper destruction of derived classes.

Definition at line 54 of file SingleChannelBeo.C.


Member Function Documentation

void SingleChannelBeo::handleInput ( SingleChannel chan,
const Image< float > &  bwimg,
const SimTime t,
const Image< byte > &  clipMask,
const rutz::shared_ptr< PyramidCache< float > > &  cache 
) [virtual]
void SingleChannelBeo::waitForOutput ( SingleChannel chan  )  [virtual]

Have we received the results from our processing node yet?

This call will block until the results are received back from the processing node. You should call this from within your overload of SingleChannel::outputAvailable(). This is how we implement the remote processing with minimum differences between SingleChannel and objects that inherit from both SingleChannel and SingleChannelBeo; indeed, each time is result is requested from SingleChannel, it will (and should in future methods!) check first that some output is available. So, by intercepting this check we can wait until the results have been received from the processing node.

Implements InputHandler.

Definition at line 127 of file SingleChannelBeo.C.

References TCPmessage::getElementDouble(), TCPmessage::getElementFloatIma(), TCPmessage::getElementFloatImaSet(), SingleChannel::hasOutputCache(), SimTime::SECS(), ImageSet< T >::size(), SingleChannel::storeClipPyramid(), SingleChannel::storeOutputCache(), SingleChannel::storePyramid(), and SingleChannel::storeSubmapCache().


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