Grid cell model with compression effects (Raudies & Hasselmo, 2015)

 Download zip file 
Help downloading and running models
We present a model for compression of grid cell firing in modules to changes in barrier location.
1 . Raudies F, Hasselmo ME (2015) Differences in Visual-Spatial Input May Underlie Different Compression Properties of Firing Fields for Grid Cell Modules in Medial Entorhinal Cortex. PLoS Comput Biol 11:e1004596 [PubMed]
Model Information (Click on a link to find other models with that property)
Model Type:
Brain Region(s)/Organism: Entorhinal cortex;
Cell Type(s):
Gap Junctions:
Simulation Environment: MATLAB;
Model Concept(s): Grid cell;
Implementer(s): Raudies, Florian [florian.raudies at];
classdef Camera < handle
    % Class 'Camera' holds the position, orientation (Dir,Up), the field of
    % view, and range of visibility. This is an abstract class.
    %   Copyright (C) 2015  Florian Raudies, 05/02/2015, Palo Alto, CA.
    %   License, GNU GPL, free software, without any warranty.
    properties (SetAccess = protected)
        name        % Name for the camera.
        Pos         % 4D position vector (column vector)
        DirVector   % Direction vector
        UpVector    % Up vector
        hFov        % Horizontal field of view in RAD
        vFov        % Vertical field of view in RAD
        hSigma      % Standard deviation for azimuth angle of 'splash'.
        vSigma      % Standard deviation for elevation angle of 'splash'.
        nPxH        % Number of pixels in horizontal direction.
        nPxV        % Number of pixels in vertical direction.
        t0          % Mininum distance of viewing frustum
        t1          % Maximum distance of viewing frustum
        fLength     % Focal length
        % Constructor.
        function obj = Camera(name)
          = name;
            obj.Pos         = [0; 0; 0; 0];
            obj.DirVector   = [0; 0; 1; 0];
            obj.UpVector    = [0; 1; 0; 0];
            obj.hFov        = 120/180*pi;
            obj.vFov        = 100/180*pi;
            obj.t0          = 0;
            obj.t1          = 10^4;
            obj.fLength     = 1;
        % Get the horizontal standard deviation for the 'splash' in the 
        % image plane.
        function s = getHorizontalSigma(obj)
            s = obj.hSigma;
        % Get the vertical standard deviation for the 'splash' in the image
        % plane.
        function s = getVerticalSigma(obj)
            s = obj.vSigma;
        % Get the position of the camera.
        function P = getPosition(obj)
            P = obj.Pos;
        function r = getAspectRatio(obj)
            r = obj.vFov / obj.hFov;
        % Get the direction-vector, a 4D row-vector.
        function D = getDirVector(obj)
            D = obj.DirVector;
        % Get the up-vector, a 4D row-vector.
        function U = getUpVector(obj)
            U = obj.UpVector;
        % Move the camera to the position 'Pos'.
        function moveTo(obj,Pos)
            obj.Pos = Pos;
        % Rotate the camera from the current orientation by the rotation
        % angles in 'Rotation'.
        function rotate(obj, Rotation)
            M               = rotMatrixForAngles(Rotation);
            obj.DirVector   = M*obj.DirVector;
            obj.UpVector    = M*obj.UpVector;
        % Orient the camera using the direction-vector and up-vector both
        % are 4D row-vectors.
        function orient(obj, DirVector,UpVector)
            obj.DirVector   = DirVector;
            obj.UpVector    = UpVector;
        % Gives a 4 x 4 transformation matrix which transforms points into 
        % the coordinate sytem of the camera using the orientation and 
        % position of the camera.
        function T = viewpointTransform(obj)
            % Get the position and orientation of the camera.
            DirVec      = obj.getDirVector()';
            UpVec       = obj.getUpVector()';
            RightVec    = [cross(DirVec(1:3),UpVec(1:3)),0];
            UpVec       = [cross(RightVec(1:3),DirVec(1:3)),0];           
            % Construct matrix for viewpoint transformation
            T = [RightVec(1:3) -RightVec*obj.Pos; ...
                 UpVec(1:3)    -UpVec*obj.Pos; ...
                 DirVec(1:3)   -DirVec*obj.Pos;
                 0 0 0         +1];
        function n = getNumberOfPixels(obj)
            n = obj.nPxV * obj.nPxH;
    methods (Abstract)
        % Get the point 'Points' transformed into image space.
        [X Y Z V] = getImagePoints(obj, Points)
        % Get the visibility for each of the points 'Points'.
        V = getVisibility(obj, Points)
        % Get image using a superposition of Gaussian blobs.
        I = raySplash(obj)
    methods (Abstract, Static)
        % Get the image flow for the points according to the camera 
        % position and orientation.
        [Dh Dv] = imageFlow(H,V, D, Vel, Omega, f)

Loading data, please wait...