// *************************************************************************** // NSL RETINA MODEL .h // // Retina model description: // ------------------------ // Quantitative modeling of Responses of Anuran retina: Stimulus Shape and // Size Dependency. In this simulations we test the model's ability to // reproduce quantitatively tabulated data on the dependency on stimulus // shape and size (Ewert 1976). // Input to the model is Light on the receptors (40X40 to simulate the // receptieve field of a single ganglion cell of each type). // The model also simulates "simple" Horizontal and Bipolar cells. // The output of the model the temporal firing rate of a Ganglion cell of // each type (R2, R3, R4). So the graphs given by NSL show the firing rate // of a ganglion cell vs. the time. // // Notes: // ----- // No Trailing edge effect since Ewert computed his data with only // the response to the leading edge. // No Leaky Integrators for the Ganglion Cells. // // Goal: Match Ewert's quantitative data on the Toad's retinal ganglion // cells. // Status: goal achieved, paper submitted to Vision Research. // // File : "retina.c" // Contents: Definition of the neural net and main code. (see "retina.nsl") // Last update: April 1st, 1992 // By: Fernando Corbacho (corbacho@pollux.usc.edu) // // *************************************************************************** class Visin : public NslModule { public: NslDoutFloat2 out; private: nsl_input_matrix in; /* NslFloat0 r0; NslFloat0 c0; NslFloat0 r1; NslFloat0 c1; NslFloat0 vx; NslFloat0 vy; NslFloat0 flag; NslFloat2 zero; */ public: Visin(nsl_string, NslModule*, int,int); ~Visin() {} void initRun(); void simRun(); }; class Receptor : public NslModule { public: NslDinFloat2 in; NslDoutFloat2 r; // Receptors // private: NslFloat2 rB; // For sustained response. public: Receptor(nsl_string, NslModule*, int,int); ~Receptor() {} void initRun(); void simRun(); }; class Horizontal : public NslModule { public: NslDoutFloat2 hor; private: NslFloat0 hor_tm; // Horizontal cells time constant. NslFloat0 H_level; // Uniform horizontal cell potential // (0 if the background is bright, 1 if dark.) public: Horizontal(nsl_string, NslModule*, int,int); ~Horizontal() {} void initRun(); void simRun(); }; class BipolarOff : public NslModule { public: NslDinFloat2 r; NslDinFloat2 hor; NslDoutFloat2 hbc; NslDoutFloat2 pbh; public: BipolarOff(nsl_string, NslModule*, int,int); ~BipolarOff() {} void simRun(); }; class BipolarOn : public NslModule { public: NslDinFloat2 r; NslDinFloat2 hor; NslDoutFloat2 dbc; private: NslFloat2 pbd; public: BipolarOn(nsl_string, NslModule*, int,int); ~BipolarOn() {} void simRun(); }; class AmacrineOff : public NslModule { public: NslDinFloat2 hbc; NslDoutFloat2 ath; NslDoutFloat2 old_ath; // previous value of the cell private: NslFloat2 prev; // Previous value of the receptor // (needed for the average exact integration method ) NslFloat2 axh; // ***** Off-channel Amacrines ***** NslFloat2 ath1; NslFloat2 ath2; NslFloat0 axh_tm; // Amacrine cells time constants. float dt; public: AmacrineOff(nsl_string, NslModule*, int,int); ~AmacrineOff() {} void initRun(); void simRun(); }; class AmacrineOn : public NslModule { public: NslDinFloat2 dbc; NslDoutFloat2 atd; NslDoutFloat2 old_atd; // previous value of the cell. private: NslFloat2 prev; // Previous value of the receptor // (needed for the average exact integration method ) NslFloat2 axd; // ***** On-channel Amacrines ***** NslFloat2 atd1; NslFloat2 atd2; NslFloat0 axd_tm; float dt; public: AmacrineOn(nsl_string, NslModule*, int,int); ~AmacrineOn() {} void initRun(); void simRun(); }; class R2 : public NslModule { public: NslDinFloat2 pbh; NslDinFloat2 ath; NslDinFloat2 atd; private: NslFloat2 r2; NslFloat2 r2_i; // previous value of r2. NslFloat2 sust; // Sustained input to R2 (from the bipolar cells). NslFloat2 sust_irf; NslFloat2 sust_erf; NslFloat2 r2t; NslFloat2 r2f; // Scaled R2. NslFloat0 pbh_irf; NslFloat0 pbh_erf; NslFloat2 erf; // R2 Excitatory Receptive Field. NslFloat2 irf; // R2 Inhibitory Receptive Field. NslFloat2 rf; // DOG. NslFloat0 erf_dia; // diameter of the Gaussian mask. NslFloat0 irf_dia; NslFloat0 erf_sig; // Standard deviation of the Gaussian. NslFloat0 irf_sig; NslFloat0 erf_wgt; // Weight. NslFloat0 irf_wgt; NslFloat0 thresh; // Thresholds for ganglion cells. NslFloat0 k; // scale constant for the ganglion cells NslFloat0 tm; // Time constants for the ganglion cells. NslFloat0 trailing; NslFloat2 temp; NslFloat2 stat; // **** stores the statistics **** // Will contain the Average firing rates // for all ganglion cells. public: R2(nsl_string, NslModule*, int,int); ~R2() {} void initRun(); void simRun(); }; class R3 : public NslModule { public: NslDinFloat2 ath; NslDinFloat2 atd; NslDinFloat2 old_ath; NslDinFloat2 old_atd; private: NslFloat2 r3; NslFloat2 r3t; NslFloat2 r3f; NslFloat2 erf; NslFloat2 irf; NslFloat0 erf_dia; NslFloat0 irf_dia; NslFloat0 erf_sig; NslFloat0 irf_sig; NslFloat0 erf_wgt; NslFloat0 irf_wgt; NslFloat0 thresh; NslFloat0 k; // outputs. NslFloat0 tm; NslFloat0 p; // Weight of trailing edge for R3. NslFloat2 all; // effect of both amacrine channels. NslFloat2 old; // former value of amacrines. NslFloat2 stat; // **** stores the statistics **** // Will contain the Average firing rates // for all ganglion cells. public: R3(nsl_string, NslModule*, int,int); ~R3() {} void initRun(); void simRun(); }; class R4 : public NslModule { public: NslDinFloat2 ath; NslDinFloat2 atd; private: NslFloat2 r4; NslFloat2 r4t; NslFloat2 r4f; // Scaled R4. NslFloat2 erf; NslFloat0 erf_dia; NslFloat0 erf_sig; NslFloat0 erf_wgt; NslFloat0 thresh; NslFloat0 k; NslFloat0 tm; NslFloat2 stat; // **** stores the statistics **** // Will contain the Average firing rates // for all ganglion cells. public: R4(nsl_string, NslModule*, int,int); ~R4() {} void initRun(); void simRun(); }; class Retina : public NslModule { public: Visin visin; Receptor receptor; Horizontal horizontal; BipolarOn bipolarOn; BipolarOff bipolarOff; AmacrineOn amacrineOn; AmacrineOff amacrineOff; R2 r2; R3 r3; R4 r4; public: Retina(char*,NslModule*,int,int); ~Retina() {} void initModule(); }; class RetinaModel : public NslModel { Retina retina; public: RetinaModel(); ~RetinaModel() {} };