GBDX

ENVI® Image Threshold To ROI

This task creates Regions of Interest (ROIs) from band thresholds.

GBDX Registered Name: ENVI_ImageThresholdToROI
Provider: Harris Geospatial Solutions

Imagery Examples

Before: Input image before running ENVI IMage Threshold to ROI

Before: Input image before running ENVI IMage Threshold to ROI

After: Output image from ENVI Image Threshold to ROI

After: Output image from ENVI Image Threshold to ROI

Quickstart

This is a workflow example for basic processing.

# Quickstart Example running the task name.

# Initialize the Environment.
from os.path import join, split
from gbdxtools import Interface
gbdx = Interface()

tasks = []
output_location = 'ENVI/ImageThresholdToROI'

cat_id = '105001000672E000'

# Image Auto ordering task parameters
order = gbdx.Task("Auto_Ordering")
order.inputs.cat_id = cat_id
order.impersonation_allowed = True
order.persist = True
order.timeout = 36000
tasks += [order]

# Image AOP task parameters
aop = gbdx.Task("AOP_Strip_Processor")
aop.inputs.data = order.outputs.s3_location.value
aop.inputs.bands = 'MS'
aop.inputs.enable_dra = False
aop.outputs.data.persist = True
aop.outputs.data.persist_location = output_location+'/aop'
aop.timeout = 36000
tasks += [aop]

# Threshold the image
envi_threshold = gbdx.Task("ENVI_ImageThresholdToROI")
envi_threshold.inputs.input_raster = aop.outputs.data.value
envi_threshold.inputs.roi_name = '["Water", "Land"]'
envi_threshold.inputs.roi_color = '[[0,255,0],[0,0,255]]'
envi_threshold.inputs.threshold = '[[138,221,0],[222,306,0]]'
envi_threshold.inputs.output_roi_uri_filename = "roi"
tasks += [envi_threshold]


workflow = gbdx.Workflow(tasks)
workflow.savedata(
    envi_threshold.outputs.output_roi_uri, location=output_location
)

workflow.execute()

Inputs

The following table lists all ENVI_ImageThresholdToROI inputs.
Mandatory (optional) settings are listed as Required = True (Required = False).

Name Required Default Valid Values Description
file_types False N/A string GBDX Option. Comma seperated list of permitted file type extensions. Use this to filter input files -- Value Type: STRING[*]
input_raster True N/A See ENVIRASTER input type Specify the input raster for applying the thresholds. -- Value Type: ENVIRASTER
input_raster_format False N/A See ENVIRASTER input type Provide the format of the image, for example: landsat-8. -- Value Type: STRING
input_raster_band_grouping False N/A See ENVIRASTER input type Provide the name of the band grouping to be used in the task, ie - panchromatic. -- Value Type: STRING
input_raster_filename False N/A See ENVIRASTER input type Provide the explicit relative raster filename that ENVI will open. This overrides any file lookup in the task runner. -- Value Type: STRING
input_raster_raw_output False False See ENVIRASTER input type Provide True to output an ENVI Binary instead of a tif. -- Value Type: STRING
roi_color True N/A string Specify a (3,n) byte array with the RGB colors for each ROI, where n is the number of ROIs specified by ROI_NAME. -- Value Type: BYTEARRAY
output_roi_uri_filename False N/A string Specify a string with the fully-qualified path and filename for OUTPUT_ROI. -- Value Type: STRING
threshold True N/A string Specify an array that represents a threshold: [minimum, maximum, zero-based band number]. You can have one or more thresholds to one or more ROIs. -- Value Type: DOUBLEARRAY
roi_name True N/A string Specify a string or array of strings with the names of each ROI. -- Value Type: STRINGARRAY

Outputs

The following table lists all ENVI_ImageThresholdToROI outputs.
Mandatory (optional) settings are listed as Required = True (Required = False).

Name Required Default Valid Values Description
task_meta_data False N/A directory GBDX Option. Output location for task meta data such as execution log and output JSON
output_roi_uri True N/A directory Output for OUTPUT_ROI. -- Value Type: ENVIURI

Output structure

The output_roi file(s) will be written in .xml format.

Background

For additional background information on this task please refer to the Harris Geospatial ENVI documentation and
ENVI® Image Threshold To ROI.

Contact

If you have any questions or issues with this task, please contact gbdx-support@digitalglobe.com.