SAS/SPECTRAVIEW provides
four filters:
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.
The Blend filter,
which is the default, gently smooths data by averaging the response value
with the values of adjacent response values. (In comparison, the Gaussian
filter smooths by averaging and also weights the response value.) The Blend
filter uses the following preset values, which you can modify:
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.
The Gaussian
filter smooths data by averaging and also weights the response value. (In
comparison, the Blend filter smooths by averaging but does not raise the response
value.) The Gaussian filter uses the following preset values, which you can
modify:
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.
The Laplacian
filter sharpens data by weighting the response value and pulling down the
adjacent response values. The Laplacian filter uses the following preset
values, which you can modify:
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 smooths data by using a median (middle) value. The Median filter
is not a template. There are no values in the matrix; only asterisks, which
cannot be changed.
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:
Note that the order in which you apply filters affects the
result. That is, if you apply a Laplacian filter, then a Gaussian filter,
the result will be different than if you apply the Gaussian filter first,
then the Laplacian filter.
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.
-
Select [Apply filter] to apply
the filter to all response values in the data.
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
-
Next,
smooth the data by applying a data filter:
-
Select [Data], then [Filter
data].
-
Select [Blend filter].
-
Select [Apply
filter].
-
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
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.