Showing results for 
Search instead for 
Do you mean 

How to fill an AOI with a constant value

by Technical Evangelist on ‎02-15-2016 06:23 AM - edited on ‎03-21-2016 02:21 PM by Anonymous (719 Views)


I am trying to fill an AOI w/ a constant value. I have a raster (US 8 bit, thematic or continuous) with all pixels having a value of 1. I add an AOI (same projection) and I would like to fill this AOI w/ a constant value. When I try to use the fill tool and have the AOI highlighted in the contents, it give an error and says incorrect layer type. If I click on the image in the contents, then click on the fill tool, it only allows me to fill the entire image w/ a constant value.


I found a workaround for this problem. If I use the classic interface the fill tool works fine. So, there must be something wrong w/ the new interface and the fill tool. I'm running Imagine 10.1.1 on windows xp, 64 bit.


The procedure for changing the pixel values inside an AOI has changed a bit since the previous version. The Area Fill tool is found under the Multispectral or Panchromatic or Thematic tab depending on what type of data you have displayed in the Viewer. The Area Fill tool is opened by selecting the Fill icon found in the Edit group. The other “Area Fill” tool found under the Drawing tab is actually just a color chooser used for selecting the style to fill AOIs.

Since your image is filled with a constant value of 1 and it is displayed with a stretch by default it will be displayed as grey instead of black. When you use the Area Fill tool it will appear that the entire image is being filled with a constant value, but this is due to the data stretch lookup table. If you save your image and clear the Viewer, the image statistics will be recalculated and when you redisplay your raster image again you will notice that only the area inside your AOI was filled with the value you specified.

Open your image in an IMAGINE 2D View with the No Stretch option enabled. The image will appear black. Draw an AOI polygon around the area that you wish to change. Make sure that the AOI is selected. Open the Area Fill tool by clicking on the Fill icon in found in the Edit group under the Panchromatic/Multispectral/Thematic tab. You must highlight the name of your raster image in the Contents panel for the Panchromatic/Multispectral/Thematic tab to be displayed. In the Area Fill tool, make sure that the Function option is set to Constant and that the Fill With value is set to the new pixel value that you want. Click the Apply button to convert the pixel values within the AOI polygon to the new pixel value. A warning message will pop up saying "Since this function modifies the pixel values of the image, you may wish to recalculate the statistics and histogram for the layer before doing any other operation that depends on this data.” Click OK. Save your image. Remove your image from the 2D View and redisplay it.