How to calculate the histogram percentage for each class in a thematic raster image and add the results to the image attribute table?
You can add a Percentage column to the raster attribute table. Display a thematic image in a 2D View. From the IMAGINE workspace Contents panel, right-click on the image name to open the context menu for the displayed raster image and select Display Attribute Table. The attribute table will be added to the bottom of the IMAGINE workspace.
Select Column Properties from the Table tab.
From the Column Properties dialogue select New. Change the title to Percentage. Check the Editable option. Change the Type pulldown menu to Real.
Select the More button located at the right of the Format window. In the Number Format dialogue, enter ‘0.00%’. Select OK.
Select the More button located at the right of the Formula window. Enter this formula $"Histogram"/(total number of pixels) where "262144" in this example equals the number of pixels in the raster image (columns X rows). In this example the raster image is 512 columns by 512 rows. Click OK to close the Formula dialogue.
Select Apply on OK, then click OK in Column Properties dialogue to add the Percentage attribute.