This task performs a difference analysis on a specific band in two images.
Example
This example performs a difference analysis between two images from different dates. The images represent NCEP-Reanalysis 2 air temperatures (K) at the 1000-isobar level, at 0600 hours Zulu time. The first image is from 29 December 2012, and the second is from 31 December 2012. Each image has one band. This example uses sample data from the ENVI installation path.
e = ENVI()
TimeSeriesDir = Filepath('', Subdir=['data','time_series'], $
Root_Dir = e.Root_Dir)
files = File_Search(TimeSeriesDir, 'AirTemp*.dat')
numRasters = N_Elements(files)
rasters = ObjArr(numRasters)
FOR i=0, (numRasters-1) DO $
rasters[i] = e.OpenRaster(files[i])
Task = ENVITask('BuildTimeSeries')
Task.INPUT_RASTERS = rasters
Task.Execute
SeriesFile = Task.OUTPUT_RASTERSERIES
SeriesFile.Set, 0
Image1 = SeriesFile.Raster
SeriesFile.Set, 8
Image2 = SeriesFile.Raster
Task = ENVITask('ImageBandDifference')
Task.INPUT_RASTER1 = Image1
Task.INPUT_RASTER2 = Image2
Task.Execute
DataColl = e.Data
DataColl.Add, Task.OUTPUT_RASTER
View = e.GetView()
Layer = View.CreateLayer(Task.OUTPUT_RASTER)
Syntax
Result = ENVITask('ImageBandDifference')
Input properties (Set, Get): INPUT_RASTER1, INPUT_RASTER2, OUTPUT_RASTER_URI
Output properties (Get only): OUTPUT_RASTER
Properties marked as "Set" are those that you can set to specific values. You can also retrieve their current values any time. Properties marked as "Get" are those whose values you can retrieve but not set.
Methods
This task inherits the following methods from ENVITask:
AddParameter
Execute
Parameter
ParameterNames
RemoveParameter
Properties
This task inherits the following properties from ENVITask:
COMMUTE_ON_DOWNSAMPLE
COMMUTE_ON_SUBSET
DESCRIPTION
DISPLAY_NAME
NAME
REVISION
TAGS
This task also contains the following properties:
INPUT_RASTER1 (required)
Specify the first raster on which to perform the image band difference.
INPUT_RASTER2 (required)
Specify the second raster on which to perform the image band difference
OUTPUT_RASTER
This is a reference to the output raster of filetype ENVI. It inherits the same map information (projection, datum, pixel size, image rotation) and wavelengths as INPUT_RASTER1.
OUTPUT_RASTER_URI (optional)
Specify a string with the fully qualified filename and path of the associated OUTPUT_RASTER. If you do not specify this property, or set it to an exclamation symbol (!), a temporary file will be created.
Version History
API Version
4.3
See Also
ENVITask, SAMImageDifference Task