# Examples

The examples in the toolbox are meant to be show how the the features of
BBTools can be used in real-world situations. They may be complex, require
large amounts of memory, and may need to run a long time.

In time it is intended to put more extensive examples on the
web page.

## Demos

Demos are given in the form of "playscripts", and are generally designed
to be runnable for an average user (although, the average user of BBTools is
expected to have a modern machine targeted for number crunching).

These are a more appropiate place to start, but does not show the real
strength of the toolbox. To start a demo, open the **Demos**
pane in the Help browser and select
under **Toolboxes**. You can also type `demo`

in the
MATLAB prompt.

## Examples

- Principal Components Analysis
- This example creates the function
`bbpca`

,
which computes a Principal Component Analysis (PCA) of a data-matrix.

## Datasets

The datasets shipped with BBTools are released under the terms of the GPL.
They are intended for used in both examples and demos, and is available for
everyone who obeys the license.

The bird image was captured by Germ Wind, and graciously donated to this
project. It was shot with a Sigma camera utilizing a Foveon image sensor.
This has the important property that all pixels in the image are significant,
in contrast to other digital cameras that interpolate.

In order to compress the image shipped with this toolbox, colors were
removed by adding the seperate components of the camera. This has the
advantage that the intensity remains a count, and can roughly be modelled as
Poisson distributed. Pixels were summed in blocks of 4 for additional
compression, retaining the discrete distribution.

The image shipped with the toolbox therefore represents raw counts. To
display this properly, it is necessary to correct for the non-linearity of
the display. Assuming exact display is overkill, this can be done by
raising each pixel to the power of 1/2.2 for any sRGB compliant monitor.

PCA Example