Chapter Contents |
Previous |
Next |

SAS/SPECTRAVIEW Software User's Guide |

Understanding the Filters |

SAS/SPECTRAVIEW provides four filters:

- Blend filter
- smooths by averaging without weighting the response value.
- Gaussian filter
- smooths by averaging and weights the response value.
- Laplacian filter
- sharpens the data.
- Median filter
- smooths by using the median value.

The filters are provided as templates and are preset with values that the software uses to multiply the response values. The templates differ only in their values, which you can use or modify to suit your needs. The Median filter does not provide values and cannot be modified.

Note that you can also create your own data filter,
which is explained in Creating and Applying Your Own Filter.

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

Each element in the matrix has a value of 1. The multiplication
does not change any values, so the response values are simply averaged to
arrive at the replacement response value.

0 0 0 0 1 0 0 0 0 0 1 0 1 4 1 0 1 0 0 0 0 0 1 0 0 0 0

The response value being operated on is multiplied by
4, which increases (weights) it. Adjacent response values are multiplied
by 1, so they are not changed. The resulting values are then averaged, with
the average replacing the response value being operated on. **Note that
the Gaussian filter is useful to smooth out spikes in CAT scan data.**

0 0 0 0-1 0 0 0 0 0-1 0 -1 7-1 0-1 0 0 0 0 0-1 0 0 0 0

The response value being operated on is multiplied by
7, which increases (weights) it. Adjacent response values are multiplied by
-1, which decreases (pulls down) their values. The resulting values are then
averaged, with the average replacing the response value being operated on. **Note that the Laplacian filter is helpful for sharpening contrast in data.**

The Median filter sorts the response value being operated
on with surrounding response values in order, selects the median value, then
replaces the response value being operated on with the median value. The median
value is the value in the sorted list that has the same number of values below
it as above it. All 27 values, except missing values, are included in each
operation.

You can apply multiple filters to the data to both smooth and sharpen data. For example:

- apply the Laplacian filter along with the Gaussian
filter
- apply the Gaussian filter or Median filter along
with the Laplacian filter
- apply the Laplacian filter along with the Median
filter.

Applying a Filter Provided with the Software |

The following instructions apply a data filter provided with SAS/SPECTRAVIEW :

- Load the appropriate data
set.
- Select [
**Data**], then [**Filter data**]. - Specify the filter you want to load by selecting
one of the following. The default is the Blend filter.
[ **Blend filter**] smooths by averaging without weighting the response value.[ **Gaussian filter**] smooths by averaging and weights the response value.[ **Laplacian filter**] sharpens the data.[ **Median filter**] smooths by using the median value. - Select [
**Apply filter**] to apply the filter to all response values in the data.

An Example Using the Blend Filter |

The following steps illustrate the effects of applying the Blend filter:

- Issue the following DATA step code to create a
SAS data set named BUMPY, which produces a series of ellipses with additional
random noise added to the response values:
data bumpy; do x = -5 to 5 by 0.5; do y = -5 to 5 by 0.5; do z = -5 to 5 by 0.5; response = (x*x*0.5 + y*y*0.3 + z*z*0.1) + 2.0*ranuni(-1); output; end; end; end; run;

- Load the data set into SAS/SPECTRAVIEW .
- Create an isosurface, which
represents one response
value:
- Select [
**Tools**], then [**Isosurface**]. - To specify the response value,
use the left mouse
button and drag the histogram's left white line to a desired value. (The
histogram appears at the bottom left of the interface.)
- Then select [
**W/ depth sort**]. The isosurface looks something like a football that is rather bumpy.

*Bumpy Isosurface*

- Select [
- Next,
smooth the data by applying a data filter:
- Select [
**Data**], then [**Filter data**]. - Select [
**Blend filter**]. - Select [
**Apply filter**].

- Select [
- Follow the same instructions as in Step 3 to re-create
the isosurface.
The result is that removing the noise in the data displays a much smoother surface, which can help in viewing overall trends in data.

*Smoother Isosurface*

Chapter Contents |
Previous |
Next |
Top of Page |

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.