Scales and converts anarray to byte data type.
Min
Top
BYTSCL linearly scales all values of array that lie in the range (Min
If the values of array are outside this range (Min
arr = FINDGEN(100) byt = BYTSCL(arr, Max=50.0) PRINT, SIZE(byt)
1 100 1 100
PRINT, byt
0 5 10 15 20 25 30 35 40 45 50 56 61 66 71 76 81 86 91
96 101 107 112 117 122 127 132 137 142 147 152 158 163 168 173 178 183 188
193 198 203 209 214 219 224 229 234 239 244 249 255 255 255 255 255 255 255
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
255 255 255 255 255
b
. The argument
BYTSCL(b, Min = 50, Max = 70)
b
so all bytes with a value less than or equal to 50 are set to 0, and all bytes with a value greater than or equal to 70 are set to 255. All bytes with a value between 50 and 70 are scaled to lie in the range {0...255}.
OPENR, unit, FILEPATH('whirlpool.img', Subdir = 'data'), /Get_Lun
b = BYTARR(512,512)
READU, unit, b FREE_LUN, unit !Order = 1 LOADCT, 3 WINDOW, 0, Xsize = 1024, Ysize = 512
TV, b, 0
TV, BYTSCL(b, Min = 50, Max = 70), 1
Figure 2-5 Galaxy image before (left) and after (right) contrast enhancement.
Figure 2-6 Galaxy image before (left) and after (right) contrast enhancement.