Cast Raster Data Types
Use Cast Raster Data Type to change, or cast, the pixel values of a raster to a different data type; for example, unsigned integer or double-precision floating-point.
You can also write a script to cast raster data types using the CastRaster task.
- From the Toolbox, select Raster Management > Cast Raster Data Type.
- Select an Input Raster and perform optional spatial or spectral subsetting, and/or masking.
-
From the Data Type drop-down list, select the data type to cast the pixel values to. The choices are:
- byte: An 8-bit unsigned integer ranging in value from 0 to 255.
- int: A 16-bit signed integer ranging from -32,768 to +32,767.
- long: A 32-bit signed integer ranging in value from -2,147,483,648 to +2,147,483,647.
- float: A 32-bit, single-precision, floating-point number in the range of ±1038, with approximately six or seven significant digits.
- double: A 64-bit, double-precision, floating-point number in the range of ±10308 with approximately 15 or 16 significant digits.
- uint: A 16-bit unsigned integer ranging from 0 to 65,535.
- ulong: A 32-bit unsigned integer ranging in value from 0 to 4,294,967,295.
Note: Casting a floating-point raster to integer will truncate the data values. Overflow will occur when the original value is greater than the maximum value for the output data type.
- Optional: In the Data Ignore Value field, specify a numeric pixel value that will be ignored upon export. The pixel state of the output raster will be the same as that of the input raster, regardless of whether or not it was set. The data ignore value should be different from any other pixel value in the input raster, in order to avoid masking out good pixels during export.
-
To write the output to disk, select the File radio button and specify a filename and location. To produce output in memory only, select the Virtual radio button.
- Enable the Display result check box to display the output in the view when processing is complete. Otherwise, if the check box is disabled, the result can be loaded from the Data Manager.
-
To reuse these task settings in future ENVI sessions, save them to a file. Click the down arrow next to the OK button
, select Save Parameter Values, then specify the path and filename to save to. Note that some parameter types, such as rasters, vectors, and ROIs, will not be saved with the file. To apply the saved task settings, click the down arrow and select Restore Parameter Values, then select the file where you previously saved your settings.
-
You can run the process in the background on your computer or in the background on an ENVI Server (if available). Click the down arrow
next to the OK button and select one of the following:
- Run Task in the Background: Runs the process on your computer. This method does not use an ENVI Server. The job progress will show in the ENVI Job Console's Background Jobs tab.
- Run Task on envi_server_name. Runs the process on the selected ENVI Server. The job progress will show in the ENVI Job Console's envi_server_name tab.
See ENVI Job Console for details on monitoring ENVI Server jobs and viewing results. See ENVI Servers for details on configuring and using an ENVI Server.
- Click OK.