/** MID Code **/ The code is based on T. Sharpee's code and updated by M. Kouh. http://www.cnl-t.salk.edu contact: sharpee@salk.edu or kouh@salk.edu =================================================================== version notes. =================================================================== ver1.1_122707: Distributable version. This version does NOT support finding more than 1 dimension. =================================================================== license. =================================================================== Copyright (C) T. Sharpee and M. Kouh. 2007. The following terms and conditions apply to use of the Programs. Downloading the programs indicates your acceptance of these terms and conditions. These programs are provided for non-commercial research use only. The programs will not be distributed further to third parties for any purpose and will not be decompiled, disassembled or otherwise reverse engineered. The Salk Institute makes no representation that the use of the programs will not infringe any patent or other proprietary right. Dr. Tantyana Sharpee and Dr. Minjoon Kouh will be acknowledged as the source of the program in any publications reporting its use. THE PROGRAMS ARE PROVIDED "AS IS" WITHOUT WARRANTY OF MERCANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OR ANY OTHER WARRANTY, EXPRESS OR IMPLIED. IN NO EVENT SHALL THE SALK INSTITUTE OR DR. SHARPEE AND DR. KOUH BE LIABLE FOR ANY DIRECT OR CONSEQUENTIAL DAMAGES RESULTING FROM USE OF THE PROGRAMS. THE USER BEARS THE ENTIRE RISK FOR USE OF THE PROGRAMS. =================================================================== compiling the codes. =================================================================== To compile, run the following commands from a terminal. make -f generic_makefile To perform some unit testing (on very, very simple cases), compile and run the test function. test_function; Note that a few routines from Numerical Recipes in C [Press et al., 1992] are provided as object files only (i.e., no source code). =================================================================== verifying stimulus and spike files. =================================================================== The stimulus file has to be written in binary format, where each pixel is in uint8 format. The spike file is also written in uint8 format, where each number corresponds to the number of spikes for each frame of the stimulus movie. To verify that your stimulus and spike files can be read by the codes, run the following in Matlab. verify_stim_file (stim_file,x_size,y_size); verify_spike_file (spike_file); Example, from the current directory, type the following in Matlab. addpath('./Matlab_Codes'); verify_stim_file('./Demo/walk5_ieee_128x128x16384.raw',128,128); verify_spike_file('./Demo/demo_spike_Noise0.50_Rep1_1.isk); =================================================================== running the code. =================================================================== do_MaxInfoDim_Nvec ... ... ... ... [Nbins] The parameters are: Identifier of each cell to be analyzed. All output files will have this identifier in the file names. Stimulus file. File containing the spikes for the current cell. Data directory for storing the output files. Size of the stimulus movie. Size of the stimulus movie. Total number of movie frames. ,,, The receptive field is typically analyzed in a smaller window. These four numbers specify the window of interest: the coordinates of the upper left corner pixel, width, and height. Note that rectangular coordinates have not been fully tested, so to be safe, let dx=dy and dimx=dimy. , Downsampling factor. Again, let cx=cy. Number of frames to incorporate. [Nbins] Number of bins to discretize probability distribution. [testrep] Jackknife runs. If this argument is not specified, all 4 jackknife runs will run in sequence. If you wish to run more jackknife estimates, change Nparts in the source code. Note: don't panic if the screen displays "precision within the machine limit..." This is a normal behavior of the algorithm. It means that during the optimization process, the algorithm has found a pretty good solution (within the precision limit). Let the codes keep running. Note there is a parallelized version (using openMP) of the codes. Please contact us for more info. =================================================================== analyzing the output of the codes. =================================================================== Once the MID code has run, use the following Matlab code. read_vec_pxpxt_file (filename,dim_info,varargin) filename will be something like: '/Test_v_' dim_info = [,,,]. Note cy is assumed to be equal to cx. varargin{1} = Nbins. This function will generate plots showing the recovered receptive field and nonlinearity of the response. In order to see how the algorithm was converging: read_app_file ('/app_') =================================================================== demo =================================================================== If the codes are compiled and tested (with test_function) okay, try running the demo stimuli and spike files. From the current directory, run the following: mkdir ./Demo/My_Data; ./do_MaxInfoDim_Nvec ... democell ... ./Demo/walk5_ieee_128x128x16384.raw ... ./Demo/demo_spike_Noise0.50_Rep1_1.isk ... ./Demo/My_Data ... 128 128 16384 5 5 120 120 4 4 1 32; (If you have multiple processors, split up the computations, by running the above command plus an extra number. ./do_MaxInfoDim_Nvec 1; ./do_MaxInfoDim_Nvec 2; ./do_MaxInfoDim_Nvec 3; ./do_MaxInfoDim_Nvec 4; The four processes will run concurrently.) To save your time, above simulations have already been run and saved in ./Demo/Data directory. Then, open Matlab, and type the following: ./Demo/demo; which will run read_vec_pxpxt_file and check the answer.