Hi,
This is how I would extract a watershed boundary from a class image (using a shapefile). Someone else may think of a more efficient way, but this method works for me in ENVI versions 5.0 and later.
1. Display the shapefile and class image.
2. Type "build mask" in the search window of the Toolbox and double-click the Build Mask tool.
3. In the Build Mask Input File, select the classification image and click OK.
4. In the Mask Definition dialog, choose Options > Import ROIs.
5. In the Mask Definition Input ROIs dialog, the shapefile should be listed. Select it and click OK.
6. Enter an output filename for the mask, then click OK.
7. Type "apply mask" in the search window of the Toolbox, and double-click the Apply Mask tool.
8. In the Apply Mask Input File dialog, select the classification image. Don't click OK yet.
9. Click the "Select Mask Band" button, then choose the mask image that you just created. Click OK, then OK again in the Apply Mask Input File dialog.
10. In the Apply Mask Parameters dialog, keep the Mask Value of 0, then enter an output filename for the masked image and click OK.
The result will be an image that shows only the classification areas defined by your watershed shapefile. The rest of the pixels will be 0 (black). If needed, you can edit the ENVI header file (.hdr) of this image to set the 'data ignore value' to 0, so that these pixels will be treated as No Data.
I hope this helps.
|