The CreateTileIterator function method returns a reference to an ENVIRasterIterator object.

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

Example


Follow these steps:

  1. Copy and paste the procedure into an IDL editor window.
  2. Save the file as envideeplearningraster_tiles_example.pro.
  3. Compile and run the procedure.
PRO envideeplearningraster_tiles_example
COMPILE_OPT IDL2
 
; Launch the application
e = ENVI(/HEADLESS)
 
; Update the following line with the correct path
; to the tutorial data files
File = Filepath('LabelRasterContainers.dat', $
  Subdir=['data','deep_learning'], Root_Dir=e.Root_Dir)
Raster = ENVIDeepLearningRaster(File)
 
; Iterate through the tiles of the first band
tiles = Raster.CreateTileIterator(BANDS=0)
count = 0
FOREACH tile, tiles DO BEGIN
  count++
  Print, ''
  Print, 'Tile Number: '
  Print, count
  Print, 'Min: '
  Print, MIN(tile)
  Print, 'Max: '
  Print, MAX(tile)
  Print, 'Band: '
  Print, tiles.CURRENT_BAND
  Print, 'Sub_rect: '
  Print, tiles.CURRENT_SUBRECT
ENDFOREACH
END

Syntax


Result = ENVIDeepLearningRaster.CreateTileIterator ([, Keywords=value])

Return Value


This method returns a reference to an ENVIRasterIterator for the ENVIRaster.

Keywords


Keywords are applied only during the initial creation of the object.

BANDS

Set this keyword to an n-element array expressing the integer indices (0-based) of the bands to be included in the spectral range the iterator will traverse. By default, all bands will be included.

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.

MODE

Set this keyword to one of the following case-insensitive strings: 'spatial', 'spectral'.

If set to 'spatial' (the default value), the iterator returns two-dimensional tiles of the form:

[range(columns dimension), range(rows dimension)]

The same spatial range is returned N times for N bands specified by the BANDS keyword.

If set to 'spectral', the iterator returns two-dimensional tiles of the form:

[range(columns dimension), range(bands dimension)]

In this case, a tile is returned for each row in the iterator span.

SUB_RECT

Set this keyword to a four-element array expressing the spatial range (in pixels) of the subset to be included in the spatial range the iterator will traverse. By default, the full extent of the image will be included. The array is of the form [x1, y1, x2, y2], where:

x1 = First pixel of the columns dimension

y1 = First pixel of the rows dimension

x2 = Last pixel of the columns dimension

y2 = Last pixel of the rows dimension

Pixel coordinates are zero-based.

TILE_SIZE

A two-element array expressing the size (in pixels) of the tiles to be returned by the iterator. The first element defines size in the columns dimension; the second in the rows dimension. TILE_SIZE specifies the preferred dimensions; many tiles (such as edge cases) will be smaller than the specified size. TILE_SIZE is ignored when MODE='spectral'. The default value is 1024 x 1024, or the image dimensions if they are smaller.

Version History


Deep Learning 1.0

Introduced

See Also


ENVIDeepLearningRaster