Skip to content

Commit

Permalink
Tweaked formatting of handout. Improved description in section 3
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanMuir committed May 15, 2017
1 parent 9055a52 commit 2d62b36
Showing 1 changed file with 50 additions and 42 deletions.
92 changes: 50 additions & 42 deletions handout/Ca_Imaging_Analysis.tex
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
\usepackage[T1]{fontenc} % Use 8-bit encoding that has 256 glyphs
\renewcommand{\familydefault}{\sfdefault}
\usepackage{fullpage}
\usepackage{helvet}
\usepackage{helvet, mathptmx}
\usepackage[compact,pagestyles]{titlesec}
\titlespacing\subsection{0pt}{12pt plus 4pt minus 2pt}{0pt plus 0pt minus 5pt}
\usepackage[english]{babel} % English language/hyphenation
Expand All @@ -17,6 +17,8 @@
\usepackage{graphicx,caption,subcaption}
\usepackage{todonotes}
\setlength{\parskip}{18pt}
\widowpenalty10000
\clubpenalty10000

\numberwithin{equation}{section} % Number equations within sections (i.e. 1.1, 1.2, 2.1, 2.2 instead of 1, 2, 3, 4)
\numberwithin{figure}{section} % Number figures within sections (i.e. 1.1, 1.2, 2.1, 2.2 instead of 1, 2, 3, 4)
Expand Down Expand Up @@ -89,17 +91,39 @@ \subsection*{Start MATLAB and download the data}

\section{Extract response time-course from a cell}

\begin{figure}[h]
\centering
\begin{subfigure}[b]{0.3\textwidth}
\includegraphics[width=\textwidth]{mean_image.pdf}
\caption{Mean projection}
\label{fig:mean_ca}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\includegraphics[width=\textwidth]{trace_raw.pdf}
\caption{Raw fluorescence trace}
\label{fig:time_trace}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\includegraphics[width=\textwidth]{trace_delta_f_f0.pdf}
\caption{$\Delta F/F_0$ time trace}
\label{fig:time_trace_dff0}
\end{subfigure}
\caption{By the end of this Section you should have obtained plots that look something like these}
\end{figure}

First, you will load images, select a cell and display its raw response trace:

\begin{itemize}
\item Load the image stack called \texttt{Calcium\_imaging\_data\_int8.tif} using the provided \texttt{load\_stack} function.
Do not forget to use \texttt{help load\_stack} to see how to use this function.
\item What is the size of the loaded stack (image width and height in pixels, number of frames)? \textbf{Write} down your answer.
\vspace{1em}
\item What is the size of the loaded stack (image width and height in pixels, number of frames)? \textbf{Write} down your answer:
\vspace*{0.75in}
\item Open the provided file \texttt{calc\_mean.m} in the ``to\_be\_completed'' directory. \textbf{Edit} it to calculate the average image: use the \texttt{mean} function and assign the result to a variable called \texttt{meanIM}. Use this function to calculate the average image of the loaded stack.
\item Plot the image using the \texttt{imagesc} function (see Figure~\ref{fig:mean_ca}). \textbf{Save} your image in \emph{to\_be\_completed} as ``meanImage.png''
\item Look at the image. What does this tell you about the activity of different neurons? \textbf{Write} down your answer:
\vspace{2em}
\vspace*{1in}
\item Start the ROI (Region of Interest) selection GUI using the function \texttt{get\_roi\_trace}.
See \texttt{help get\_roi\_trace} if you are unsure of the input arguments.
On the new figure, draw an ellipse around a cell to highlight it. Double-click on the ellipse, and the average time-trace of the pixels within your ROI will be returned.
Expand All @@ -116,28 +140,6 @@ \section{Extract response time-course from a cell}
\item Run your \texttt{calc\_dF\_F.m} function on the raw trace and plot the $dF/F$ using \texttt{plot} (see Figure~\ref{fig:time_trace_dff0}). \textbf{Save} your image as ``dffTrace.png''.
\end{itemize}

\begin{figure}
\centering
\begin{subfigure}[b]{0.3\textwidth}
\includegraphics[width=\textwidth]{mean_image.pdf}
\caption{Mean projection}
\label{fig:mean_ca}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\includegraphics[width=\textwidth]{trace_raw.pdf}
\caption{Raw fluorescence trace}
\label{fig:time_trace}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\includegraphics[width=\textwidth]{trace_delta_f_f0.pdf}
\caption{$\Delta F/F_0$ time trace}
\label{fig:time_trace_dff0}
\end{subfigure}
\caption{By the end of this Section you should have obtained plots that look something like these}
\end{figure}


\section{Understanding the stimulus presentation paradigm}

Expand All @@ -146,19 +148,10 @@ \section{Understanding the stimulus presentation paradigm}

\begin{itemize}
\item \textbf{Draw} below what this stimulation paradigm looks like over time, by indicating the time in seconds for baseline and for stimulus presentation, for a single presentation of a drafting grating.
\vspace{2.5in}
\item How many frames are in one stimulus presentation (blank+stim)? What is the imaging frame rate? \textbf{Write} down your answers and \textbf{add} the number of frames on your drawing above.
\item The drift direction in degrees presented for each stimulus frame is saved in the file \texttt{ori\_stimuli.mat}.
Load these data using the \texttt{load} function. What is the name of the variable containing the orientation information (look at the work space)?
Use the \texttt{plot} command to look at the contents of this variable. What do you notice about the order in which the stimuli are presented?
\textbf{Write} your answer:\\
\vspace{2in}
\item Open the provided file \texttt{meanTraces.m}. This function will be used to split up the response into presentations of the same directions, over the three trials per direction, and average over trials. \textbf{Complete} the file \texttt{meanTraces.m}. Pay attention to the comments in the file.
\item Your \texttt{meanTraces} function averages the three individual trial traces for each direction.
Plot these average traces for each of the 16 stimulus directions on the same plot (see Figure~\ref{fig:trace_all_ori}). \textbf{Save} your image as ``meanTraces.png''
\item Plot a single average trace over all stimuli. Where does the peak fall with respect to the stimulus start time? Refer to your diagram, above.
\vspace*{2.5in}
\end{itemize}


\begin{figure}
\centering
\begin{subfigure}[b]{0.46\textwidth}
Expand All @@ -175,6 +168,21 @@ \section{Understanding the stimulus presentation paradigm}
\caption{}
\end{figure}

\begin{itemize}
\item How many frames are in one stimulus presentation (blank+stim)? What is the imaging frame rate? \textbf{Write} down your answers and \textbf{add} the number of frames on your drawing from the last question.
\vspace*{1in}
\item The drift direction in degrees presented for each stimulus frame is saved in the file \texttt{ori\_stimuli.mat}.
Load these data using the \texttt{load} function. What is the name of the variable containing the orientation information (look at the work space)?
Use the \texttt{plot} command to look at the contents of this variable. What do you notice about the order in which the stimuli are presented?
\textbf{Write} your answers:\\
\vspace{2in}
\item Open the provided file \texttt{meanTraces.m}. This function will be used to split up the response into presentations of the same directions, over the three trials per direction, and average over trials. \textbf{Complete} the file \texttt{meanTraces.m}. Pay attention to the comments in the file.
\item Your \texttt{meanTraces} function averages the three individual trial traces for each direction.
Plot these average traces for each of the 16 stimulus directions on the same plot (see Figure~\ref{fig:trace_all_ori}). \textbf{Save} your image as ``meanTraces.png''.
\item Plot a single average trace over all stimuli. Where does the peak fall with respect to the stimulus start time? Refer to your diagram, above.
\end{itemize}



\section{Calculate responses to different stimuli}

Expand All @@ -184,16 +192,16 @@ \section{Calculate responses to different stimuli}
\item Open the file \texttt{makePolarPlot.m}. This function will be used to display the mean response for each orientation.
\textbf{Edit} the function as follows:
\begin{enumerate}
\item Choose a window of 5 time points that should contain the peak response to a stimulus, during the stimulus period.
\item Choose a window of 5 time points (i.e. 5 frame indices) that should contain the peak response to a stimulus, during the stimulus period.
\item Average the 5 time points within this window, from the average timecourse of each stimulus orientation.
\item Plot the mean responses on a polar plot, which will reveal the orientation tuning of the cell, using the \texttt{polar} function (see Figure~\ref{fig:polar_ori_plot}).
\end{enumerate}
\item Why is a polar plot a better choice than a conventional x/y line or scatter plot? \textbf{Write} down your answer.
\vspace{1em}
\item Why is a polar plot a better choice than a conventional x/y line or scatter plot? \textbf{Write} down your answer:
\vspace*{1in}
\item Use the \texttt{makePolarPlot} function to plot the preferred orientation(s) of your cell. \textbf{Save} your image as ``polarResult.png''.
\item Is your cell tuned to the drift direction of the stimulus? Is your cell tuned to the drift direction of two stimuli of the same orientation?
\textbf{Write} down your answer.
\vspace{2em}
\textbf{Write} down your answer:
\vspace*{1in}
\end{itemize}

To assess the selectivity of your cell, you will compute its \emph{orientation selectivity index} (OSI).
Expand Down

0 comments on commit 2d62b36

Please sign in to comment.