% ==============================================================
% ==============================================================
% ==============================================================

\newcommand\figQualitative{
\begin{figure*}[tb]
    \centering
    \hspace{12mm}
    \includegraphics[width=
    .9\textwidth]{figs/qualitative_Template_3.png}
    %\includegraphics[width=.9\textwidth,trim=0 600 0 0, clip]{figs/qualitative_Template2.png}
    \caption{\small
    Qualitative results. 
    \EmbedSeg and two baselines compared on representative images of the BBBC010 and Usiigaci datasets.
    Columns show: full input image, zoomed insets, ground truth labels (GT), and instance segmentation results by the 3-class U-Net baseline, the best performing competing baseline, and \EmbedSeg. 
    Note that each segmented instance is shown in a unique random color.
    }
    \label{fig:qualitative}
\end{figure*}
}

\newcommand\figAppendixMouseOrganoid{
\begin{figure*}[htb]
    \centering
    \begin{overpic}[width=1.0\textwidth]{figs/appendix/A3/mouse-organoid-combined}
    \put (27,29) {\color{white}\tiny\textbf{RAW}}
    \put (62,29) {\color{white}\tiny\textbf{GT}}
    \put (90,29) {\color{white}\tiny\textbf{\EmbedSeg}}
\end{overpic}
    \caption{\small
    Qualitative results of \EmbedSeg on the \Organoid dataset.
    Columns show orthogonal $XY$, $YZ$ and $XZ$ slices of one representative input image, ground truth labels (GT), and our instance segmentation results using \EmbedSeg, respectively. Note that each segmented instance is shown in a random but unique color. 
    }
    \label{fig:appendix-mouse-organoid}
\end{figure*}
}



\newcommand\figAppendixPlatyLive{
\begin{figure*}[htb]
    \centering
    \begin{overpic}[width=1.0\textwidth]{figs/appendix/A3/platy-live-combined}
    \put (27,29) {\color{white}\tiny\textbf{RAW}}
    \put (62,29) {\color{white}\tiny\textbf{GT}}
    \put (90,29) {\color{white}\tiny\textbf{\EmbedSeg}}
\end{overpic}
    \caption{\small
    Qualitative results of \EmbedSeg on the \PlatynereisLive dataset.
    Columns show orthogonal $XY$, $YZ$ and $XZ$ slices of one representative input image, ground truth labels (GT), and our instance segmentation results using \EmbedSeg, respectively. Note that each segmented instance is shown in a random but unique color. 
    }
    \label{fig:appendix-platy-live}
\end{figure*}
}


\newcommand\figAppendixMouseSkull{
\begin{figure*}[htb]
    \centering
    \begin{overpic}[width=1.0\textwidth]{figs/appendix/A3/mouse-skull-combined}
    \put (26, 42) {\color{white}\tiny\textbf{RAW}}
    \put (61, 42) {\color{white}\tiny\textbf{GT}}
    \put (90, 42) {\color{white}\tiny\textbf{\EmbedSeg}}
\end{overpic}
    \caption{\small
    Qualitative results of \EmbedSeg on the \MouseSkull dataset.
    Columns show orthogonal $XY$, $YZ$ and $XZ$ slices of one representative input image, ground truth labels (GT), and our instance segmentation results using \EmbedSeg, respectively. Note that each segmented instance is shown in a random but unique color. 
    }
    \label{fig:appendix-mouse-skull-two}
\end{figure*}
}





\newcommand\figAppendixPlatyFixed{
\begin{figure*}[htb]
    \centering
    \begin{overpic}[width=1.0\textwidth]{figs/appendix/A3/platy-fixed-combined}
    \put (17,28) {\color{white}\tiny\textbf{RAW}}
    \put (53,28) {\color{white}\tiny\textbf{GT}}
    \put (82,28) {\color{white}\tiny\textbf{\EmbedSeg}}
\end{overpic}
    \caption{\small
    Qualitative results of \EmbedSeg on the \PlatynereisFixed dataset.
    Columns show orthogonal $XY$, $YZ$ and $XZ$ slices of one representative input image, ground truth labels (GT), and our instance segmentation results using \EmbedSeg, respectively. Note that each segmented instance is shown in a random but unique color. 
    }
    \label{fig:appendix-platy-fixed}
\end{figure*}
}


\newcommand\figArchitecture{
\begin{figure*}[htb]
    \centering
    \includegraphics[scale=0.36]{figs/appendix/A4/vertical_architecture.png}
    
    \caption{\small
    Schematic representing the architecture of the used 3D Branched ERF-Net which accepts volumetric images with $C$ color channels. The encoder portion of the network has two branches: the first branch returns 6 outputs per pixel which represent the offsets and the clustering bandwidths in x, y and z dimensions. 
    The second branch returns one output per pixel which represents the `seediness' score of the pixel.
    }
    \label{fig:architecture}
\end{figure*}
}


\newcommand\figAppendixInference{
\begin{figure*}[h]
    \centering
    \hspace{12mm}
    \includegraphics[scale=0.6]{figs/appendix/A1/inference.png}
    \caption{\small
    \textbf{Visualization of inference procedure of \EmbedSeg.}
    An exemplary input image (top-left), we iteratively pick seed pixels greedily from the predicted seediness map (top-right) and cluster other foreground pixels \wrt their predicted embeddings as explained in Section \ref{sec:approach}.
    In the bottom left image we show: ground truth instances as a binary mask (white regions), the embedding location and clustering bandwidth (thresholded at a likelihood of $0.5$) of iteratively picked seed pixels (larger, semi-transparent ellipses), and the learnt spatial embedding locations (smaller dots inside ellipses) of 5 randomly chosen foreground pixels per predicted instance (colored plus signs).
    The final predicted instance segmentation result is shown in the bottom-right panel. 
    }
    \label{fig:appendix_clustering_visualization}
\end{figure*}
}
