12287 How to change the classification values (pixel values) in an ENVI Classic classification image This Help Article describes how you can change the class values (pixel values) in a classification image in ENVI Classic. This is sometimes useful when trying to match different classification output images that have different values for the same classification types. It is sometimes necessary to reassign class values to new values when working with multiple classification images where the same class type (forest, for example) is classified as a different class value in a different classification image. There are a few ways this can be accomplished in ENVI: Using the Combine Classes tool One way to change the values of a classification image is to use the Combine Classes tool located in the Classification ->Post Classification menu. Combine classes allows you to reassign existing classes to new existing classes. For example, if I want to have Class 1 represented as Class 5 and Class 5 represented as Class 1, I can use Combine Classes to do this. In the Combine Classes Parameters dialog, select Class 1 input to be combined with Class 5 output and then Add Combination. Do the same for Class 5 input and Class 1 output. This will switch the class values (pixel values) and reassign the class names to a new classification image. Using the Band Threshold to ROI Tool Similar to the Combine Classes tool, the Band Threshold to ROI Tool will allow you to change an existing class value to a new existing class value by creating ROIs that represent the new classes. To use this tool, display the classification image and bring up the ROI Tool under Tools ->Region of Interest ->ROI Tool. In the ROI Tool, go to Options ->Band Threshold to ROI. Select the classification image as input. Enter the class value of the first class you want in your new classification image. For example, if I now want class 4 to be class 1, enter 4 as the min and max thresh value. Set the class name in the ROI Name entry box and set the class color in the ROI Color entry box. Select OK and ENVI will find all pixels with a value of 4 and create a new ROI. Do this for all classes you want to change. Once all new classes are defined, select Options ->Create Class Image from ROIs. Select the new ROIs that were created and output the ROIs to a new classification image. Using Band Math Band Math provides a very flexible means of changing pixel values. This method could apply not only to classification images, but any image where changing the pixel values is desired. The key is to use the correct syntax to get the expected results. One example might be that I want to change all class pixel values of 1 to a value of 2. An appropriate band math expression might be: 2*(b1 eq 1) + b1*(b1 ne 1) The first part of the equation, 2*(b1 eq 1), creates a mask where pixel values equal to 1 are set to 1 and all other values are set to 0. Multiplying this result by 2 sets the pixels equal to 1 now equal to 2. The second part of the equation, b1*(b1 ne 1), creates a mask of 1s where the pixels do not equal 1 and where the pixels do equal 1, they are set to 0. Multiplying this mask by the original image sets all values of 1 equal to zero while retaining the original image values everywhere else. Adding these two images together gives us the result we desire - pixel values of 1 are now set to values of 2 while all other pixels remain the same. All band math results are standard ENVI format files. The output will no longer be an ENVI Classification type image. This is easy to change by using the File ->Edit ENVI Header dialog and setting the file type to ENVI Classification. Reviewed 8/25/2014 MM ENVI 4.7 Imaging Notes – Fall 2009 – The Whole World in Your Hands