This program accepts a user-defined boxcar and loops
through the input image. It finds the mode pixel
value in the boxcar, and sets the center pixel value
to that mode value. If the boxcar is poly-modal, the
filter writes the lowest of the mode values to the center
This will determine how many samples the boxcar will
have. The number must be an odd integer, and size
often has a noticeable impact on time. It will
also have an impact on the blurring effect. The
larger the boxcar, the greater the blurring. The user
will have to discover other effects on their own.
This will determine how many lines the boxcar will
have. The number must be an odd integer, and size
often has a noticeable impact on time. It will
also have an impact on the blurring effect. The
larger the boxcar, the greater the blurring. The user
will have to discover other effects on their own.
This value indicates the minimum value of a valid
pixel. If a pixel holds a value below the minimum
value, it will either be excluded or included,
depending on user input in the "Filter Style"
area.
This value indicates the maximum value of a valid
pixel. If a pixel holds a value over the maximum
value, it will either be excluded or included,
depending on user input in the "Filter Style"
area.
This determines what to put in the center pixel,
in the event that there aren't enough non-special
pixels in the boxcar to meet the minimum. The
default is to replace it with the current value,
and the other option is to replace it with NULL.
Type
string
Default
CENTER
Option List:
Option
Brief
Description
CENTER
Center pixel value
This sets the center pixel of the boxcar
to whatever was already there, in the event
that there are not enough non-Special pixels
to meet minimum requirements.
NULL
Pixel value Null
This sets the center pixel of the boxcar
to the special pixel value fo "Null", if
there are not enough non-Special pixels
to meet minimum requirements.
These options determine which pixels are to be included in the
filtering process. ALL filters all pixels, regardless of value, VALID
only filters those pixels with values between LOW and HIGH, and
INVALID only filters those pixels with values outside LOW and
HIGH. Note that these only determine which Non-Special pixels to
filter. Also, the median will only be calculated from pixel values
between LOW and HIGH.
Type
string
Default
ALL
Option List:
Option
Brief
Description
ALL
Filter All
This option filters all Non-Special pixels, regardless of value.
It only filters Special Pixels indicated by the user, and the mode
value is only calculated from values between LOW and HIGH.
INSIDE
Filter Between Low and High
This option filters only those pixels whose value lies between
LOW and HIGH, as well as the Special Pixels indicated by the
user.
OUTSIDE
Filter Outside Low and High
This option will filter only those pixels with values below LOW or
above HIGH. It will filter any Special Pixels indicated by the user,
and the mode value is still calculated from between LOW and
HIGH.
If the center of the boxcar is Null, and this box is checked, the pixel
will be overwritten with the mode value of the boxcar as a whole. If
this box is left unchecked, the pixel will be left alone.
If the center of the boxcar is Hrs, and this box is checked, the pixel
will be overwritten with the mode value of the boxcar as a whole. If
this box is left unchecked, the pixel will be left alone.
If the center of the boxcar is His, and this box is checked, the pixel
will be overwritten with the mode value of the boxcar as a whole. If
this box is left unchecked, the pixel will be left alone.
If the center of the boxcar is Lrs, and this box is checked, the pixel
will be overwritten with the mode value of the boxcar as a whole. If
this box is left unchecked, the pixel will be left alone.
If the center of the boxcar is Lis, and this box is checked, the pixel
will be overwritten with the mode value of the boxcar as a whole. If
this box is left unchecked, the pixel will be left alone.
This demonstrates the commands necessary to run mode on
a file named "peaks.cub" with a 3x3 boxcar. The small size
will not produce much difference.
GUI Screenshot
mode gui
Example GUI
Screenshot of the GUI set to filter all pixels for the image
using a 3x3 boxcar.
Input Image
input cube
Input image before mode filter
Parameter Name:
FROM
This is the original cube. The areas of greatest interest are
those with a great deal of contrast such as edges.
Output Image
mode output
Output of 3x3 boxcar mode filter
Parameter Name:
TO
This is the image after the filter. You may notice that the whole
image is slightly softer, particularly around areas of sharp
contrast. Due to the small size of the boxcar, the effect is
subtle and difficult to notice.
Example 2
Running mode with a 15x15 boxcar
Description
This demonstrates running the mode program on a sample
cube.
This demonstrates the commands necessary to run mode on
a file named "peaks.cub" with a 15x15 boxcar. The large size
of the boxcar produces a marked effect.
GUI Screenshot
mode gui
Example GUI
Screenshot of the GUI set to filter all pixels for the image
using a 15x15 boxcar.
Input Image
input cube
Input image before mode filter
Parameter Name:
FROM
This is the original cube. The areas of greatest interest are
those with a great deal of contrast such as edges.
Output Image
mode output
Output of 15x15 boxcar mode filter
Parameter Name:
TO
This is the output image for a 15x15 boxcar. You will notice
the entire image is noticeably blurrier. It is now virtually
impossible to make out any but the largest of features.