IHR

Read database image header


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

Back to top

Description


IHR extracts data from a PCIDSK file header and georeferencing layer, and writes the data values to the output parameter(s).
Back to top

Parameters


Name Type Caption Length Value range
FILE * String Input file name 1 - 192  
IMSTAT Float Image Statistics 0 - 15  

* Required parameter
Back to top

Parameter descriptions

FILE

Specifies the name of the PCIDSK image file from which header and georeferencing data are to be extracted.

IMSTAT

Header and georeferencing data extracted from the database file are saved in the IMSTAT output parameter for use by other algorithms. After IHR has completed running, IMSTAT contains the following values:
Back to top

Details

IHR reads header and georeferencing data from the specified input file (FILI), and saves the retrieved data to the IMSTAT parameter.

Back to top

Examples

Get database header and georeferencing data from the demo database file irvine.pix, and print the values.

EASI>FILE="irvine.pix"
EASI>RUN IHR

EASI>SHOW IMSTAT
IMSTAT  - Image Statistics  >     512      512       10        9
                                    1        0        0       32
                                   30       30        1   428720
                              3734400   444080  3719040

The code shown below calculates the georeferenced location of the center of a specified database position (X,Y). Scaling factors (XSCALE,YSCALE) are calculated, given georeferenced locations of the upper-left and lower-right corners of the database, and the number of pixels and lines on the database.

LOCAL #X,#Y,#XSCALE,#YSCALE
ASK   "Enter Database File Name  : " FILE
RUN IHR
#XSCALE = (IMSTAT(14)-IMSTAT(12)) / IMSTAT(1)
#YSCALE = (IMSTAT(15)-IMSTAT(13)) / IMSTAT(2)
INPUT "Enter X Database Position > " #X
INPUT "Enter Y Database Position > " #Y
PRINT "Georeferenced X position  = ",IMSTAT(12)+#XSCALE*(#X-0.5)
PRINT "Georeferenced Y position  = ",IMSTAT(13)+#YSCALE*(#Y-0.5)
Note: When georeferencing units are UTM or METER, the pixel size (IMSTAT(9),IMSTAT(10)) equals the absolute value of the scaling factors (XSCALE,YSCALE).

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