adel.naseri Posted April 30, 2016 Report Share Posted April 30, 2016 (edited) HI I have masked water in an image and now i want to replace all masked pixels with a desired values.. how i can do this in ENVI Preferably or other Softwares? thanks in advance Edited April 30, 2016 by adel.naseri Quote Link to comment Share on other sites More sharing options...
bejokaryo Posted May 1, 2016 Report Share Posted May 1, 2016 we can use envi classic with band math. for example given band1 (b1), masked value = 0, replace value with 10. use band math (b1 eq 0)*10. then add the image with the non masked (b1 ne 0)*b1. adding both image will combine masked and non masked images. you can also directly add both using formula ((b1 eq 0)*10 + b1). eq means equal. ne means not equal. just check envi help Quote Link to comment Share on other sites More sharing options...
mamadouba Posted May 1, 2016 Report Share Posted May 1, 2016 If the masked values are actually NAN in ENVI, and not 0, you can use the following expression (example replaces NAN with 999 and all other values are preserved): (999 * finite(b1,/nan))+(finite(b1)*(b1 > (-1e+34))) Quote Link to comment Share on other sites More sharing options...
sigologo Posted May 5, 2016 Report Share Posted May 5, 2016 If the masked values are actually NAN in ENVI, and not 0, you can use the following expression (example replaces NAN with 999 and all other values are preserved): (999 * finite(b1,/nan))+(finite(b1)*(b1 > (-1e+34))) Yes Sr on Band Math..... (0 * finite(b1, /nan))+(finite(b1)*(b1 > (-1e+34)))..... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.