% in this chapter all plugins are described
%
\chapter{List of Filters and Plugins}
\newcommand\plugtabstart{\begin{tabular}{|p{0.1\columnwidth}|p{0.1\columnwidth}|p{0.5\columnwidth}|p{0.1\columnwidth}|}\hline}
This chapter lists all the plugins available in mona2d.
The descriptions follow the following pattern:
\begin{description}
\item [Plugin:]\emph{the name by which the plugin is selected on the command
line}
\item [Description:]A description of the filter
\item [Parameters:] a list of the plugin parameters
\plugtabstart
parameter name& parameter type& description of the parameter & default value\\\hline
\end{tabular}
\end{description}
\section{2D image filters}
\label{sec:plugins}
In this section the following notation is used: $g$ indicates the source image,
$\hat{f}$ is the output image, and $S_{xy}$ is the set of pixels that is covered by the filter mask.
For an in-depth discussion of most of the filters presented here, see, e.g., \citet{gonzales02:dip}.
\subsection*{adaptive median filtering}
\begin{description}
\item [Plugin:]\emph{adaptmed}
\item [Description:]The filter works is a smoothing filter that has the
advantage that is does not introduce new pixel values into the image
intensity range, see \emph{median filter} for details. The filter
width is set to 3 at the beginning is enlarged until the filtered
pixel value no longer is at the boundaries of the filter width intensity
range, or the maximum filter width is hit.
\item [Parameters:] w
\plugtabstart
w& integer& half maximum filter width (maximum width = 2w+1) & 0\\
\hline
\end{tabular}
\end{description}
\subsection*{adaptive mean filtering}
\begin{description}
\item [Plugin:]\emph{admean}
\item [Description:] Filter depending on local variation.
\item [Parameters:] w
\plugtabstart
w& integer& half maximum filter width (maximum width = 2w+1) & 0\\
\hline
\end{tabular}
\end{description}
\subsection*{Anisotropic diffusion}
\begin{description}
\item [Plugin:]\emph{aniso}
\item [Description:]Anisotropic diffusion is an iterative edge preserving
filter. Various edge stopping functions are supported (cf e.g. \citet{black98:aniso})
and the noise level can be deduced automatically, or set to a fixed
value.
\item [Parameters:] epsilon, iter, k , n, psi
\plugtabstart
epsilon & float & stopping criterion, iteration is ended, if the sum of all pixel intensity updates falls below that level & 1\\\hline
iter & integer& maximum number of iterations & 100\\\hline
k & float & the noise threshold - a value of 0 indicates automatic detection &0\\\hline
n & integer& neighborhood - 4 and 8 are supported &8\\\hline
psi & string & The edge stopping function tukey, pm1, pm2 & tukey\\\hline
\end{tabular}
\end{description}
\subsection*{Intensity based bandpass filter}
\begin{description}
\item [Plugin:]bandpass
\item [Description:]An intensity band pass filter - all pixels with intensities
outside the given range are set to zero, all other pixels remain the
same ($x:=x\in [min,max]\:?\: x\::\:0$
\item [Parameters:] min, max
\plugtabstart
min& float& lower bound of the bandpass range &0\\\hline
max& float& upper bound of the bandpass range &3.40282e+38\\\hline
\end{tabular}
\end{description}
\subsection*{Binarize}
\begin{description}
\item [Plugin:]\emph{binarize}
\item [Description:]A binarize filter - all pixels with intensities outside
the given range are set to 0, all other pixels are set to $x:=x \in [min,max]\:?\:1\::\:0$
\item [Parameters:] min, max
\plugtabstart
min& float& lower bound of the binarize range &0\\
\hline
max& float& upper bound of the binarize range &3.40282e+38\\
\hline
\end{tabular}
\end{description}
\subsection*{Class probability mapper}
\begin{description}
\item [Plugin:]\emph{classmap}
\item [Description:]Given a fuzzy c-means classification of the image based
on intensities, an probability image is created.
\item [Parameters:] class, map
\plugtabstart
class & integer & the class to be mapped &2 \\\hline
map & string & the probability map & (none) \\\hline
\end{tabular}
\end{description}
\subsection*{Distance Transform}
\label{sec:distance}
\begin{description}
\item [Plugin:]\emph{distance}
\item [Description:] Evaluate an image that represents an euclidian distance from the shape of the input image. The algorithm is based on \cite{felzenszwalb04dist}.
\item [Parameters:] scale
\plugtabstart
scale & float & scaling factor for the fixed poinmt arithmetic storage $\in$ [1, 1024] & 256 \\\hline
\end{tabular}
\end{description}
\subsection*{Integer to Byte Pixel Conversion}
\begin{description}
\item [Plugin:]\emph{conv2b}
\item [Description:] convert an image to unsigned byte pixel representation
\item [Parameters:] min, max
\plugtabstart
min & integer & lower intensity boundary, everything below will get mapped to black=0 &0\\\hline
max & integer & upper intensity boundary, everything above will get mapped to white=255 &2147483647 \\\hline
\end{tabular}
\end{description}
\subsection*{Image cropping}
\begin{description}
\item [Plugin:]\emph{crop}
\item [Description:] crop a certain region from an input image
\item [Parameters:] sx, sy, ex, ey
\plugtabstart
sx & integer & left boundary of the crop region &0\\\hline
sy & integer & upper boundary of the crop region &0 \\\hline
dx & integer & width of the crop region -1 = maximum possible width & -1\\\hline
sy & integer & height of the crop region -1 = maximum possible height &-1\\\hline
\end{tabular}
\end{description}
\subsection*{Image downscaling}
\begin{description}
\item [Plugin:]\emph{downscaler}
\item [Description:] downscale an image, the high frequency portions of the image are removed using a Gaussian filter
\item [Parameters:] dx, dy
\plugtabstart
dx & integer & width of target image &1\\\hline
dy & integer & height of target image &1 \\\hline
\end{tabular}
\end{description}
\subsection*{Extended Kuwahara filter}
\begin{description}
\item [Plugin:]\emph{extkuwa}
\item [Description:] an edge preserving filter, extending the original Kuwahara filter
\item [Parameters:] w
\plugtabstart
w & integer & filter width parameter &1\\\hline
\end{tabular}
\end{description}
\subsection*{Frequency Domain Filtering}
\begin{description}
\item [Plugin:]\emph{fft}
\item [Description:] frequency domain based filtering, the actual filter has to be specified by the
kernel parameter
\item [Parameters:] kernel
\plugtabstart
kernel & string & a description of the filter kernel (see Section \ref{sec:fftkernels}) & (none)\\\hline
\end{tabular}
\end{description}
\subsection*{Spacial Domain to Frequency Spectrum Conversion}
\begin{description}
\item [Plugin:]\emph{frequency}
\item [Description:] A conversion from the spacial domain to the frequency domain
\item [Parameters:] none
\end{description}
\subsection*{Gaussian Blurring}
\begin{description}
\item [Plugin:]\emph{gauss}
\item [Description:] the Gaussian smoothing filter
\item [Parameters:] w
\plugtabstart
w & integer & filter width parameter &1\\\hline
\end{tabular}
\end{description}
\subsection*{Harmonic Mean Filter}
\begin{description}
\item [Plugin:]\emph{harmmean}
\item [Description:] the Harmonic median filter $\hat{f}(x,y) = \frac{(2w+1)^2}{\sum_{(s,t) \in S_{xy}}\frac{1}{g(s,t)}}$
\item [Parameters:] w
\plugtabstart
w & integer & filter width parameter &1\\\hline
\end{tabular}
\end{description}
\subsection*{Kuwahara Filter}
\begin{description}
\item [Plugin:]\emph{kuwahara}
\item [Description:] the Kuwahara filter (use the extended Kuwahara filter instead)
\item [Parameters:] w
\plugtabstart
w & integer & filter width parameter & 1\\\hline
\end{tabular}
\end{description}
\subsection*{Label Mapping Filter}
\begin{description}
\item [Plugin:]\emph{labelmap}
\item [Description:] a filter to replace intensities (labels) in an image according to a given map
\item [Parameters:] map
\plugtabstart
map & string & the label map description file & (none)\\
\hline
\end{tabular}
\end{description}
\subsection*{Logarithmic Frequency Domain Filtering}
\begin{description}
\item [Plugin:]\emph{lnfft}
\item [Description:] logarithmic frequency domain based filtering, the actual filter has to be specified by the
kernel parameter. Logarithmic means, the natural Logarithmic function is applied
to the intensity values before the FFT, and the exponential function after the
back transformation. As a result, multiplicative frequency components become additive.
\item [Parameters:] kernel
\plugtabstart
kernel & string & a description of the filter kernel (see Section \ref{sec:fftkernels}) & (none)\\
\hline
\end{tabular}
\end{description}
\subsection*{Median Filter}
\begin{description}
\item [Plugin:]\emph{median}
\item [Description:] the median filter
\item [Parameters:] w
\plugtabstart
w & integer & filter width parameter & 1\\
\hline
\end{tabular}
\end{description}
\subsection*{Midpoint Filter}
\begin{description}
\item [Plugin:]\emph{midpoint}
\item [Description:] the midpoint filter
\item [Parameters:] w
\plugtabstart
w & integer & filter width parameter & 1\\
\hline
\end{tabular}
\end{description}
\subsection*{Mask Filter}
\begin{description}
\item [Plugin:]\emph{mask}
\item [Description:] Mask an image by a given input mask (binary image): $\hat{f}(x,y) = \text{mask}(x,y) ? g(x,y): 0$.
\item [Parameters:] mask
\plugtabstart
mask & string & the mask image & (none)\\
\hline
\end{tabular}
\end{description}
\subsection*{Morphological Operations}
\begin{description}
\item [Plugin:]\emph{close}, \emph{dilate}, \emph{erode}, \emph{open}
\item [Description:]The specified morphological operation.
Supported structuring elements are described in Section \ref{sec:2dshapes}.
\item [Parameters:] hint, shape
\plugtabstart
hint& integer& gives a hint whether the image will contain more white or more black pixels & black \\\hline
shape& string& the structuring element & {[}circle:r=1{]}\\\hline
\end{tabular}
\end{description}
\subsection*{Noise Simulation}
\begin{description}
\item [Plugin:]\emph{noise}
\item [Description:] Add noise to an image.
\item [Parameters:] g, m
\plugtabstart
g & string & noise generator, see Section \ref{sec:plugnoise} & [gauss:mu=0,sigma=10] \\\hline
m & integer &modulated noise & 0\\\hline
\end{tabular}
\end{description}
\subsection*{Probability based Region Growing}
\begin{description}
\item [Plugin:]\emph{regiongrow}
\item [Description:] Given an input image and a class probability map, connected regions are segmented.
The region growing is seeded by all pixels that have a probability higher then \emph{seed} in the
indicated \emph{class} as described in \emph{map}.
Pixels located in the 4 neighborhood of the growing region are added, if their
class probability is greater then \emph{low}.
\item [Parameters:] class, low, map, seed
\plugtabstart
class & integer & (tissue) class to be segmented & 2 \\\hline
low & float & lower probability threshold for the region growing & 0.5\\\hline
map & string & probability map & (none)\\\hline
seed & float & high probability threshold to seed the region growing & 0.9\\\hline
\end{tabular}
\end{description}
\begin{description}
\item [Plugin:]\emph{rgg}
\item [Description:] Given an input image and a class probability map, connected regions are segmented.
The region growing is seeded by all pixels that have a probability higher then \emph{seed} in the respective classes as described in \emph{map}.
Pixels located in the 4 neighborhood of the growing region are added in th eorder of lowest gradient.
\item [Parameters:] map, seed
\plugtabstart
map & string & probability map & (none)\\\hline
seed & float & high probability threshold to seed the region growing & 0.9\\\hline
\end{tabular}
\end{description}
\subsection*{Salt and Pepper Filter}
\begin{description}
\item [Plugin:]\emph{sandp}
\item [Description:] A salt and pepper noise remove filter that is based on the median filter.
The median filter is only applied to a pixel, if the difference between its original value and
the value resulting from the filter is larger then \emph{thresh}.
\item [Parameters:] w, thresh
\plugtabstart
w & integer & filter width parameter & 1\\\hline
thresh & float & the median application threshold & 10\\\hline
\end{tabular}
\end{description}
\subsection*{Thresh}
\begin{description}
\item [Plugin:]\emph{thresh}
\item [Description:] A filter to remove background noise by setting all pixels with an intensity less then
\emph{thresh} and with all neighboring pixels also below that threshold to zero.
This helps image compression and supports speeding up calculations.
\item [Parameters:] min, n
\plugtabstart
min & float & threshold value & 0\\\hline
n & integer & neighborhood out of $\{ 0, 4, 8 \}$ & 8\\\hline
\end{tabular}
\end{description}
\subsection*{Variation Image}
\begin{description}
\item [Plugin:]\emph{variation}
\item [Description:] Evaluate the variation of an image using a given window width \emph{w}.
\item [Parameters:] float, w, scale
\plugtabstart
float & integer & output the result as float valued image (useful for watershed algorithms),
otherwise use input pixel format & 0\\\hline
w & integer & window width parameter & 1\\\hline
scale &integer & scale variation to use full intensity range & 0\\\hline
\end{tabular}
\end{description}
\subsection*{Watershed algorithm V1}
\begin{description}
\item [Plugin:]\emph{ws}
\item [Description:] a watershed algorithm somewhat inspired by \citet{rodriguez05:water}.
It somehow tries to segment all classes at the same time.
\item [Parameters:] map, p, thresh, tol, w
\plugtabstart
p & float & decision parameter whether fuzzy segmentation or neighborhood should be used & 1.5\\\hline
thresh & float & threshold for seed probability & 0.9\\\hline
tol & float & tolerance for watershed & 0.8\\\hline
w & integer & window width for variation evaluation & 1\\\hline
\end{tabular}
\end{description}
\subsection*{Watershed algorithm V2}
\begin{description}
\item [Plugin:]\emph{watershed}
\item [Description:] another watershed algorithm somewhat inspired by \citet{rodriguez05:water}.
\item [Parameters:] class, map, p, thresh, tol, w
\plugtabstart
class & integer & class to be segmented & 2\\\hline
p & float &decision parameter whether fuzzy segmentation or neighborhood should be used & 1.5\\\hline
thresh & float & threshold for seed probability & 0.9\\\hline
tol & float & tolerance for watershed & 0.8\\\hline
w & integer & window width for variation evaluation & 1\\\hline
\end{tabular}
\end{description}
\subsection*{Weighted Mean Filter}
\begin{description}
\item [Plugin:]\emph{wmean}
\item [Description:] a weighed median filter
\item [Parameters:] hw, weight
\plugtabstart
hw & integer & filter width parameter & 1\\\hline
weight & float & the weight applied to the non-central pixels & 0.7 \\\hline
\end{tabular}
\end{description}
\section{2D Stack filter plugins}
\label{sec:2dstackfilters}
\subsection*{Gauss Filter}
\begin{description}
\item [Plugin:]\emph{gauss}
\item [Description:] the Gauss filter
\item [Parameters:] w
\plugtabstart
w & integer & filter width parameter & 1\\\hline
\end{tabular}
\end{description}
\subsection*{Extended Kuwahara Filter (Mean Least Variation)}
\begin{description}
\item [Plugin:]\emph{extkuwa}
\item [Description:] an edge preserving and enhancing filter, extending the original Kuwahara filter
\item [Parameters:] w
\plugtabstart
w & integer & filter width parameter & 1\\\hline
\end{tabular}
\end{description}
\subsection*{Parallized Extended Kuwahara Filter}
\begin{description}
\item [Plugin:]\emph{pextkuwa}
\item [Description:] an edge preserving filter, extending the original Kuwahara filter, parallized implementation - use only if you have really more
then one processor core to work with (Hyperthreading might improve performance as well).
\item [Parameters:] w
\item [Parameters:] threads
\plugtabstart
w & integer & filter width parameter & 1\\\hline
threads & integer & number of threads to use for working on the data, 0=use as many threads as processors are available on the system & 0 \\\hline
\end{tabular}
\end{description}
\subsection*{Connected Component Labelling}
\begin{description}
\item [Plugin:]\emph{label}
\item [Description:] A labelling filter to label connected components in a binary image.
\item [Parameters:] map
\plugtabstart
map & string & output to a recapping table to be able to relabel merged components (input to 2D filter labelmap) & (none)\\\hline
\end{tabular}
\end{description}
\subsection*{Median Filter}
\begin{description}
\item [Plugin:]\emph{median}
\item [Description:] the median filter
\item [Parameters:] w
\plugtabstart
w & integer & filter width parameter & 1\\\hline
\end{tabular}
\end{description}
\subsection*{Morphological Operations}
\begin{description}
\item [Plugin:] \emph{dilate}, \emph{erode}
\item [Description:]The specified morphological operation.
Supported structuring elements are described in Section \ref{sec:3dshapes}.
\item [Parameters:] hint, shape
\plugtabstart
hint& integer& gives a hint whether the image will contain more white or more black pixels & black \\\hline
shape& string& the structuring element & {[}sphere:r=1{]}\\\hline
\end{tabular}
\end{description}
\subsection*{Probability based Region Growing}
\begin{description}
\item [Plugin:]\emph{regiongrow}
\item [Description:] Given an input image and a class probability map, connected regions are segmented.
The region growing is seeded by all pixels that have a probability higher then \emph{seed} in the
indicated \emph{class} as described in \emph{map}.
Pixels located in the 4 neighborhood of the growing region are added, if their
class probability is greater then \emph{low}.
\item [Parameters:] class, low, map, seed
\plugtabstart
class & integer & (tissue) class to be segmented & 2 \\\hline
depth & integer & number of slices the filter keeps in memory in order to grow a region & 5\\\hline
low & float & lower probability threshold for the region growing & 0.5\\\hline
map & string & probability map & (none)\\\hline
seed & float & high probability threshold to seed the region growing & 0.9\\\hline
\end{tabular}
\end{description}
\section{Frequency Domain 2D Filter Kernels}
\label{sec:fftkernels}
\subsection*{Dummy}
\begin{description}
\item [Plugin:] \emph{dummy}
\item [Description:]a dummy kernel for testing purposes
\item [Parameters:] none
\end{description}
\subsection*{Band filter}
\begin{description}
\item [Plugin:] \emph{bandpass}, \emph{bandreject}
\item [Description:]Band pass and band reject kernels.
\item [Parameters:] f, w, m
\plugtabstart
f& float & band center frequency & 10.0\\\hline
w& float & band width & 10.0 \\\hline
m& string& a filter model out of \{ ideal, $\text{butterworth}^2$, gauss \} & gauss \\\hline
\end{tabular}
\end{description}
\subsection*{Low-/Highpass}
\begin{description}
\item [Plugin:] \emph{lowpass}, \emph{highpass}
\item [Description:]lowpass and high pass filter kernel
\item [Parameters:] f, w, m
\plugtabstart
f& float & cut-off frequency & 10.0\\\hline
m& string& a filter model out of \{ ideal, $\text{butterworth}^2$, gauss \} & gauss \\\hline
\end{tabular}
\end{description}
\section{2D Shapes}
\label{sec:2dshapes}
\subsection*{4n Neighborhood}
\begin{description}
\item [Plugin:] \emph{4n}
\item [Description:] the 4-n neighborhood shape
\begin{tabular}{|c|c|c|}
\hline
&X&\\
\hline
X&O&X\\
\hline
&X&\\
\hline
\end{tabular}
\item [Parameters:] none
\end{description}
\subsection*{8n Neighborhood}
\begin{description}
\item [Plugin:] \emph{8n}
\item [Description:] the 8-n neighborhood shape
\begin{tabular}{|c|c|c|}
\hline
X&X&X\\
\hline
X&O&X\\
\hline
X&X&X\\
\hline
\end{tabular}
\item [Parameters:] none
\end{description}
\subsection*{Circle}
\begin{description}
\item [Plugin:] \emph{circle}
\item [Description:] a disk shape
\item [Parameters:] r
\plugtabstart
r& float & radius of the disk & 1 \\\hline
\end{tabular}
\end{description}
\subsection*{Square}
\begin{description}
\item [Plugin:] \emph{square}
\item [Description:] a square shape (with the interior)
\item [Parameters:] w
\plugtabstart
w& int & edge length & 1 \\\hline
\end{tabular}
\end{description}
\section{3D Shapes}
\label{sec:3dshapes}
\subsection*{6n Neighborhood}
\begin{description}
\item [Plugin:] \emph{6n}
\item [Description:] the 6-n neighborhood shape
\item [Parameters:] none
\end{description}
\subsection*{18n Neighborhood}
\begin{description}
\item [Plugin:] \emph{18n}
\item [Description:] the 18-n neighborhood shape
\item [Parameters:] none
\end{description}
\subsection*{26n Neighborhood}
\begin{description}
\item [Plugin:] \emph{26n}
\item [Description:] the 26-n neighborhood shape
\item [Parameters:] none
\end{description}
\subsection*{Sphere}
\begin{description}
\item [Plugin:] \emph{sphere}
\item [Description:] a sphere shape (with interior)
\item [Parameters:] r
\plugtabstart
r& float & radius of the sphere & 1 \\\hline
\end{tabular}
\end{description}
\subsection*{Cube}
\begin{description}
\item [Plugin:] \emph{cube}
\item [Description:] a cube shape (with the interior)
\item [Parameters:] w
\plugtabstart
w& int & edge length & 1 \\\hline
\end{tabular}
\end{description}
\section{Noise Generator Plugins}
\label{sec:plugnoise}
The quality of the noise generators currently depends heavily on the quiality of the random generator
provided by the rand() function.
\subsection*{Gaussien Noise}
\begin{description}
\item [Plugin:] \emph{gauss}
\item [Description:] create Gaussian noise ( = normal distributed)
\item [Parameters:] mu, sigma
\plugtabstart
mu& float & mean value of noise distribution& 0 \\\hline
sigma & float & variance of noise distribution & 1 \\\hline
\end{tabular}
\end{description}
\subsection*{Uniform Noise}
\begin{description}
\item [Plugin:] \emph{uniform}
\item [Description:] create uniform noise
\item [Parameters:] a, b
\plugtabstart
a& float & lower limit of the random values& 0 \\\hline
b& float & upper limit of the random values & 1 \\\hline
\end{tabular}
\end{description}