Hi,
You can do this using ENVI's masking tool:
Open your image in ENVI.
From the menu bar, select Basic Tools > Masking > Build Mask.
In the Mask Definition dialog, select Options > Import Data Range.
Select your input image when prompted.
In the Input for Data Range Mask dialog, enter:
Data Min Value: 2
Data Max Value: 2
Click OK.
Select Options > Import Data Range again.
In the Input for Data Range Mask dialog, enter:
Data Min Value: 4
Data Max Value: 4
Click OK.
Select the Options menu again and ensure that the following options are enabled:
Selected Areas "On"
Selected Attributes [ Logical OR]
Choose an output filename for the mask, and click Apply.
The resulting mask file will have the pixel values re-mapped according to what you wanted (2 and 4 are now "1", and everything else is "0.")
|