DEMEDPREP

Prepare a DEM for manual editing


EnvironmentsPYTHON :: EASI :: MODELER
Quick linksDescription :: Parameters :: Parameter descriptions :: Details :: Example :: Related

Back to top

Description


DEMEDPREP prepares a digital elevation model (DEM) for manual editing inCATALYST Professional Focusby either copying or linking its elevation channel to a new file. The editing is assisted by a set of raw overlapping images that contain a math-model segment. The images are assembled into epipolar pairs or triplets, and then the cutlines between individual epipolar pairs or triplets are written to an output vector segment. If necessary, you can open the DEM and the cutline segment in theFocus DEM Editingwindow to create on-the-fly orthorectified images and analyze them in real time as you manually adjust the DEM.
Back to top

Parameters


Name Type Caption Length Value range
MFILE * String Input file names, folder, or text file 1 - 192  
FILEDEM * String File containing the DEM 1 - 192  
DBEC Integer Input elevation channel 0 - 1 Default: 1
FILO * String File to contain editable DEM channel and image-pair cutlines 1 - 192  
LINKFILE String Create linked file 0 - 3 Yes| No
Default: No
SELMTHD String Method for selecting epipolar pairs or triplets 0 - 192 PAIR | MAXIMUM | ALL | OPT | DENSE | STRIPS | AUTO | TRI
Default: PAIR
MINPC Integer Percentage of minimum overlap 0 - 2 0 - 100
BREAKANG Float Break angle of the flight line 0 - 1  

* Required parameter
Back to top

Parameter descriptions

MFILE

The names of image files, a folder, or a text file that contains the input images to process. If necessary, you can use wildcards, such as the asterisk (*) in the value string.

You can specify the value of the MFILEparameter by using any of the following forms:

If you use a wildcard, DEMEDPREP processes all files that match the specified file-name pattern.

If you specify a folder, DEMEDPREP processes all the recognized image files in that folder.

If you specify the name of a text file, DEMEDPREP processes the images listed in the file. Each image should be listed on a separate line. Any other entries that follow the file path and name on each line are ignored.

Each image file selected for processing must have a segment with a valid math model. DEMEDPREP uses the last math-model segment in each file. If no math model is found in an image, it is excluded from further processing. If no image with a math model is found, processing stops, and an error message is displayed.

FILEDEM

The name of an existing file containing DEM data to prepare for editing. The file must be in a supported raster format.

DBEC

The elevation channel to prepare for editing.The default value is 1.

DEMEDPREP verifies that the input channel has the required DEM-specific metadata tags. The required tags are:

If any of the tags is missing or has an invalid value, processing stops, and an error message is displayed.

FILO

The name of a PCIDSK (.pix) file to contain an editable DEM channel, and the derived cutlines of epipolar pairs or triplets. The file you specify must not exist already or have the same file name as your input DEM file.

If the file you specify does not exist, it is created during processing in the projection of your input DEM file with one elevation channel. The channel is either copied from or linked to the input elevation channel, as discussed in the parameter description when you specify whether to create a linked file.

If the file is the same name as your input DEM file, creating a linked file is not necessary (it is not processed). The data in the channel you specified as the input elevation channel will be edited in place. If the elevation channel cannot be written to, processing stops, and an error message is displayed. In either case, the cutlines are saved in the file you specify in a vector segment namedCutlines.

LINKFILE

Whether the output file specified in theFILOparameter should be created as a link file to theFILEDEM. The default value isNo.

If you selectNo, a new file is created containing the editable DEM channel with a copy of the data from the input elevation channel, and cutlines of epipolar pairs or triplets. Otherwise, the new file is created as a link to the input elevation channel specified in theDBECparameter.

If the file containing the DEM channel and cutlines cannot be written to, processing stops, and an error message is displayed.

SELMTHD

The method to use to form the epipolar pairs. The default isPair.

You can use any of the following supported values:

With the Max,All, Opt(Optimum), andDensemethods, you can specify additional options with a KEY=value. Each KEY=value pair must be preceded by a comma.

The following KEYs and their values are recognized:

MINPC

The percentage of minimum overlap acceptable between two images for them to be considered a valid pair. The value you specify must be between0and100.

The default value is50(50 percent).

The first step in the pairing is to evaluate every pair to determine if the overlap is greater or equal to the value of this parameter. For each image pair,AandB, two overlap values are calculated:A/BandB/A.Pairs are rejected when the minimum ofA/BandB/Ais less than the valueMINPC / 100. The difference between the values A/B versus B/A is larger the more the two image sizes differ.

Image Overlap Calculations

Example Overlap Scenarios:

Example Overlap Scenarios

CAUTION:
This parameter is ignored with some values of theSELMTHD(pair selection method) parameter.
Note: The MINPC parameter allows for two values. The second value is only used with the SELMTHD STRIPS, and is ignored for other selection methods. See the STRIPS method to understand how the first and second values are used to find epipolar candidates.

BREAKANG

The break angle of the flight line, which is used to determine the end of a flight line. The vector angles between image centers are calculated, and if the vector angle between two image centers is greater than the break-angle threshold, this is determined to be the end of the flight line, at which point a new one begins. The default value is22.5(22.5 degrees).

CAUTION:
Use this parameter only when the selection method for epipolar pairs isOptimum(Opt) orDense.

This parameter is optional.

Back to top

Details

DEMEDPREP prepares data for DEM editing in theDEM Editingwindow ofCATALYST Professional Focus.

The input image files must have a math-model segment to use to create epipolar pairs or triplets. The highest-numbered math-model segment of each file is used. If an image has no model, it is removed from processing. If fewer than two images with a math model are found during pair generation, processing stops, and an error message is displayed.Incomplete triplets, that is, pairs are accepted.

DEMEDPREP executes the following steps:
  1. Ingest and verify all parameters per the description of each.
  2. Create the output file in the input DEM geometry, and either copy or link the input elevation channel to it.
  3. Generate a list of epipolar pairs or triplets from the raw images in the input file names, folder, or text file, according to the specified pair selection method.
  4. Create a vector outline of each epipolar-pair or epipolar triplet data area.
  5. Remove overlaps between all epipolar outlines.
  6. For a selection method generating pairs, add the LeftImage and RightImage attribute to each polygon to identify the left and right image of each pair.
  7. For theTriselection method, add the LeftImage, MiddleImage and RightImage attribute to each polygon to identify the left (forward), middle (nadir) and right (backward) image of each triplet.Missing images have empty attribute fields.
  8. If necessary, reproject the resulting polygons to the output file geometry.
  9. Create the output vector segment.
  10. Store the resulting polygons in the output vector segment.
The output file will have at least one epipolar pair or triplet for each DEM pixel where the DEM and accepted image data overlap. After opening the data in theFocus DEM Editingwindow, the display will flicker between the left and right orthorectified images. These images will be created on-the-fly in the current editing area from the raw images and using the current DEM elevations. By iteratively adjusting the elevations in the window, and verifying the resulting orthorectified images, an accurate DEM can be produced quickly.

If the input elevation channel was linked to the output file, the in-place edited file containing the DEM can be used in further processing. If the input elevations were copied to the output file, the edited DEM in the output file should be used instead.

DEMEDPREP exits with an error if there is no overlap between the DEM area and the final cutline polygons.The output file is still created, and can be examined for any potential problems.

With theEpipolar-image-selection method(SELMTHD) parameter, you can select from a variety of selection methods, with theOptimum(Opt) andDensemethods designed specifically for airborne images:

You can further refine the selection criteria by using the optional KEY=value pairs. You can use the lower and upper values of stereo separation for theMax,All, Optimum(Opt), andDensemethods. For example, to restrict theDensepair-selection method to the range of convergence angles from 20 degrees to 40 degrees, specify the value of theEpipolar-image-selection method(SELMTHD) parameter as"DENSE,SSL=20,SSU=40".

TheSARkey is specific to satellite-SAR images, and is evaluated only for theMaxand Allmethods.Typically, all of the parameters are used and, therefore, it is sufficient to specify the SAR keyword by itself, for example"MAX,SAR,SSL=5,SSU=20".The non-default settings should be used only in rare circumstances and for well-understood data, so that undesirable pairs are not formed.

Back to top

Example

This example uses a DEM in the PIX format, and creates epipolar pairs from airborne images stored in thedemo folder, with file names having the prefixpoand extension.pix. The DEM parameters necessary for processing will be extracted from the DEM file. The output file will have the elevation channel linked to the input DEM file, and the output cutline segment will be created on it. TheOptimum(Opt) selection method is used to form the pairs, and to provide continuous coverage with minimum overlapping between successive pairs.

EASI>mfile= "demo/po*.pix"! input image files
EASI>filedem= "demo/MyDEM.pix"! input DEM file
EASI>dbec = ! use channel 1 in the DEM file by default
EASI>filo = "demo/DEMToEdit.pix"! output DEM and vectors
EASI>linkfile = "YES"! Edit the input DEM in-place
EASI>selmthd= "Opt"! use OPT method to form pairs
EASI>minpc= ! default value (not used for OPT method)
EASI>BREAKANG=30.0 ! flight-line-break angle

EASI>RUN demedprep
      

© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.