| Environments | PYTHON :: EASI |
| Quick links | Description :: Parameters :: Parameter descriptions :: Details :: Examples :: Related |
| Back to top |
| Back to top |
| Name | Type | Caption | Length | Value range |
|---|---|---|---|---|
| FILI * | String | Name of input file | 1 - 192 | |
| DBIB * | Integer | Segment number of input bitmap | 1 - 1 | |
| FILO * | String | Name of output file to modify or create | 1 - 192 | |
| DBOB | Integer | Segment number of modified bitmap in output file | 0 - 1 | |
| SIZE | Integer | Size of dilation, erosion, or both | 0 - | |
| STHRESH | Integer | Threshold sizes of unmasked areas to fill or masked areas to remove | 0 - 2 | |
| DBSD | String | Description of output bitmap segment | 0 - 192 |
| Back to top |
FILI
The name of the file that contains the bitmap layer to process.
DBIB
The segment number of the bitmap of the input file to process.
You can specify only one segment number.
FILO
The name of the file to which to write the modified bitmap segment.
The name you specify can be that of the input file, an existing file, or a new file you want to create.
If the file name you specify is that of the input file, and you do not specify the segment number for the output file, a bitmap layer will be added automatically to the input file. If you specify the segment number for the output file with the DBOB parameter, the corresponding bitmap layer must exist already in the output file. If you opt to create a new file, a single bitmap layer will be written to the output file. If you specify an existing file, the bitmap will be the size of the overlapping area.
DBOB
The number of the segment to which to write the modified bitmap.
If you do not specify a value, a new segment is created in the output file you specify.
The value you specify cannot be the same as that of the input segment.
SIZE
The number of pixels by which to dilate or erode the bitmap, or both.
To dilate (grow) areas of the bitmap that are set, enter a positive integer.
To erode (shrink) areas of the bitmap that are set, enter a negative integer.
To fill unmasked areas or remove masked areas, enter a value of 0 (zero).
If you want to neither dilation nor erosion, do not enter a value; that is, leave the parameter blank.
You can specify more than one value. By doing so, each operation is applied in the order you specify.
STHRESH
The threshold size, in pixels, at which to fill masked areas of the bitmap after applying dilation and erosion.
You can specify zero, one, or two values. The first value you specify removes voids (unset bits) of an area at the threshold size or less. The second value you specify removes "islands" (set bits) of an area at the threshold size or less.
To remove only islands, and not voids, enter 0 (zero) as the first value.
DBSD
The description of the output bitmap segment.
| Back to top |
DILATEBIT performs morphological operations (dilation and erosion) on a bitmap layer and, optionally, fills unmasked areas, removes masked areas, or both that are smaller than an area, in pixels, that you specify. You specify the sequence of processing with the SIZE parameter.
The input and output bitmap cannot be the same segment.
The dilation and erosion is relative to the set bits of the bitmap.
If a series of dilation and erosion steps are performed, the output is based on the result of the previous step.
The steps to fill voids, remove islands, or both are based on the threshold you specify.
You can neither interleave nor reorder the dilation and erosion process with the void-filling or island-removal process; however, you can run DILATEBIT in succession to do so.
You specify erosion and dilation with negative and positive integers, respectively.
| To | Do this | Result |
|---|---|---|
| Dilate (grow) a bitmap by n pixels | Enter a positive integer to define the radius n of bits to set around the bits unset currently. | Applies the dilation of radius n around the the bits unset currently. |
| Erode (shrink) a bitmap by n pixels | Enter a negative integer to define the radius n of bits to set around the bits unset currently. | Applies the erosion of radius n around the the bits unset currently. |
| Fill voids | Enter as the first value the maximum size, in pixels, of areas to fill. | Voids containing fewer than the number of pixels of the first specified threshold size will be filled. |
| Remove islands | Enter as the second value the maximum size, in pixels, of islands to remove. | Islands containing fewer than the number of pixels of the second specified threshold size will be filled. |
The output bitmap layer cannot be the same as the input bitmap; that is, if the output and input file are the same, the value of DBOB and DBIB must differ.
| Back to top |
In the following example, a bitmap segment of low values is created by first running the THR algorithm. DILATEBIT is then run to create buffers around the low-value areas.
The isolated areas are removed by an erosion operation (Size: -1), followed by a merging (dilation) of islands that are within 6 pixels of each other (Size: 3), because each island is expanded. A second erosion follows (Size: -2), which results in a one pixel buffer around the merged data of the second operation. On completion of the three operations, voids with fewer than 50 pixels are filled, and islands containing less than 30 pixels are removed.
! Generate a bitmap of the pixels in channel 1 with values between 0 and 0.25
EASI>FILE = "input.pix"
EASI>DBIC = 1
EASI>DBOB =
EASI>TVAL = 0, 0.25
EASI>COMP = "Off"
EASI>DBSN = "Low Val"
EASI>DBSD = "Bitmap of low values"
EASI>run THR
! Generate bitmap buffers around low-value areas
EASI>FILI = FILE
EASI>DBIB = 2
EASI>FILO = FILE
EASI>DBOB =
EASI>SIZE = -1, 3, -2
EASI>STHRESH = 50, 30
EASI>DBSD = "Buffered bitmap"
EASI>run DILATEBIT
In the following example, the bitmap in segment 2 is examined, and voids less than 20 pixels in size and islands less than 40 pixels in size are removed. The result is written to the existing segment 3.
! Remove bitmap voids and islands
EASI>FILI = "file_with_bitmap.pix"
EASI>DBIB = 2
EASI>FILO = FILI
EASI>DBOB = 3
EASI>SIZE =
EASI>STHRESH = 20, 40
EASI>DBSD = "Bitmap with voids and islands removed"
EASI>run DILATEBIT
© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.