\scriptsize
\section{Function reference}
\subsection{.}
\begin{description}
\item[actualvscontrol]{%
Computes feature values at actual fixations and at controls. }
\ref{ssec:.:actualvscontrol}
%\item[actualvscontrolbayes]{%
%Computes feature values at actual fixations and at controls. }
%\ref{ssec:.:actualvscontrolbayes}
%\item[actualvscontrolhippocampus]{%
%Computes feature values at actual fixations and at controls. }
%\ref{ssec:.:actualvscontrolhippocampus}
\item[actualvscontrolstatistics]{%
Finding a ceiling for actual vs control}
\ref{ssec:.:actualvscontrolstatistics}
\item[appearence\_of\_new\_perceptual\_object]{%
Do unusual features attract more attention than usual ones?}
\ref{ssec:.:appearenceofnewperceptualobject}
%\item[binprob]{%
%Binomial probability: get one p out of a set of p's. }
%\ref{ssec:.:binprob}
\item[bootpdf]{%
Bootstraps monkey and human fixations and compares differences of the pdfs. }
\ref{ssec:.:bootpdf}
\item[chi2]{%
Chi2 test for equal distributions (D1 and D2 with equal lengths)}
\ref{ssec:.:chi2}
\item[clearfixmat]{%
Clears fixmat of undesired fixations}
\ref{ssec:.:clearfixmat}
\item[conditionalprobability]{%
Calculates conditional probabilities of feature values and fixations}
\ref{ssec:.:conditionalprobability}
\item[ContrastMap]{%
Computes the contrast map of an image. }
\ref{ssec:.:ContrastMap}
\item[corrcoef]{%
CORRCOEF calculates the correlation coefficient. Copyright: (C) 2000-2003 Alois Schloegl (koders.com).}
%\ref{ssec:.:corrcoef}
\item[divergence]{%
Calculates divergence of fixations over fixations}
\ref{ssec:.:divergence}
\item[edf2mat]{%
Reads in an .EDF or .ASC file and converts it to a matrix }
\ref{ssec:.:edf2mat}
\item[effectatdegree]{%
Computes feature values at actual fixations and at controls. }
\ref{ssec:.:effectatdegree}
\item[entropy]{%
Calculates the entropy of a probability distribution p. }
\ref{ssec:.:entropy}
\item[expandActualvsControls]{%
Expands a control matrix from size images*subjects to all fixations}
\ref{ssec:.:expandActualvsControls}
\item[fcext]{%
Feature contrast extraction. }
\ref{ssec:.:fcext}
\item[fixationprob]{%
Generates a probability density function from fixations. }
\ref{ssec:.:fixationprob}
\item[fixbyfix]{%
Enumerates fixations in a fixation matrix by order of occurence in trials}
\ref{ssec:.:fixbyfix}
\item[getbasiceyemovements]{%
Gives back the basic eye movement properties to all fixations}
\ref{ssec:.:getbasiceyemovements}
\item[getcontrols]{%
Computes feature values at control fixations }
\ref{ssec:.:getcontrols}
\item[getdata]{%
script that runs edf to mat for a number of files and concatinates the}
\ref{ssec:.:getdata}
\item[histcnew]{%
Calculates a histogram of continuous values for a vector }
\ref{ssec:.:histcnew}
\item[jointprobability]{%
Calculates joint probabilities of feature values and fixations}
\ref{ssec:.:jointprobability}
\item[jsd]{%
Jensen-Shannon divergence}
\ref{ssec:.:jsd}
\item[kl]{%
Returns the Kullback Leibler Divergence of two matrices.}
\ref{ssec:.:kl}
\item[mode]{%
Finds the mode of a 2d matrix.}
\ref{ssec:.:mode}
\item[nextfixation]{%
Plots "Next-Fixation" statistics}
\ref{ssec:.:nextfixation}
\item[nonan]{%
remove entries from vec1, where either vec1 or vec2 have NaNs}
\ref{ssec:.:nonan}
%\item[oldnewfeatures]{%
%compare "traditional" method of feature extraction and "Gaussian" one. }
%\ref{ssec:.:oldnewfeatures}
\item[plotSubject]{%
Plots fixations on an image. }
\ref{ssec:.:plotSubject}
%\item[ptf]{%
%PTF  Print a figure to a file.}
%\ref{ssec:.:ptf}
%\item[ranks]{%
%RANKS gives the rank of each element in a vector.}
%\ref{ssec:.:ranks}
\item[shuffle]{%
shuffle(A) returns matrix A with elements randomly permuted. }
\ref{ssec:.:shuffle}
\item[specialplot2]{%
Same as specialplot but for two pairs. Outputs statistics in tex format}
\ref{ssec:.:specialplot2}
%\item[sumskipnan]{%
%SUMSKIPNAN adds all non-NaN values. }
%\ref{ssec:.:sumskipnan}
\item[windowsize]{%
Calculates the number of pixels that correspond to one degree}
\ref{ssec:.:windowsize}
\end{description}
\subsection{./bochumData}
\begin{description}
%\item[actualvscontrol]{%
%computes feature values at actual fixations and at controls using a}
%\ref{ssec:./bochumData:actualvscontrol}
%\item[BarnessMap]{%
%call Barness=BarnessMap(Image, y, x, sigma)}
%\ref{ssec:./bochumData:BarnessMap}
%\item[clearfixmat]{%
%clears fixmat of first fixations and badly calibrated fixations for}
%\ref{ssec:./bochumData:clearfixmat}
%\item[ContrastMap]{%
%[cim]=ContrastMap(im,ws,Normalize);}
%\ref{ssec:./bochumData:ContrastMap}
\item[einhaeuser2fixmat]{%
Converts Wolfgang Einhaeuser's data to fixmat matrix. }
\ref{ssec:./bochumData:einhaeuser2fixmat}
%\item[fcext]{%
%function [feature]=fcext(fixmat,screen)}
%\ref{ssec:./bochumData:fcext}
%\item[fixationprob]{%
%function PCONV=fixationprob(fixmat,WS,h)}
%\ref{ssec:./bochumData:fixationprob}
%\item[forCC]{%
%read image number and level}
%\ref{ssec:./bochumData:forCC}
%\item[getFixations]{%
%}
%\ref{ssec:./bochumData:getFixations}
%\item[windowsize]{%
%Calculates the number of pixels that correspond to one degree}
%\ref{ssec:./bochumData:windowsize}
\end{description}
\subsection{./latex}
\begin{description}
%\item[laprint]{%
%LAPRINT prints a figure for inclusion in LaTeX documents.}
%\ref{ssec:./latex:laprint}
\item[tutorial]{%
Creates a hyperlinked function reference from a project's directory tree. }
\ref{ssec:./latex:tutorial}
%\item[tutorialwraplines]{%
%automatically extracts all function descriptions and puts them together}
%\ref{ssec:./latex:tutorialwraplines}
%\item[write\_highlighted\_code]{%
%- Display the line number at each line}
%\ref{ssec:./latex:writehighlightedcode}
\end{description}
\subsection{./plots}
\begin{description}
\item[figure1]{%
this one is lavish! }
\ref{ssec:./plots:figure1}
\item[figure2]{%
figure 2}
\ref{ssec:./plots:figure2}
\item[figure3]{%
figure3 }
\ref{ssec:./plots:figure3}
\item[figure4]{%
figure 4}
\ref{ssec:./plots:figure4}
\item[plotcondprob]{%
plot conditionalprobabilities of features f (1=luminance, 2=texture,}
\ref{ssec:./plots:plotcondprob}
\item[plotdivergence]{%
divergence statistics}
\ref{ssec:./plots:plotdivergence}
\item[plotfoft]{%
features as functions of time}
\ref{ssec:./plots:plotfoft}
\item[plotjointprob]{%
plot joint probabilities of features f1 and f2 (1=luminance, 2=texture,}
\ref{ssec:./plots:plotjointprob}
\item[plotsome]{%
Plots all kind of figures from data and prints statistics}
\ref{ssec:./plots:plotsome}
%\item[plotsomebayes]{%
%Plots all kind of figures from data and prints statistics}
%\ref{ssec:./plots:plotsomebayes}
%\item[plotsomewind]{%
%Plots all kind of figures from data and prints statistics}
%\ref{ssec:./plots:plotsomewind}
\item[understand\_divergence]{%
plotting divergence}
\ref{ssec:./plots:understanddivergence}
\end{description}
\twocolumn
\addtolength{\textwidth}{2cm}
\addtolength{\columnsep}{1.5cm}
\addtolength{\oddsidemargin}{-1cm}
\addtolength{\evensidemargin}{-3cm}
\section{Documentation}
\subsection{.}
\subsubsection{actualvscontrol}
\label{ssec:.:actualvscontrol}
\lstinline$Computes feature values at actual fixations and at controls. $\newline
\lstinline$Optionally reads in feature values at different degrees. $\newline
\lstinline$$\newline
\lstinline$Usages: $\newline
\lstinline$[actual,control]=actualvscontrol(fixmat)$\newline
\lstinline$[actual,control]=actualvscontrol(fixmat,path)$\newline
\lstinline$[actual,control]=actualvscontrol(fixmat,path,WS)$\newline
\lstinline$$\newline
\lstinline$If windowsize WS is not given, one degree, as given by windowsize.m, is$\newline
\lstinline$assumed. If WS is a scalar vector (of length>1), actuals and controls $\newline
\lstinline$are computed for all values of the vector (e.g. for computing effects of $\newline
\lstinline$feature values at different degrees). If computations of effect at $\newline
\lstinline$different degrees are desired, the path argument specifies the location $\newline
\lstinline$of feature maps on which the ContrastMap function is to be performed, $\newline
\lstinline$with convolutions of WS. Otherwise, the path argument indicates from $\newline
\lstinline$where feature maps are to be taken. The matrix imagelookup gives$\newline
\lstinline$correspondences of image numbers (row NI in fixmat) and file names. $\newline
\lstinline$$\newline
\lstinline$Note that since only odd numbers as inputs to ContrastMap.m are allowed,$\newline
\lstinline$WS should conform also. WARNING! Fixmat should not contain fixations that$\newline
\lstinline$transgress screen size [1024x768] (use clearfixmat.m). $\newline
\lstinline$$\newline
\lstinline$Definitions: (as talked with Selim, 22-Mar-2006, as used by Sonja$\newline
\lstinline$and Honey)$\newline
\lstinline$actual fixations:= all the fixations of a given subject (subject$\newline
\lstinline$dependent) done on image i$\newline
\lstinline$control fixations:= all the fixations of a given subject done on all$\newline
\lstinline$images but i$\newline
\lstinline$subject-dependent(specific) fixations. Eliminating individual viewing$\newline
\lstinline$preferences (biases). The statistical data were sufficient for such a$\newline
\lstinline$step as 262 images per 10 fixations on average were available. $\newline
\lstinline$$\newline
\lstinline$First fixations are discarded. $\newline
\lstinline$$\newline
\lstinline$Example: Compute actuals and controls for texture contrast at degrees $\newline
\lstinline$from 0.5 to 8 in steps of half a degree. (Here, 25 corresponds to 1 $\newline
\lstinline$degree)$\newline
\lstinline$$\newline
\lstinline$WS=round([0.5:0.5:8]*25); $\newline
\lstinline$WS(mod(WS,2)==0)=WS(mod(WS,2)==0)+1; $\newline
\lstinline$load fixmat/monkeys.mat$\newline
\lstinline$[actual,control]=actualvscontrol(monkeys,'featuremaps/LCM',WS);$\newline
\lstinline$$\newline
\lstinline$$\newline
\lstinline$created in Mar-2006$\newline
\lstinline$last changed: 20-May-2006$\newline
\lstinline$May 1: see fcext.m$\newline
\lstinline$May 20: this function originally took the means of points at fixated$\newline
\lstinline$points. I changed to Frank's method of weighted means (Gaussians on $\newline
\lstinline$fixation points) and took the median later (because the distribution $\newline
\lstinline$is not Gaussian). Included path option$\newline
\lstinline$May-30. Decommented plotting. Squared them (Robert's suggestion)$\newline
\lstinline$$\newline
\lstinline$$\newline
\lstinline$based on fcext.m and actualvscontrol.m$\newline
\lstinline$created May(?) 2006, Benjamin. Last changed August 2006 for omission of$\newline
\lstinline$first fixations and functionality of effectatdegree.m. Optimized for$\newline
\lstinline$speed with pre-computation of convolutions. $\newline
%\subsubsection{actualvscontrolbayes}
%\label{ssec:.:actualvscontrolbayes}
%\lstinline$Computes feature values at actual fixations and at controls. $\newline
%\lstinline$Optionally reads in feature values at different degrees. $\newline
%\lstinline$$\newline
%\lstinline$Usages: $\newline
%\lstinline$[actual,control]=actualvscontrol(fixmat)$\newline
%\lstinline$[actual,control]=actualvscontrol(fixmat,path)$\newline
%\lstinline$[actual,control]=actualvscontrol(fixmat,path,WS)$\newline
%\lstinline$$\newline
%\lstinline$If windowsize WS is not given, one degree, as given by windowsize.m, is$\newline
%\lstinline$assumed. If WS is a scalar vector (of length>1), actuals and controls $\newline
%\lstinline$are computed for all values of the vector (e.g. for computing effects of $\newline
%\lstinline$feature values at different degrees). If computations of effect at $\newline
%\lstinline$different degrees are desired, the path argument specifies the location $\newline
%\lstinline$of feature maps on which the ContrastMap function is to be performed, $\newline
%\lstinline$with convolutions of WS. Otherwise, the path argument indicates from $\newline
%\lstinline$where feature maps are to be taken. The matrix imagelookup gives$\newline
%\lstinline$correspondences of image numbers (row NI in fixmat) and file names. $\newline
%\lstinline$$\newline
%\lstinline$Note that since only odd numbers as inputs to ContrastMap.m are allowed,$\newline
%\lstinline$WS should conform also. Fixmat should not contain fixations that$\newline
%\lstinline$transgress screen size [1024x768] (use clearfixmat.m). $\newline
%\lstinline$$\newline
%\lstinline$Definitions: (as talked with Selim, 22-Mar-2006, as used by Sonja$\newline
%\lstinline$and Honey)$\newline
%\lstinline$actual fixations:= all the fixations of a given subject (subject$\newline
%\lstinline$dependent) done on image i$\newline
%\lstinline$control fixations:= all the fixations of a given subject done on all$\newline
%\lstinline$images but i$\newline
%\lstinline$subject-dependent(specific) fixations. Eliminating individual viewing$\newline
%\lstinline$preferences (biases). The statistical data were sufficient for such a$\newline
%\lstinline$step as 262 images per 10 fixations on average were available. $\newline
%\lstinline$$\newline
%\lstinline$First fixations are discarded. $\newline
%\lstinline$$\newline
%\lstinline$Example: Compute actuals and controls for texture contrast at degrees $\newline
%\lstinline$from 0.5 to 8 in steps of half a degree. (Here, 25 corresponds to 1 $\newline
%\lstinline$degree)$\newline
%\lstinline$$\newline
%\lstinline$WS=round([0.5:0.5:8]*25); $\newline
%\lstinline$WS(mod(WS,2)==0)=WS(mod(WS,2)==0)+1; $\newline
%\lstinline$load fixmat/monkeys.mat$\newline
%\lstinline$[actual,control]=actualvscontrol(monkeys,'featuremaps/LCM',WS);$\newline
%\lstinline$$\newline
%\lstinline$$\newline
%\lstinline$created in Mar-2006$\newline
%\lstinline$last changed: 20-May-2006$\newline
%\lstinline$May 1: see fcext.m$\newline
%\lstinline$May 20: this function originally took the means of points at fixated$\newline
%\lstinline$points. I changed to Frank's method of weighted means (Gaussians on $\newline
%\lstinline$fixation points) and took the median later (because the distribution $\newline
%\lstinline$is not Gaussian). Included path option$\newline
%\lstinline$May-30. Decommented plotting. Squared them (Robert's suggestion)$\newline
%\lstinline$$\newline
%\lstinline$$\newline
%\lstinline$based on fcext.m and actualvscontrol.m$\newline
%\lstinline$created May(?) 2006, Benjamin. Last changed August 2006 for omission of$\newline
%\lstinline$first fixations and functionality of effectatdegree.m. Optimized for$\newline
%\lstinline$speed with pre-computation of convolutions. $\newline
%\subsubsection{actualvscontrolhippocampus}
%\label{ssec:.:actualvscontrolhippocampus}
%\lstinline$Computes feature values at actual fixations and at controls. $\newline
%\lstinline$Optionally reads in feature values at different degrees. $\newline
%\lstinline$$\newline
%\lstinline$Usages: $\newline
%\lstinline$[actual,control]=actualvscontrol(fixmat)$\newline
%\lstinline$[actual,control]=actualvscontrol(fixmat,path)$\newline
%\lstinline$[actual,control]=actualvscontrol(fixmat,path,WS)$\newline
%\lstinline$$\newline
%\lstinline$If windowsize WS is not given, one degree, as given by windowsize.m, is$\newline
%\lstinline$assumed. If WS is a scalar vector (of length>1), actuals and controls $\newline
%\lstinline$are computed for all values of the vector (e.g. for computing effects of $\newline
%\lstinline$feature values at different degrees). If computations of effect at $\newline
%\lstinline$different degrees are desired, the path argument specifies the location $\newline
%\lstinline$of feature maps on which the ContrastMap function is to be performed, $\newline
%\lstinline$with convolutions of WS. Otherwise, the path argument indicates from $\newline
%\lstinline$where feature maps are to be taken. The matrix imagelookup gives$\newline
%\lstinline$correspondences of image numbers (row NI in fixmat) and file names. $\newline
%\lstinline$$\newline
%\lstinline$Note that since only odd numbers as inputs to ContrastMap.m are allowed,$\newline
%\lstinline$WS should conform also. Fixmat should not contain fixations that$\newline
%\lstinline$transgress screen size [1024x768] (use clearfixmat.m). $\newline
%\lstinline$$\newline
%\lstinline$Definitions: (as talked with Selim, 22-Mar-2006, as used by Sonja$\newline
%\lstinline$and Honey)$\newline
%\lstinline$actual fixations:= all the fixations of a given subject (subject$\newline
%\lstinline$dependent) done on image i$\newline
%\lstinline$control fixations:= all the fixations of a given subject done on all$\newline
%\lstinline$images but i$\newline
%\lstinline$subject-dependent(specific) fixations. Eliminating individual viewing$\newline
%\lstinline$preferences (biases). The statistical data were sufficient for such a$\newline
%\lstinline$step as 262 images per 10 fixations on average were available. $\newline
%\lstinline$$\newline
%\lstinline$First fixations are discarded. $\newline
%\lstinline$$\newline
%\lstinline$Example: Compute actuals and controls for texture contrast at degrees $\newline
%\lstinline$from 0.5 to 8 in steps of half a degree. (Here, 25 corresponds to 1 $\newline
%\lstinline$degree)$\newline
%\lstinline$$\newline
%\lstinline$WS=round([0.5:0.5:8]*25); $\newline
%\lstinline$WS(mod(WS,2)==0)=WS(mod(WS,2)==0)+1; $\newline
%\lstinline$load fixmat/monkeys.mat$\newline
%\lstinline$[actual,control]=actualvscontrol(monkeys,'featuremaps/LCM',WS);$\newline
%\lstinline$$\newline
%\lstinline$$\newline
%\lstinline$created in Mar-2006$\newline
%\lstinline$last changed: 20-May-2006$\newline
%\lstinline$May 1: see fcext.m$\newline
%\lstinline$May 20: this function originally took the means of points at fixated$\newline
%\lstinline$points. I changed to Frank's method of weighted means (Gaussians on $\newline
%\lstinline$fixation points) and took the median later (because the distribution $\newline
%\lstinline$is not Gaussian). Included path option$\newline
%\lstinline$May-30. Decommented plotting. Squared them (Robert's suggestion)$\newline
%\lstinline$$\newline
%\lstinline$$\newline
%\lstinline$based on fcext.m and actualvscontrol.m$\newline
%\lstinline$created May(?) 2006, Benjamin. Last changed August 2006 for omission of$\newline
%\lstinline$first fixations and functionality of effectatdegree.m. Optimized for$\newline
%\lstinline$speed with pre-computation of convolutions. $\newline
\subsubsection{actualvscontrolstatistics}
\label{ssec:.:actualvscontrolstatistics}
\lstinline$Finding a ceiling for actual vs control$\newline
\lstinline$as talked with Selim. Implemented in Sept. 2006$\newline
\lstinline$$\newline
\lstinline$For all images take actuals from the 10 most salient areas in$\newline
\lstinline$the image, as controls take the overall fixation map .* feature map$\newline
\subsubsection{appearence\_of\_new\_perceptual\_object}
\label{ssec:.:appearenceofnewperceptualobject}
\lstinline$Do unusual features attract more attention than usual ones?$\newline
\lstinline$Idea: cluster the image according to feature contrasts$\newline
\lstinline$resarch interest: do irregular locations attract more fixations?$\newline
%\subsubsection{binprob}
%\label{ssec:.:binprob}
%\lstinline$Binomial probability: get one p out of a set of p's. $\newline
%\lstinline$$\newline
%\lstinline$INPUT: P - a vector of (surrogate?) significance values$\newline
%\lstinline$pthresh - a probability significance threshold for each observation$\newline
%\lstinline$$\newline
%\lstinline$OUTPUT: newp - better called P(k,N), is the probability of observing k of N significant results$\newline
%\lstinline$for the given set of correlations$\newline
%\lstinline$$\newline
%\lstinline$group statistics$\newline
%\lstinline$found in J. Onton et al. / NeuroImage 27 (2005) p. 344$\newline
\subsubsection{bootpdf}
\label{ssec:.:bootpdf}
\lstinline$Bootstraps monkey and human fixations and compares differences of the pdfs. $\newline
\lstinline$improved version (diff to avg) of the test I presented at the tea-time. $\newline
\lstinline$changed Sept. 2006$\newline
\subsubsection{chi2}
\label{ssec:.:chi2}
\lstinline$Chi2 test for equal distributions (D1 and D2 with equal lengths)$\newline
\lstinline$$\newline
\lstinline$Input:$\newline
\lstinline$- D1 and D2: distributinos with equal bin size.$\newline
\lstinline$- V1 and V2: variances of the respective distribution.$\newline
\lstinline$- df: degrees of freedom of the two distributions$\newline
\lstinline$- alpha: the significance level wished for deciding against H0. If not$\newline
\lstinline$given assume 0.05$\newline
\lstinline$$\newline
\lstinline$Returns: $\newline
\lstinline$- H=1 if you can reject H0 that both dists are equal with alpha, and 0 $\newline
\lstinline$if you can't. $\newline
\lstinline$- p: the probability that at df degrees of freedom, the X2 value occurs $\newline
\lstinline$by chance. $\newline
\lstinline$- X2 value$\newline
\lstinline$- df: degrees of freedom. $\newline
\lstinline$$\newline
\lstinline$needs statistics toolbox$\newline
\lstinline$Based on Frank's code. Adapted from Numerical Recipes in C page 622$\newline
\lstinline$Was thought of in the book for comparison of two binned distributions of $\newline
\lstinline$equal bin numbers (p.623 of unequal bin numbers). $\newline
\lstinline$$\newline
\lstinline$degrees of freedom can be calculated examplarily as follows: $\newline
\lstinline$df=number of bins - number of independent variables - number of NaN bins$\newline
\subsubsection{clearfixmat}
\label{ssec:.:clearfixmat}
\lstinline$Clears fixmat of undesired fixations$\newline
\lstinline$Undesired fixations can be first fixations and badly calibrated fixations$\newline
\lstinline$in the case of feature analysis (removal may not be necessary for$\newline
\lstinline$analysis of eye movements)$\newline
\lstinline$$\newline
\lstinline$Input: fixation matrix, border limit $\newline
\lstinline$$\newline
\lstinline$Output: cleared fixmat, indices of cleared fixations in original fixmat$\newline
\lstinline$$\newline
\lstinline$border limit determines the cut-off edge. $\newline
\lstinline$$\newline
\lstinline$E.g. for luminance contrast in the case of Tang's images, a black border$\newline
\lstinline$extended to roughly 28-30 pixels. $\newline
\lstinline$So we could cut off at 30 for LCMs. $\newline
\lstinline$For texture 65 on all but Tang's images (-213 monkey fixations=6.1\%, $\newline
\lstinline$7336 human fixations=11.35\%), 95 on Tang's (-346=9.91\%/8536=13.21\%)$\newline
\lstinline$for barness border=50 (Tang), 15 all other images$\newline
\lstinline$I took maximum border values in each case to have consistency over all $\newline
\lstinline$monkeys and humans$\newline
\lstinline$$\newline
\lstinline$Idea for rewrite: bandwidth filtering for all dimensions decisive for$\newline
\lstinline$reduction (drift corr., calibration...). Mean/median -> Min, max$\newline
\subsubsection{conditionalprobability}
\label{ssec:.:conditionalprobability}
\lstinline$Calculates conditional probabilities of feature values and fixations$\newline
\lstinline$bayesian theorem: P(A|B)=P(A\&B)/P(B)$\newline
\lstinline$P(A,B) is the probability of co-occurrence of a fixation, A, with a$\newline
\lstinline$particular feature value, B$\newline
\lstinline$for P(B) we need control values$\newline
\lstinline$$\newline
\lstinline$inputs: fixmat, subject s$\newline
\lstinline$outputs: P(fixation|feature), P(feature)$\newline
\lstinline$$\newline
\lstinline$P(A,B) is the joint probability of A and B together, $\newline
\lstinline$i.e. the ratio of fixation in feature bin to the total number of$\newline
\lstinline$fixations. $\newline
\lstinline$$\newline
\lstinline$Needs histcnew.m. $\newline
\lstinline$$\newline
\lstinline$based on Frank's thesis$\newline
\lstinline$written April (?) 2006. Benjamin Auffarth. $\newline
\subsubsection{ContrastMap}
\label{ssec:.:ContrastMap}
\lstinline$Computes the contrast map of an image. $\newline
\lstinline$Inputs are image IM and a window size of WS. IM can contain many $\newline
\lstinline$different images in its 3rd dimension then CIM contains the contrast $\newline
\lstinline$maps of the corresponding images in its third dimension. $\newline
\lstinline$It uses convolution routines of matlab. WS is preferentially an odd $\newline
\lstinline$number this makes it straigthforward to select the number of zeros used $\newline
\lstinline$to zeros pad. NORMALIZE has to be 1 if you want to normalize the $\newline
\lstinline$standard deviation map by the mean luminance of the image. $\newline
\lstinline$$\newline
%\lstinline$Last Revision by Selim 2005.$\newline
%\subsubsection{corrcoef}
%\label{ssec:.:corrcoef}
%\lstinline$CORRCOEF calculates the correlation coefficient.$\newline
%\lstinline$$\newline
%\lstinline$found at koders.com. Copyright: (C) 2000-2003 by Alois Schloegl. $\newline
%\lstinline$GPL licensed. $\newline
%\lstinline$$\newline
%\lstinline$X and Y can contain missing values encoded with NaN.$\newline
%\lstinline$NaN's are skipped, NaN do not result in a NaN output. $\newline
%\lstinline$It is garanteed that abs(R) is not larger than 1. $\newline
%\lstinline$A significance test to check the independence of NaN's$\newline
%\lstinline$is included. $\newline
%\lstinline$R = CORRCOEF(X [,Mode]);$\newline
%\lstinline$calculates the (auto-)correlation matrix of X$\newline
%\lstinline$R = CORRCOEF(X,Y [,Mode]);$\newline
%\lstinline$calculates the crosscorrelation between X and Y$\newline
%\lstinline$$\newline
%\lstinline$Mode='Pearson' or 'parametric' [default]$\newline
%\lstinline$gives the correlation coefficient  $\newline
%\lstinline$also known as the "product-moment coefficient of correlation" or "Pearson's correlation" [1]$\newline
%\lstinline$Mode='Spearman' 	gives "Spearman's Rank Correlation Coefficient"$\newline
%\lstinline$This replaces SPEARMAN.M$\newline
%\lstinline$Mode='Rank' 		gives a nonparametric Rank Correlation Coefficient$\newline
%\lstinline$This replaces RANKCORR.M$\newline
%\lstinline$$\newline
%\lstinline$The result is only valid if the occurence of NaN's is uncorrelated. $\newline
%\lstinline$This can be checked with $\newline
%\lstinline$[nan\_R,nan\_sig]=corrcoef(X,isnan(X))$\newline
%\lstinline$or  [nan\_R,nan\_sig]=corrcoef([X,Y],isnan([X,Y]))$\newline
%\lstinline$or  [R,p,ci1,ci2,nan\_sig] = CORRCOEF(...);$\newline
%\lstinline$$\newline
%\lstinline$[R,p,ci1,ci2,nansig] = CORRCOEF(...);$\newline
%\lstinline$R is the correlation matrix$\newline
%\lstinline$R(i,j) is the correlation coefficient r between X(:,i) and Y(:,j)$\newline
%\lstinline$p    gives the significance of R$\newline
%\lstinline$It tests the null hypothesis that the product moment correlation coefficient is zero $\newline
%\lstinline$using Student's t-test on the statistic t = r sqrt(N-2)/sqrt(1-r\^{}2) $\newline
%\lstinline$where N is the number of samples (Statistics, M. Spiegel, Schaum series).$\newline
%\lstinline$p > alpha: do not reject the Null hypothesis: "R is zero".$\newline
%\lstinline$p < alpha: The alternative hypothesis "R2 is larger than zero" is true with probability (1-alpha).$\newline
%\lstinline$ci1	lower 0.95 confidence interval $\newline
%\lstinline$ci2	upper 0.95 confidence interval $\newline
%\lstinline$nan\_sig 	p-value whether H0: "NaN's are not correlated" could be correct$\newline
%\lstinline$if nan\_sig < alpha, H1 ("NaNs are correlated") is very likely. $\newline
%\lstinline$$\newline
%\lstinline$Further recommandation related to the correlation coefficient $\newline
%\lstinline$+ LOOK AT THE SCATTERPLOTS!$\newline
%\lstinline$+ Correlation is not causation. The observed correlation between two variables $\newline
%\lstinline$might be due to the action of other, unobserved variables.$\newline
%\lstinline$$\newline
%\lstinline$see also: SUMSKIPNAN, COVM, COV, COR, SPEARMAN, RANKCORR, RANKS$\newline
%\lstinline$$\newline
%\lstinline$REFERENCES:$\newline
%\lstinline$on the correlation coefficient $\newline
%\lstinline$[ 1] http://mathworld.wolfram.com/CorrelationCoefficient.html$\newline
%\lstinline$[ 2] http://www.geography.btinternet.co.uk/spearman.htm$\newline
%\lstinline$[ 3] Hogg, R. V. and Craig, A. T. Introduction to Mathematical Statistics, 5th ed.  New York: Macmillan, pp. 338 and 400, 1995.$\newline
%\lstinline$[ 4] Lehmann, E. L. and D'Abrera, H. J. M. Nonparametrics: Statistical Methods Based on Ranks, rev. ed. Englewood Cliffs, NJ: Prentice-Hall, pp. 292, 300, and 323, 1998.$\newline
%\lstinline$[ 5] Press, W. H.; Flannery, B. P.; Teukolsky, S. A.; and Vetterling, W. T. Numerical Recipes in FORTRAN: The Art of Scientific Computing, 2nd ed. Cambridge, England: Cambridge University Press, pp. 634-637, 1992$\newline
%\lstinline$[ 6] http://mathworld.wolfram.com/SpearmanRankCorrelationCoefficient.html$\newline
%\lstinline$on the significance test of the correlation coefficient$\newline
%\lstinline$[11] http://www.met.rdg.ac.uk/cag/STATS/corr.html$\newline
%\lstinline$[12] http://www.janda.org/c10/Lectures/topic06/L24-significanceR.htm$\newline
%\lstinline$[13] http://faculty.vassar.edu/lowry/ch4apx.html$\newline
%\lstinline$[14] http://davidmlane.com/hyperstat/B134689.html$\newline
%\lstinline$others$\newline
%\lstinline$[20] http://www.tufts.edu/\~{}gdallal/corr.htm$\newline
\subsubsection{divergence}
\label{ssec:.:divergence}
\lstinline$Calculates divergence of fixations over fixations$\newline
\lstinline$$\newline
\lstinline$Inputs: a fixation matrix, mode (what kind of divergence?)$\newline
\lstinline$$\newline
\lstinline$two modes: $\newline
\lstinline$1 -> KL-divergence of fixations (cf Tatler, 2005)$\newline
\lstinline$2 -> Euclidean distances from cog at fixation nr and image $\newline
\lstinline$(get the individual divergences from the mean and measure the radius from$\newline
\lstinline$the mean)$\newline
\lstinline$3 -> median of inter-subject distances (historically this used to be $\newline
\lstinline$"non-overlapping points method".)$\newline
\lstinline$Trashed August, 2006$\newline
\lstinline$4 -> Jensen-Shannon divergence  (symmetric information theoretic measure)$\newline
\lstinline$5 -> Mahalanobis distance$\newline
\lstinline$$\newline
\lstinline$[AXP=1;AYP=2;CALIB=3;DRIFT=4;STTIME=5;SPTIME=6;NS=7;COND=8;FIXN=9;NI=10] $\newline
\lstinline$$\newline
\lstinline$created May (?), 2006. Benjamin Auffarth. Last changed August, 2006$\newline
\lstinline$changed from median/mean to nanmedian/nanmean to calculate divergence of$\newline
\lstinline$eye movements. $\newline
\subsubsection{edf2mat}
\label{ssec:.:edf2mat}
\lstinline$Reads in an .EDF or .ASC file and converts it to a matrix $\newline
\lstinline$$\newline
\lstinline$expects an EDF (ending in 'edf') or an ASC (with or without respective$\newline
\lstinline$extension). Takes an optional second argument subject number (which comes$\newline
\lstinline$in handy if you merge many edfs into one matrix. $\newline
\lstinline$$\newline
\lstinline$Input: a file name (either an .EDF file or an .ASC event file), and$\newline
\lstinline$(optionally) a number, the subject is to be indexed by (NS). $\newline
\lstinline$$\newline
\lstinline$Output: fixation matrix, imagelookup$\newline
\lstinline$[AXP;AYP;CALIB;DRIFT;STTIME;SPTIME;NS;COND;FIXATIONNR;NI]$\newline
\lstinline$(where DRIFT is the correction BEFORE TRIAL)$\newline
\lstinline$$\newline
\lstinline$Remember to set up the variable 'imagewildcards' in order to index your $\newline
\lstinline$images and you may want to define your conditions... E.g. make them $\newline
\lstinline$dependent on ntrial data\{ntrial\}.co=mod(ntrial,2);  \% or whatever else $\newline
\lstinline$you like :)$\newline
\lstinline$$\newline
\lstinline$based on Selim's code$\newline
\lstinline$created June-12,June-13 2006 by Benjamin. Last changed: June-14$\newline
\lstinline$$\newline
\lstinline$$\newline
\lstinline$Example: script get\_fixmats$\newline
\lstinline$$\newline
\lstinline$subjects=dir('data/EDF/*.EDF');$\newline
\lstinline$subjects=\{subjects.name\};$\newline
\lstinline$fixmat=[];$\newline
\lstinline$for s=1:length(subjects)$\newline
\lstinline$fname=subjects\{s\}$\newline
\lstinline$fixmat=[fixmat,[edf2mat(['data/EDF/' fname(1:end-4)],s)]]; \%searches$\newline
\lstinline$\% for the asc's. Remove subscript to fname for working on the edf's$\newline
\lstinline$end$\newline
\subsubsection{effectatdegree}
\label{ssec:.:effectatdegree}
\lstinline$Computes feature values at actual fixations and at controls. $\newline
\lstinline$Optionally reads in feature values at different degrees. $\newline
\lstinline$$\newline
\lstinline$Usages: $\newline
\lstinline$[actual,control]=actualvscontrol(fixmat)$\newline
\lstinline$[actual,control]=actualvscontrol(fixmat,path)$\newline
\lstinline$[actual,control]=actualvscontrol(fixmat,path,WS)$\newline
\lstinline$$\newline
\lstinline$If windowsize WS is not given, one degree, as given by windowsize.m, is$\newline
\lstinline$assumed. If WS is a scalar vector (of length>1), actuals and controls $\newline
\lstinline$are computed for all values of the vector (e.g. for computing effects of $\newline
\lstinline$feature values at different degrees). If computations of effect at $\newline
\lstinline$different degrees are desired, the path argument specifies the location $\newline
\lstinline$of feature maps on which the ContrastMap function is to be performed, $\newline
\lstinline$with convolutions of WS. Otherwise, the path argument indicates from $\newline
\lstinline$where feature maps are to be taken. The matrix imagelookup gives$\newline
\lstinline$correspondences of image numbers (row NI in fixmat) and file names. $\newline
\lstinline$$\newline
\lstinline$Note that since only odd numbers as inputs to ContrastMap.m are allowed,$\newline
\lstinline$WS should conform also. Fixmat should not contain fixations that$\newline
\lstinline$transgress screen size [1024x768] (use clearfixmat.m). $\newline
\lstinline$$\newline
\lstinline$Definitions: (as talked with Selim, 22-Mar-2006, as used by Sonja$\newline
\lstinline$and Honey)$\newline
\lstinline$actual fixations:= all the fixations of a given subject (subject$\newline
\lstinline$dependent) done on image i$\newline
\lstinline$control fixations:= all the fixations of a given subject done on all$\newline
\lstinline$images but i$\newline
\lstinline$subject-dependent(specific) fixations. Eliminating individual viewing$\newline
\lstinline$preferences (biases). The statistical data were sufficient for such a$\newline
\lstinline$step as 262 images per 10 fixations on average were available. $\newline
\lstinline$$\newline
\lstinline$First fixations are discarded. $\newline
\lstinline$$\newline
\lstinline$Example: $\newline
\lstinline$load fixmat/allhumans.mat \% for monkeys use: load fixmat/monkeys.mat$\newline
\lstinline$actualvscontrol(fixmat,'featuremaps/LCM');$\newline
\lstinline$$\newline
\lstinline$created in Mar-2006$\newline
\lstinline$last changed: 20-May-2006$\newline
\lstinline$May 1: see fcext.m$\newline
\lstinline$May 20: this function originally took the means of points at fixated$\newline
\lstinline$points. I changed to Frank's method of weighted means (Gaussians on $\newline
\lstinline$fixation points) and took the median later (because the distribution $\newline
\lstinline$is not Gaussian). Included path option$\newline
\lstinline$May-30. Decommented plotting. Squared them (Robert's suggestion)$\newline
\lstinline$$\newline
\lstinline$$\newline
\lstinline$based on fcext.m and actualvscontrol.m$\newline
\lstinline$created May(?) 2006, Benjamin.$\newline
\subsubsection{entropy}
\label{ssec:.:entropy}
\lstinline$Calculates the entropy of a probability distribution p. $\newline
\lstinline$formula: http://en.wikipedia.org/wiki/Information\_entropy$\newline
\lstinline$$\newline
\subsubsection{expandActualvsControls}
\label{ssec:.:expandActualvsControls}
\lstinline$Expands a control matrix from size images*subjects to all fixations$\newline
\lstinline$$\newline
\lstinline$Motivation: It is possible to create all kinds of control features that$\newline
\lstinline$correspond somehow to specific fixations, or all fixations in a fixation$\newline
\lstinline$matrix. $\newline
\lstinline$However, most sense does it make, to have a vector of control fixations$\newline
\lstinline$that correspond to \~{}image and subject. $\newline
\lstinline$So, if you have the output from actualvscontrol.m, you get this vector. $\newline
\lstinline$$\newline
\lstinline$Tip: For a rough estimate, before running fcext, you might want to run$\newline
\lstinline$actualvscontrol.m together with expandActualvsControls(fixmat,actual)!$\newline
\lstinline$$\newline
\lstinline$Input: fixation matrix, features (imagesXsubjects)$\newline
\lstinline$$\newline
\lstinline$Output: longfeatures$\newline
\lstinline$the features vector has the same length as the fixation matrix. $\newline
\lstinline$$\newline
\lstinline$Created August, 2006$\newline
\lstinline$$\newline
\lstinline$Example: expand LC features to all fixations$\newline
\lstinline$load allhumans$\newline
\lstinline$load actualvscontrol$\newline
\lstinline$controls=expandActualvsControls(humans,squeeze(actualcontrolhumans(2,1,:,:)));$\newline
\lstinline$length(features)$\newline
\lstinline$$\newline
\lstinline$ans =$\newline
\lstinline$$\newline
\lstinline$64629$\newline
\lstinline$$\newline
\lstinline$length(humans)$\newline
\lstinline$$\newline
\lstinline$ans =$\newline
\lstinline$$\newline
\lstinline$64629$\newline
\subsubsection{fcext}
\label{ssec:.:fcext}
\lstinline$Feature contrast extraction. $\newline
\lstinline$$\newline
\lstinline$Usages:$\newline
\lstinline$[feature]=fcext(fixmat)$\newline
\lstinline$[feature]=fcext(fixmat,pathes)$\newline
\lstinline$$\newline
\lstinline$Reads in feature values at fixations (as found in fixmat) from feature $\newline
\lstinline$maps at 'pathes' (a cell array of strings or a string). $\newline
\lstinline$Extracts all feature values weighted by vicinity in order to compensate $\newline
\lstinline$for inaccuracies of the eye trackers. $\newline
\lstinline$$\newline
\lstinline$The size of the Gaussian (as given in 'WS' at FWHM) should correspond to$\newline
\lstinline$the accuracies in the eye tracker measurements. Assumes x,y values are $\newline
\lstinline$restricted to non-border areas and the x,y values are positive integers>0 $\newline
\lstinline$(i.e. rounded)! You will have to specify cut off values at the borders $\newline
\lstinline$for fcext to ignore (see clearfixmat.m). $\newline
\lstinline$$\newline
\lstinline$Motivation for function: I found it useful to extract all features, store $\newline
\lstinline$them away, and then compute everything on the existant feature values. $\newline
\lstinline$$\newline
\lstinline$Note that as this function computes convolutions for all fixations in the$\newline
\lstinline$matrix it can take very long. $\newline
\lstinline$$\newline
\lstinline$Created originally in April 2006. Changed last May-29 and May-30, 2006$\newline
\lstinline$(commented). Adapted to new format spec on June 15. August: Adapted to $\newline
\lstinline$new fixationprob.m for higher speed. Benjamin Auffarth. $\newline
\lstinline$$\newline
\subsubsection{fixationprob}
\label{ssec:.:fixationprob}
\lstinline$Generates a probability density function from fixations. $\newline
\lstinline$$\newline
\lstinline$Probability density maps of fixations convolved with a Gaussian of a FSHM$\newline
\lstinline$of WS. If WS is not given one degree (as determined by windowsize.m) is$\newline
\lstinline$taken. If WS is not a scalar, it is assumed that it contains the$\newline
\lstinline$convolution (use make\_gaussian.m, this can significantly speed up $\newline
\lstinline$lengthy processes). $\newline
\lstinline$Optionally applies a function, addressed by the function handle, to the $\newline
\lstinline$duration of the fixation. It returns a weighted fixation matrix.    $\newline
\lstinline$$\newline
\lstinline$Attention: fixmat should contain only fixations that fit on the screen$\newline
\lstinline$(1024x768)$\newline
\lstinline$$\newline
\lstinline$Usages: $\newline
\lstinline$PCONV=fixationprob(fixmat,WS)$\newline
\lstinline$PCONV=fixationprob(fixmat,Gaussian)$\newline
\lstinline$PCONV=fixationprob(.,.,h)$\newline
\lstinline$$\newline
\lstinline$$\newline
\lstinline$Example: $\newline
\lstinline$load fixmat/allhumans$\newline
\lstinline$load imagelookup$\newline
\lstinline$WS=windowsize*5; \% let's have 5 degrees$\newline
\lstinline$for i=1:262$\newline
\lstinline$PCONV=fixationprob(fixmat(:,fixmat(NI,:)==i),WS(1),@(x) 1);$\newline
\lstinline$fname=imagelookup\{i\}$\newline
\lstinline$save(['featuremaps/pdf5d/humans/' fname(1:end-4)$\newline
\lstinline$'.mat'],'PCONV','-v6');$\newline
\lstinline$end$\newline
\lstinline$$\newline
\lstinline$created 22-Mar-2006 from fixationprob.m$\newline
\lstinline$Apr 26: took out the picindex param$\newline
\lstinline$Apr 27; bugfix (thanks to Alper and Selim). Speed optimization. Made $\newline
\lstinline$h optional.Renamed to fixationprob.m$\newline
\lstinline$May 5; Optimized using Alper's diff idea then changed everything using $\newline
\lstinline$accumarray! May 28; Pulled out matrix to front. Faster!$\newline
\lstinline$June 15. Commented. Made more adaptable by introducing indices to fixmat.$\newline
\lstinline$June 18. Improved considerably in speed by including conv2.m$\newline
\lstinline$August: Allowed argument WS to be the convolution for speed optimization. $\newline
\lstinline$$\newline
\subsubsection{fixbyfix}
\label{ssec:.:fixbyfix}
\lstinline$Enumerates fixations in a fixation matrix by order of occurence in trials$\newline
\lstinline$$\newline
\lstinline$Input: fixmat$\newline
\lstinline$$\newline
\lstinline$Output: fixation number corresponding to input matrix$\newline
\lstinline$$\newline
\lstinline$Created 19-May-2006 by Benjamin. Last changed 31-May-2006. $\newline
\lstinline$$\newline
\subsubsection{getbasiceyemovements}
\label{ssec:.:getbasiceyemovements}
\lstinline$Gives back the basic eye movement properties to all fixations$\newline
\lstinline$calculates fixation duration,saccade length,saccade speed, and $\newline
\lstinline$saccade duration. $\newline
\lstinline$$\newline
\lstinline$INPUT: fixation matrix$\newline
\lstinline$$\newline
\lstinline$OUTPUT: fixationduration,saccadelength,saccadespeed,saccadeduration$\newline
\lstinline$$\newline
\lstinline$The returned vectors correspond to all fixations in fixmat. $\newline
\lstinline$In order to ignore effects of last saccades and last fixations in a $\newline
\lstinline$trial, these are ignored. $\newline
\lstinline$Filters out outliers for saccades $\newline
\lstinline$$\newline
\subsubsection{getcontrols}
\label{ssec:.:getcontrols}
\lstinline$Computes feature values at control fixations $\newline
\lstinline$(extended version). See actualvscontrol)$\newline
\lstinline$It uses a weighted neighborhood function for correction of calibration $\newline
\lstinline$errors. $\newline
\lstinline$$\newline
\lstinline$Input: fixmat, path to feature maps, varargin (optional additional$\newline
\lstinline$restrictions on controls)$\newline
\lstinline$$\newline
\lstinline$Definitions: (as talked with Selim, as used by Sonja$\newline
\lstinline$and Honey, among others)$\newline
\lstinline$actual fixations:= all the fixations of a given subject (subject$\newline
\lstinline$dependent) done on image i$\newline
\lstinline$control fixations:= all the fixations of a given subject done on all$\newline
\lstinline$images but i$\newline
\lstinline$subject-dependent(specific) fixations. Eliminating individual viewing$\newline
\lstinline$preferences (biases). As for my experiment, the statistical data were $\newline
\lstinline$sufficient for such a step as 262 images per 10 fixations on average $\newline
\lstinline$were available. $\newline
\lstinline$$\newline
\lstinline$Historical note: originally control extraction was implemented by$\newline
\lstinline$actualvscontrol.m$\newline
\lstinline$This here was rewritten from scratch July 10. 2006. Last changed July 13.$\newline
\lstinline$$\newline
\lstinline$Idea for varargin: getcontrols.m extracts controls, def. see above: 1$\newline
\lstinline$restriction: FIXN's have to correspond for actuals and controls$\newline
\lstinline$varargin is a optional input argument, that can extend the definition of$\newline
\lstinline$control fixations. Control fixations are fixations on different images by$\newline
\lstinline$same subjects and same varargin\{1\}, varargin\{2\}, ..., varargin\{nargin\} $\newline
\lstinline$(try e.g. FIXN, or use tempwin for clustering of input space, say, $\newline
\lstinline$STARTTIME or STOPTIME or duration). (omit this parameter for$\newline
\lstinline$standard definition)$\newline
\lstinline$compare: [actual]=fcext(fixmat); \% gives back actuals for fixations$\newline
\lstinline$$\newline
\lstinline$Attention: getcontrols doesn't check whether your coordinates $\newline
\lstinline$(fixmat(AXP,:) and fixmat(AYP,:) are within [1:imsize(1) 1:imsize(2)]. $\newline
\lstinline$Be sure to cut off the fixations properly (e.g. by using clearfixmat.m)$\newline
\lstinline$$\newline
\lstinline$For bootstrapping applications (e.g. calculating bootstrapped medians and$\newline
\lstinline$confidence intervals) look at the "bootstrap version" comment.$\newline
\lstinline$Bootstrapping can take a long time (and Selim doesn't like bootstrapping). $\newline
\lstinline$$\newline
\lstinline$Example: $\newline
\lstinline$$\newline
\lstinline$load data/allhumans.mat  \% fixmat humans$\newline
\lstinline$$\newline
\lstinline$path='images/featuremaps/LCM/';$\newline
\lstinline$$\newline
\lstinline$cleared=clearfixmat(humans,30);$\newline
\lstinline$$\newline
\lstinline$[control]=getcontrols(cleared,path); \% for standard definition$\newline
\subsubsection{getdata}
\label{ssec:.:getdata}
\lstinline$script that runs edf to mat for a number of files and concatinates the$\newline
\lstinline$resulting matrices. $\newline
\lstinline$$\newline
\subsubsection{histcnew}
\label{ssec:.:histcnew}
\lstinline$Calculates a histogram of continuous values for a vector $\newline
\lstinline$$\newline
\lstinline$Input: vector x, number of bins (optional), equalize (optional)$\newline
\lstinline$$\newline
\lstinline$Output: edge count, bin edges, bin standard errors, optionally: bin variance$\newline
\lstinline$$\newline
\lstinline$histcnew is similar to histc except for $\newline
\lstinline$a) parameter nbins instead of edges which rather gives number of edges $\newline
\lstinline$instead of the edges itself, and $\newline
\lstinline$b) logical parameter equalize, which - if true - results in bins of $\newline
\lstinline$equal counts (equalized bin edges)$\newline
\lstinline$c) if given a two-dimensional vector x, histcnew gives means of x(2,:),$\newline
\lstinline$as bucketted x(1,:), and the SEM of the buckets. Gives also the $\newline
\lstinline$computed edges (so they can be reused). $\newline
\lstinline$$\newline
\lstinline$The function in c) can be used to arrange feature values along (e.g. $\newline
\lstinline$temporal) dimensions. Initial motivation: durations can and onsets of $\newline
\lstinline$fixations could be correlated to feature values. $\newline
\lstinline$E.g. (Einhaeuser and Koenig, 2003) showed that luminance contrasts are$\newline
\lstinline$correlated only with saliency within a temporal window. $\newline
\lstinline$$\newline
\lstinline$n(k) counts the value x(i) if edges(k) <= x(i) < edges(k+1). The first $\newline
\lstinline$bin contains values edges(1)>x>=min(X)The last bin $\newline
\lstinline$(analogously to hist.m) contains values edges(end-1) <= x(i) <= edges(end). $\newline
\lstinline$$\newline
\lstinline$For normalization with controls call function twice, first $\newline
\lstinline$(t,actuals,nbins) then (t,controls,nbins) then devide. $\newline
\lstinline$$\newline
\lstinline$To combine the SEMs of two features, y1, y2, do the following: $\newline
\lstinline$std1=dy1.*sqrt(y1);$\newline
\lstinline$std2=dy2.*sqrt(y2);$\newline
\lstinline$variance12=sqrt((std1.\^{}2./y1)+(std2.\^{}2./y2));  $\newline
\lstinline$(wikipedia: standard deviation.) $\newline
\lstinline$Thanks also to Robert, who provided an alternative method$\newline
\lstinline$$\newline
\lstinline$Created: Apr 11, 2006. Benjamin. Last changed: Apr. 29. Switched output$\newline
\lstinline$parameters for ease of usage with hist or bar$\newline
\lstinline$Changed 22-May-2006 to include sems. Output always of same bin-length$\newline
\lstinline$June-15. Combined with tempwin.m to extend funcionality. $\newline
\lstinline$July 17. Bugs fixed and optimized by rewriting everything relying on $\newline
\lstinline$http://mri.med.yale.edu/individual/pawel/fMRIprograms/fMRI-tools/hist.m$\newline
\lstinline$(standard histogram) and my old function histcnew. $\newline
\lstinline$Sept. 11: Changed bucket* invocations from nbin to nbin+1 !!!$\newline
\lstinline$$\newline
\lstinline$EXAMPLE: plot the intersubject divergence of x-coord over fixations by$\newline
\lstinline$nr. (cf. plotsome.m)$\newline
\lstinline$$\newline
\lstinline$subjects=intersect(humans(NS,:),humans(NS,:));$\newline
\lstinline$[n,edges]=histcnew([humans(9,:);abs((1024/2)-humans(1,:))],16);  $\newline
\lstinline$\% for my data, 16 fixations were the maximum$\newline
\lstinline$for i=subjects$\newline
\lstinline$n(i,:)=histcnew([humans(9,humans(7,:)==i);...$\newline
\lstinline$abs((1024/2)-humans(1,humans(7,:)==i))],edges);  $\newline
\lstinline$\% always take the same edges (not necessary in this example, nevertheless$\newline
\lstinline$\% illustrating)$\newline
\lstinline$end$\newline
\lstinline$sem=nanstd(n)./length(subjects);$\newline
\lstinline$errorbar(mean(n),sem);$\newline
\lstinline$figure;$\newline
\lstinline$plot(sem)$\newline
\lstinline$$\newline
\lstinline$To convert from sem (std/sqrt(n)) to variance (e.g. for chi2 stats):$\newline
\lstinline$variance=(sem.*sqrt(n)).\^{}2;$\newline
\subsubsection{jointprobability}
\label{ssec:.:jointprobability}
\lstinline$Calculates joint probabilities of feature values and fixations$\newline
\lstinline$first calculates the conditional probabilities P(Fixation|Feature1) and$\newline
\lstinline$P(Fixation|Feature2) then takes the outer product. Needs$\newline
\lstinline$conditionalprobability.m. $\newline
\lstinline$$\newline
\lstinline$Input: actual1,control1,actual2,control2$\newline
\lstinline$$\newline
\lstinline$Output: n,edges1,edges2,baseline,sem$\newline
\lstinline$$\newline
\lstinline$based on Frank's thesis. Written April (?) 2006, by Benjamin.$\newline
\subsubsection{jsd}
\label{ssec:.:jsd}
\lstinline$Jensen-Shannon divergence$\newline
\lstinline$jensenshannon=jsd(P,Q)$\newline
\lstinline$$\newline
\lstinline$js has the advantage over kl of being symmetric. $\newline
\lstinline$created June 19, 2006, by Benjamin Auffarth from descriptions at$\newline
\lstinline$reference: en.wikipedia.org/wiki/Kullback\_Leibler\_divergence $\newline
\subsubsection{kl}
\label{ssec:.:kl}
\lstinline$Returns the Kullback Leibler Divergence of two matrices.$\newline
\lstinline$two specifications: $\newline
\lstinline$a) div=kl(P,Q)$\newline
\lstinline$this version assumes your two matrices are descrete probability $\newline
\lstinline$distributions. $\newline
\lstinline$b) div=kl(P,Q,pbins,qbins)$\newline
\lstinline$this version creates probability distributions from the two vectors. $\newline
\lstinline$$\newline
\lstinline$Matrices P and Q are expected to be doubles, pbins and qbins are bin $\newline
\lstinline$sizes for p and q discretizing probability distributions of P and Q.$\newline
\lstinline$pbins and qbins can also be edges of the bins. $\newline
\lstinline$kl version b) needs histcnew. $\newline
\lstinline$$\newline
\lstinline$side remark: $\newline
\lstinline$Log zero is not defined. In order to avoid NaNs kl.m ignores Log(0)'s by $\newline
\lstinline$default. $\newline
\lstinline$$\newline
\lstinline$created August 2006, Benjamin Auffarth.$\newline
\subsubsection{mode}
\label{ssec:.:mode}
\lstinline$Finds the mode of a 2d matrix.$\newline
\lstinline$[result perecents]=mode(matrix)$\newline
\lstinline$where result is the mode of the matrix$\newline
\lstinline$and percents is the amount of difference within the mode$\newline
\lstinline$ORIGNALLY TABULATE.m by B.A. Jones$\newline
\lstinline$Changes by David Li, UCSB updated: 4-8-2004. Changed by Benjamin$\newline
\lstinline$Auffarth, June 2006 to take matrices as well as vectors as inputs. $\newline
\subsubsection{nextfixation}
\label{ssec:.:nextfixation}
\lstinline$Plots "Next-Fixation" statistics$\newline
\lstinline$$\newline
\lstinline$INPUT: fixation matrix [,feature vector]$\newline
\lstinline$feature vector (if given) has to correspond to fixmat or -- if scalar --$\newline
\lstinline$windowsize at one degree$\newline
\lstinline$$\newline
\lstinline$based on Selim's code $\newline
\lstinline$created April 2006 with bugfixes$\newline
\lstinline$changed slightly 19-May-2006 and again 22-May-2006$\newline
\lstinline$feature is of same length as fixmat (as it gives information to each$\newline
\lstinline$fixation. I extracted all features using fcext.m and saved the mat,$\newline
\lstinline$resulting in more time-efficient computations$\newline
\lstinline$$\newline
\lstinline$For normalization with controls apply the function first to the feature$\newline
\lstinline$vector then to the control vector and divide. (Selim's idea)$\newline
\subsubsection{nonan}
\label{ssec:.:nonan}
\lstinline$remove entries from vec1, where either vec1 or vec2 have NaNs$\newline
\lstinline$also makes vec1 and vec2 equal length by truncating the longer. $\newline
\lstinline$$\newline
\lstinline$september 2006. Benjamin.$\newline
%\subsubsection{oldnewfeatures}
%\label{ssec:.:oldnewfeatures}
%\lstinline$compare "traditional" method of feature extraction and "Gaussian" one. $\newline
%\lstinline$$\newline
\subsubsection{plotSubject}
\label{ssec:.:plotSubject}
\lstinline$Plots fixations on an image. $\newline
\lstinline$function plotSubject(fixmat,numberofsubject, pix)$\newline
\lstinline$pix is the index to the pix'th shown image in imagelookup$\newline
\lstinline$created: 24-Mar-2006$\newline
\lstinline$$\newline
\lstinline$change this according to your specifications: $\newline
\lstinline$(important are rows 1 and 2 for location of fixations, and 4 and 5 for $\newline
\lstinline$the duration of fixations. $\newline
\lstinline$$\newline
\lstinline$Example: $\newline
\lstinline$load (['fixmat/human' int2str(ns) '.mat']);$\newline
\lstinline$plotSubject(fixmat,1,1);$\newline
\lstinline$$\newline
\lstinline$25-May-2006: Introduced duration. Indicates fixation durations$\newline
\lstinline$as thickness of markers. $\newline
\lstinline$29-May-2006: Implemented different thickness of lines connecting$\newline
\lstinline$fixations according to speed of saccade. Didn't look good enough. $\newline
\lstinline$1-June-2006: 3dimensional, z=speed (don't show the image if you want to $\newline
\lstinline$see it properly)$\newline
\lstinline$June-17, 2006. Made speed visible by color mapping. (based on$\newline
\lstinline$colourplot.m, found at http://www.mathworks.com/matlabcentral/$\newline
\lstinline$fileexchange/loadFile.do?objectId=11235\&objectType=File). $\newline
\lstinline$Also decided to show fixated regions only (Nora's idea, originated from $\newline
\lstinline$bubbles) $\newline
\lstinline$$\newline
%\subsubsection{ptf}
%\label{ssec:.:ptf}
%\lstinline$PTF  Print a figure to a file.$\newline
%\lstinline$PTF(H) writes the figure with handle H to the file FIG<H>.EXT where$\newline
%\lstinline$<H> indicates the (integer) handle value and EXT is the extension$\newline
%\lstinline$corresponding to the specified output file format (see below).$\newline
%\lstinline$$\newline
%\lstinline$PTF operates on the current figure.$\newline
%\lstinline$$\newline
%\lstinline$PTF(...,PARAM1,VALUE1,PARAM2,VALUE2,...) specifies parameter-value$\newline
%\lstinline$pairs that control various characteristics of the output file. Allowed$\newline
%\lstinline$parameter-value pairs are described below.$\newline
%\lstinline$$\newline
%\lstinline$PTF(...,PARAM1,VALUE1,PARAM2,VALUE2,...,SWITCH1,SWITCH2,...) allows$\newline
%\lstinline$for additional switches specifying actions which are described below.$\newline
%\lstinline$Any parameter-value pairs provided after the first switch will be$\newline
%\lstinline$ignored.$\newline
%\lstinline$$\newline
%\lstinline$File format parameter-value pairs:$\newline
%\lstinline$'Format' Specifies the output file format and should have one of the$\newline
%\lstinline$following values:$\newline
%\lstinline$'eps'     Encapsulated PostScript$\newline
%\lstinline$'eps2'    Encapsulated level 2 Postscript (default)$\newline
%\lstinline$'jpeg'    JPEG files$\newline
%\lstinline$'png'     Portable Network Graphics$\newline
%\lstinline$'preview' Does not generate an output file but instead creates a$\newline
%\lstinline$new figure window with a preview of the exported$\newline
%\lstinline$figure. In this case the FILENAME parameter is$\newline
%\lstinline$ignored.$\newline
%\lstinline$'Preview' Specifies a preview for EPS files and is one of the$\newline
%\lstinline$strings 'none' or 'tiff' (72dpi). Defaults to 'tiff'.$\newline
%\lstinline$'FileName' Specifies the filename of the output file. If no filename$\newline
%\lstinline$extension has been specified, the extension will automatically$\newline
%\lstinline$be set corresponding to the specified output file format.$\newline
%\lstinline$$\newline
%\lstinline$Figure size parameter-value pairs:$\newline
%\lstinline$'Width' Specifies the figure width.$\newline
%\lstinline$'Height' Specifies the figure height.$\newline
%\lstinline$Both 'Width' and 'Height' must be positive scalars. Specifying$\newline
%\lstinline$only one dimension sets the other dimension so that the exported$\newline
%\lstinline$aspect ratio is the same as the figure's current aspect ratio.$\newline
%\lstinline$If neither dimension is specified the size defaults to the width$\newline
%\lstinline$and height from the figure's PaperPosition.$\newline
%\lstinline$'PaperUnits' Specifies the units for 'Width' and 'Height' using one$\newline
%\lstinline$of the following values:$\newline
%\lstinline$'inches'      Units in inches$\newline
%\lstinline$'centimeters' Units in centimeters$\newline
%\lstinline$'normalized'  Maps the lower-left corner of the page to (0,0)$\newline
%\lstinline$and the upper-right corner to (1,1).$\newline
%\lstinline$'points'      Units in points (=1/72 inch)$\newline
%\lstinline$PaperUnits defaults to the current Matlab settings.$\newline
%\lstinline$$\newline
%\lstinline$Rendering parameter-value pairs:$\newline
%\lstinline$'Color' Specifies the color mode using one of the following values:$\newline
%\lstinline$'b/w'  Specifies that lines and text are exported in black and$\newline
%\lstinline$all other objects in grayscale (default).$\newline
%\lstinline$'gray' Specifies that all objects are exported in grayscale.$\newline
%\lstinline$'cmyk' Specifies that all objects are exported in color using$\newline
%\lstinline$the CMYK color space.$\newline
%\lstinline$'Resolution' A scalar value which specifies the resolution in$\newline
%\lstinline$dots-per-inch. The default value is determined by the Matlab$\newline
%\lstinline$default (see the PRINT command) except that Simulink, Tiff and$\newline
%\lstinline$Jpeg images are printed in screen resolution by default. A$\newline
%\lstinline$Resolution equal to 0 implies screen resolution.$\newline
%\lstinline$'Renderer' Specifies the renderer to use and must be set to one of$\newline
%\lstinline$the values 'painters', 'zbuffer' or 'opengl'. The default value$\newline
%\lstinline$is determined by the current Matlab settings (see the Renderer$\newline
%\lstinline$property of the figure).$\newline
%\lstinline$$\newline
%\lstinline$Font parameter-value pairs:$\newline
%\lstinline$'FontMode' One of the strings 'scaled' or 'fixed'.$\newline
%\lstinline$'FontSize' A positive scalar specifying the font size in points.$\newline
%\lstinline$In 'scaled' mode the FontSize value multiplies with the font$\newline
%\lstinline$size of each text object to obtain the exported font size. In$\newline
%\lstinline$'fixed' mode the FontSize value specifies the font size of all$\newline
%\lstinline$text objects in points.$\newline
%\lstinline$If FontMode is 'scaled' but FontSize is not specified then a$\newline
%\lstinline$scaling factor is computed from the ratio of the size of the$\newline
%\lstinline$exported figure to the size of the actual figure. The minimum$\newline
%\lstinline$font size allowed after scaling is 5 points. If FontMode is$\newline
%\lstinline$'fixed' but FontSize is not specified then the exported font$\newline
%\lstinline$sizes of all text objects is 7 points. The default 'FontMode'$\newline
%\lstinline$setting is 'scaled'.$\newline
%\lstinline$'FontName' A string specifying the font of all text objects and axes$\newline
%\lstinline$tick labels. Defaults to the current Matlab settings.$\newline
%\lstinline$'FontStyle' A string specifying the style using one of the following$\newline
%\lstinline$values:$\newline
%\lstinline$'n'   Normal$\newline
%\lstinline$'b'   Bold face$\newline
%\lstinline$'i'   Italics$\newline
%\lstinline$'b/i' Both italics and bold face.$\newline
%\lstinline$FontStyle defaults to the current Matlab settings.$\newline
%\lstinline$'FontEncoding' One of the strings 'latin1' or 'adobe', specifying$\newline
%\lstinline$the character encoding of the font. The default is the Matlab$\newline
%\lstinline$default (specified in the PRINT command).$\newline
%\lstinline$$\newline
%\lstinline$Line parameter-value pairs:$\newline
%\lstinline$'LineMode' One of the strings 'scaled' or 'fixed'.$\newline
%\lstinline$'LineWidth' A positive scalar specifying the line width.$\newline
%\lstinline$The semantics of LineMode and LineWidth are exactly the same as$\newline
%\lstinline$FontMode and FontSize, except that they apply to line widths$\newline
%\lstinline$instead of font sizes. The minimum line width allowed after$\newline
%\lstinline$scaling is 0.5 points. If LineMode is 'fixed' but LineWidth is$\newline
%\lstinline$not specified then the exported line width of all line objects$\newline
%\lstinline$is 1 point. The default LineMode is 'scaled'.$\newline
%\lstinline$$\newline
%\lstinline$Switches:$\newline
%\lstinline$'-gui' Opens a GUI menu enabling the user to set all parameter-value$\newline
%\lstinline$pairs. Parameter-value pairs provided in the input argument list$\newline
%\lstinline$are displayed in the menu. Any parameter-value pairs after the$\newline
%\lstinline$-gui switch will be ignored. A file won't be created untill the$\newline
%\lstinline$appropriate button in the menu has been pressed.$\newline
%\lstinline$Other switches are internal GUI callbacks so don't bother.$\newline
%\lstinline$$\newline
%\lstinline$$\newline
%\lstinline$Examples:$\newline
%\lstinline$ptf('Filename','fig1.eps','Height',3)$\newline
%\lstinline$Exports the current figure to the file named fig1.eps with a$\newline
%\lstinline$height of 3 centimeters (assuming the figure's PaperUnits is$\newline
%\lstinline$centimeters) and an aspect ratio the same as the figure's aspect$\newline
%\lstinline$ratio on screen.$\newline
%\lstinline$$\newline
%\lstinline$ptf(h,'FontMode','fixed','FontSize',10,'Color','cmyk')$\newline
%\lstinline$Exports the figure with handle h to fig<h>.eps in color with all$\newline
%\lstinline$text in 10 point fonts. The size of the exported figure is the$\newline
%\lstinline$figure's PaperPosition width and height.$\newline
%\lstinline$$\newline
%\lstinline$ptf(gcf,'FileName','fig3.eps','-gui')$\newline
%\lstinline$Opens a GUI menu with a pre-set file name 'fig3.eps'. No further$\newline
%\lstinline$actions take place, no files will be generated nor will there be$\newline
%\lstinline$any other activity.$\newline
%\subsubsection{ranks}
%\label{ssec:.:ranks}
%\lstinline$RANKS gives the rank of each element in a vector.$\newline
%\lstinline$This program uses an advanced algorithm with averge effort O(m.n.log(n)) $\newline
%\lstinline$NaN in the input yields NaN in the output.$\newline
%\lstinline$$\newline
%\lstinline$r = ranks(X)$\newline
%\lstinline$if X is a vector, return the vector of ranks of X adjusted for ties.$\newline
%\lstinline$if X is matrix, the rank is calculated for each column. $\newline
%\lstinline$r = ranks(X,'traditional')$\newline
%\lstinline$implements the traditional algorithm with O(n\^{}2) computational $\newline
%\lstinline$and O(n\^{}2) memory effort$\newline
%\lstinline$r = ranks(X,'mtraditional')$\newline
%\lstinline$implements the traditional algorithm with O(n\^{}2) computational $\newline
%\lstinline$and O(n) memory effort$\newline
%\lstinline$r = ranks(X,'advanced   ')$\newline
%\lstinline$implements an advanced algorithm with O(n*log(n)) computational $\newline
%\lstinline$and O(n.log(n)) memory effort$\newline
%\lstinline$$\newline
%\lstinline$see also: CORRCOEF, SPEARMAN, RANKCORR$\newline
%\lstinline$$\newline
%\lstinline$REFERENCES:$\newline
%\lstinline$--$\newline
\subsubsection{shuffle}
\label{ssec:.:shuffle}
\lstinline$shuffle(A) returns matrix A with elements randomly permuted. $\newline
\lstinline$(uses RANDPERM).$\newline
\subsubsection{specialplot2}
\label{ssec:.:specialplot2}
\lstinline$Same as specialplot but for two pairs. Outputs statistics in tex format$\newline
\lstinline$$\newline
\lstinline$Input: X,Y,color$\newline
\lstinline$accepts variable input length, grouped in 3 of$\newline
\lstinline$X(1),Y(1),color(1),...,X(n),Y(n),color(n)$\newline
\lstinline$$\newline
\lstinline$Output: an errorbar plot$\newline
\lstinline$Outputs also some statistics: correlations for [X;Y] and$\newline
\lstinline$ANOVA between two succeeding groups of <X(i),Y(i)>,<X(i+1),Y(i+1)>$\newline
\lstinline$$\newline
\lstinline$created August 2006, Benjamin Auffarth$\newline
%\subsubsection{sumskipnan}
%\label{ssec:.:sumskipnan}
%\lstinline$SUMSKIPNAN adds all non-NaN values. $\newline
%\lstinline$$\newline
%\lstinline$All NaN's are skipped; NaN's are considered as missing values. $\newline
%\lstinline$SUMSKIPNAN of NaN's only  gives O; and the number of valid elements is return. $\newline
%\lstinline$SUMSKIPNAN is also the elementary function for calculating $\newline
%\lstinline$various statistics (e.g. MEAN, STD, VAR, RMS, MEANSQ, SKEWNESS, $\newline
%\lstinline$KURTOSIS, MOMENT, STATISTIC etc.) from data with missing values.  $\newline
%\lstinline$SUMSKIPNAN implements the DIMENSION-argument for data with missing values.$\newline
%\lstinline$Also the second output argument return the number of valid elements (not NaNs) $\newline
%\lstinline$$\newline
%\lstinline$Y = sumskipnan(x [,DIM])$\newline
%\lstinline$[Y,N,SSQ] = sumskipnan(x [,DIM])$\newline
%\lstinline$$\newline
%\lstinline$DIM	dimension$\newline
%\lstinline$1 sum of columns$\newline
%\lstinline$2 sum of rows$\newline
%\lstinline$default or []: first DIMENSION with more than 1 element$\newline
%\lstinline$$\newline
%\lstinline$Y	resulting sum$\newline
%\lstinline$N	number of valid (not missing) elements$\newline
%\lstinline$SSQ	sum of squares$\newline
%\lstinline$$\newline
%\lstinline$The mean \& standard error of the mean and $\newline
%\lstinline$Y./N \& sqrt((SSQ-Y.*Y./N)./(N.*max(N-1,0))); $\newline
%\lstinline$the mean square \& the standard error of the mean square and$\newline
%\lstinline$SSQ./N \& sqrt((S4M-SSQ.\^{}2./N)./(N.*max(N-1,0)))$\newline
%\lstinline$$\newline
%\lstinline$features:$\newline
%\lstinline$- can deal with NaN's (missing values)$\newline
%\lstinline$- implements dimension argument. $\newline
%\lstinline$- compatible with Matlab and Octave$\newline
%\lstinline$$\newline
%\lstinline$see also: SUM, NANSUM, MEAN, STD, VAR, RMS, MEANSQ, $\newline
%\lstinline$SSQ, MOMENT, SKEWNESS, KURTOSIS, SEM$\newline
\subsubsection{windowsize}
\label{ssec:.:windowsize}
\lstinline$$\newline
\lstinline$Calculates the number of pixels that correspond to one degree$\newline
\lstinline$Used for calculation of window size$\newline
\lstinline$$\newline
\lstinline$needs the following data:$\newline
\lstinline$dist: distance of observer from screen in mm.$\newline
\lstinline$res: the resolution of the monitor in pixel e.g. [768 1024].$\newline
\lstinline$sizem: the size of the monitor in mm, e.g. [300 400]. $\newline
\lstinline$$\newline
\lstinline$Created: 23-Mar-2006. Last changed Apr 10, 2006$\newline
\lstinline$Based on a routine by Hans-Peter Frey (Jan 2005)$\newline
\lstinline$$\newline
\subsection{./bochumData}
%\subsubsection{actualvscontrol}
%\label{ssec:./bochumData:actualvscontrol}
%\lstinline$computes feature values at actual fixations and at controls using a$\newline
%\lstinline$weighted neighborhood function for correction of calibration errors. $\newline
%\lstinline$$\newline
%\lstinline$input: fixmat, path to feature maps$\newline
%\lstinline$Usage: function [actual,control]=actualvscontrol(fixmat)$\newline
%\lstinline$$\newline
%\lstinline$definitions: (as talked with Selim, 22-Mar-2006, as used by Sonja$\newline
%\lstinline$and Honey)$\newline
%\lstinline$actual fixations:= all the fixations of a given subject (subject$\newline
%\lstinline$dependent) done on image i$\newline
%\lstinline$control fixations:= all the fixations of a given subject done on all$\newline
%\lstinline$images but i$\newline
%\lstinline$subject-dependent(specific) fixations. Eliminating individual viewing$\newline
%\lstinline$preferences (biases). As for my experiment, the statistical data were $\newline
%\lstinline$sufficient for such a step as 262 images per 10 fixations on average $\newline
%\lstinline$were available. $\newline
%\lstinline$$\newline
%\lstinline$$\newline
%\lstinline$created in Mar-2006$\newline
%\lstinline$last changed: June 15. $\newline
%\lstinline$$\newline
%\lstinline$Example: $\newline
%\lstinline$load fixmat/allhumans.mat $\newline
%\lstinline$actualvscontrol(fixmat,'featuremaps/LCM');$\newline
%\subsubsection{BarnessMap}
%\label{ssec:./bochumData:BarnessMap}
%\lstinline$call Barness=BarnessMap(Image, y, x, sigma)$\newline
%\lstinline$returns map of "barness feature" for an image using isotropic patches of$\newline
%\lstinline$size y, x. Barness is a measure of orientation in a patch, irrespective $\newline
%\lstinline$of the angel of the orientation.$\newline
%\lstinline$For details, see getOrientation.m by Wolfgang Einh?user that it uses. $\newline
%\lstinline$$\newline
%\lstinline$attention: this uses nlfilter and is slow. $\newline
%\lstinline$$\newline
%\lstinline$Parameters:$\newline
%\lstinline$- the image$\newline
%\lstinline$- the x and y size of the iso patch barness is calculated in$\newline
%\lstinline$- sigma: the std. of the gaussian to make isotropic patches with$\newline
%\lstinline$$\newline
%\lstinline$needs: getOrientation.m (by Wolfgang Einh?user) and isotrop.m$\newline
%\lstinline$$\newline
%\lstinline$Frank Schumann, 2005.$\newline
%\subsubsection{clearfixmat}
%\label{ssec:./bochumData:clearfixmat}
%\lstinline$clears fixmat of first fixations and badly calibrated fixations for$\newline
%\lstinline$feature analysis (not necessary for analysis of eye movements)$\newline
%\lstinline$for luminance contrast in the case of Tang's images, the black border$\newline
%\lstinline$extended to roughly 28-30 pixels. So we cut off at 30 for LCMs. $\newline
%\lstinline$for texture 65 on all but Tang's images (-213 monkey fixations=6.1\%, $\newline
%\lstinline$7336 human fixations=11.35\%), 95 on Tang's (-346=9.91\%/8536=13.21\%)$\newline
%\lstinline$for barness border=50 (Tang), 15 all other images$\newline
%\subsubsection{ContrastMap}
%\label{ssec:./bochumData:ContrastMap}
%\lstinline$[cim]=ContrastMap(im,ws,Normalize);$\newline
%\lstinline$computes the contrast map of a given image IM by using a window size of$\newline
%\lstinline$WS. IM can contain many different images in its 3rd dimension then CIM $\newline
%\lstinline$contains the contrast maps of the corresponding images in its third dimension. $\newline
%\lstinline$It uses convolution routines of matlab. WS is preferentially an odd number$\newline
%\lstinline$this makes it straigthforward to select the number of zeros used to zeros$\newline
%\lstinline$pad. NORMALIZE has to be 1 if you want to normalize the standard$\newline
%\lstinline$deviation map by the mean luminance of the image. $\newline
%\lstinline$$\newline
%\lstinline$Last Revision by Selim 2005.$\newline
\subsubsection{einhaeuser2fixmat}
\label{ssec:./bochumData:einhaeuser2fixmat}
\lstinline$Converts Wolfgang Einhaeuser's data to fixmat matrix. $\newline
\lstinline$$\newline
\lstinline$Input argument: screen$\newline
\lstinline$$\newline
\lstinline$screen is big, 'BS', or small, 'SS', (refers to two sessions with$\newline
\lstinline$different screensizes)$\newline
\lstinline$big screen (Einhaeuser, 2006). small screen (Einhaeuser, 2004)$\newline
\lstinline$window size one degree: 25 for SS,7 for BS$\newline
\lstinline$$\newline
\lstinline$Output: fixation matrix (corresponding to either BS or SS)$\newline
\lstinline$[X;Y;CALIB;DRIFT;TRIAL;BLOCK;SUBJECT;HUMANORMONKEY;FIXNR;IMAGE] $\newline
\lstinline$CALIB=empty;DRIFT=empty$\newline
\lstinline$$\newline
\lstinline$Humans are condition 1, monkeys condition 2$\newline
\lstinline$Human subjects and monkey subjects are numbered independently (i.e. $\newline
\lstinline$starting from 1). $\newline
\lstinline$$\newline
\lstinline$put in bochumData directory and run$\newline
\lstinline$$\newline
\lstinline$created in June, 2006 by Benjamin. $\newline
%\subsubsection{fcext}
%\label{ssec:./bochumData:fcext}
%\lstinline$function [feature]=fcext(fixmat,screen)$\newline
%\lstinline$reads in feature values at fixations for the Bochum data$\newline
%\lstinline$Inputs: fixmat, screen ('BS' or 'SS')$\newline
%\lstinline$Output: feature values for fixations. $\newline
%\lstinline$$\newline
%\lstinline$restrict x,y values to certain areas (not-border pixels)! $\newline
%\subsubsection{fixationprob}
%\label{ssec:./bochumData:fixationprob}
%\lstinline$function PCONV=fixationprob(fixmat,WS,h)$\newline
%\lstinline$calculates the fixationprobability by gaussian convolution and applies a$\newline
%\lstinline$function, addressed by the function handle, to the duration of the fixation. $\newline
%\lstinline$It returns a weighted fixation matrix.    $\newline
%\lstinline$Attention: put only the fixations in that correspond to the image$\newline
%\lstinline$$\newline
%\lstinline$Input: $\newline
%\subsubsection{forCC}
%\label{ssec:./bochumData:forCC}
%\lstinline$read image number and level$\newline
%\subsubsection{getFixations}
%\label{ssec:./bochumData:getFixations}
%\subsubsection{windowsize}
%\label{ssec:./bochumData:windowsize}
%\lstinline$$\newline
%\lstinline$Calculates the number of pixels that correspond to one degree$\newline
%\lstinline$Used for calculation of window size$\newline
%\lstinline$$\newline
%\lstinline$needs the following data:$\newline
%\lstinline$dist: distance of observer from screen in mm.$\newline
%\lstinline$res: the resolution of the monitor in pixel e.g. [768 1024].$\newline
%\lstinline$sizem: the size of the monitor in mm, e.g. [300 400]. $\newline
%\lstinline$$\newline
%\lstinline$Created: 23-Mar-2006. Last changed Apr 10, 2006$\newline
%\lstinline$Based on a routine by Hans-Peter Frey (Jan 2005)$\newline
%\lstinline$$\newline
\subsection{./latex}
%\subsubsection{laprint}
%\label{ssec:./latex:laprint}
%\lstinline$LAPRINT prints a figure for inclusion in LaTeX documents.$\newline
%\lstinline$LaPrint creates an eps-file and a tex-file. The tex-file contains$\newline
%\lstinline$the annotation of the figure such as titles, labels and texts. The$\newline
%\lstinline$eps-file contains the non-text part of the figure as well as the $\newline
%\lstinline$position of the text-objects. The packages 'graphicx' (or 'epsfig')$\newline
%\lstinline$and 'psfrag' (and possibly ''color'') are required for the LaTeX $\newline
%\lstinline$run. A postscript driver like 'dvips' is required for printing. $\newline
%\lstinline$$\newline
%\lstinline$Usage:   >> laprint$\newline
%\lstinline$$\newline
%\lstinline$This opens a graphical user interface window, to control the$\newline
%\lstinline$various settings. It includes a help facility. Just try it.$\newline
%\lstinline$$\newline
%\lstinline$As an alternative to the GUI you can call laprint from the command$\newline
%\lstinline$line with various extra input arguments. These arguments are $\newline
%\lstinline$explained in the help window of the GUI, which can be also be $\newline
%\lstinline$opened using the command$\newline
%\lstinline$>> laprint helpwindow$\newline
%\lstinline$$\newline
%\lstinline$There is an Users Guide available at$\newline
%\lstinline$http://www.uni-kassel.de/fb16/rat/matlab/laprint/laprintdoc.ps  $\newline
\subsubsection{tutorial}
\label{ssec:./latex:tutorial}
\lstinline$Creates a hyperlinked function reference from a project's directory tree. $\newline
\lstinline$$\newline
\lstinline$Automatically extracts all function descriptions of all .m files in the $\newline
\lstinline$current directory all subfolders and puts them together as a$\newline
\lstinline$documentation and creates a hyperlinked function reference from function $\newline
\lstinline$names and short description. The resulting LaTeX file can be either a $\newline
\lstinline$stand-alone meta document (e.g. .pdf) or embedded in connection with $\newline
\lstinline$\(\backslash\)include\{\}. $\newline
\lstinline$$\newline
\lstinline$Input: include (boolean). $\newline
\lstinline$Include is an optional switch that indicates, whether you plan to include $\newline
\lstinline$it in a bigger document or have a stand-alone pdf/html/rtf/...$\newline
\lstinline$(include is set on by default)$\newline
\lstinline$$\newline
\lstinline$Usage: change into your projects top-folder and start the function. $\newline
\lstinline$(use addpath('pathtotutorialm') )$\newline
\lstinline$$\newline
\lstinline$Please note that the short description is based on the first line of$\newline
\lstinline$comment in the file. So, try to write a concise one-liner heading your$\newline
\lstinline$other comments. $\newline
\lstinline$$\newline
\lstinline$Written July 26 and July 27. Benjamin Auffarth. $\newline
\lstinline$The highlighting of code is based on highlight.m (as written by Guillaume$\newline
\lstinline$Flandin, 2003)$\newline
\lstinline$$\newline
\lstinline$TODO: wrap long lines... (please use line breaks in your comment!!)$\newline
\lstinline$$\newline
\subsubsection{tutorialwraplines}
\label{ssec:./latex:tutorialwraplines}
\lstinline$automatically extracts all function descriptions and puts them together$\newline
\lstinline$and a hyperlinked reference in .tex format to form some kind of tutorial$\newline
\subsubsection{write\_highlighted\_code}
\label{ssec:./latex:writehighlightedcode}
\lstinline$- Display the line number at each line$\newline
\subsection{./plots}
\subsubsection{figure1}
\label{ssec:./plots:figure1}
\lstinline$this one is lavish! $\newline
\subsubsection{figure2}
\label{ssec:./plots:figure2}
\lstinline$figure 2$\newline
\lstinline$copyedit from plotsome with some additions and changes$\newline
\subsubsection{figure3}
\label{ssec:./plots:figure3}
\lstinline$figure3 $\newline
\lstinline$fixations over time$\newline
\subsubsection{figure4}
\label{ssec:./plots:figure4}
\lstinline$figure 4$\newline
\subsubsection{plotcondprob}
\label{ssec:./plots:plotcondprob}
\lstinline$plot conditionalprobabilities of features f (1=luminance, 2=texture,$\newline
\lstinline$3=barness$\newline
\subsubsection{plotdivergence}
\label{ssec:./plots:plotdivergence}
\lstinline$divergence statistics$\newline
\lstinline$inter-subject Euclidean distances$\newline
\subsubsection{plotfoft}
\label{ssec:./plots:plotfoft}
\lstinline$features as functions of time$\newline
\subsubsection{plotjointprob}
\label{ssec:./plots:plotjointprob}
\lstinline$plot joint probabilities of features f1 and f2 (1=luminance, 2=texture,$\newline
\lstinline$3=barness$\newline
\subsubsection{plotsome}
\label{ssec:./plots:plotsome}
\lstinline$Plots all kind of figures from data and prints statistics$\newline
\lstinline$creates all figures for my bachelor thesis$\newline
\subsubsection{plotsomebayes}
\label{ssec:./plots:plotsomebayes}
\lstinline$Plots all kind of figures from data and prints statistics$\newline
\lstinline$creates all figures for my bachelor thesis$\newline
\subsubsection{plotsomewind}
\label{ssec:./plots:plotsomewind}
\lstinline$Plots all kind of figures from data and prints statistics$\newline
\lstinline$creates all figures for my bachelor thesis$\newline
\subsubsection{understand\_divergence}
\label{ssec:./plots:understanddivergence}
\lstinline$plotting divergence$\newline
\onecolumn
\normalsize
\addtolength{\textwidth}{-2cm}
\addtolength{\columnsep}{-1.5cm}
\addtolength{\oddsidemargin}{+1cm}
\addtolength{\evensidemargin}{+3cm}
