%======================================================================%
% Filename: Article.tex
% Project: Insight Journal Article - LookAt and ObliqueSection
% Author: Dan Mueller - d.mueller[at]qut.edu.au, dan.muel[at]gmail.com
% Date: $Date$
% Revision: $Revision$
%----------------------------------------------------------------------%
% Description:
% This artcile is for the Insight Journal.
% It describes a LookAt transform and ObliqueSection filter.
%======================================================================%
\documentclass{InsightArticle}

%\usepackage{courier}                 %Font
%\usepackage{charter}                 %Font
%\usepackage{times}                   %Font
%\usepackage{newcent}                 %Font
%\usepackage{pslatex}                 %Font
%\usepackage{lmodern}                 %Font
%\usepackage{palatino}                %Font
%\usepackage{bookman}                 %Font
\usepackage{amsfonts}                 %Maths fonts
\usepackage{amssymb}                  %Maths symbols
\usepackage{listing}                  %Used for list of listings
\usepackage{listings}                 %List program code source
\usepackage{subfigure}                %For subfigures
\usepackage{color}                    %Allow color
\usepackage{fancyhdr}                 %Use headers and footers
\usepackage{graphicx}                 %Graphics
\usepackage{ccaption}
\usepackage[dvipdfmx=true,
            bookmarks=true,
            bookmarksopen=true,
            bookmarksopenlevel=2,
            bookmarksnumbered=true,
            backref=section,
            colorlinks=true,
            linkcolor={blue},
            citecolor={blue},
            urlcolor={blue}]{hyperref}

%Set default font
%\renewcommand{\familydefault}{\rmdefault}  %Roman
\renewcommand{\familydefault}{\sfdefault}   %Sans serif
%\renewcommand{\familydefault}{\ttdefault}  %Typewriter

%Keywords
\newcommand{\keywords}[1]{\noindent\textbf{Keywords:}\it{\ #1}}

% TOC depth
\setcounter{tocdepth}{2}

%Stuff for images
\graphicspath{{images/}}

%Create indent for description
\newenvironment{indentdescription}
               {\list{}{\leftmargin \leftmargin}%
                \item\relax}
               {\endlist}
               
%Allow symbol footnotes
\long\def\symbolfootnote[#1]#2{\begingroup%
\def\thefootnote{\fnsymbol{footnote}}\footnote[#1]{#2}\endgroup}

% Center last line of captions
%\captionstyle{\centerlastline}

%Allow code listings
\input{listcode}                 

%Create conditional to include or exclude figures 
%(saves time during debug compilation).
\makeatletter
\newif\if@includefigs@
\@includefigs@true

%======================================================================%
%                   F r o n t   M a t t e r                            % 
%======================================================================%
% The title should be descriptive enough for people to be able to find
% the relevant document.
\title{LookAt Transform Initializer and\\Oblique Section Image Filter}

% Increment the release number whenever significant changes are made.
% The author and/or editor can define 'significant' however they like.
\release{1.0}

% Name and affiliation
\author{Dan Mueller$^{\scriptscriptstyle\textsf{1}}$}
\authoraddress{$^{\textsf{1}}$Queensland University of Technology, Brisbane, Australia}

% Set custom header style
\pagestyle{fancy}                               
\fancyhead{}            % clear all header fields
\fancyhead[L]{\textsf{LookAt Transform Initializer and Oblique Section Filter}}
\fancyhead[R]{\textsf{\thepage}}
\fancyfoot{}            % clear all footer fields

% Document
\begin{document}

% Show the title
\maketitle

% Make the title page header/footer empty
\thispagestyle{empty}

%======================================================================%
%                       A b s t r a c t                                % 
%======================================================================%
\begin{abstract}
\noindent
This paper describes the ITK implementation of a transform initializer
to produce a rigid 3-D transform able to center a given point on an
arbitrary plane.
The resultant transform allows the user to ``look at'' a point
from a given direction.
The resultant transform can also be used to obtain an oblique section:
a single arbitrary 2-D slice through a 3-D image.
%
\newline
\newline
\keywords{oblique section, plane, resample, ITK}

\end{abstract}

%======================================================================%
%                     M a i n   M a t t e r                            % 
%======================================================================%
\tableofcontents

%----------------------------------------------------------------------%
% Section
%----------------------------------------------------------------------%
\newpage
\section{Introduction}
An oblique section is an arbitrary 2-D plane through a 3-D image.
Such images are useful for a variety of visualization and image
processing tasks.
At present, ITK supports the resampling of an input image through
a given coordinate transform using the \code{itkResampleImageFilter}.
It is possible to use this filter to produce oblique sections:
the trick is to specify a suitable transform.

This paper describes a helper class \code{itkLookAtTransformInitializer}
allowing the user to specify a rigid 3-D transform for centering an object
(ie. for looking at a point).
The transform is initialized by specifying a centered plane:
the user must provide a center point, a direction to look along,
and a second vector --- called the ``up'' vector ---
that indicates which input axis is mapped to the output y-axis.
The initializer is based on the OpenGL \code{gluLooktAt(..)} function.
This paper also describes \code{itkObliqueSectionImageFilter}:
a filter encapsulating the use of the transform intializer for creating
2-D oblique sections from 3-D images.

%----------------------------------------------------------------------%
% Section
%----------------------------------------------------------------------%
\section{Implementation}

The \code{itkLookAtTransformInitializer} directly computes
the underlying $3\times3$ matrix, center point, and translation.
The matrix is specified by finding the axis orthogonal to the direction
and up vectors.
The center of the transform is the center point specified by the user.
The translation is computed using the center of the image.
See \href{http://developer.apple.com/documentation/Darwin/Reference/ManPages/man3/gluLookAt.3.html}{here}
for details regarding the OpenGL \code{gluLooktAt(..)} function.

The \code{itkObliqueSectionImageFilter} encapsulates the transform initializer,
resampling, and extraction. The internal \code{itkResampleImageFilter} is
configured to produce a one slice 3-D image and the internal \code{itkExtractImageFilter}
is used to extract the final 2-D image.
The default interpolation is linear, but this can be set by the user as desired.

The full source code, an example dataset, and tests are provided with this article.
Some results are depicted in \figurename~\ref{fig:Results:Tooth}.

\if@includefigs@
\begin{figure}[htb]
    \centering
    \subfigure[Direction: 0, 0, -1]{\label{fig:Results:Tooth:Norm::MIP}
    \includegraphics[height=3.75cm]{Tooth-Norm-MIP.png}}
    \hspace{2mm}
    \subfigure[Direction: 0, 0, -1]{\label{fig:Results:Tooth:Norm::Slice}
    \includegraphics[height=3.75cm]{Tooth-Norm-Slice.png}}
    \\
    \subfigure[Direction: 0, -0.5, -1]{\label{fig:Results:Tooth:01::MIP}
    \includegraphics[height=3.75cm]{Tooth-01-MIP.png}}
    \hspace{2mm}
    \subfigure[Direction: 0, -0.5, -1]{\label{fig:Results:Tooth:01::Slice}
    \includegraphics[height=3.75cm]{Tooth-01-Slice.png}}
    \\
    \subfigure[Direction: 0, -1, 0]{\label{fig:Results:Tooth:02::MIP}
    \includegraphics[height=3.75cm]{Tooth-02-MIP.png}}
    \hspace{2mm}
    \subfigure[Direction: 0, -1, 0]{\label{fig:Results:Tooth:02::Slice}
    \includegraphics[height=3.75cm]{Tooth-02-Slice.png}}
    \label{fig:Results:Tooth}
    \caption{Some resultant images using the transform initializer and oblique section filter.
             The first row depicts Maximum Intensity Projection (MIP) images
             and the second row depicts single slices.}
\end{figure}
\fi

%----------------------------------------------------------------------%
% Conclusion
%----------------------------------------------------------------------%
\section{Conclusion}

The source code accompanying this article provides a simple addition to ITK allowing
the user to initialize a transform for looking at a point from a given direction.
The transform initializer was used to construct an oblique section filter.
For suggestions or bugs, feel free to contact 
us\footnote{Corresponding author: Dan Mueller: %
\href{mailto:d.mueller@qut.edu.au}{d.mueller@qut.edu.au} or
\href{mailto:dan.muel@gmail.com}{dan.muel@gmail.com}.
}.

%======================================================================%
%                    B i b l i o g r a p h y                           % 
%======================================================================%
%\newpage
%\bibliographystyle{plain}
%\bibliography{article}

\end{document}
