\documentclass[10pt]{article}
\input{articlepackage}
\usepackage{tocloft}
\usepackage[labelfont=bf]{caption}
\makeatletter
\renewcommand{\@cftmaketoctitle}{}
\makeatother
\usepackage{caption}
\usepackage{slashed}

\usepackage[margin=1.0in]{geometry}
\usepackage{fancyhdr}
\pagestyle{fancy}
\lhead{\small\textsc{Cross-Section Calculation}}
\chead{}
\rhead{}
\lfoot{}
\cfoot{\textit{\thepage}}
\rfoot{}
\renewcommand*{\thefootnote}{\fnsymbol{footnote}}
\setcounter{footnote}{1}

\begin{document}
\hrule
\vspace{1pt}
\hrule
\begin{center}
\large\textsc{\color{darkblue}\textbf{Scalar Dark Matter and Neutrino Masses: Cross-Section Calculation}}
\vspace{5pt}

\footnotesize\textit{\textbf{J.B.G. Alvey}, Theoretical Particle Physics and Cosmology, King's College London\footnote{\href{mailto:james.alvey@kcl.ac.uk}{james.alvey@kcl.ac.uk}}}
\end{center}
\begin{abstract}
\noindent This report provides an explicit evaluation of the cross section for the scattering $\nu\nu \rightarrow \phi\phi$ within the framework of an effective field theory for dark matter with a coupling $g\phi \bar{N}_R \nu_L$. Here, $\phi$ is a dark scalar, and $N$ is a dark fermion.
\end{abstract}
\hrule
\tableofcontents
\vspace{5pt}
\hrule
\vspace{1pt}
\hrule
\vspace{10pt}
%\begin{multicols}{2}
\renewcommand{\thefootnote}{\tiny\textbf{\arabic{section}.\arabic{footnote}}}

\section{Theory}
\subsection{The Lagrangian}
We start with the SM Lagrangian and introduce two additional particles;
\begin{enumerate}
\item \emph{Scalar DM,} $\phi$, either a scalar or a pseudoscalar and potentially real or complex
\item \emph{Fermionic Mediator}, $N$, which may be Majorana or Dirac
\end{enumerate}
These are coupled to the visible sector via the SM neutrinos, which may themselves be Majorana or Dirac. The Lagrangian is then considered to be of the form;
\begin{equation}
\mathcal{L}= \mathcal{L}_{\text{SM}} + \sum_{i = 1}^{3}{g_i \phi \overline{N_R} \nu^i_{L}}
\end{equation}
where the sum is over the different neutrino eigenstates. We recall the definitions for a spinor $\psi$;
\begin{equation*}
\overline{\psi_{R, L}} := (P_{R, L}\psi)^{\dagger}\gamma_0 = \psi^{\dagger}P_{R, L}^{\dagger} \gamma_0
\end{equation*}
The projection operators are of course given by $P_{R, L} = \tfrac{1}{2}(1 \pm \gamma_5)$ where $\gamma_5^{\dagger} = \gamma_5$. So the projection operators are hermitian, and so using $\set{\gamma_0, \gamma_5} = 0$;
\begin{equation*}
\overline{\psi_{R, L}} = \psi^{\dagger}\gamma_0\tfrac{1}{2}(1 \mp \gamma_5) = \overline{\psi}P_{L, R}
\end{equation*}
We find that the full tree level Lagrangian is (along with the kinetic terms of course);
\begin{equation}
\mL = \mL_{\text{SM}} + \sum_{i}\left(g_i \phi \overline{N}P_L \nu^{i} + g_{i}\phi^{\dagger} \overline{\nu}^{i}P_R N\right)
\end{equation}
\subsection{Dirac/Majorana Neutrinos}
We are interested in the processes of the form;
\begin{align*}
\nu \,\, \nu &\longrightarrow \phi \,\, \phi \\
\nu \,\, \overline{\nu} &\longrightarrow \phi \,\, \phi
\end{align*}
If the neutrinos are Majorana, both of these processes can happen, whilst only the second can occur in the case they are Dirac so as to conserve lepton number. These leads to a factor of $4$ difference in the value of the cross section for the process.
\subsection{Parameters of the Model}
We take some guidance from \cite{Farzan2014} as to the values of the parameters. Firstly, in order that $\phi$ truly is the DM candidate, we require $m_{\phi} < m_N$. Furthermore, the observed DM abundance and the neutrino masses should remain in the correct range, leading to the constraints;\footnotemark
\footnotetext{There is a brief discussion regarding the presence of a new sterile neutrino. In that case, the coupling $g_s$ in $g_s \phi \overline{N_R}\nu_L^s$ could be $\mO(1)$}
\begin{equation}
m_N \sim 1 - 10 \, \text{MeV}, \quad m_{\phi} \leq 1 \, \text{MeV}, \quad g_i < 10^{-3}
\end{equation}
In what follows, for simplicity we will assume that all the couplings $g_i = g$.
\section{Calculation}
\subsection{Program}
We will take the following route to calculate the cross section for the process $\nu \bar{\nu} \rightarrow \phi \phi$;
\begin{enumerate}
\item Compute the amplitude $\mM = \mM_1 + \mM_2$ where $\mM_{1,2}$ are represented by the diagrams as shown in Figure \ref{fig:feyn}.
\item Calculate the helicity averaged squared matrix element;
\begin{equation}
\langle \left|\mM\right|^2\rangle = \frac{1}{4}\sum_{r,s}{\left|\mM\right|^2}
\end{equation}
\item We then have two choices representing the two sets of independent variables: $(s, \theta)$ and $(s,t)$. We need to integrate over either $\theta$ or $t$. In the interests of completeness, we will do both as a consistency check that they indeed give the same answer.
\end{enumerate}
\begin{figure}[h]
\begin{framed}
\centering
\includegraphics[width=0.6\linewidth]{feyndiag}
\caption{The two diagrams contributing to $\nu \bar{\nu} \rightarrow \phi \phi$ scattering amplitude in the case that $\phi$ is a real scalar and $\nu$, $N$ are Dirac fermions.}
\label{fig:feyn}
\end{framed}
\end{figure}
\subsection{Amplitudes}
\noindent Using the Feynman rules from the Lagrangian, we can write down the two amplitudes;
\begin{align}
-i\mM_1 &= \frac{g^2}{4}\bar{v}^r(\vec{p}_2)(1 - \gamma_5)\frac{\slashed{p}_1 - \slashed{p}_3 + m_N}{(p_1 - p_3)^2 - m_N^2}(1 - \gamma_5)u^s(\vec{p}_1) \\
-i\mM_2 &= \frac{g^2}{4}\bar{v}^r(\vec{p}_2)(1 - \gamma_5)\frac{\slashed{p}_1 - \slashed{p}_4 + m_N}{(p_1 - p_4)^2 - m_N^2}(1 - \gamma_5)u^s(\vec{p}_1)
\end{align}
We will need to compute the complex conjugate of this amplitude. If we consider;
\begin{equation*}
\mM \propto \bar{v}(1 - \gamma_5)(\slashed{k} + m_N)(1 - \gamma_5)u
\end{equation*}
along with the relations;
\begin{equation}
\gamma_\mu^{\dagger} = \gamma_0 \gamma_\mu \gamma_0, \,\, \gamma_5^{\dagger} = \gamma_5, \,\, \set{\gamma_\mu, \gamma_5} = 0
\end{equation}
then we find;
\begin{align*}
\mM^{\star} &= \left(v^{\dagger}\gamma_0(1 - \gamma_5)(k^{\mu}\gamma_\mu + m_N)(1 - \gamma_5)u\right)^{\star} \\
&= u^{\dagger}(1 - \gamma_5^{\dagger})(k^{\mu}\gamma_\mu^{\dagger} + m_N)(1 - \gamma_5^{\dagger})\gamma_0^{\dagger}v \\
&= u^{\dagger}\gamma_0(1 + \gamma_5)(k^{\mu}\gamma_\mu + m_N)(1 + \gamma_5)v \\
&= \bar{u}(1 + \gamma_5)(\slashed{k} + m_N)(1 + \gamma_5)v
\end{align*}
So we find that;
\begin{align}
i\mM_1^{\star} &= \frac{g^2}{4}\bar{u}^{s}(\vec{p}_1)(1 + \gamma_5)\frac{\slashed{p}_1 - \slashed{p}_3 + m_N}{(p_1 - p_3)^2 - m_N^2}(1 + \gamma_5)v^{r}(\vec{p}_2) \\
i\mM_2^{\star} &= \frac{g^2}{4}\bar{u}^{s}(\vec{p}_1)(1 + \gamma_5)\frac{\slashed{p}_1 - \slashed{p}_4 + m_N}{(p_1 - p_4)^2 - m_N^2}(1 + \gamma_5)v^{r}(\vec{p}_2)
\end{align}
\subsection{Squared Matrix Elements}
We can now compute the squared matrix elements;
\begin{multline*}
\left|\mM_1\right|^2 = \frac{g^4}{16}\left(\bar{u}^{s}(\vec{p}_1)(1 + \gamma_5)\frac{\slashed{p}_1 - \slashed{p}_3 + m_N}{(p_1 - p_3)^2 - m_N^2}(1 + \gamma_5)v^{r}(\vec{p}_2)\right) \\ \times \left(\bar{v}^r(\vec{p}_2)(1 - \gamma_5)\frac{\slashed{p}_1 - \slashed{p}_3 + m_N}{(p_1 - p_3)^2 - m_N^2}(1 - \gamma_5)u^s(\vec{p}_1) \right)
\end{multline*}
\begin{multline*}
\left|\mM_2\right|^2 = \frac{g^4}{16}\left(\bar{u}^{s}(\vec{p}_1)(1 + \gamma_5)\frac{\slashed{p}_1 - \slashed{p}_4 + m_N}{(p_1 - p_4)^2 - m_N^2}(1 + \gamma_5)v^{r}(\vec{p}_2)\right) \\ \times\left(\bar{v}^r(\vec{p}_2)(1 - \gamma_5)\frac{\slashed{p}_1 - \slashed{p}_4 + m_N}{(p_1 - p_4)^2 - m_N^2}(1 - \gamma_5)u^s(\vec{p}_1) \right)
\end{multline*}
\begin{multline*}
\mM_1^\star \mM_2 = \frac{g^4}{16}\left(\bar{u}^{s}(\vec{p}_1)(1 + \gamma_5)\frac{\slashed{p}_1 - \slashed{p}_3 + m_N}{(p_1 - p_3)^2 - m_N^2}(1 + \gamma_5)v^{r}(\vec{p}_2)\right) \\ \times\left(\bar{v}^r(\vec{p}_2)(1 - \gamma_5)\frac{\slashed{p}_1 - \slashed{p}_4 + m_N}{(p_1 - p_4)^2 - m_N^2}(1 - \gamma_5)u^s(\vec{p}_1) \right)
\end{multline*}
\begin{multline*}
\mM_2^\star \mM_1 = \frac{g^4}{16}\left(\bar{u}^{s}(\vec{p}_1)(1 + \gamma_5)\frac{\slashed{p}_1 - \slashed{p}_4 + m_N}{(p_1 - p_4)^2 - m_N^2}(1 + \gamma_5)v^{r}(\vec{p}_2)\right) \\ \times\left(\bar{v}^r(\vec{p}_2)(1 - \gamma_5)\frac{\slashed{p}_1 - \slashed{p}_3 + m_N}{(p_1 - p_3)^2 - m_N^2}(1 - \gamma_5)u^s(\vec{p}_1) \right)
\end{multline*}
The helicity averaged squared matrix element is then obtained via;
\begin{equation*}
\langle \Abs{\mM}^2 \rangle = \frac{1}{4}\sum_{r, s}{\left(\Abs{\mM_1}^2 + \mM_1^\star \mM_2 + \mM_2^\star \mM_1 + \Abs{\mM_2}^2\right)}
\end{equation*}
To do this sum we make use of the identities:
\begin{equation}
\sum_{r}{u_\alpha^r(\vec{p})\bar{u}_\beta^r(\vec{p})} = (\slashed{p} + m)_{\alpha \beta}, \,\, \sum_{r}{v_\alpha^r(\vec{p})\bar{v}_\beta^r(\vec{p})} = (\slashed{p} - m)_{\alpha \beta}
\end{equation}
We are working at energies much greater than the mass of the neutrino, so here $m_\nu = 0$. Hence;
\begin{align*}
\frac{1}{4}\sum_{r, s}{\left|\mM_1\right|^2 }&= \frac{g^4}{16}\tr\left[\slashed{p}_1(1 + \gamma_5)\frac{\slashed{p}_1 - \slashed{p}_3 + m_N}{(p_1 - p_3)^2 - m_N^2}(1 + \gamma_5)\slashed{p}_2(1 - \gamma_5)\frac{\slashed{p}_1 - \slashed{p}_3 + m_N}{(p_1 - p_3)^2 - m_N^2}(1 - \gamma_5) \right] \\
\frac{1}{4}\sum_{r, s}{\left|\mM_2\right|^2 }&= \frac{g^4}{16}\tr\left[\slashed{p}_1(1 + \gamma_5)\frac{\slashed{p}_1 - \slashed{p}_4 + m_N}{(p_1 - p_4)^2 - m_N^2}(1 + \gamma_5)\slashed{p}_2(1 - \gamma_5)\frac{\slashed{p}_1 - \slashed{p}_4 + m_N}{(p_1 - p_4)^2 - m_N^2}(1 - \gamma_5) \right] \\
\frac{1}{4}\sum_{r, s}{\mM_1^\star \mM_2}&= \frac{g^4}{16}\tr\left[\slashed{p}_1(1 + \gamma_5)\frac{\slashed{p}_1 - \slashed{p}_3 + m_N}{(p_1 - p_3)^2 - m_N^2}(1 + \gamma_5)\slashed{p}_2(1 - \gamma_5)\frac{\slashed{p}_1 - \slashed{p}_4 + m_N}{(p_1 - p_4)^2 - m_N^2}(1 - \gamma_5) \right] \\
\frac{1}{4}\sum_{r, s}{\mM_2^\star \mM_1}&= \frac{g^4}{16}\tr\left[\slashed{p}_1(1 + \gamma_5)\frac{\slashed{p}_1 - \slashed{p}_4 + m_N}{(p_1 - p_4)^2 - m_N^2}(1 + \gamma_5)\slashed{p}_2(1 - \gamma_5)\frac{\slashed{p}_1 - \slashed{p}_3 + m_N}{(p_1 - p_3)^2 - m_N^2}(1 - \gamma_5) \right] \\
\end{align*}
\subsection{Computing the Traces}
At this point we turn to the Dirac trace identities so as to do this analytically (in order to check the result obtained using \cite{Patel:2015tea}). We will make use of;
\begin{itemize}
\item $\tr(\gamma_{\mu}\gamma_{\nu}) = 4\eta_{\mu\nu}$
\item $\tr(\gamma_\mu \gamma_\nu \gamma_5) = 0$
\end{itemize}
as well as the fact that $\gamma_5^2 = \mathbb{I}_4$. Then we consider the general expression, which covers all the cases above;
\begin{align*}
&\tr\left[\slashed{p}_1(1 + \gamma_5)(\slashed{k}_1 + m_N)(1 + \gamma_5)\slashed{p}_2(1 - \gamma_5)(\slashed{k}_2 + m_N)(1 - \gamma_5)\right] \\
&\quad= p_1^{\mu}k_1^{\nu}p_2^{\rho}k_2^{\sigma}\tr\left[\gamma_\mu(1 + \gamma_5)\gamma_\nu(1 + \gamma_5)\gamma^{\rho}(1 - \gamma_5)\gamma^{\sigma}(1 - \gamma_5)\right] \\
&\qquad+ p_1^{\mu}k_1^{\nu}p_2^{\rho}m_N \tr\left[\gamma_\mu(1 + \gamma_5)\gamma_\nu(1 + \gamma_5)\gamma^{\rho}(1 - \gamma_5)(1 - \gamma_5)\right] \\
&\qquad \quad + p_1^{\mu}m_Np_2^{\rho}k_2^{\sigma} \tr\left[\gamma_\mu(1 + \gamma_5)(1 + \gamma_5)\gamma^{\rho}(1 - \gamma_5)\gamma_\sigma(1 - \gamma_5)\right] \\
&\qquad \qquad+ p_1^{\mu}p_2^{\rho}m_N^2 \tr\left[\gamma_\mu(1 + \gamma_5)(1 + \gamma_5)\gamma_\rho(1 - \gamma_5)(1 - \gamma_5)\right]
\end{align*}
Now, we first note the following;
\begin{align*}
\gamma_\mu (1 \pm \gamma_5)\gamma_\nu(1 \pm \gamma_5) &= \gamma_\mu(1 \pm \gamma_5)(1 \mp \gamma_5)\gamma_\nu \\
&= \gamma_\mu (\mathbb{I}_4 - \gamma_5^2)\gamma_\nu \\
&= 0
\end{align*}
So the first three terms vanish, we then just need to compute;
\begin{align*}
\tr\left[\gamma_\mu(1 + \gamma_5)(1 + \gamma_5)\gamma_\rho(1 - \gamma_5)(1 - \gamma_5)\right] &= 4\tr\left[\gamma_\mu(1 + \gamma_5)\gamma_\rho(1 - \gamma_5)\right] \\
&= 4\tr\left[\gamma_\mu \gamma_\rho (1 - \gamma_5)(1 - \gamma_5)\right] \\
&= 8\tr\left[\gamma_\mu \gamma_\rho (1 - \gamma_5)\right] \\
&= 32\eta_{\mu\rho}
\end{align*}
So we find that;
\begin{equation}
\tr\left[\slashed{p}_1(1 + \gamma_5)(\slashed{k}_1 + m_N)(1 + \gamma_5)\slashed{p}_2(1 - \gamma_5)(\slashed{k}_2 + m_N)(1 - \gamma_5)\right] = 32 m_N^2 (p_1 \cdot p_2)
\end{equation}
Therefore we find that;
\begin{align*}
\frac{1}{4}\sum_{r, s}{\left|\mM_1\right|^2 }&=  \frac{g^4}{64}32(p_1 \cdot p_2)m_N^2 \left(\frac{1}{(p_1 - p_3)^2 - m_N^2}\right)^2 \\
\frac{1}{4}\sum_{r, s}{\left|\mM_2\right|^2 }&=  \frac{g^4}{64}32(p_1 \cdot p_2)m_N^2 \left(\frac{1}{(p_1 - p_4)^2 - m_N^2}\right)^2 \\
\frac{1}{4}\sum_{r, s}{\mM_1^\star \mM_2}&=  \frac{g^4}{64}32(p_1 \cdot p_2)m_N^2 \left(\frac{1}{(p_1 - p_3)^2 - m_N^2}\right)\left(\frac{1}{(p_1 - p_4)^2 - m_N^2}\right) \\
\frac{1}{4}\sum_{r, s}{\mM_2^\star \mM_1}&=  \frac{g^4}{64}32(p_1 \cdot p_2)m_N^2 \left(\frac{1}{(p_1 - p_4)^2 - m_N^2}\right)\left(\frac{1}{(p_1 - p_3)^2 - m_N^2}\right) \\
\end{align*}
Summing these and using the definitions of the Mandelstam variables;
\begin{equation}
s = (p_1 + p_2)^2, \quad t = (p_1 - p_3)^2, \quad u = (p_1 - p_4)^2
\end{equation}
At this point, note that the expression for $s$ along with the fact that $p_1^2 = p_2^2 = m_\nu^2 \equiv 0$ gives;
\begin{equation*}
s = (p_1 + p_2)^2 = p_1^2 + p_2^2 + 2(p_1 \cdot p_2) = 2(p_1 \cdot p_2)
\end{equation*}
Then we can write down the helicity averaged squared matrix element;
\begin{examplebox1}
\begin{equation}
\label{eq:msquared}
\langle \Abs{\mM}^2 \rangle = \frac{1}{4} \sum_{r, s}{\Abs{\mM}^2} = \frac{1}{4}g^4 m_N^2 s \left(\left(\frac{1}{t - m_N^2}\right)^2 + \left(\frac{1}{u - m_N^2}\right)^2 + \frac{2}{(t - m_N^2)(u - m_N^2)}\right)
\end{equation}
\end{examplebox1}
\subsection{Kinematics}
To compute the integrated cross section, we need to consider the kinematics in the centre of mass frame. The general set up is shown in Figure \ref{fig:kinematics}. The following results and definitions hold in the centre of mass frame;
\begin{itemize}
\item $\vec{p}_1 + \vec{p}_2 = \vec{0}$ which implies $\vec{p}_3 + \vec{p}_4 = \vec{0}$ by conservation of $3$-momentum
\item Thus, $\Abs{\vec{p}_1} = \Abs{\vec{p}_2}$ and $\Abs{\vec{p}_3} = \Abs{\vec{p}_4}$
\item We define the scattering angle $\theta$ by $\vec{p}_1 \cdot \vec{p}_3 = \Abs{\vec{p}_1}\Abs{\vec{p}_3}\cos \theta$
\item Therefore, $\vec{p}_1 \cdot \vec{p}_4 = -\vec{p}_1 \cdot \vec{p}_3 =  -\Abs{\vec{p}_1}\Abs{\vec{p}_3}\cos \theta$
\end{itemize}
Conservation of energy with $m_\nu = 0$, along with $\Abs{\vec{p}_1} = \Abs{\vec{p}_2}$ and $\Abs{\vec{p}_3} = \Abs{\vec{p}_4}$ gives;
\begin{align*}
\Abs{\vec{p}_1} + \Abs{\vec{p}_2} &= \sqrt{\Abs{\vec{p}_3}^2 + m_\phi^2} + \sqrt{\Abs{\vec{p}_4}^2 + m_\phi^2} \\
\Rightarrow  \Abs{\vec{p}_1} &= \sqrt{\Abs{\vec{p}_3}^2 + m_\phi^2} \\
\Rightarrow  \Abs{\vec{p}_3} &= \sqrt{\Abs{\vec{p}_1}^2 - m_\phi^2}
\end{align*}
Furthermore, we have the $4$-momenta $p_1 = (\Abs{\vec{p}_1}, \vec{p}_1)$, $p_2 =  (\Abs{\vec{p}_1}, -\vec{p}_1)$, so $p_1 + p_2 = (2\Abs{\vec{p}_1}, \vec{0})$ which implies $s = (p_1 + p_2)^2 = 4\Abs{\vec{p}_1}^2$. Therefore we can read off;
\begin{equation}
\Abs{\vec{p}_1} = \frac{1}{2}\sqrt{s}, \quad \Abs{\vec{p}_3} = \sqrt{\frac{1}{4}s - m_\phi^2}
\end{equation}
\begin{figure}
\begin{framed}
 \centering
 \includegraphics[width=0.6\linewidth]{comdiag}
 \caption{The kinematics in the centre of mass frame, acting as a definition of the scattering angle, $\theta$.}
 \label{fig:kinematics}
 \end{framed}
\end{figure}
We can then write the other Mandelstam variables in terms of only $s$ and $\theta$ as follows;
\begin{align*}
t &= (p_1 - p_3)^2 \\
&= p_1^2 + p_3^2 - 2 (p_1 \cdot p_3) \\
&= \underset{=0}{\underbrace{m_\nu^2}} + m_\phi^2 - 2(E_1 E_3 - \vec{p}_1 \cdot \vec{p}_3) \\
&= m_\phi^2 - 2\left(\Abs{\vec{p}_1}\sqrt{\Abs{\vec{p}_3}^2 + m_\phi^2} - \Abs{\vec{p}_1} \Abs{\vec{p}_3}\cos \theta\right) \\
&= m_\phi^2 - 2\left(\Abs{\vec{p}_1} \sqrt{\frac{1}{4}s - m_\phi^2 + m_\phi^2} - \Abs{\vec{p}_1}\sqrt{\frac{1}{4}s - m_\phi^2}\cos\theta\right) \\
&= m_\phi^2 - 2\left(\frac{1}{2}\sqrt{s}\cdot\frac{1}{2}\sqrt{s} - \frac{1}{2}\sqrt{s}\sqrt{\frac{1}{4}s - m_\phi^2}\cos\theta\right) \\
&= m_\phi^2 - \frac{1}{2}s + \sqrt{s\left(\frac{1}{4}s - m_\phi^2\right)}\cos\theta
\end{align*}
Finally we can use the relationship between the Mandelstam variables;
\begin{equation}
s + t + u = \sum_{i}{m_i^2} = 2m_\phi^2
\end{equation}
to write $u$ in terms of $s$ and $\theta$;
\begin{align*}
u &= 2 m_\phi^2 - s - t \\
&= 2 m_\phi^2 - s - m_\phi^2 + \frac{1}{2}s - \sqrt{s\left(\frac{1}{4}s- m_\phi^2 \right)}\cos\theta \\
&= m_\phi^2 - \frac{1}{2}s - \sqrt{s\left(\frac{1}{4}s - m_\phi^2\right)}\cos\theta
\end{align*}
Thus we can write the squared matrix element in terms of only $(s, \theta)$ as follows;
\begin{multline}
\langle \Abs{\mM}^2 \rangle = \frac{1}{4}g^4 m_N^2 s \left[ \frac{1}{\left(m_\phi^2 - m_N^2 - \frac{1}{2}s + \sqrt{s\left(\frac{1}{4}s - m_\phi^2\right)}\cos\theta\right)^2} \right. \\ \left. +  \frac{1}{\left(m_\phi^2 - m_N^2 - \frac{1}{2}s - \sqrt{s\left(\frac{1}{4}s - m_\phi^2\right)}\cos\theta\right)^2} \right. \\ \left. + \frac{2}{\left(m_\phi^2 - m_N^2 - \frac{1}{2}s + \sqrt{s\left(\frac{1}{4}s - m_\phi^2\right)}\cos\theta\right)\left(m_\phi^2 - m_N^2 - \frac{1}{2}s - \sqrt{s\left(\frac{1}{4}s - m_\phi^2\right)}\cos\theta\right)}  \right]
\end{multline}
\subsection{Method 1: The Differential Cross Section}
Our first method for computing the integrated cross section is via the differential cross section, which is given by the following standard result in the centre of mass frame, from \cite{Thomson:2013zua};
\begin{equation}
\frac{\ud \sigma}{\ud \Omega} = \frac{1}{64 \pi^2 s}\frac{\Abs{\vec{p}_3}}{\Abs{\vec{p}_1}} \langle \Abs{\mM}^2 \rangle
\end{equation}
Plugging in the expressions for $\Abs{\vec{p}_1}$ and $\Abs{\vec{p}_3}$ we therefore find;
\begin{multline*}
\frac{\ud \sigma}{\ud \Omega} = \frac{g^4 m_N^2}{256 \pi^2}\sqrt{\frac{s - 4m_\phi^2}{s}}\left[ \frac{1}{\left(m_\phi^2 - m_N^2 - \frac{1}{2}s + \sqrt{s\left(\frac{1}{4}s - m_\phi^2\right)}\cos\theta\right)^2} \right. \\ \left. +  \frac{1}{\left(m_\phi^2 - m_N^2 - \frac{1}{2}s - \sqrt{s\left(\frac{1}{4}s - m_\phi^2\right)}\cos\theta\right)^2} \right. \\ \left. + \frac{2}{\left(m_\phi^2 - m_N^2 - \frac{1}{2}s + \sqrt{s\left(\frac{1}{4}s - m_\phi^2\right)}\cos\theta\right)\left(m_\phi^2 - m_N^2 - \frac{1}{2}s - \sqrt{s\left(\frac{1}{4}s - m_\phi^2\right)}\cos\theta\right)}  \right]
\end{multline*}
To find the cross section we need to integrate over the solid angle;
\begin{equation}
\sigma = \int{\upd{\Omega}\frac{\ud \sigma}{\ud \Omega}} = \int_{0}^{2\pi}{\upd{\phi}\int_{-1}^{+1}{\upd{(\cos\theta)}\frac{\ud\sigma}{\ud \Omega}}} = 2\pi \int_{-1}^{+1}{\upd{(\cos\theta)}\frac{\ud\sigma}{\ud\Omega}}
\end{equation}
We make the following definitions to simplify the algebra;
\begin{itemize}
\item $\alpha = m_\phi^2 - m_N^2 - \frac{1}{2}s$
\item $\beta = \sqrt{s\left(\frac{1}{4}s - m_\phi^2\right)}$
\item $u = \cos\theta$
\end{itemize}
Then the cross section can be written as;
\begin{equation*}
\sigma = \frac{g^4 m_N^2}{128 \pi}\sqrt{\frac{s - 4m_\phi^2}{s}}\int_{-1}^{+1}{\upd{u}\left[\frac{1}{(\alpha + \beta u)^2} + \frac{1}{(\alpha - \beta u)^2} + \frac{2}{(\alpha - \beta u)(\alpha + \beta u)}\right]}
\end{equation*}
It remains to compute the integrals;
\begin{align*}
\int_{-1}^{+1}{\upd{u}\frac{1}{(\alpha + \beta u)^2}} &= \frac{1}{\beta}\left[-\frac{1}{\alpha + \beta u}\right]_{-1}^{+1} \\
&= \frac{2}{\alpha^2 - \beta^2} \\
\int_{-1}^{+1}{\upd{u}\frac{1}{(\alpha - \beta u)^2}} &=  \frac{2}{\alpha^2 - \beta^2} \\
\int_{-1}^{+1}{\upd{u}\frac{2}{(\alpha - \beta u)(\alpha + \beta u)}} &= \frac{2}{\alpha \beta}\log\left(\frac{\alpha + \beta}{\alpha - \beta}\right)
\end{align*}
So we find that;
\begin{equation*}
\sigma = \frac{g^4 m_N^2}{128 \pi}\sqrt{\frac{s - 4m_\phi^2}{s}}\left(\frac{4}{\alpha^2 - \beta^2} + \frac{2}{\alpha \beta}\log\left(\frac{\alpha + \beta}{\alpha - \beta}\right)\right)
\end{equation*}
Substituting our expressions for $\alpha$ and $\beta$ from above we find;
\begin{multline*}
\sigma = \frac{g^4 m_N^2}{64\pi}\sqrt{\frac{s - 4m_\phi^2}{s}}\left( \frac{2}{\left(m_\phi^2 - m_N^2 - \frac{1}{2}s\right)^2 - s\left(\frac{1}{4}s - m_\phi^2\right)} \right. \\ \left. + \frac{1}{\left(m_\phi^2 - m_N^2 - \frac{1}{2}s\right)\sqrt{s\left(\frac{1}{4}s - m_\phi^2\right)}} \log\left(\frac{m_\phi^2 - m_N^2 - \frac{1}{2}s + \sqrt{s\left(\frac{1}{4}s - m_\phi^2\right)}}{m_\phi^2 - m_N^2 - \frac{1}{2}s - \sqrt{s\left(\frac{1}{4}s - m_\phi^2\right)}}\right)\right)
\end{multline*}
which reduces to;
\begin{examplebox1}
\begin{multline}
\label{eq:sigma}
\sigma(s) = \frac{g^4 m_N^2}{32 \pi}\left[\sqrt{\frac{\frac{1}{4}s - m_\phi^2}{s}}\frac{2}{\left(m_\phi^2 - m_N^2 - \frac{1}{2}s\right)^2 - s\left(\frac{1}{4}s - m_\phi^2\right)} \right. \\ \left. + \frac{1}{s\left(m_\phi^2 - m_N^2 - \frac{1}{2}s\right)}\log\left(\frac{m_\phi^2 - m_N^2 - \frac{1}{2}s + \sqrt{s\left(\frac{1}{4}s - m_\phi^2\right)}}{m_\phi^2 - m_N^2 - \frac{1}{2}s - \sqrt{s\left(\frac{1}{4}s - m_\phi^2\right)}}\right)\right]
\end{multline}
\end{examplebox1}
\subsection{Method 2: Integrating over $t$}
As a check of the integration, we want to see that we obtain the same result by instead integrating over the Mandelstam variable $t$. Again, we use a standard result from \cite{Thomson:2013zua};
\begin{equation}
\frac{\ud \sigma}{\ud t} = \frac{1}{64 \pi s \Abs{\vec{p}_1}^2}\langle \Abs{\mM}^2 \rangle
\end{equation}
Using again the fact that $\Abs{\vec{p}_1} = \frac{1}{2}\sqrt{s}$ we see that;
\begin{equation*}
\sigma = \int_{t_0}^{t_1}{\upd{t}\frac{\langle \Abs{\mM}^2 \rangle}{16 \pi s^2}}
\end{equation*}
To determine the limits on the integration we consider the expression from the Kinematics section;
\begin{equation*}
t = m_\phi^2 - \frac{1}{2}s + \sqrt{s\left(\frac{1}{4}s - m_\phi^2\right)}\cos\theta
\end{equation*}
The extremal values occur when $\cos\theta = \pm 1$, so we find;
\begin{equation}
t_0 = m_\phi^2 - \frac{1}{2}s - \sqrt{s\left(\frac{1}{4}s - m_\phi^2\right)}, \,\, t_1 = m_\phi^2 - \frac{1}{2}s + \sqrt{s\left(\frac{1}{4}s - m_\phi^2\right)}
\end{equation}
We can write the matrix element in terms of only $s$ and $t$ using $s + t + u = 2m_\phi^2$, then substituting this into \eqref{eq:msquared} we find;
\begin{equation*}
\frac{\langle \Abs{\mM}^2 \rangle}{16\pi s^2} = \frac{g^4 m_N^2}{64\pi s}\left(\left(\frac{1}{t - m_N^2}\right)^2 + \left(\frac{1}{2m_\phi^2 - m_N^2 - s - t}\right)^2 + \frac{2}{(t - m_N^2)(2m_\phi^2 - m_N^2 - s - t)}\right)
\end{equation*}
We can then gather together some integrals, firstly;
\begin{equation*}
\int_{t_0}^{t_1}{\upd{t}\frac{1}{(t - a)^2}} = \frac{1}{t_0 - a} - \frac{1}{t_1 - a}
\end{equation*}
which we apply with $a = m_N^2$ and $a = 2m_\phi^2 - m_N^2 - s$ to find;
\begin{multline*}
\int_{t_0}^{t_1}{\upd{t}\left(\frac{1}{(t - m_N^2)^2} + \frac{1}{(2m_\phi^2 - m_N^2 - s - t)^2}\right)} \\ = \frac{1}{m_\phi^2 - m_N^2 - \frac{1}{2}s - \sqrt{s\left(\frac{1}{4}s - m_\phi^2\right)}} - \frac{1}{m_\phi^2 - m_N^2 - \frac{1}{2}s + \sqrt{s\left(\frac{1}{4}s - m_\phi^2\right)}} \\ + \frac{1}{m_\phi^2 - 2m_\phi^2 + m_N^2 + s - \frac{1}{2}s - \sqrt{s\left(\frac{1}{4}s - m_\phi^2\right)}} \\ - \frac{1}{m_\phi^2 - 2m_\phi^2 + m_N^2 + s - \frac{1}{2}s + \sqrt{s\left(\frac{1}{4}s - m_\phi^2\right)}}
\end{multline*}
Simplifying the last two terms we find;
\begin{align*}
&\int_{t_0}^{t_1}{\upd{t}\left(\frac{1}{(t - m_N^2)^2} + \frac{1}{(2m_\phi^2 - m_N^2 - s - t)^2}\right)} \\
&\qquad \qquad= \frac{2}{m_\phi^2 - m_N^2 - \frac{1}{2}s - \sqrt{s\left(\frac{1}{4}s - m_\phi^2\right)}} - \frac{2}{m_\phi^2 - m_N^2 - \frac{1}{2}s + \sqrt{s\left(\frac{1}{4}s - m_\phi^2\right)}} \\
&\qquad \qquad= \frac{4\sqrt{s\left(\frac{1}{4}s - m_\phi^2\right)}}{\left(m_\phi^2 - m_N^2 - \frac{1}{2}s\right)^2 - s\left(\frac{1}{4}s - m_\phi^2\right)}
\end{align*}
The last integral can be evaluated by considering;
\begin{align*}
\int_{t_0}^{t_1}{\upd{t}\frac{1}{(t - a)(b - t)}} &= \int_{t_0}^{t_1}{\upd{t}\frac{1}{b - a}\left(\frac{1}{t - a} + \frac{1}{b - t}\right)} \\
&= \frac{1}{b - a}\left[\log\left(\frac{t - a}{b - t}\right)\right]_{t_0}^{t_1} \\
&= \frac{1}{b - a}\log\left(\frac{(t_1 - a)(b - t_0)}{(b - t_1)(t_0 - a)}\right)
\end{align*}
We apply this with $a = m_N^2$, $b = 2m_\phi^2 - m_N^2 - s$ which gives;
\begin{align*}
&\frac{1}{2m_\phi^2 - 2m_N^2 - s}\log\left( \frac{\left(m_\phi^2 - m_N^2 -\frac{1}{2}s + \sqrt{s\left(\frac{1}{4}s - m_\phi^2\right)}\right)}{\left(2m_\phi^2 - m_N^2 - s - m_\phi^2 + \frac{1}{2}s - \sqrt{s\left(\frac{1}{4}s - m_\phi^2\right)}\right)} \right. \\
& \qquad \quad \cdot \left. \frac{\left(2m_\phi^2 - m_N^2 - s - m_\phi^2 + \frac{1}{2}s +  \sqrt{s\left(\frac{1}{4}s - m_\phi^2\right)}\right)}{\left(m_\phi^2 - m_N^2 -\frac{1}{2}s - \sqrt{s\left(\frac{1}{4}s - m_\phi^2\right)}\right)}\right) \\
&\quad=\frac{1}{2m_\phi^2 - 2m_N^2 - s} \log\left(\frac{\left(m_\phi^2 - m_N^2 -\frac{1}{2}s + \sqrt{s\left(\frac{1}{4}s - m_\phi^2\right)}\right)^2}{\left(m_\phi^2 - m_N^2 -\frac{1}{2}s - \sqrt{s\left(\frac{1}{4}s - m_\phi^2\right)}\right)^2}\right) \\
&\quad=\frac{1}{m_\phi^2 - m_n^2 - \frac{1}{2}s}\log\left(\frac{m_\phi^2 - m_N^2 - \frac{1}{2}s + \sqrt{s\left(\frac{1}{4}s - m_\phi^2\right)}}{m_\phi^2 - m_N^2 - \frac{1}{2}s - \sqrt{s\left(\frac{1}{4}s - m_\phi^2\right)}}\right)
\end{align*}
Adding the two integrals together and collecting the terms, we do indeed recover the expression in \eqref{eq:sigma}.

\section{Results}
\begin{figure}
\begin{framed}
 \centering
 \includegraphics[width=0.7\linewidth]{sigma}
 \caption{The interaction cross section $\sigma(s)$ plotted with the values of the parameters given by $m_\nu = 0.01 \, \text{eV}, g = 10^{-3}$, $m_\phi = 1 \, \text{MeV}$, $m_N = 10 \, \text{MeV}$. The black dotted line indicates the threshold energy at $m_\phi$, whilst the thick red line indicates the centre of mass energy of the PeV neutrino.}
 \label{fig:sigmaplot}
\end{framed}
\end{figure}
\subsection{Plotting the Cross Section}
We now look to check our result by making some initial plots and comparing the centre of mass energy for the original PeV neutrino. We assume that the neutrino from the blazar has an energy $E_\nu = 1 \, \text{PeV}$ and that the cosmic neutrino background is approximately at rest. Then, the energy of the blazar neutrino in the centre of mass frame is given by $E^\star_\nu = \sqrt{2m_\nu E_\nu}$ which is $\mO(\text{MeV})$. We note that this depends on the neutrino mass, but more importantly is $\mO(m_\phi, m_N)$. There are a number of things to note from Figure \ref{fig:sigmaplot};
\begin{itemize}
\item The threshold centre of mass energy, at the mass of the scalar, for the creation of the two $\phi$ particles is indeed realised in our analytic expression
\item Whilst the neutrinos from the blazar are very high energy, the small value of the neutrino mass (taken here to be $0.01 \, \text{eV}$) actually ensures that the centre of mass energy of the collision is precisely around the resonance peak. It could therefore be argued perhaps that the process is interesting precisely because the neutrinos have such a high energy. If they had a smaller energy, the centre of mass energy would be below the threshold and the process could not occur.
\end{itemize}
\subsection{What next?}
Now we have the cross section, we need to try and put some constraints on the model via some astrophysical considerations. These might include;
\begin{itemize}
\item Using the cross section to calculate the mean free path for the neutrino from the blazar, this might involve integrating over the dark matter density, $n_\chi(z)$.
\item The blazar is $\sim 5.6$ billion light years away, so a red shift in the neutrino energy may be important, indeed the red shift might cause the effective energy at some red shift, $z$, to fall below the threshold energy discussed above. If this is the case, then there will be a cutoff $z^\star$, after which the process will not happen.
\item Whether we need to consider other scattering channels, off e.g. dark matter to calculate the mean free path.
\item How to combine the above to put constraints on the model, including which variables to constrain ($m_\phi, m_N$ etc.).
\end{itemize}

\hrule
\vspace{1pt}
\hrule
\nocite{*}
\bibliography{update7Nov}
\vspace{15pt}
\hrule
\vspace{1pt}
\hrule
\end{document}


\documentclass[12pt]{article}
\usepackage{graphics}
\begin{document}

\section*{NYU Engineering Physics 1---In-class Exam 2}

\vfill

\paragraph{Name:} ~

\paragraph{email:} ~

\vfill

This exam consists of three problems.  Write only in this booklet.  Be
sure to show your work.

\vfill ~

\clearpage

\section*{Problem 1}

In the diagram below, all surfaces are frictionless, and all strings
and pulleys are massless and frictionless.
\\
\resizebox{\textwidth}{!}{\includegraphics{../mp/pulley_ramp.eps}}

\textsl{(a)}~Draw free body diagrams for both blocks, showing all
forces acting.

\vfill

\textsl{(b)}~Find the acceleration $\vec{a}_2$ (magnitude and
direction) of block $m_2$, in terms of the labeled quantities and
anything else you need ($g$, for example).  Be sure to show clearly
the direction corresponding to positive acceleration for each block.

\vfill ~

\clearpage

\section*{Problem 2}

A major-league baseball pitcher can throw a baseball at about
$90~\mathrm{mi\,hr^{-1}}$.  Estimate the impulse $\Delta p$ given to
the ball by the pitcher.  Make an estimate of the work done $\Delta W$
by the pitcher on the ball during the throw.  Use the work to figure
out the average force $F$ applied by the pitcher to the ball in SI
units (newtons).  Does your answer seem reasonable?  \emph{Clearly
state your assumptions, and justify any that are non-trivial.}

\clearpage

\section*{Problem 3}

A physicist of mass $48~\mathrm{kg}$ stands (carefully) on a perfectly
frictionless ice rink, next to a block of ice of mass
$16~\mathrm{kg}$.  Both begin at rest in the ``rink frame.''  The
physicist pushes on the block until it is moving away \emph{relative
to the physicist} at $1~\mathrm{m\,s^{-1}}$.

When viewed in the rink frame, the block ends up moving in the
positive $x$ direction and the physicist ends up moving in the
negative $x$ direction, by conservation of momentum.  What are the
final speeds of the block and physicist, in the rink frame?

\end{document}


\documentclass[Physics.tex]{subfiles}
\begin{document}
\chapter{Work, Energy and Power}
The \sldef{work} done by a force on a body is the product of the force and the displacement of the body in the direction of the force. \begin{equation}W = \mathbf{F}\cdot\mathbf{s} = \left|\mathbf{F}_\parallel\right|\left|\mathbf{s}\right|\end{equation} The SI unit of work done is the \sldef{joule} (\si{\joule}), which is the work done by a force of \SI{1}{\newton} in moving an object by \SI{1}{\metre}.

When a gas is expanding, it does work on external pressure of
\begin{equation}W = p\mathbf{A}\cdot\mathbf{s} = p\Delta V = p(V_f - V_i)\end{equation} When a gas is compressed, work is done on it by the surroundings, and work done by the gas is negative.

\sldef{Energy} is the stored ability to do work. Energy can be transferred through thermal transfer (heating), or mechanical transfer (by doing work).

There are many forms of energy, including kinetic energy, gravitational potential energy, elastic potential energy, chemical potential energy, electrical potential energy and light energy.

\sldef{Kinetic energy} is the energy possessed by a body due to its motion. \begin{equation}T = \frac{1}{2}m\mathbf{v}^2\end{equation}

\begin{slderiv}Consider a constant net force \(\mathbf{F}\) acting on an object with mass \(m\) with some initial velocity \(\mathbf{u}\). \begin{equation*}\begin{split}\mathbf{v}^2 &= \mathbf{u}^2 + 2\mathbf{a}\mathbf{s}\\\implies W &= \mathbf{F}\cdot\mathbf{s} = m\mathbf{as} \mathrel(\mathrel\because\mathbf{F} = m\mathbf{a}) = \frac{1}{2}m(\mathbf{v}^2 - \mathbf{u}^2)\end{split}\end{equation*} The work done by \(\mathbf{F}\) increases only the kinetic energy of the block, so \[W = \Delta T \mathrel\therefore T_f - T_i = \frac{1}{2}m(\mathbf{v}^2 - \mathbf{u}^2)\] If \(\mathbf{u} = 0\), \[T_i = 0 \mathrel\therefore T_f = \frac{1}{2}m\mathbf{v}^2 \mathrel\therefore T = \frac{1}{2}m\mathbf{v}^2\qedhere\]\end{slderiv}

\sldef{Gravitational potential energy} is the energy a body possesses due to its position relative to something else. \begin{equation}U = mgh\end{equation}

\begin{slderiv}Consider a body of mass \(m\) at height \(h_i\) above the surface of the Earth, with acceleration of free fall \(\mathbf{g}\). A force \(\mathbf{F}\) raises the body vertically at a constant velocity to height \(h_f\). \[\begin{split}\mathbf{a} &= 0 \mathrel\therefore \mathbf{F}_\text{net} = 0 \mathrel\therefore \left|\mathbf{F}\right| - mg = 0 \mathrel\therefore \left|\mathbf{F}\right| = mg\\\mathrel\therefore W &= \left|\mathbf{F}\right|\left|\mathbf{s}\right| = mg(h_f - h_i)\end{split}\] The work done by \(\mathbf{F}\) increases only the gravitational potential energy of the block, so \[W = \Delta U \mathrel\therefore U_{f} - U_{i} = mg(h_f - h_i)\] If we take the gravitational potential energy at \(h_i\) as the reference level i.e. \(U\) at \(h_i = 0\), then an object of mass \(m\) raised by height \(h\) vertically above the reference level has gravitational potential energy of \(U = mgh\).\qedhere\end{slderiv}

\sldef{Elastic potential energy} is the energy possessed by an elastic body when it is subjected to deformation. \begin{equation}E = \frac{1}{2}k(\Delta\mathbf{x})^2\end{equation}

The principle of \sldef{conservation of energy} states that the total energy is constant i.e. energy cannot be created or destroyed, but can be converted from one form to another.

A \sldef{dissipative force} is a resistive force that reduces the energy of a system, like friction.

A non-isolated system is one where the system can interact and exchange energy with its environment. Energy of a non-isolated system is not conserved, but the energy of the system and its environment is always conserved.

\sldef{Power} is the work done per unit time, or the rate at which work is done. \begin{equation}P = \sldd{W}{t}\end{equation}

For a constant force \(\mathbf{F}\) acting on an object such that the object moves with a constant velocity \(\mathbf{v}\), \begin{equation}P = \sldd{W}{t} = \sldd{\mathbf{Fs}}{t} = \mathbf{F}\sldd{s}{t} + \mathbf{s}\sldd{F}{t} = \mathbf{F}\sldd{s}{t} = \mathbf{F}\cdot\mathbf{v}\end{equation}

\sldef{Efficiency} is the ratio between the useful output of an energy conversion and the input.
\end{document}


\section{Diffusion Tensor Imaging}
Diffusion is a process that involves the movement of molecules via thermally driven random motions, or namely Brownian motion (see Figure \ref{fig:diffusion}). Generally, factors such as molecular weight, viscosity, and temperature are the common solution properties influencing diffusion. However, in biological tissues, the cellular organization of the tissue influences the mobility of diffusing molecules by acting as obstacles within our organs. In certain cases, this means that the distance traveled by a diffusing molecules in one direction will not be the same as some other directions. As a comparison, in a solution with no barriers to diffusion, diffusion is isotropic or the same in all directions (See Figure \ref{fig:diffusion}, middle). On the other hand, if diffusion is hindered by some particularly oriented barriers, then it is termed anisotropic diffusion (Figure \ref{fig:diffusion}, right). In the anisotropic scenario, the structural organization of the barriers can be identified simply by the diffusion patterns and the degree of anisotropy is directly related to the geometry of the barriers.

\begin{figure}[htbp]
	\centering
	\includegraphics[width=\textwidth]{../figures/chapter2/motion_diffusion.png}
	\caption{Illustrations of diffusion}
	\caption*{Left: Diffusion process illustrated by simulated Brownian motion where four particles, indicated by different colors, all begin at the same origin of $(0,0)$ yet end up with different random paths. In biological tissues, diffusion path of water molecules will be influenced by cellular microstructures. Middle: cartoon illustrating diffusion with similar molecular displacement in all directions (isotropic). Right: cartoon illustrating greater diffusion in one direction over others (anisotropic).}
	\label{fig:diffusion}
\end{figure}

Diffusion weighted imaging(DWI) takes advantage of the phenomenon that water diffusion is highly anisotropic in tissues of the nervous system. In magnetic resonance imaging techniques, diffusion is often measured by an  "apparent diffusion coefficient" (ADC). Which is not a \emph{true} measure of the intrinsic diffusion, but instead a metric dependent on the interaction of the molecule (water in most biological usages) with the cellular structures over a given amount of diffusion time. In contrast to DWI, diffusion tensor imaging (DTI) computes a diffusion tensor that's a 3-by-3 matrix instead of one numerical value. This 3D tensor allows estimates of water mobility in all directions for a given voxel, enabling quantification of anisotropic diffusion. The methodology to combine diffusion metrics with magnetic resonance pulses was introduced by Stejskal and Tanner in 1960 \cite{stejskal_spin_1965}, and eventually adapted to clinical routines by Le Bihan and colleagues in 1980 \cite{le_bihan_mr_1986}. The key idea in this adaptation is that stationary water spin signal will be the same in response to two magnetic pulses of opposite polarities, but  moving water will return spin signals in a different position, giving off a weaker signal. The difference in signal attenuation is proportional to the water motion. Modern DTI acquisition routines reduce scan time by sending a series of oscillation gradient reversals instead of a train of $180^{\circ}$ pulses. Water movement is sampled in all directions covered by the diffusion sensitive gradients, providing quantification of diffusion in $x,y,z$ directions of a 3D brain volume.

% Insert DWI figure illustrating directionality
\begin{figure}[htbp]
	\centering
	\includegraphics[scale=0.8]{../figures/chapter2/fod.png}
	\caption{Axial view of human brain's fiber orientation distribution.}
	\caption*{Tri-dimensional representation of water diffusion along white-matter fibers with color coded $x \textrm{ (red)},y\textrm{ (green)},z\textrm{ (blue)}$ axes representing main diffusion direction. Spherical models provide information about the degree of anisotropy, with longer poles representing directed diffusion and smaller spheres representing isotropic diffusion. Zoomed in region showing anisotropic diffusion along the corpus callosum.}
	\label{fig:fod}
\end{figure}

% Summarize dMRI, last few points, transition to usages with citations, and finally transition to why and what we do here.
The concept of diffusion coefficient is only briefly covered here, as there has been much more sophisticated methods of quantifying anisotropic diffusion \cite{basser_estimation_1994, basser_mr_1994,pierpaoli_toward_1996,ulug_orientation-independent_1999}. However, the simple ADC framework provides an intuitive feel for diffusion tensors and has led to many valuable findings. Early observations of water diffusion in human brains in vivo focused on areas of large diffusion variation. Measurements showing a range of diffusion constants in white-matter fibers with different gradients revealed myelinated sheaths, microfilaments, and axonala membranes can act as barriers to water molecules traveling along the length of axons \cite{thomsen_vivo_1987}. On the other hand, gray matter does not exhibit anisotropic diffusion due to the lack of long oriented fiber structures \cite{chenevert_anisotropic_1990, chien_mr_1990}.  Subsequently, studies showing anisotropic water diffusion in animal brains and spinal cords \cite{moseley_diffusion-weighted_1990,king_diffusion-weighted_1991,howe_magnetic_1992} in addition to human cranial nerves \cite{hajnal_mr_1991,moseley_anisotropy_1991} proved the usefulness of diffusion weighted MRI. Eventually, DTI was adapted for measuring brain maturation \cite{sakuma_adult_1991,rutherford_mr_1991} as well as non-invasive fiber orientation \cite{douek_mr_1991}.

\subsection{Diffusion MRI Drawbacks}
While diffusion tensors became even more widely adapted with modern neuroscience studies acquiring multiple modalities of brain images at the same time, improving the signal to noise ratio (SNR) of DWI contrasts and accuracy of tensors have also shifted into focus. Despite its clinical usages for both brain \cite{moseley_diffusion-weighted_1990,warach_acute_1995} and body \cite{kiselev_fundamentals_2017,koh_diffusion-weighted_2007}, a low signal to noise ratio and artifact contamination are usual sources of low confidence in diffusion measurements. Specifically, long scan echo times (60-120 ms) and strong diffusion gradient pulses limits precision, and subsequently the accuracy of diffusion estimations after acquisition \cite{aja-fernandez_noise_2008,veraart_constrained_2011}. Aside from post hoc digital processing, improved SNR can be achieved by lengthening scan time or lowering spatial resolution. Longer scan times for each gradient direction only increases precision slowly, while echo times imposed by hardware  and acquisition protocol prevents changes in scan time. Additionally, loss in anatomical detail and smoothing effects contradicts the goal of improving SNR by lowering spatial resolution.

Unlike hardware imposed SNR deficits, diffusion MRI in humans suffers from additional artifacts from a variety of sources. While all MR acquisitions experience degrees of motion artifacts, diffusion MRI is exceedingly sensitive to motion. During  the strong gradient pulses, any head motion or small tissue movement such as pulsating flow amplifies the detected shifts in molecules. If all spin shifts detected in all voxels experience the same motion displacement, there is minimal loss in signal coherence and effects on ADC measurements. However, problematic artifacts occur when voxels in different slices of MR acquisition experience different degrees of motion during a single MR pulse sequence. In addition, macroscopic head motion will not be identical replicas of itself every time, and an accumulation of shifts over time during a sequence of pulses will lead to large signal variations across the image\cite{le_bihan_artifacts_2006}. Another artifact arising from repeated gradient pulse switches is eddy currents, where conducting surfaces in the MRI machinery induct currents in response to the on-off switching of magnetic pulses, which results in erroneously persisting gradients in addition to the main gradient \cite{andersson_model-based_2002,andersson_integrated_2016}. As mentioned before, low spatial sampling resolution to shorten scan time is common in diffusion MRI acquisition protocol, the effect of this shortcoming is exacerbated when high-contrast boundaries are poorly sampled, leading to Gibbs ringing artifacts \cite{veraart_gibbs_2016,wheeler_2021,tournier_diffusion_2011}. Such boundary artifacts have been identified to cause inaccuracies such as erroneous negative diffusivity and kurtosis values (kurtosis map black voxels) \cite{veraart_gibbs_2016,kellner_gibbs-ringing_2016,perrone_effect_2015}. Lastly, spatial signal bias caused by radio frequency pulse inhomogeneity which also requies correction \cite{bernstein_imaging_2006,belaroussi_intensity_2006}.

\section{DESIGNER Preprocessing Pipeline}
Improving diffusion tensor estimates via spatial smoothing \cite{tabesh_estimation_2011} or averaging \cite{cui_panda_2013} are considered brute force techniques that do not specifically target a type of contamination such as Gibbs ringing or thermal noise. To amend the noise and artifact issues mentioned above, Ades-Aron and colleagues proposed the DESIGNER pipeline, which stands for "Diffusion parameter EStImation with Gibbs and NoisE removal" \cite{ades-aron_evaluation_2018}. This preprocessing pipeline was shown to increase diffusion estimation precision by a factor of ~2 compared to aforementioned pipelines while preserving spatial resolution. Since then, specific proposed procedures in DESIGNER has been adapted into the open source software \emph{mrtrix3} \cite{tournier_mrtrix3_2019}.

\emph{Mrtrix3} provides a large collection of functionality for diffusion MRI focused processing and analysis. Similar to older pre-existing tools such as Freesurfer \cite{Fischl2012}, SPM \cite{penny_statistical_2006}, and FSL \cite{Jenkinson2012}, the suite of neuroimaging tool provide standalone modules but do not have any pre-established workflows, capabilities for parallel processing across subject data, or a standardized input \& output data framework. Although the DESIGNER pipeline is available as an open source Python project, the simple scripts does not comprehensively cover end-to-end diffusion MRI processing, and is not easily scalable to large datasets. Here, we will summarize the problems and preprocessing procedures recommended by DESIGNER, introduce our contributions to automating diffusion MRI processing, and showcase collaborative efforts on accelerating diffusion derived tractography computations.

\subsubsection{MP-PCA}
The pre-requisite step before targeted artifact removal is to denoise, as corrupted spatially varying MRI data can propagate through preprocessing procedures and lower the accuracy of the final diffusion quantification \cite{vizioli_lowering_2021}. The electronic components and the human subject being scanned can introduce a zero mean Gaussian distributed "thermal noise" to the sensitive MR scanners \cite{hoult_signal--noise_1976,edelstein_intrinsic_1986}. This thermal noise is further amplified by parallel imaging acquisition protocols for accelerated scan times, which introduces a non-uniform scaling of the noise amplitudes \cite{pruessmann_sense_1999}. This ubiquitous noise becomes a dominant contribution to voxel signals when employing high resolutions, short pulse repetition times, and/or lower magnetic fields \cite{triantafyllou_comparison_2005,triantafyllou_physiological_2011}. Many existing denoising techniques deals with this spatially variant non-Gaussian noise by weighted averaging of selected patches of voxels that share similar statistics \cite{buades_2005,coupe_fast_2006,manjon_mri_2008,orchard2008efficient,rajan_maximum_2011,foi2011noise}. These approaches suffer from the blurring of the image and introduction of additional partial volume effects that leads to downstream errors or biases in diffusion modeling.

To remove local noise variations while preserving edges in the images, Hotelling proposed the idea of transforming a redundant dataset into principle components and preserving only thee components carrying signal \cite{hotelling1933analysis}. Hotelling's assumption that diffusion MRI data is redundant is based on the confirmed phenomenon that 1) correlation between many diffusion weighted signals is brought by one underlying diffusion process, and 2) because the diffusion signals can be modeled be efficient represented by a small number of parameters (spherical models). Since then, it has been shown that principal component analysis (PCA) of redundant data reveals a majority of signal variance is contained in a few components \cite{deledalle2011image,manjon_mri_2015} , and the noise associated eigenvalues follow a Marchenko-Pastur (MP) distribution parameterized by non-Gaussian noise variance \cite{marchenko1967distribution} (See Figure \ref{fig:mp_dist}).

\begin{figure}[htbp]
    \centering
    \includegraphics[width=0.6\textwidth]{../figures/chapter2/MP-dist.png}
    \caption{Marchenko-Pastur distribution.}
    \caption*{Example of simulated Marchenko-Pastur distribution and it's upper end zoomed in, showing a universal characteristic of correlated noise in covariance matrices computed during PCA analysis, distinguishing between noise- and signal-carrying components. Image taken from the published work of Veraart et al., who generated this example with simulated data matrix of size $90x250$ \cite{veraart_denoising_2016}.}
    \label{fig:mp_dist}
\end{figure}

To remove the pure noise associated eigenvalues and eigenvectors, one needs to optimally select the appropriate noise level and the number of noise components to remove before reconstruction of the signal matrix. Coincidentally, the mean of the lowest eigenvalues will exceed the expected value of the MP distribution if at least one eigenvalue corresponds to a signal component. Therefore, the denoising algorithm will iteratively add eigenvalues from the noise end (see Figure \ref{fig:mp_dist}) until the sum of eigenvalues is greater than or equal to the expected value of the MP distribution. Subsequently, the denoised signal matrix will be reconstructed using the remaining signal components, without compromising anatomical detail and only requires about 1 min of processing time for a whole brain volume.

\subsubsection{Gibb's ringing artifact correction}
Gibb's ringing is an ubiquitous artifact that manifests as oscillatory signals near sharp image gradients. In the case of brain MRI, the borders between cerebrospinal fluid (CSF), gray matter (GM), and white matter (WM) are the usual source of Gibb's ringing artifacts due to insufficient sampling. This ringing artifact is clearly illustrated mathematically when we consider that MR images are acquired in $k$-space. Th $k$-space encodes both the phase and frequency of the acquired data, which represents the spatial frequency information of the MR volume. Every point in the $k$-space data matrix contains partial information for the complete image, but does not correspond to the same point in the image matrix. The outer rows of $k$-space contains high spatial frequency data describing information about the borders and contours of the image. On the other hand, the inner parts of the matrix provide information on low spatial frequency content, such as the general contrast of the image \cite{bronzino2000biomedical,mezrich1995perspective}. To recover the actual MRI image, one relates the $k$-space acquired Fourier expansion coefficients to intensities values at voxel $x$ ($I(x)$) as the following:

\begin{equation}
\label{eq:ktransform}
I(x) = \frac{1}{N} \sum_{k=0}^{N-1} c(k) \cdot e^{\frac{-2 \pi i k x}{N}}
\end{equation}

where $c(k)$ are the $N$ expansion coefficients in $k$-space. The Gibb's phenomenon says that while a Fourier series converges exponentially after $2N+1$ terms for a periodic signal, the convergence deteriorates for a function that is not periodic \cite{gottlieb_gibbs_1992}. In the case of a sharp image transition near boundaries, more high frequency components are required to reconstruct the image. Requiring higher amounts of $N$ components for a sharp edge that deteriorates Fourier series convergence will cause Gibb's ringing artifacts to appear.

Similar to denoising techniques, image filtering approaches to removing Gibb's ringing can smooth the oscillatory artifacts. But the filtering will apply a global smoothing effect, thus the spatial resolution of the image is reduced and finer details are lost \cite{gottlieb_gibbs_1997,jerri_lanczos-like_2000}. More intricate methods involves piece-wise reconstruction of smooth regions \cite{gottlieb_gibbs_1997,archibald_method_2002}. But the requirement for edge detection introduces instabilities due to the need for optimal parameter choices. The DESIGNER pipeline recommends an alternative approach where the $k$-space series expansions are modeled as a sinc function in image space. The method implemented here avoids spatial filtering, and makes use of the fact that the strength of the ringing effect depends on the precise location of the boundary in a sampling grid (or how the sinc function is sampled). The sinc function is found by optimizing the amount of ringing removed, which is quantified by the absolute differences in a certain "neighborhood" around a voxel, and the size of the "neighborhood" is the only parameter required. The final voxel value is obtained by re-interpolating the shifted image positions based on the original image grid voxel intensities \cite{kellner_gibbs-ringing_2016}.

\begin{figure}[htbp]
    \centering
    \includegraphics[width=\textwidth]{../figures/chapter2/unring.png}
    \caption{Gibb's Ringing Removal.}
    \caption*{Two example anatomical MRI slices with obvious ringing artifacts. Arrows indicating the fine details and peak structures are preserved after removal of ringing. Image taken from the published work of Kellner et al.'s original work on subvoxel shifts \cite{kellner_gibbs-ringing_2016}.}
    \label{fig:unring}
\end{figure}

\subsubsection{Rician bias correction}
The noise in diffusion MRI is governed by a Rician or non-central $\chi$ distribution that creates a positive bias in low SNR images \cite{gudbjartsson_rician_1995}. This bias affects the fitting of any diffusion model at high gradient values \cite{gudbjartsson_rician_1995}. Taking advantage of our MP-PCA procedure, the DESIGNER pipeline suggests using the estimated noise level at each voxel to estimate the expected value of the true voxel intensity signal as described by \cite{koay_analytically_2006}, as it has been shown that denoising using MP-PCA returns a proxy expectation value of measured magnitude intensity \cite{veraart_denoising_2016}

\subsubsection{B1 inhomogeneity correction}
The signal intensity of MR images can be spatially biased due to radiofrequency (RF) field inhomogeneities caused by high-density receiver coils, often named $B_1$ bias field. This bias often persists through voxels of the same tissue type, and can ultimately affect the final tensor fitting as well. In DESIGNER, it is recommended to estimate this bias field based on the mean $b=0$ image and apply the field correction to all volumes \cite{zhang_segmentation_2001,smith_advances_2004,tustison_n4itk_2010}.

\subsection{Pipetography}
While all the diffusion MRI preprocesssing procedures discussed above are by no means recent advances in digital image procesing, the effort to create accessible and standardized tools has hindered the usability of each methodology. First, tracking down working code and data associated with manuscripts is an impossible task, and the quality of shared code is fully dependent on efforts of the authors. The original DESIGNER publication \cite{ades-aron_evaluation_2018} provides a simple script for executing the recommended steps in serial, but did not concern themselves with reusability, reproducibility, and data provenance. Since then, \url{https://brainlife.io} has adopted the DESIGNER pipeline as a standalone module on their publicly accessible cloud computing platform. Brainlife adopts data and code reproducibility principles and is focused on provenance tracking, however, users are limited by inflexible inputs, finite shared computing resources and remote data storage. Overall, there is still a need for an end-to-end tool that takes input diffusion MRI data and outputs network derivatives in a standardized generalizable fashion.

\emph{Pipetography} (Pipeline for tractography) is an open source Python library that accepts standardized Brain Imaging Data Structure (BIDS) datasets \cite{gorgolewski_brain_2016} for pre- and post-processing of anatomical and diffusion MRI data. We utilized the Python workflow engine Nipype \cite{gorgolewski_nipype_2011} and its interfaces capabilities with different neuroimaging tools to create a parallelizable standardized workflow for diffusion MRI data processing. The Python library is hosted on the Python package index online for download, whereas documentation, version control, basic testing are hosted through GitHub at \url{https://github.com/axiezai/pipetography}. The library consists of interfaces that interact with \emph{FSL} \cite{Jenkinson2012}, \emph{ANTS} \cite{avants2009advanced}, and \emph{mrtrix3} \cite{tournier_mrtrix3_2019} for image processing. To improve usability of the library, we also provide containerized images in both Singularity and Docker formats, so users do not need to install all three neuroimaging tools separately. Here, we summarize the inputs and workflows implemented in pipetography and recommend visiting the pipetography webpage for a full working example of diffusion data processing.

\subsubsection{BIDS}
Despite the fact that MR modality images are routinely acquired for neuroimaging research, there has been no widely adopted standard for organizing and describing the data collected in an imaging experiment. Not only are standardized file naming conventions rarely found within labs, but proper documentation of acquisition protocols and scanner parameters are also often left to individual lab's preferences. This renders sharing and reusing data (within or between labs) difficult if not impossible, and creates an unnecessary barrier that complicates the application of automated pipelines.

The Brain Imaging Data Structure (BIDS) is a standard for organizing and describing MRI datasets. The BIDS standard uses file formats compatible with existing software, unifies the majority of practices already common in the field, and captures the metadata necessary for most common data processing operations. BIDS naming standard (See Figure \ref{fig:bids}) not only provides human understandable names for all imaging outputs, but also provides a way to manage data curation without the need to install and maintain an additional software application. Additionally, data description and neuroimaging meta data is easily accessible through JSON files for reading and usage in neuroimaging tools.

\begin{figure}[htbp]
    \centering
    \includegraphics[width=\textwidth]{../figures/chapter2/bids.png}
    \caption{BIDS Structured Dataset Example}
    \caption*{BIDS is a format for standardizing and describing outputs of neuroimaging experiments (left) in a way that is intuitive to understand and easy to use with existing analysis tools (right).}
    \label{fig:bids}
\end{figure}

Unlike other neuroimaging data mangement tools that has not been widely adopted, the BIDS approach provides a very simple naming convention scheme that can be easily employed when converting from scanner DICOM files to Nifti images. Additionally, there exists an ecosystem of BIDS related tools to assist adopting to the standard, and ease execution of commonly used neuroimaging workflows. The suite of BIDS applications simply reads the BIDS folder layout and extracts necessary meta data to minimize human error and maximize adaptation.

In \emph{pipetography}, we adapted the BIDS standard so that users can simply provide a directory as input, and the BIDS meta data files alongside the naming convention will allow a layout of subjects and scanning session combinations to be created. All  subject-session combinations will construct a workflow graph to execute processing steps, and the entire workflow for the dataset is automatically parallelized across subjects with the help of Nipype. Subsequently, all outputs will be saved according to the BIDS standard as well, with intermediate files saved for provenance. Next, we will summarize the modules implemented for end-to-end processing of a diffusion BIDS dataset.

\subsubsection{Anatomical Images}
The pipeline is initialized by a \emph{PyBIDS} \cite{yarkoni_tal_2021_5295700,yarkoni_pybids_2019} assisted reading of the BIDS dataset layout, including validation of all file naming and meta data for fulfillment of the required BIDS specifications. With this layout framework, the only required input from users is the BIDS dataset location, workflow graph is automatically created for all subjects and sessions with Nipype. If given enough processing resources (number of CPU's), both anatomical and diffusion MRI processing steps will be executed in parallel as long as pre-requisite inputs are found. The full processing pipeline is illustrated in Figure \ref{fig:pipeline}, with the anatomical steps summarized in red.

The goal of anatomical MRI processing is to obtain a high resolution brain volume in the standard coordinate space established by the Montreal Neurological Institute (MNI) \cite{brett_problem_2002}. Each subject's anatomical MRI volume is transformed and co-registered to the MNI template brain provided by \emph{FSL}, and after skull stripping and brain extraction, a 5 tissue type segmentation is performed \cite{patenaude_bayesian_2011} to create a binary mask MRI volume highlighting the gray matter white matter interface (GMWMI). The GMWMI voxels will be used as the starting positions for tractography and white matter fiber streamline generation.

\begin{figure}[htbp]
    \centering
    \includegraphics[width=\textwidth]{../figures/chapter2/fullpipeline.png}
    \caption{Processing pipeline overview}
    \caption*{Anatomical MRI preprocessing pipeline (left), diffusion MRI pipeline (middle), and connectome generation (right). The anatomical pipeline feeds its outputs into intermediate steps of the diffusion MRI pipeline. The connectomes pipeline uses diffusion MRI derived fiber tractograms and standard atlases to compute connectivity statistics.}
    \label{fig:pipeline}
\end{figure}

\subsubsection{DWI}
The diffusion weighted image (DWI) module (Figure \ref{fig:pipeline}, middle) consists of the DESIGNER recommended steps and a few add-on steps to prepare for tractography. In addition to the previously discussed DESIGNER steps, the workflow uses the anatomical module outputs to transform the DWI volume as well as its directional gradients into MNI space, and resamples the voxels to match the voxel grids of the MNI standard. Brain masks, mean $b0$ volumes, and skull stripped DWI images will be outputted in BIDS naming convention, a full example output tree is shown in Figure \ref{fig:outputs}.

\begin{figure}[htbp]
    \centering
    \includegraphics[width=\textwidth]{../figures/chapter2/outputs.png}
    \caption{Example pre-processing output file tree}
    \caption*{Following BIDS specifications, the pre-processing outputs are placed in a \emph{derivatives} folder inside the BIDS directory. The \emph{graph} folder has images illustrating the constructed workflow graph that was executed for each subject and session. For each session, a \emph{preprocessed} folder is created to organize all anatomical and DWI derived outputs.}
    \label{fig:outputs}
\end{figure}

\subsubsection{Connectomes}
The goal of our research is to use connectome profiles as anatomical information for structure-function modeling of brain activity. Therefore, the last step of the pipeline is to obtain connectivity strength matrices and corresponding distance adjacency matrices in pairs. These matrices consist of rows and columns corresponding to parcellated regions in a chosen atlas image, where voxels belonging to a region of interest (ROI) are marked by integer labels instead of MR signal intensities. For each input atlas image, a separate workflow is created to linearly (affine transform) co-register and nonlinearly (warping) co-register the image to the DWI in MNI space. Meanwhile, white matter modeling is performed with a spherical deconvolution approach \cite{jeurissen_multi-tissue_2014,tournier_direct_2004}. However, the density of reconstructed connections is not reflective of the density of underlying white matter fibers. Therefore, we implement the spherical-deconvolution informed filtering of tractograms (SIFT) method to determine a subset of the streamlines reconstruction such that the streamlines densities throughout the white matter are as close as possible to fiber densities estimated using the spherical deconvolution diffusion model \cite{smith_sift2_2015}. In particular, the SIFT2 implementation by \emph{mrtrix3} determines an appropriate cross-sectional area multiplier for each streamline rather than removing streamlines altogether, and biologically accurate measures of fiber connectivity are obtained by making use of the complete streamlines reconstruction.

\begin{figure}[htbp]
    \centering
    \includegraphics[width=\textwidth]{../figures/chapter2/connectomes.png}
    \caption{Example pre-processing output file tree}
    \caption*{Connectivity strength matrix (left) and distance adjacency matrix (right) for the 246 ROIs of the brainnectome atlas, showing strongly connected regions are closely located.}
    \label{fig:omes}
\end{figure}

% Transition paragraph to tractography/streamlines
Finally, the connectomes are constructed from input tractograms and parcellation images, weighted by SIFT2's output metrics. The final connectomes are stored in a \emph{connectomes} folder next to \emph{preprocessed} as \emph{.csv} files. An example output for the 246 regions \emph{brainnectome} atlas \cite{fan_human_2016} is shown in Figure \ref{fig:omes}. Next, we will recommend the latest addition in white matter tractogram computation.

\section{Tractography}
Tractography based on diffusion-weighted MRI provides non-invasive in vivo estimates of trajectories of long-range brain connections. These estimates are important in research that measures individual differences in brain connections and in clinical use-cases. But the computational demands of tractography present a barrier to progress. Here, we present a GPU-based tractography implementation that accelerates tractography algorithms implemented as part of the Diffusion Imaging in Python (DIPY) project. This implementation speeds up tractography by at least a factor of ~200X, providing tractographies that closely match CPU-based solutions. These speedups enable applications of tractography in clinical data, and in very large datasets.

\subsection{GPU-accelerated Diffusion MRI Tractography in DIPY}
DIPY (Diffusion Imaging in Python; \url{https://dipy.org}) is an open-source software library that implements many methods in computational neuroanatomy \cite{garyfallidis_dipy_2014}. Relying on the DIPY implementation of residual bootstrap tractography \cite{berman_probabilistic_2008}, we implemented a multi-GPU parallelizable version constructed on NVIDIA’s CUDA application programming interface (API).  The API of the GPU version is compatible with the one implemented in DIPY, enabling direct comparisons and interoperability. A docker container of the software makes the installation and use of the software straightforward. The software is available at \url{https://github.com/dipy/GPUStreamlines}. Experiments to profile the performance of the algorithm were conducted using an AWS $p3.16\textrm{xlarge}$ instance with 8 NVIDIA Tesla V100 Graphical Processing Units and 488 GB RAM. For comparison, CPU code was run on an AWS $x1e.4\textrm{xlarge}$ with 488 GB RAM. We used two datasets, the first is a HARDI acquisition with 2x2x2 mm3 isotropic voxels, 150 b=1,000 s/mm2 volumes and 10 b0 volumes previously described in \cite{rokem_evaluating_2015}. The other dataset was a Super-Resolution Hybrid Diffusion Imaging  (HYDI) dataset \cite{Garyfallidis2019}, with an effective resolution of 0.625 mm3 isotropic voxels, b=500, 800, 1600, 2600 s/mm2, in 134 diffusion directions, and 8 b0 volumes, also previously described in \cite{elsaid_super-resolution_2019}. In both cases, 27 seeds were placed in each voxel in the white matter to initialize tracking.

\subsection{Results}
In the HARDI dataset, with the seeding approach used
here, approximately 2.1M streamlines were generated. Using the CPU-based
residual bootstrap tracking algorithm took approximately 13 hours. The
GPU-accelerated implementation provides approximately 200-fold speedup
with a single GPU, and up to 671-fold speedup with 8 GPUs run in
parallel (Figure \ref{fig:gpu_speedup}). In the HYDI dataset, the seeding approach used generated 150M streamlines (497GB). Tracking in this case with 8 GPU
completed in just under 2 hours. A subset of the HYDI streamlines are
shown in Figure \ref{fig:gpu_streamlines}.

\begin{figure}[htbp]
    \centering
    \includegraphics[width=\textwidth]{../figures/chapter2/speedup.png}
    \caption{GPU streamline generation speedup compared to CPU}
    \caption*{For the same task (HARDI data, 27 seeds per WM voxel) tractography duration decreases with the number of GPUs available. Speedup relative to CPU ranges from approximately 200-fold, with one GPU to almost 700-fold with 8 GPUs.}
    \label{fig:gpu_speedup}
\end{figure}

\begin{figure}[htbp]
	\centering
	\includegraphics[width=\textwidth]{../figures/chapter2/streamlines.png}
	\caption{Visualization of GPU generated streamlines.}
	\caption*{GPU-accelerated tractography of high-resolution data, acquired at 0.625 mm3  effective resolution. This is a small subset sampled randomly for visualization purposes: approximately 8M streamlines of the 150M streamlines tracked.}
	\label{fig:gpu_streamlines}
\end{figure}

\subsection{Discussion and Conclusion}
A GPU-based implementation of residual bootstrap tractography provides orders of magnitude speedup, relative to the CPU-based version, while providing solutions that match CPU-based solutions very closely. This was demonstrated in standard and high-resolution measurements. Thus, this GPU-based implementation allows
researchers to both (1) save time and money solving existing problem
sizes and (2) solve new problems that are computationally intractable on
CPU-only resources. Open-source software is provided, as well as a
docker container that encapsulates the software, together with all of
its dependencies available at
\url{docker.pkg.github.com/dipy/gpustreamlines/gpustreamlines}.


\documentclass[10pt,oneside,onecolumn,letterpaper]{article}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage[hidelinks]{hyperref}
\usepackage{booktabs}
\usepackage{adjustbox}

\usepackage[top=.5in, bottom=1in, left=.5in, right=.7in]{geometry}

\usepackage{fontspec}
\setmainfont{Arial}

\begin{document}

%%
% THIS IS THE HEADER
%%
\noindent\colorbox{black}{
\begin{minipage}[c]{.99\linewidth}
  \vspace{.4cm}
  \Large{\color{white}{\textbf{\hspace{.3cm}University of Massachusetts Boston}}}
  \begin{flushright}
    \vspace{-1.2cm}
    \includegraphics[width=3cm]{gfx/cs460.png}
  \end{flushright}
\end{minipage}
}

%%
% CONTENT STARTS HERE
%%

\vspace{.5cm} % add some space

\noindent\textbf{CS460 Fall 2019} \\
\textbf{Name:} Jared Barresi \\
\textbf{Student ID:} 00974358 \\
\textbf{Due Date:} 09/23/2019
\section*{Assignment 3: Three.js Cubes ... and other geometries}

\textbf{We will use Three.js to create multiple different geometries in an interactive fashion.}

\vspace{.5cm} % add some space

In class, we learned how to create a \url{THREE.Mesh} by combining the \url{THREE.BoxBufferGeometry} and the \url{THREE.MeshStandardMaterial}. We also learned how to \emph{unproject} a mouse click from 2D (viewport / screen space) to a 3D position. This way, we were able use the \url{window.onclick} callback to move a cube to a new position in the 3D scene. Now, we will extend our code.

\vspace{.5cm}

The goal of this assignment is to create multiple different geometries by clicking in the viewport. This means, rather than moving an existing mesh, we will create new ones in the \url{window.onclick} callback. On each click, our code will randomly choose a different geometry and a random color to place the object at the current mouse position.

\vspace{.5cm} % add some space

\noindent \textbf{We will be using six different geometries. Before we start coding, we want to understand their parameters. Please complete the table below.} You can find this information in the Three.js documentation at \url{https://threejs.org/docs/} (scroll down to Geometries). In most cases, we only care about the first few parameters (\textbf{please replace the Xs}).

\vspace{.5cm} % add some space

\begin{tabular}{lr}
    \toprule
    Constructor & Parameters \\
    \midrule
    \textbf{THREE.BoxBufferGeometry} & ( width, height, depth ) \\
    \textbf{THREE.TorusKnotBufferGeometry} & ( radius, tube, tubularSegments, radialSegments ) \\
    \textbf{THREE.SphereBufferGeometry} & ( radius, widthSegments, heightSegments ) \\
    \textbf{THREE.OctahedronBufferGeometry} & (radius) \\
    \textbf{THREE.ConeBufferGeometry} & ( radius, height ) \\
    \textbf{THREE.RingBufferGeometry} & ( innerRadius, outerRadius, thetaSegments )
\end{tabular}

\vspace{.5cm} % add some space

\textbf{Please write code to create one of these six geometries with a random color on each click at the current mouse position.} We will use the \url{SHIFT}-key to distinguish between geometry placement and regular camera movement. Copy the starter code from \url{https://cs460.org/shortcuts/08/} and save it as \textbf{03/index.html} in your github fork. This code includes the \url{window.onclick} callback, the \url{SHIFT}-key condition, and the \url{unproject} functionality.

\vspace{.5cm} % add some space

\noindent After six clicks, if you are lucky and you don't have duplicate shapes, this could be your result:

\begin{center}
    \includegraphics[width=.7\textwidth]{gfx/for-each-shapes.png}
\end{center}

\noindent\textbf{Please make sure that your code is accessible through Github Pages. Also, please commit this PDF and your final code to your Github fork, and submit a pull request.}

\vspace{.5cm} % add some space

Link to your assignment: \url{https://hltdev8642.github.io/cs460student/03/index.html}

\clearpage %%% new page for bonus questions

\noindent\textbf{Bonus (33 points):}

\vspace{.5cm} % add some space

\noindent Part 1 (5 points): Do you observe Z-Fighting? If yes, when?

\\~\\
Yes.
It is seen most at the points in the scene that have the highest density of geometries, or regions in which there are many overlapping objects/polygons.
\vspace{1cm}

\begin{center}
    \includegraphics[width=1.0\textwidth]{gfx/z-fighting-investigation-image-1.png}
\end{center}

\vspace{3cm}

\clearpage

\noindent Part 2 (10 points): Please change \url{window.onclick} to \url{window.onmousemove}. Now, holding \url{SHIFT} and moving the mouse draws a ton of shapes. Submit your changed code as part of your \url{03/index.html} file and \textbf{please replace the screenshot below with your drawing}.

\begin{center}
    \includegraphics[width=.5\textwidth]{gfx/shape-galaxy-screenshot-1.png}
    \includegraphics[width=.5\textwidth]{gfx/shape-galaxy-screenshot-2.png}
    \includegraphics[width=.5\textwidth]{gfx/shape-galaxy-screenshot-3.png}
    \includegraphics[width=.5\textwidth]{gfx/shape-galaxy-screenshot-4.png}
\end{center}

\vspace{2cm} % add some space

\noindent Part 3 (18 points): Please keep track of the number of placed objects and print the count in the JavaScript console. Now, with the change to \url{window.onmousemove}, after how many objects do you see a slower rendering performance?
\\~\\
\noindent I honestly couldn't reach a number that it started to decline. The count I was at however was at 3441 objects and there still was very little noticeable drop in performance.

\vspace{.5cm}

\noindent However I realized through use of the Application/Memory inspector in chrome that my visual assessment of performance was probably not too accurate, as the trace revealed a very well-defined point in the runtime when the performance decreased.

\vspace{.5cm}
(***See screenshot below***)
\vspace{1cm}

\begin{center}
    \includegraphics[width=1.0\textwidth]{gfx/performance-monitor-check-1.png}
\end{center}

\vspace{1cm}

\clearpage

\noindent What happens if the console is not open during drawing?
\\~\\
\noindent The performance \textit{may} have increased slightly, however it was nothing too significant if any. Also, it would be difficult to use the performance monitor (to check the performance), as this is ironically part of the console/inspector panel...
\vspace{1cm}

\noindent Can you estimate the total number of triangles drawn as soon as slow-down occurs?
\\~\\
\noindent A lot....
\vspace{.5cm}

\noindent Using the console command "renderer.info.render.triangles", I was able to determine that for one of each type of geometry the total number of triangles is \textbf{4164}.

\vspace{.5cm}

\noindent If we assume the slowdown happened at 3241 objects (as mentioned prior), that would be:
\noindent\textbf{4164 triangles per iteration X 3241 / 6 objects per iteration = (3241/6) * 4164}
\vspace{.5cm}

\noindent\underline{= A GRAND TOTAL OF (APPROX):} \textbf{1750140 triangles}

\end{document}


\documentclass[../PHYS306Notes.tex]{subfiles}

\begin{document}
\section{Lecture 2}
\subsection{Lecture Notes - Lagrangian Mechanics Part 2}
\subsubsection{Review of Variational Principle}
Variational principle. We want to minimize a functional (that takes in a function as an argument), by finding stationary points. This is reminiscent of the process of finding extremum in elementary/single variable calculus, where if we move slightly away from the point, we don't change the function very much. Now, we generalize this notion to a function space, where if we change the function slightly, we do not change the functional very much.

\noindent We want to derive that the shortest path between two points is a straight line (no objections general relativists!). We consider the variation $y(x) + \alpha\eta(x)$ around the true path $y(x)$. Look at worksheet one for the solutions/walkthrough of this.
\end{document}


% \documentclass[10pt,t,presentation,ignorenonframetext,aspectratio=169]{beamer}
\documentclass[10pt,t,handout,ignorenonframetext,aspectratio=169]{beamer}
\usepackage[default]{lato}
\usepackage{tk_beamer1}
\input{tk_packages}
\input{tk_macros}
\input{tk_environ}
\input{tk_ximera}
\usepackage{wasysym}            % for smiley
\newcommand{\zoz}{$\mathbf{ \frac{0}{0} }$}

% some inverse trigs
\DeclareMathOperator{\arcsec}{arcsec}
\DeclareMathOperator{\arccot}{arccot}
\DeclareMathOperator{\arccsc}{arccsc}

%%%% META DATA
\newcommand{\semester}{Autumn 2021}
\newcommand{\course}{Math 1151}
\newcommand{\lecTitle}{Lecture 36: First Fundamental Theorem \\ of Calculus (FFTOC)}

%%%% TITLE PAGE
\title[\course]{\lecTitle}
\institute[Ohio State]
{
  \medskip
}
\date[\week]{\semester}
\author{Tae Eun Kim, Ph.D.}

\begin{document}
\begin{frame}
  \titlepage
\end{frame}

\subsection{Accumulation Function}
\begin{frame}
  \frametitle{Accumulation functions}
  \begin{defn}
    Given a function $f$, an \textbf{accumulation function} is
    \[
      F(x) = \int_a^x f(t) \; dt
    \]
  \end{defn}

  \begin{itemize}
  \item It calculates the signed area of the region between $y = f(t)$ and $t$-axis over the interval $[a, x]$ where the location of right-endpoint is now a variable.
  \end{itemize}
\end{frame}

\begin{frame}
  \vs
  \begin{example}[Rectangles]
    Let $\ds F(x) = \int_{-3}^x 4 \; dt$. What is $F(5)$? What is
    $F(-5)$? What is $F(x)$?
  \end{example}
\end{frame}

\begin{frame}
  \vs
  \begin{example}[Trapezoid]
    Let $\ds F(x) = \int_0^x (2t+1) \; dt$. Find $F(x)$.
  \end{example}
\end{frame}

\begin{frame}
  \vs
  \begin{example}[Monotonicity of accumulation function]
    Let $\ds F(x) = \int_{-1}^x t^3 \; dt$. On the interval $[-1, 1]$,

    \begin{enumerate}
    \item Where is $F$ increasing/decreasing?
    \item When does $F$ have local
      extrema?
    \item Answer the same questions with the interval replaced by
      $(-\infty, \infty)$.
    \end{enumerate}
  \end{example}
\end{frame}

\subsection{The First Fundamental Theorem of Calculus}

\begin{frame}
  \frametitle{Motivation}
  Let $f$ be a continuous function on the real numbers and consider
  \[
    F(x)= \int_a^x f(t)\; dt \,.
  \]
  We know that
  \begin{itemize}
  \item $F$ is increasing when $f$ is positive;
  \item $F$ is decreasing when $f$ is negative.
  \end{itemize}

  It is also clear that
  \begin{itemize}
  \item $F$ is concave up when $f'$ is positive;
  \item $F$ is concave down when $f'$ is negative.
  \end{itemize}

  There must be a deep connection between $F'$ and $f$.
\end{frame}

\begin{frame}
  \frametitle{The First Fundamental Theorem of Calculus}
  \begin{thm}[First Fundamental Theorem of Calculus, FTC1]
    Suppose that $f$ is continuous on the real numbers and let
    \[
      F(x) = \int_a^x f(t) \; dt \,.
    \]
    Then
    \[
      F'(x) = \ddx \int_a^x f(t) \; dt = f(x) \,.
    \]
  \end{thm}

  \textbf{Interpretation.}
  \begin{itemize}
  \item An accumulation function of $f$ is an antiderivative of $f$.
  \item The rate at which the accumulated area under a curve grows is precisely described by the curve itself.
  \end{itemize}
\end{frame}

\begin{frame}
  \vs
  \red{\textit{The idea of proof}.}
  Assume $h>0$. Note that $F(x+h) - F(x)$ is the net area of the region whose base
  is $[x, x+h]$ since
  \[
    F(x+h) - F(x) = \int_x^{x+h} f(t) \; dt \,.
  \]
  For sufficiently small $h$, the region is approximately rectagular
  and so this region is approximately $f(x) h$, i.e.,
  \[
    F(x+h) - F(x) \approx f(x) h \,.
  \]
  Upon division by $h$, we obtain
  \[
    \frac{F(x+h) - F(x)}{h} \approx f(x) \,,
  \]
  which, in the limit as $h \to 0$, yields
  \[
    F'(x) = \lim_{h\to0} \frac{F(x+h) - F(x)}{h} = f(x) \,,
  \]
  as required. \qed{}
\end{frame}

\begin{frame}
  \frametitle{Derivatives of composed accumulation functions}

  The following variation of the FTC1 is noteworthy:
  \[
    \ddx \int_a^{g(x)} f(t) \; dt = f(g(x)) g'(x) \,.
  \]
\end{frame}

\begin{frame}
  \vs
  \question{} Find the derivative of
  \begin{enumerate}
  \item  $\ds \int_2^{x^2} \ln t \; dt$.
    \vfill
  \item $\ds \int_{\cos x}^{5} t^3 \; dt$.
    \vfill
  \item $\ds \int_{x^2}^x f(t) \; dt$.
    \vfill
  \end{enumerate}
\end{frame}

\end{document}
%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End: