OESELIMG
Search through and select images from an
OrthoEngine
project
Description
OESELIMG
searches through an
OrthoEngine
project file for images based on criteria you specify. The file names
of the images in the search result are selected and written to a text
file, which you can use as input with various
CATALYST Professional
algorithms.
Parameters
oeselimg
(oeproji, tfile, ltyp, imstat, where)
| Name |
Type |
Caption |
Length |
Value range |
| OEPROJI * |
str |
Input
OrthoEngine
project file
|
1 - |
|
| TFILE |
str |
Output text file name |
0 - |
|
| LTYP |
str |
Listing type |
0 - 5 |
BRIEF, SHORT, FULL Default: SHORT |
| IMSTAT |
List[float] |
Output statistics |
0 - |
|
| WHERE * |
str |
Query string to use |
1 - |
|
* Required parameter
Parameter descriptions
OEPROJI
The file name of the
OrthoEngine
project through which to search.
TFILE
The name of the output file, known as a TFILE, to which to write
the file names of the selected images. A TFILE is in text format (
.txt
). Like an MFILE, data is written to a TFILE such that it can be
used with other
CATALYST Professional
algorithms.
If the search does not find any matching images, the file is
still created; however, it will contain only comments or blank
lines.
If no value is specified for this parameter, the file names of
the selected images are written to the report.
The content and format of a TFILE, with
LTYP
set to
FULL
, is as follows (comments and blank lines notwithstanding):
!
! OESELIMG output
! ---------------
!
! All files are from the OrthoEngine project:
! ottawa.prj
!
! Your search returned the following images based on the query:
! where = "(band=red & band = blue) or (! look = f)"
1_554_170312_1833_RGBB19L1.pix
1_554_170312_1833_RGBF26L1.pix
1_554_170312_1833_RGBN00L1.pix
! Images processed: 10
! Images accepted: 3
! Images rejected : 7
LTYP
Whether to write brief, short, or full information to the TFILE
and report.
You can specify any one of the following:
-
BRIEF:
writes only the file names of the matching images to the
TFILE, but not to the report. Use BRIEF
in workflow scripts where extra information is unnecessary.
This is particularly useful if you need to read the TFILE;
since it contains only filenames there is no need for the
parsing code to be smart.
-
SHORT:
includes header and footer information of the selected image
files. The report includes information to easily identify
which images were processed by
OESELIMG
. Rejected images are excluded from the TFILE and the report.
-
FULL:
like
SHORT
, but the report includes rejected images and the reason for
rejection.
IMSTAT
Various statistics describing the result of the query.
On completion of processing, the following entries are displayed:
- first IMSTAT array element: total number of images accepted.
- second IMSTAT array element: total number of images rejected.
- third IMSTAT array element: total number images in the project.
- fourth IMSTAT array element: number of active images accepted.
- fifth IMSTAT array element: number of active images rejected.
- sixth IMSTAT array element: number of inactive images accepted.
- seventh IMSTAT array element: number of inactive images rejected.
- eighth IMSTAT array element: number of online images accepted.
- ninth IMSTAT array element: number of online images rejected.
- tenth IMSTAT array element: number of offline images accepted.
- eleventh IMSTAT array element: number of offline images rejected.
The number of active, inactive, online, and offline images take
into account only whether the "active" and "online" filters accepted
or rejected the image. The other filters do not play a role in those
counts. Thus, the counts may add up to more than to the total number
of images processed.
These statistics are written to the output file and report when
LTYP is set to FULL.
WHERE
A string is a query using various strings, operators, and
expressions. For more information, see
Details
.
With each image in the
OrthoEngine
project file, when the query resolves to
true
, the file name is appended based on the name specified for the
TFILE. When the query resolves to
false
, the file name may, depending on the value of
LTYP
, be written to the report.
The query string you specify for
WHERE
is case-sensitive; that is, all characters must be lowercase,
except metadata-tag filters. Metadata-tag filters must match the
case of the metadata tag.
Sample queries
You can copy each of the following samples directly to your Python
code:
-
Select only images with a look direction of forward, backward,
or nadir. Images with a look direction other than the
preceding are rejected.
where="looks = f|look=b|look=n"
where="looks = f|b|n"
-
Select images of any look direction.
where="!look=unknown"
-
Select only images that have a red band; however, other bands
are allowed.
where="band=r"
-
Select only images that have all three bands: red, green, and
blue. The bands can be in any order and other bands are
allowed.
where="band=r and band=g & band=b"
where="band=r,g,b"
-
Select only images with the look direction of forward,
backward, or nadir, and that have bands red, green, or, blue.
where="(look=f | look=b | look=n) & (band=r,g,b,i)"
where="look=f|b|n&band=r,g,b,i"
-
Select only images that have the metadata tag ELEVATION_DATUM
in channel 1 that match the regular expression
"ELL.*"
.
where="$ELEVATION_DATUM#1=~'ELL.*'"
-
Select only images that have the metadata tag ELEVATION_DATUM
in channel 1 that is strictly equal to the string
"MSL"
. Notice that the
==
operator is used instead of the
=
operator.
where="$ELEVATION_DATUM#1=='MSL'"
-
Select only images that have the metadata tag NO_DATA_VALUE
with any value. You can use this string to test that the
metadata tag exists in the image file, and that its value does
not matter.
where="$NO_DATA_VALUE=~'.*'"
-
Select only images that have the metadata tag MinWavelength in
channel 1 with a value of 0.610 or less.
where="$MinWavelength#1<=0.610"
-
Select all active online images.
where="online=true & active=true"
-
Select images that have 10 or more ground control points
(GCP).
where="gcps >= 10"
-
Select images that have two or more overlapping images.
where="overlaps > 2"
-
Select images that have 10 or more 10 GCPs and 20 or fewer tie
points (TP).
where="gcps > 10 & tps<=20"
-
Select images that have more than three stereo GCPs and more
than 10 TPs.
where="sgcps > 3 & tps>10"
-
Select images that are PCIDSK files with "BLU" in the file
name.
where="filename = ~'.*BLU.*.pix'"
-
The following two queries are similar except that the second
has more brackets (which are not really necessary):
where="look=f|b|n & band=r,g,b & $ELEVATION_DATUM#1='ELL' & (!$ProductType='ORTHO' | !$ProductType='1')"
where="(look=f|b|n) & (band=r,g,b) & ($ELEVATION_DATUM#1='ELL') & (!($ProductType='ORTHO') | (!($ProductType='1')))"
Return Value
Returns: Program execution status
Type:
PCI_INT
The return value is 0.
This function returns only if it executes successfully; otherwise,
it throws an exception.
|
Details
OESELIMG
selects images from an
OrthoEngine
project that match a query. Each image that matches the query is
written to the output TFILE.
About the filter language
Querying file properties
With a query on file properties, offline images are rejected.
-
looks =
directions
:
compares the look direction of the image with the specified set of
look directions. Possible values for
directions
are as follows:
-
forward
or
fwd
or
f:
the forward look direction
-
backward
or
bwd
or
b:
the backward look direction
-
nadir
or
nad
or
n:
the nadir look direction
-
other:
any other look direction
-
unknown:
when the look direction is unknown
You can also use
look =
look directions
.
where="looks = forward"
-
bands =
bandlist:
compares the bands in the image with the specified set of bands.
Possible values for
bandlist
are as follows:
-
red
or
r:
contains a channel in the red band
-
green
or
grn
or
g:
contains a channel in the green band
-
blue
or
blu
or
b:
contains a channel in the blue band
-
ir
or
i:
contains a channel in the infrared band
-
panchromatic
or
pan
or
p:
contains a panchromatic channel
-
other:
any other band
-
unknown:
when the band is unknown
You can also use
band =
bandlist
. Each band specified in the query must exist in the image. The
order of the bands does not matter.
where="bands = red,green,blue"
-
filename eqOp
regex
:
compare the absolute file name of the image with a regular
expression. You can also use
file eqOp
regex
.
where="filename = ~'.*BLU.*.pix'"
-
filename eqOp "
string
":
compare whether the file name of the image is equal to a string.
You can also use
file eqOp "
string
"
.
where="filename != 'c:\\canada\\ottawa.pix'"
Querying metadata tags
If an image is offline, the metadata tag does not exist, or if the
channel does not exist, the image is rejected.
-
$
tag
#
chan
eqOp
regex
:
compare a channel-level metadata tag to a regular expression.
where="$ELEVATION_DATUM#1 = ~'ELL.*'"
-
$
tag
#
chan
eqOp "
string
":
compare if the value of a channel-level metadata tag is equal to a
string.
where="$ELEVATION_DATUM#1 == 'MSL'"
-
$
tag
#
chan compOp float
:
compare a channel-level metadata tag with a floating-point number.
where="$MinWavelength#1 <= 0.610"
-
$
tag
eqOp "
regex
":
compare a file-level metadata tag with a regular expression.
where="$Acquisition_DateTime = ~'2008.*'"
-
$
tag
eqOp "
string
":
compare if the value of a file-level metadata tag is equal to a
string.
where="$SensorCode == 'MS'"
-
$
tag compOp float
: compare a file-level metadata tag with a floating-point number.
where="$AngleOfSolarElevation >= 41.90"
-
tag
is the name of the metadata tag.
-
chan
is the channel number in which the tag is found. You can use
any integer as a value. Channel numbers start at one (1). If
the specified channel is zero (0) or less, the file-level
metadata tag is checked.
-
regex
is the regular expression to which to match.
-
string
is the string to which to compare.
-
compOp
is a comparison operator. For more information about supported
comparison operators, see
Comparison operators
.
-
float
is the floating-point number with which to compare.
Querying
OrthoEngine
properties
Querying spatial properties
Each query of a point property compares the number of
active
points with the value specified in the query. For more information
about supported comparision operators, see
Comparison operators
.
-
gcps
compOp
integer
:
compare the number of
active
GCPs in the image with the specified
integer
. You can also use
gcp
compOp
number
.
where="gcps < 120"
-
sgcps
compOp
integer
:
compare the number of
stereo
GCPs, active or inactive, in the image to the specified
integer
. You can also use
sgcp
compOp
integer
.
where="sgcps >= 3"
-
tps
compOp
integer
:
compare the number of
active
TPs in the image with the specified
integer
. You can also use
tp
compOp
integer
.
where="tps > 21"
-
overlaps
compOp
integer
:
compare how many images overlap the image with the specified
integer
. This number is seen in the
Total Overlap Pairs
property in the output from
OEPROJSUM
. You can also use
overlap
compOp
integer
.
where="overlaps >= 2"
-
rms
compOp float
:
compare the overall RMS value of the image with the specified
floating-point number.
where="rms <= 1.5"
-
rmsgcps
compOp float
:
compare the GCP RMS value of the image with the specified
floating-point number. You can also use
rmsgcp
,
rms_gcps
, or
rms_gcp
instead of
rmsgcps
.
where="rmsgcps <= 0.9"
-
rmstps
compOp float
:
compare the TP RMS value of the image with the specified
floating-point number. You can also use
rmstp
,
rms_tps
, or
rms_tp
instead of
rmstps
.
where="rmstps <= 0.75"
-
compOp
is a comparison operator. For more information about supported
comparison operators, see
Comparison operators
.
-
integer
is the integer with which to compare.
Logical operators
-
&
or
and
: logical
AND
operator
-
|
or
or
: logical
OR
operator
-
!
: logical
NOT
operator
Comparison operators
The comparison operators include the
range operators
and the
equality operators
.
Comparison operators apply only to queries that have a
compOp
attribute, such as the
gcps
property queries.
Range comparison operators
-
<
: is the property value less than the specified value?
-
>
: is the property value greater than the specified value?
-
<=
: is the property value less than or equal to the specified value?
-
>=
: is the property value greater than or equal to the specified
value?
Equality operators (eqOp):
-
=
: strictly equal to
-
==
: strictly equal to
-
!=
: strictly not equal to
Special queries
-
The asterisk (*) query selects everything. This is a handy way to
list all of the images in an
OrthoEngine
project. However, you cannot combine the asterisk with any other
query.
where="*"
Regular-expression queries (regex)
Some queries described earlier in this topic compare a property of
the image with a regular expression. All regular-expression queries
are case-sensitive. If the property value does not match the regular
expression, the image is rejected.
A regular-expression query is specified by the following syntax:
~"regexstring"
. The tilde (~) is the marker that indicates that the subsequent
quoted string is a regular expression.
Regular-expression queries use the Perl regular-expressions syntax.
Regular-expression queries are case-sensitive.
where="id = ~'.*[aA][bB][cC].*'"
Operator precedence
Typical operator-precedence rules apply; for example, the ampersand
(&) operator has higher precedence than the vertical bar (|)
operator.
-
Property queries (such as
looks
and
gcps
) have higher precedence than the exclamation point (!) operator
(not operator).
- The exclamation point (!) operator (not operator) has higher
precedence than the ampersand (&) operator.
- The ampersand (&) operator has higher precedence than the
vertical bar (|) operator.
- Use brackets to affect precedence.
Quotes in queries on strings
Queries using string values must have the comparison string or
regular expression enclosed in matching single quotes or double
quotes. To escape quotes, use a backslash. Essentially, the
query language processes quotes like Python.
Spaces in queries
In queries, spaces are mostly ignored; however, you must enter a space
between the
and
and
or
operators. In regular expression queries, spaces are not ignored.
Boolean values and synonyms
With queries that accept boolean values, you can use the following
boolean synonyms:
-
true:
yes, y, true, t, 1
-
false:
no, n, false, f, 0
The TFILE contains all of the images that match the query. The file
names and paths in the TFILE are relative to file name of the TFILE.
Example
Select only forward-looking images from an
OrthoEngine
project file,
ads.prj
, which contains airborne digital sensor (ADS) data. Each selected
image is written to the TFILE
images.txt
.
from pci.oeselimg import oeselimg
oeproji = "ads.prj"
tfile = "images.txt"
ltyp="full"
imstat=[]
where = "look=forward"
oeselimg(oeproji, ltyp, tfile, imstat, where)
The output file is a TFILE,
images.txt
, which lists only images that match the query specified for
WHERE
.
© PCI Geomatics Enterprises, Inc.®,
2026. All rights reserved.