COREM: configurable retina simulator (Martínez-Cañada et al., 2016)

 Download zip file 
Help downloading and running models
COREM is a configurable simulator for retina modeling that has been implemented within the framework of the Human Brain Project (HBP). The software platform can be interfaced with neural simulators (e.g., NEST) to connect with models of higher visual areas and with the Neurorobotics Platform of the HBP. The code is implemented in C++ and computations of spatiotemporal equations are optimized by means of recursive filtering techniques and multithreading. Most retina simulators are more focused on fitting specific retina functions. By contrast, the versatility of COREM allows the configuration of different retina models using a set of basic retina computational primitives. We implemented a series of retina models by combining these primitives to characterize some of the best-known phenomena observed in the retina: adaptation to the mean light intensity and temporal contrast, and differential motion sensitivity. The code has been extensively tested in Linux. The software can be also adapted to Mac OS. Installation instructions as well as the user manual can be found in the Github repository:
1 . Martínez-Cañada P, Morillas C, Pino B, Ros E, Pelayo F (2016) A Computational Framework for Realistic Retina Modeling. Int J Neural Syst 26:1650030 [PubMed]
Citations  Citation Browser
Model Information (Click on a link to find other models with that property)
Model Type: Realistic Network;
Brain Region(s)/Organism: Retina;
Cell Type(s): Retina bipolar GLU cell; Retina photoreceptor cone GLU cell; Retina ganglion GLU cell; Retina amacrine cell; Retina horizontal cell;
Gap Junctions:
Simulation Environment: C or C++ program;
Model Concept(s): Vision;
Implementer(s): Martínez-Cañada, Pablo [pablomc at]; Carrillo, Richard R. [rcarrillo at];
Search NeuronDB for information about:  Retina ganglion GLU cell; Retina photoreceptor cone GLU cell; Retina bipolar GLU cell;
% AVI2INR convert a AVI file movie to INRimage format
% avi2inr(filename, fps_mult, last_input_frame) opens filename.avi and
% creates a filename.inr file. fps_mult indicates how many (linearly
% interpolated) output frames will be created from each input frame.
% last_input_frame indicates now many input frames will be read (and
% saved). The outut video will contain aproximately
% fps_mult * last_input_frame frames.
% avi2inr(filename, fps_mult, last_input_frame, convert_gray) specifies
% whether the frames must be converted to grayscale before saved.
% Parameters fps_mult, last_input_frame and convert_gray are optional.
% In Linux Matlab may requiere the installation of packages:
%  - gstreamer0.10-plugins-good and gstreamer0.10-tools
% to open .avi files.
% Some old versions of Matlab may also require that
% /usr/local/MATLAB/MATLAB_Production_Server/R2013a/sys/os/glnxa64/ link
% is changed to point to system as well
% Example to create movie.inr from movie.avi with same frame rate and approx. length:
%  avi2inr('movie',1,Inf)

%   Copyright (C) 2016 by Richard R. Carrillo 
%   $Revision: 1.0 $  $Date: 26/9/2016 $

%   This program is free software; you can redistribute it and/or modify
%   it under the terms of the GNU General Public License as published by
%   the Free Software Foundation; either version 3 of the License, or
%   (at your option) any later version.
function avi2inr(filename, fps_mult, last_input_frame, convert_gray)
% Set default values
if nargin<4
if nargin<3
if nargin<2

vid_in = VideoReader([filename '.avi']); % Open input video file
vid_out=inrvideowrite([filename '.inr']); % Create output video file
pixel_data_type=class(ant_frame); % Save the original pixel data type
if convert_gray
   ant_frame=mean(ant_frame,3); % Average reg, green and blue channels
num_frames = vid_in.NumberOfFrames;
if num_frames>0
    % Always save the first frame
    int_frame=cast(ant_frame, pixel_data_type); % Recover original pixel data type
    vid_out.add_frame(int_frame); % Add frame to output file
    % Get and save sucessive frames
    input_frame_index = 2;
    while input_frame_index <= num_frames && input_frame_index <= last_input_frame
       cur_frame = read(vid_in,input_frame_index); % Load next frame form input
       if convert_gray
       for frame_subindex=1:fps_mult
          % Interpolate using previous and current frame
          int_frame=interp1([0 fps_mult], double(v), frame_subindex);
          % place dimenion create for interp1 (first one) at the end to
          % that it can be ignored
          int_frame=permute(int_frame, [2 3 4 1]);
          int_frame=cast(int_frame, pixel_data_type); % Recover original pixel data type
          % In Matlab image matrices encode Y pixel coordinates in the
          % first dimension and color channel in the third dimension.
          % add_frame makes the corresponding permutations to obtain INR
          % frames from this Matlab encoding
          vid_out.add_frame(int_frame); % Add frame to output file
       input_frame_index = input_frame_index + 1;
delete(vid_out); % Update output file content and close