Browse Source

Natural movies data and code

Helene Schreyer 3 years ago
parent
commit
1f0251576a

BIN
naturalMovies/16d190023Comp.mat


BIN
naturalMovies/16d190024Comp.mat


BIN
naturalMovies/16d200016Comp.mat


BIN
naturalMovies/16d200017Comp.mat


BIN
naturalMovies/16d200018Comp.mat


BIN
naturalMovies/16d200019Comp.mat


BIN
naturalMovies/16d200021Comp.mat


BIN
naturalMovies/17127007Comp.mat


BIN
naturalMovies/17203004Comp.mat


BIN
naturalMovies/17203005Comp.mat


BIN
naturalMovies/172220041Comp.mat


BIN
naturalMovies/172220042Comp.mat


BIN
naturalMovies/172220043Comp.mat


BIN
naturalMovies/189010047Comp.mat


BIN
naturalMovies/189010050Comp.mat


BIN
naturalMovies/189130042Comp.mat


BIN
naturalMovies/189130044Comp.mat


BIN
naturalMovies/18d040017Comp.mat


BIN
naturalMovies/18d130036Comp.mat


+ 10 - 0
naturalMovies/ExampleCellIDs.txt

@@ -0,0 +1,10 @@
+Filename	 Date	Retina Number	Cell Number
+%Higher prediction
+16d200016Comp	161219	2	5	
+
+%medium and lower prediction
+17127007Comp	170127	1	2
+16d190024Comp	161219	1	4
+172220043Comp	170222	2	1
+
+

BIN
naturalMovies/LogInfo_NaturalMovies.xlsx


+ 1 - 1
naturalMovies/code natural movies/BC_getNaturalMovies.m

@@ -40,7 +40,7 @@ NyWhiteNoise=ceil(monitorYPixels/pixelSize); %number of squares shown Y dimensio
 nbrFrames=998;
 genRandSignal=rand(NyMovie,NxMovie,nbrFrames)*255; %a movie signal (0-255 intensity values, as movie itself)) of 240 (y-dim) 320 (x-dim) and 998 (time frames); thats where you have to put the original movie signal at 320x240xnumber of frames 
 % %%code to load the tiff files in 1 to 998
-% loadTiff='Y:\FromPeopleToPeople\Helene2Tim\tiffMovie4';
+% loadTiff='Y:\tiffMovie4';
 % indx=1;
 % ContentStackDir_tif=dir([loadTiff '\']); %what is inside the folder
 % for l=1:1000 %nbr of files in the folder

+ 14 - 4
naturalMovies/code natural movies/BC_predNaturalMovies.m

@@ -1,5 +1,5 @@
 function [naturalMovie_output]=BC_predNaturalMovies(loadData,filename,movieSignal,STA_output,NL_output,Hz)
-%[naturalMovie_output]=BC_predNaturalMovies(movieSignal,STA_output,NL_output)
+%[naturalMovie_output]=BC_predNaturalMovies(loadData,filename,movieSignal,STA_output,NL_output,Hz)
 %this function shows the prinicpal calculation for the prediction of the 
 %response to the natural movie, from the linear-nonlinear model (LN-model)
 %computed with white noise stimulus.
@@ -12,12 +12,13 @@ function [naturalMovie_output]=BC_predNaturalMovies(loadData,filename,movieSigna
 %               STA_output =  output of the BC_STA function; containing the
 %               STA (filter) of the white noise stimulus  
 %               NL_output =  output of the BC_NL function; containing the
-%               output nonlinearity of the white noise stimulus                 
+%               output nonlinearity of the white noise stimulus  
+%               Hz = movie update rate given in excel file
 %
 %Outpus:        naturalMovie_output = structure containing the output of the
 %               prediction
 %
-% code by HS last modiefied Feb 2021
+% code by HS last modiefied March 2021
 
 %% Constants
 findBreak=500; %the movie is repeated multiple times. Between the movies there is 
@@ -38,8 +39,17 @@ movieSignal2D_zoom=reshape(movieSignal_zoom,size(movieSignal_zoom,1)*...
 %normalize the filter
 linearFiler=normSTA(STA_output.STA2D_zoom);
 %convolve the natural movie stimulus sequence  with the
-%normalized STA
+%normalized STA.
 stim2pred=filter2(linearFiler,movieSignal2D_zoom,'valid');
+%%IMPORTANT: if you have a best spatial and temporal component as described in Point 7
+%in the function BC_STA.m (see Method of Manuscript), this part hast to be done in two lines, e.g.:
+%NL_PredXaxis2=filter2(sp_bestnorm,movieSignal2D_zoom,'valid'); %first
+%convolve the spatial dimension
+%generator_signal=filter2(temp_bestnorm,NL_PredXaxis2,'valid'); %then the
+%temporal dimension
+%%Also note, to avoid noise contributions from pixels outside the receptive
+%%field,it is important to cut the STA into a smaller region around the maximum pixel, this
+%%gives a much cleaner NL-> see BC_STA.m and Methods in Schreyer&Gollisch (2021).
 
 %% 2.2 compute the prediction through linear interpolation
 NL_x=NL_output.bins.NL_xbin;

+ 2 - 1
naturalMovies/code natural movies/avgPerFrameNatMovies.m

@@ -1,11 +1,12 @@
 function [membranPotAVG]=avgPerFrameNatMovies ...
     (membranePot,ttls_ms,MovieFrames,Hz)
 %function [membranPotAVG]=avgPerFrameNatMovies ...
-%         (membranePot,ttls_ms_correctedPulse)
+%         (membranePot,ttls_ms,MovieFrames,Hz)
 %builds the average membrane potential between frames for the natural movie
 % INPUT:        membranePos -> membrane Potential
 %               ttls_ms -> pulses in ms
 %               MovieFrames -> number of frames per movie
+%               Hz -> update rate in excel file
 %
 % OUTPUT:       membranPotAVG -> average membrane potential per frames