Sunday, February 26, 2012

Table text with line break

\newcommand{\specialcell}[2][c]{%
\begin{tabular}[#1]{@{}c@{}}#2\end{tabular}}


\begin{figure}[htb]
\centering
\begin{minipage}[c]{0.6\textwidth}
\centering
\includegraphics[width=0.99\linewidth]{boxplot1.png}
\end{minipage}
%\hspace{0.2in}
\begin{minipage}[c]{0.35\textwidth}
\centering
\begin{tabular}{|l|c|c|}
\hline
&\specialcell{Median \\ time (ms)} & \specialcell{Median \\ error (mm)} \\ \hline
% &Median time(ms) & Median error(mm) \\ \hline
\specialcell{Random \\ Forest }& 343 & 34 \\ \hline
%\parbox[c]{1.2cm}{Our method} & 5 & 38 \\ \hline
\specialcell{Our \\ method} & 5 & 38 \\ \hline
\end{tabular}
\end{minipage}
\newline
\label{fig:single_organ}
\vspace{-0.2in}
\caption{Our dataset consists of 3D CT scans from different body portions and pathologies.}
\end{figure}

Table and Figure sitting side by side

\newcommand{\specialcell}[2][c]{%
\begin{tabular}[#1]{@{}c@{}}#2\end{tabular}}


\begin{figure}[htb]
\centering
\begin{minipage}[c]{0.6\textwidth}
\centering
\includegraphics[width=0.99\linewidth]{boxplot1.png}
\end{minipage}
%\hspace{0.2in}
\begin{minipage}[c]{0.35\textwidth}
\centering
\begin{tabular}{|l|c|c|}
\hline
&\specialcell{Median \\ time (ms)} & \specialcell{Median \\ error (mm)} \\ \hline
% &Median time(ms) & Median error(mm) \\ \hline
\specialcell{Random \\ Forest }& 343 & 34 \\ \hline
%\parbox[c]{1.2cm}{Our method} & 5 & 38 \\ \hline
\specialcell{Our \\ method} & 5 & 38 \\ \hline
\end{tabular}
\end{minipage}
\newline
\label{fig:single_organ}
\vspace{-0.2in}
\caption{Our dataset consists of 3D CT scans from different body portions and pathologies.}
\end{figure}