\usepackage[htt]{hyphenat}% allow hyphen inside texttt to avoid overfull hbox warnings
\usepackage[english, french]{babel}
\usepackage[margin=0.5in]{geometry}% default margins are too big for my taste: too much wasted space http://kb.mit.edu/confluence/pages/viewpage.action?pageId=3907057
This action will let the user choose the directory that contains the input sequences. This directory is called \texttt{raw\_images\-\_root\_path}, and its value is stored in the user's home directory, in a file named \texttt{\textasciitilde/.fr.univ-rennes1\-.ipr.lipase.json}. This \texttt{raw\_images\-\_root\_path} is used by some other lipase imagej plugin menu items, so it's probably the first action the user is expeted to perform. Unless the user has multiple image databases, this action only requires to be performed once.
The directory chosen as is expected to contain sequences of images, with the proper accompanying metadata files (\texttt{display\_and\_comments.txt} and \texttt{metadata.txt}) saved by micromanager\footnote{\url{https://micro-manager.org/}}. An example of sequence database is shown in figure \ref{fig:input_images_layout}.
where $D$ is the dark image, $W$ the white image, $R$ the raw image and $P$ the preprocessed image, as explained below.
\begin{itemize}
\item Input data:
\begin{description}
\item [input image stack] the sequence of raw images that need to be preprocessed. For each pixel location, no value is expected to be outside the range defined by dark image and white image for that location.
\item [white image] the image that would be obtained if we were looking at a 100\% reflective material under the lighting and optic conditions that were used to capture raw sequence.
\item [dark image] the image that would be obtained if we were looking at a 0\% reflective material under the lighting and optic conditions that were used to capture raw sequence.
\end{description}
\item Output data:
\begin{description}
\item [uniform sequence] the preprocessed sequence after removal of lighting and optics non uniformity. In this preprocessed sequence, each pixel value is expected to be in the range $[0.0;1.0]$.
\end{description}
\end{itemize}
\subsubsection{Ipr/Lipase/Estimate White}
This action allows the user to estimate the white image from an opened sequence. The white image represents the maximum value each pixel can have, regardless what is observed. It's an image of light and optics non-uniformity. The algorithm comes from Matlab telemosToolbox's estimatewhiteFluoImageTelemos function and is documented in its comments.
This is only guaranteed to give a good white estimate if each pixel position of the sequence is hit by the maximum of light in at least one frame in the sequence.
This action performs a detection of globules in the given sequence, and for each image in the sequence, computes the area aof all globules. At the end of the computation, a graph showing the area of globules along time is displayed. Figure \ref{fig:trap_sequence1} shows an example sequence that can be processed with this action.
\begin{itemize}
\item Input data:
\begin{description}
\item [input image stack] the sequence of images containing particle-like globules evolving with time over a static background.
\item [background image] the image that will be used as a background image. This background image is expected to contain everything but the particles that we want to detect. If in your sequence, one of the images has no particle at all, it could be used as a background image.
\item [particle threshold] the threshold used to detect particles, expressed in grey levels.
\begin{itemize}
\item if set too high, the area of particles will be underestimated, as some particles will be either undetected or detected smaller than they actually are.
\item if set too low, the area of particles will be overestimated, as some of the background will be wrongly detected as particles, because the background is never completely static (noise, changes in illumination, etc.).
\end{itemize}
\end{description}
\item Output data:
\begin{description}
\item [area over time] this 1D-data shows the evolution of the detected globules area for each frame in the sequence. Note that the globules area is expressed as a coverage ratio of the detected globules in each image (its value is therefore in the range $[0;1]$).
\end{description}
\end{itemize}
Here's how it works:
\begin{itemize}
\item the sequence \texttt{diff} is computed by sustracting \texttt{background image} from \texttt{input image stack}
\item the sequence \texttt{abs\_diff} is computed as the absolute value of \texttt{diff}
\item the sequence \texttt{is\_globule} is computed by performing a threshold operator on \texttt{abs\_diff} with the threshold value {particle threshold}
\item\texttt{area over time} is computed by counting the number of non zero pixel values in each frame of \texttt{is\_globule}
This imagej plugin computes $g(p, r)$ and $\sigma(p, r)$ of the method described in section \ref{sec:circularness}
\begin{itemize}
\item Input data:
\begin{description}
\item [input image] an image containing particle-like globules
\item [maximal radius of globules] the maximum size of globule we expect to have in the input image, expressed in pixels. (the value of $R$ descibed in section \ref{sec:circularness}')
\item [number of radial sectors] (the value of $n_r$ described in section \ref{sec:circularness}')
\item [number of angular sectors] (the value of $n_a$ described in section \ref{sec:circularness}')
\end{description}
\item Output data:
\begin{description}
\item [$g(p, r)$] this is returned as an hyperstack, where the channel axis is used for the different values of $r$
\item [$\sigma(p, r)$] this is returned as an hyperstack, where the channel axis is used for the different values of $r$
\end{description}
\end{itemize}
\subsubsection{Ipr/Lipase/Detect globules}
This imagej plugin detects circular shaped particules in the input image, using the method described in section \ref{sec:circularness}
\begin{itemize}
\item Input data:
\begin{description}
\item [input image] an image containing particle-like globules
\item [mask image] image containing non-zero values for pixels that should be ignored. This is useful to ignore areas in the image that we know can't contain globules.
\item [maximal radius of globules] the maximum size of globule we expect to have in the input image, expressed in pixels. (the value of $R$ descibed in section \ref{sec:circularness}')
\item [number of radial sectors] (the value of $n_r$ described in section \ref{sec:circularness}')
\item [number of angular sectors] (the value of $n_a$ described in section \ref{sec:circularness}')
\item [max finder parameters] the max finder is used to detect peaks in the circularness image. See section \ref{sec:max_finder} for this algorithm and the meaning of its parameters.
\end{description}
\item Output data:
\begin{description}
\item [the position of detected globules] they are returned in the form of an imagej table and displayed as crosses in the selection layer of the input image.
Images have been acquired on the telemos microscope\footnote{\url{https://www6.inrae.fr/pfl-cepia/content/download/3542/34651/version/1/file/notes_TELEMOS.pdf}}.
\subsection{computing background image for trap sequences}
Trap sequences show traps at fixed positions with particles that move over time, as shown in figure \ref{fig:trap_sequence1}. In order to detect the particles, we can subtract from each image a background image, which is an image of the scene without any particle.
If we suppose that particles are moving fast enough, we can estimate this background image $B$, as :
The circularness of a pixel is defined by its likeliness of being the center of a circular symmetry. When we compute this circularness for each pixel, then we obtain what we call a circularness image.
The idea is that for each pixel $p$ we compute, treating this pixel to be a center of circular symmetry :
\begin{itemize}
\item the radial profile $g(p,r)$ (where $r$ is the radius from the center of the pixel) of the pixel values in the neighborhood of this pixel.
\item the radial profile standard deviation $\sigma(p,r)$ in the same neighborhood ($\sigma(p,r)$ is the standard deviation of the image on the circle centered on $p$ and of radius $r$)
\end{itemize}
Let $s_p$ being the contrast of the radial profile, computed as the standard deviation of the radial profile $g(p, r)$, and $a(p)$ the angular noise, computed as the standard deviation of $\sigma(p,r)$. Center of circular particles can then be detected at pixels where:
\begin{itemize}
\item the radial profile standard deviation $a(p)$ is small (which means there is a strong circular symmetry with this pixel as as center)
\item and the radial profile exhibits a strong peak (to not consider uniform areas as proper center of circular symmetry). The position of the peak gives the particle radius. $s(p)$ can be used as an estimator of the peak strongness.
\end{itemize}
The circularness $c(p)$ of pixel $p$ is computed as follow :
\begin{equation}
c(p) = w_s.s(p) - w_a.a(p)
\end{equation}
where $w_s$ and $w_a$ act as weighting parameters to give more importance to strong peaks or little noise along circles.
$g(p,r)$ and $\sigma(p,r)$ can be computed efficiently using convolution techniques. For this, the disc area around pixels is discretised into $n_r \times n_a$ areas, $n_r$ being the number of radial zones (the radial range $\lbrack0;R \rbrack$ around pixel $p$ is split into $n_r$ equal size zones), and $n_a$ the number of angular zones (the angular range $\lbrack0;2\pi\rbrack$ is split int $n_a$ angular sectors).
To understand the meaning of threshold and tolerance parameters, I had to look at the source code \footnote{\url{https://github.com/imagej/imagej1/blob/master/ij/plugin/filter/MaximumFinder.java\#L636}}
\begin{enumerate}
\item The algorithm first builds the list of maxima candidates. Only local maxima above this threshold are considered as valid maxima candidates
\item Then each maximum candidate is processed to find its neighborhood area, starting from the highest. For ecach candidate, a propagation is performed on neighbours as long as the neighbour value is within the tolerance of the maximum candidate. If another candidate is encountered as a neighbour, then this candidate is removed as it('s been absorbed by the current maximum candidate)
\end{enumerate}
\begin{description}
\item[threshold] local maxima below this value are ignored
\item[tolerance] ignore local maxima if they are in the neighborhood of another maximum. The neighborhood of a maximum is defined by the area that propagates until the the difference between the pixel value and the value of the considered local maximum exceeds tolerance. The higher the tolerance, the more local maxima are removed.