This function constructs a lightweight ENVIDeepLearningRaster subclass from a file that can be used with ENVITasks in ENVI Deep Learning. It contains additional GeoJSON information about bounding boxes, stored in the metadata. The bounding boxes are used for object detection. The raster metadata must contain certain values to be considered a valid Deep Learning object detection raster.

This routine is part of ENVI Deep Learning, which requires a separate license and installation.

This is not a virtual raster. It offers the same interface that a base ENVIRaster would for the same file. For normal use in the Deep Learning API, it avoids the persistent use of file descriptors, so creating many of these objects will avoid running into operating system limits that the base ENVIRaster encounters.

The ENVIDeepLearningRaster will open a file descriptor during certain operations, so that you can use it like a base ENVIRaster anywhere in ENVI:

  • ENVIDeepLearningRaster::CreateTileIterator()
  • ENVIDeepLearningRaster::GetData()
  • ENVIDeepLearningRaster::WriteMetadata
  • ENVIDataCollection::Add
  • ENVIRasterToFID()
  • ENVIView::CreateLayer()

Example


Sample data files are available on our ENVI Tutorials web page. Click the "Deep Learning" link in the ENVI Tutorial Data section to download a .zip file containing the data. Extract the contents of the .zip file to a local directory. Files are located in the object_detection folder.

; Launch the application
e = ENVI(/HEADLESS)
 
; Update the following line with the correct path
; to the tutorial data files
File = 'C:\MyTutorialFiles\ObjectDetectionRaster_HandicapParkingSpots1.dat'
Raster = ENVIDeepLearningObjectDetectionRaster(File)
Print, Raster

Syntax


Result = ENVIDeepLearningObjectDetectionRaster([, URI] [, Properties=value])

Return Value


This function returns a reference to an ENVIDeepLearningObjectDetectionRaster object.

Arguments


URI

Specify a scalar string that is a fully-qualified file path to a raster on disk. The file must be in the ENVI raster format.

Methods


The ENVIDeepLearningObjectDetectionRaster class inherits the methods and properties of ENVIRaster, including:

Close

Save (not used with ENVIDeepLearningObjectDetectionRaster)

SetData (not used with ENVIDeepLearningObjectDetectionRaster)

SetTile (not used with ENVIDeepLearningObjectDetectionRaster)

The following ENVIDeepLearningObjectDetectionRaster methods will override these inherited ENVIRaster methods:

CreatePyramid (not used with ENVIDeepLearningObjectDetectionRaster)

CreateTileIterator

Decode

Dehydrate

Encode

Export

GetData

Hydrate

WriteMetadata

Keywords


ERROR

Set this keyword to a named variable that will contain any error message issued during execution of this routine. If no error occurs, the ERROR variable will be set to a null string (''). If an error occurs and the routine is a function, then the function result will be undefined.

When this keyword is not set and an error occurs, ENVI returns to the caller and execution halts. In this case, the error message is contained within !ERROR_STATE and can be caught using IDL's CATCH routine. See IDL Help for more information on !ERROR_STATE and CATCH.

See the Manage Errors topic in ENVI Help for more information on error handling.

Properties


Properties marked as (Init) are applied only during the initial creation of the object. Properties marked as (Get) can be retrieved but not set. All other properties can be set during the creation of the object, or retrieved or changed after creation.

AUXILIARY_SPATIALREF (Get)

This property retrieves a reference to an ENVIGLTRasterSpatialRef, ENVIPseudoRasterSpatialRef, ENVIRPCRasterSpatialRef, or ENVIStandardRasterSpatialRef object, depending on what secondary map information the raster object uses for spatial reference (if any). This property provides a simple way to view secondary map information without having to query the metadata in the file header.

  • If the raster object only has one spatial reference, this property returns a !NULL value.
  • If the raster object contains standard map information plus RPC or pseudo information, the standard map information will be used as the primary spatial reference (returned by the SPATIALREF property) and the RPC or pseudo information will be the auxiliary spatial reference (returned by the AUXILIARY_SPATIALREF property). RPC information will be written to the header file (for ENVI-format files) if you call the WriteMetadata method.
  • If the raster object contains RPC and pseudo map information, the RPC information will be used as the primary spatial reference (returned by the SPATIALREF property).

AUXILIARY_URI (Get)

This property retrieves a string array containing the URIs for any auxiliary files associated with the raster file. Auxiliary files are files that ENVI creates, specifically header and pyramid files. If there are no associated files, !NULL is returned.

COORD_SYS (Get)

This property retrieves a reference to the ENVICoordSys associated with the raster.

DATA_TYPE (Get)

An integer or string specifying the raster data type (strings are not case-sensitive). When retrieving the property, a string is returned.

String Value Data Type
byte 1 Byte (8 bits)
double 5 Double-precision floating point (64 bits)
float 4 Floating point (32 bits)
int 2 Integer (16 bits)
long 3 Long integer (32 bits)
uint 12 Unsigned integer (16 bits)
ulong 13 Unsigned long integer (32 bits)

You cannot create or modify an ENVIDeepLearningObjectDetectionRaster that contains complex data.

FORMAT (Get)

This property retrieves the image format of the file. ENVI is the supported format.

INTERLEAVE (Get)

A string specifying the interleave of the raster.

String Interleave Data Array
bil Band interleaved by line [ncolumns, nbands, nrows]
bip Band interleaved by pixel [nbands, ncolumns, nrows]
bsq Band sequential [ncolumns, nrows, nbands]

METADATA (Get)

This property retrieves a reference to the ENVIRasterMetadata object. If METADATA and INHERITS_FROM are both set, the new raster will have the union of both sets of metadata. The METADATA values override those from INHERITS_FROM if there is a conflict.

NBANDS (Get)

The number of bands in the raster.

NCOLUMNS (Get)

The number of columns in the raster.

NROWS (Get)

The number of rows in the raster.

PYRAMID_EXISTS (Get)

Returns 1 (TRUE) if a pyramid file exists for the raster, and 0 (FALSE) if not.

READ_ONLY (Get)

Returns 1 (TRUE) if ENVIDeepLearningObjectDetectionRaster is read-only, and 0 (FALSE) if not. If the value is 0, the SetData and Save methods are available.

SPATIALREF (Get)

This property retrieves a reference to an ENVIGLTRasterSpatialRef, ENVIPseudoRasterSpatialRef, ENVIRPCRasterSpatialRef, or ENVIStandardRasterSpatialRef object.

TIME (Get)

This property retrieves a reference to the ENVITime object.

URI (Init, Get)

A string that is a fully qualified raster file path. If not set on initialization, a temporary file will be generated.

Version History


1.2

Introduced

See Also


ENVIDeepLearningRaster, BuildObjectDetectionRasterFromAnnotation Task, TrainTensorFlowObjectDetectionModel Task