Industry Solutions
Academic
Defense & Intelligence
Fed/Civil
Maritime
Precision Agriculture
Utilities
Custom Solutions
Software & Technology
ENVI
ENVI SARscape
Helios
IDL
Jagwire
Geospatial Services Framework
Data & Imagery
Aerial Imagery
Elevation Data
Geiger-mode LiDAR
Mapping Services
Satellite Imagery
Visual Simulation
Learn
Case Studies
Whitepapers
Videos
Blogs
Brochures
Training
Support
Forums
Extensions
Self Help Tools
Documentation Center
Tutorials
Help Articles
Product Updates
Technical Support
Company
About Harris Geospatial Solutions
Core Technology
News
Careers
Partners
Events
Tradeshows
Webinar
Contact Us
Loading
My Account
|
Register
|
Login
X
Industry Solutions
Academic
Defense & Intelligence
Fed/Civil
Maritime
Precision Agriculture
Utilities
Custom Solutions
Software & Technology
ENVI
ENVI SARscape
Helios
IDL
Jagwire
Geospatial Services Framework
Data & Imagery
Aerial Imagery
Elevation Data
Geiger-mode LiDAR
Mapping Services
Satellite Imagery
Visual Simulation
Learn
Case Studies
Whitepapers
Videos
Blogs
Brochures
Training
Support
Forums
Extensions
Self Help Tools
Documentation Center
Tutorials
Help Articles
Product Updates
Technical Support
Company
About Harris Geospatial Solutions
Core Technology
News
Careers
Partners
Events
Tradeshows
Webinar
Contact Us
Support
Forums
Products
ENVI
Maintain background pixels through raster stretch
Forums
Search Forum
Search
Advanced Search
Topics
Posts
Unanswered
Active Topics
Prev
Go to previous topic
Next
Go to next topic
Last Post 05 Mar 2018 10:59 AM by
Mari Minari
Maintain background pixels through raster stretch
4 Replies
Sort:
Oldest First
Most Recent First
You are not authorized to post a reply.
Author
Messages
Solar Smith
New Member
Posts:4
23 Feb 2018 10:56 AM
I'm trying to write automated processing routines to stretch and reformat my binary file data.
I have floating point raster data in which the background pixels are zero and all valid values are greater than zero.
I need to stretch the data to byte values and keep the background pixels distinct from the data pixels.
I'm trying to use ENVILogStretchRaster to stretch the data. Unfortunately, pixel values near the MIN value are being mapped to zero which then look like background values. I'd like to be able to specify the valid output range for valid data but I don't see the ability to do that in the ...StretchRaster documentation.
Lacking an alternative, I'm resorting to using 'WHERE' to first identify the non-background pixels before the stretch, then another 'WHERE' to change all of the non-backgournd stretched values that are zero to '1'. However, this requires a couple of extra 'GetData' processes which are very inefficient with large datasets. Is there a faster, more efficient way to stretch the data and preserve background pixels as background?
Mari Minari
Veteran Member
Posts:1961
26 Feb 2018 11:35 AM
Have you tried one of the Stretch options after applying a mask to the 0 values using the Data ignore value?
http://www.harrisgeospatial.com/docs/Masks.html
Solar Smith
New Member
Posts:4
26 Feb 2018 10:35 PM
Yes, I did try setting the Data_Ignore_Value but I still saw no zero for both the output background pixels and the lowest data pixels.
Solar Smith
New Member
Posts:4
26 Feb 2018 10:51 PM
It's possible I didn't understand how to properly create and apply a mask using the 'Data_Ignore_Value' with the ENVI??StretchRaster routine. It might be helpful if I saw a script sample of how to correctly do that with say 'ENVILogStretchRaster'.
Thanks
Mari Minari
Veteran Member
Posts:1961
05 Mar 2018 10:59 AM
I could stretch the data using the following code. This includes setting the data ignore value, calculating the statistical min/max and then stretching the remaining values to bytes:
pro stretchFloats
compile_opt idl2
e=envi()
file='c:\temp\Quac_scaled.dat'
raster=e.openraster(file)
;start task
task1 = ENVITask('EditRasterMetadata')
task1.input_raster=raster
task1.data_ignore_value = 0.0
task1.output_raster_uri = e.GetTemporaryFilename()
task1.execute
DataColl = e.Data
DataColl.Add, Task1.Output_Raster
Task2=ENVITask('RasterStatistics')
task2.input_raster=task1.output_raster
Task2.Execute
Print, Task2.MAX
Print, Task2.MIN
Task3=ENVITask('LogStretchRaster')
task3.input_raster=task1.output_raster
Task3.MIN = task2.min
Task3.MAX = task2.max
Task3.OUTPUT_RASTER_URI = e.GetTemporaryFilename()
task3.Execute
DataColl = e.Data
DataColl.Add, Task3.Output_Raster
view = e.GetView()
layer = view.CreateLayer(task3.output_raster)
end
You are not authorized to post a reply.
Forum Groups & Categories
--Harris Geospatial Solutions
----Licensing & Installation
----General Questions
Products
--ENVI
----ENVI LiDAR
----ENVI
----ENVI SARscape
----ENVI OneButton
--ENVI SARscape
--IDL
--Enterprise
----ENVI Services Engine (ESE)
----Jagwire
----ENVI for ArcGIS Services Editi...
Forums
Products
ENVI