macro 'ROT to opt.+ LUT [+]'; var i,j,l:integer; begin EnhanceContrast; ApplyLUT; MultiplyByConstant(0.99); AddConstant(1); for j:=1 to 127 do begin i:=2*j; RedLUT[j]:=255; GreenLUT[j]:=255-i; BlueLUT[j]:=i; end; for j:=1 to 127 do begin i:=2*j; l:=j+127; RedLUT[l]:=255-i; GreenLUT[l]:=i; BlueLUT[l]:=255; end; UpdateLUT; end; macro 'ROT to opt.- LUT [-]'; var i,j,l:integer; begin EnhanceContrast; ApplyLUT; MultiplyByConstant(0.99); AddConstant(1); for j:=1 to 127 do begin i:=2*j; RedLUT[j]:=i; GreenLUT[j]:=255-i; BlueLUT[j]:=255; end; for j:=1 to 127 do begin i:=2*j; l:=j+127; RedLUT[l]:=255; GreenLUT[l]:=i; BlueLUT[l]:=255-i; end; UpdateLUT; end; macro 'ROT to +Pol LUT [L]'; var i,j,l:integer; begin EnhanceContrast; ApplyLUT; MultiplyByConstant(0.99); AddConstant(1); for j:=1 to 127 do begin i:=2*j; RedLUT[j]:=255-i; GreenLUT[j]:=255-i; BlueLUT[j]:=255-i; end; for j:=1 to 127 do begin i:=2*j; l:=j+127; RedLUT[l]:=i; GreenLUT[l]:=i; BlueLUT[l]:=i; end; UpdateLUT; end; macro '(-' begin end; macro 'INC to CirPol [C]'; var i,j,l,diffo:integer; begin AddConstant(1); for j:=0 to 91 do begin RedLUT[j]:=j+j; GreenLUT[j]:=j+j; BlueLUT[j]:=50+j+j; end; for j:=1 to 90 do begin i:=182-j; RedLUT[i]:=j+j; GreenLUT[i]:=j+j; BlueLUT[i]:=50+j+j; end; UpdateLUT; end; macro 'INC strips [Q]'; var i,j,l:integer; begin for i:=1 to 10 do begin j:=i; RedLUT[j]:=48; GreenLUT[j]:=0; BlueLUT[j]:=148; end; for i:=1 to 10 do begin j:=i+10; RedLUT[j]:=0; GreenLUT[j]:=0; BlueLUT[j]:=158; end; for i:=1 to 10 do begin j:=i+20; RedLUT[j]:=0; GreenLUT[j]:=0; BlueLUT[j]:=208; end; for i:=1 to 10 do begin j:=i+30; RedLUT[j]:=0; GreenLUT[j]:=10; BlueLUT[j]:=250; end; for i:=1 to 10 do begin j:=i+40; RedLUT[j]:=0; GreenLUT[j]:=95; BlueLUT[j]:=240; end; for i:=1 to 10 do begin j:=i+50; RedLUT[j]:=0; GreenLUT[j]:=133; BlueLUT[j]:=158; end; for i:=1 to 10 do begin j:=i+60; RedLUT[j]:=0; GreenLUT[j]:=148; BlueLUT[j]:=0; end; for i:=1 to 10 do begin j:=i+70; RedLUT[j]:=0; GreenLUT[j]:=198; BlueLUT[j]:=0; end; for i:=1 to 10 do begin j:=i+80; RedLUT[j]:=10; GreenLUT[j]:=230; BlueLUT[j]:=0; end; for i:=1 to 10 do begin j:=i+90; RedLUT[j]:=100; GreenLUT[j]:=240; BlueLUT[j]:=0; end; for i:=1 to 10 do begin j:=i+100; RedLUT[j]:=198; GreenLUT[j]:=240; BlueLUT[j]:=0; end; for i:=1 to 10 do begin j:=i+110; RedLUT[j]:=240; GreenLUT[j]:=240; BlueLUT[j]:=0; end; for i:=1 to 10 do begin j:=i+120; RedLUT[j]:=250; GreenLUT[j]:=220; BlueLUT[j]:=0; end; for i:=1 to 10 do begin j:=i+130; RedLUT[j]:=240; GreenLUT[j]:=200; BlueLUT[j]:=0; end; for i:=1 to 10 do begin j:=i+140; RedLUT[j]:=240; GreenLUT[j]:=180; BlueLUT[j]:=0; end; for i:=1 to 10 do begin j:=i+150; RedLUT[j]:=240; GreenLUT[j]:=140; BlueLUT[j]:=0; end; for i:=1 to 10 do begin j:=i+160; RedLUT[j]:=240; GreenLUT[j]:=100; BlueLUT[j]:=0; end; for i:=1 to 11 do begin j:=i+170; RedLUT[j]:=240; GreenLUT[j]:=0; BlueLUT[j]:=0; end; UpdateLUT; end; macro 'INC strips black [A]'; var i,j,l:integer; begin for i:=1 to 10 do begin j:=i; RedLUT[j]:=0; GreenLUT[j]:=0; BlueLUT[j]:=0; end; for i:=1 to 10 do begin j:=i+10; RedLUT[j]:=0; GreenLUT[j]:=0; BlueLUT[j]:=208; end; for i:=1 to 10 do begin j:=i+20; RedLUT[j]:=0; GreenLUT[j]:=10; BlueLUT[j]:=250; end; for i:=1 to 10 do begin j:=i+30; RedLUT[j]:=0; GreenLUT[j]:=95; BlueLUT[j]:=240; end; for i:=1 to 10 do begin j:=i+40; RedLUT[j]:=0; GreenLUT[j]:=133; BlueLUT[j]:=158; end; for i:=1 to 10 do begin j:=i+50; RedLUT[j]:=0; GreenLUT[j]:=148; BlueLUT[j]:=0; end; for i:=1 to 10 do begin j:=i+60; RedLUT[j]:=0; GreenLUT[j]:=198; BlueLUT[j]:=0; end; for i:=1 to 10 do begin j:=i+70; RedLUT[j]:=10; GreenLUT[j]:=230; BlueLUT[j]:=0; end; for i:=1 to 10 do begin j:=i+80; RedLUT[j]:=100; GreenLUT[j]:=240; BlueLUT[j]:=0; end; for i:=1 to 10 do begin j:=i+90; RedLUT[j]:=198; GreenLUT[j]:=240; BlueLUT[j]:=0; end; for i:=1 to 10 do begin j:=i+100; RedLUT[j]:=240; GreenLUT[j]:=240; BlueLUT[j]:=0; end; for i:=1 to 10 do begin j:=i+110; RedLUT[j]:=250; GreenLUT[j]:=220; BlueLUT[j]:=0; end; for i:=1 to 10 do begin j:=i+120; RedLUT[j]:=240; GreenLUT[j]:=200; BlueLUT[j]:=0; end; for i:=1 to 10 do begin j:=i+130; RedLUT[j]:=240; GreenLUT[j]:=180; BlueLUT[j]:=0; end; for i:=1 to 10 do begin j:=i+140; RedLUT[j]:=240; GreenLUT[j]:=140; BlueLUT[j]:=0; end; for i:=1 to 10 do begin j:=i+150; RedLUT[j]:=240; GreenLUT[j]:=100; BlueLUT[j]:=0; end; for i:=1 to 10 do begin j:=i+160; RedLUT[j]:=240; GreenLUT[j]:=0; BlueLUT[j]:=0; end; for j:=171 to 255 do begin RedLUT[j]:=0; GreenLUT[j]:=0; BlueLUT[j]:=0; end; UpdateLUT; end; macro 'INC strips black 30 [B]'; var i,j,l:integer; begin for i:=1 to 30 do begin j:=i; RedLUT[j]:=0; GreenLUT[j]:=0; BlueLUT[j]:=0; end; for i:=1 to 10 do begin j:=i+30; RedLUT[j]:=0; GreenLUT[j]:=0; BlueLUT[j]:=208; end; for i:=1 to 10 do begin j:=i+40; RedLUT[j]:=0; GreenLUT[j]:=95; BlueLUT[j]:=240; end; for i:=1 to 10 do begin j:=i+50; RedLUT[j]:=0; GreenLUT[j]:=148; BlueLUT[j]:=0; end; for i:=1 to 10 do begin j:=i+60; RedLUT[j]:=0; GreenLUT[j]:=198; BlueLUT[j]:=0; end; for i:=1 to 10 do begin j:=i+70; RedLUT[j]:=10; GreenLUT[j]:=230; BlueLUT[j]:=0; end; for i:=1 to 10 do begin j:=i+80; RedLUT[j]:=100; GreenLUT[j]:=240; BlueLUT[j]:=0; end; for i:=1 to 10 do begin j:=i+90; RedLUT[j]:=198; GreenLUT[j]:=240; BlueLUT[j]:=0; end; for i:=1 to 10 do begin j:=i+100; RedLUT[j]:=240; GreenLUT[j]:=240; BlueLUT[j]:=0; end; for i:=1 to 10 do begin j:=i+110; RedLUT[j]:=250; GreenLUT[j]:=200; BlueLUT[j]:=0; end; for i:=1 to 10 do begin j:=i+120; RedLUT[j]:=240; GreenLUT[j]:=140; BlueLUT[j]:=0; end; for i:=1 to 10 do begin j:=i+130; RedLUT[j]:=240; GreenLUT[j]:=100; BlueLUT[j]:=0; end; for i:=1 to 10 do begin j:=i+140; RedLUT[j]:=240; GreenLUT[j]:=0; BlueLUT[j]:=0; end; for j:=151 to 255 do begin RedLUT[j]:=0; GreenLUT[j]:=0; BlueLUT[j]:=0; end; UpdateLUT; end; macro '(-' begin end; macro 'Correct INC [Z]'; var i,j,l,minu,maxu,diffu,mino,maxo,diffo:integer; n,mean,mode,min,max:integer; begin Measure; GetResults(n,mean,mode,min,max); ShowHistogram; minu:= GetNumber('lower min (³1): ',min); maxu:= GetNumber('lower max (²90): ',90); mino:=(90-maxu)+91; mino:= GetNumber('upper min (³91): ',mino); maxo:=181-minu; maxo:= GetNumber('upper max (²180): ',maxo); diffu:=maxu-minu+1; diffo:=maxo-mino+1; for j:=1 to minu-1 do begin RedLUT[j]:=255; GreenLUT[j]:=255; BlueLUT[j]:=255; end; for j:=minu to maxu do begin i:=(j-minu)*89/diffu; RedLUT[j]:=255-i; GreenLUT[j]:=255-i; BlueLUT[j]:=255-i; end; for j:=maxu to 90 do begin RedLUT[j]:=255-90; GreenLUT[j]:=255-90; BlueLUT[j]:=256-90; end; for j:=91 to mino-1 do begin RedLUT[j]:=255-91; GreenLUT[j]:=255-91; BlueLUT[j]:=256-91; end; for j:=mino to maxo do begin i:=(j-mino)*89/diffo+91; RedLUT[j]:=255-i; GreenLUT[j]:=255-i; BlueLUT[j]:=255-i; end; for j:=maxo+1 to 180 do begin RedLUT[j]:=255-180; GreenLUT[j]:=255-180; BlueLUT[j]:=255-180; end; UpdateLUT; ApplyLUT; Measure; ShowHistogram; end; macro 'Inflect LUT [G]'; var i,j,l,minu,maxu,diffu,mino,maxo,diffo:integer; factor: real; begin maxu:= GetNumber('inflection grey value: ',127); factor:=254/maxu; maxo:=2*maxu; for j:=1 to maxu do begin RedLUT[j]:=255-j*factor; GreenLUT[j]:=255-j*factor; BlueLUT[j]:=255-j*factor; end; for i:=1 to maxu do begin j:=i+maxu; RedLUT[j]:=(i-1)*factor; GreenLUT[j]:=(i-1)*factor; BlueLUT[j]:=(i-1)*factor; end; for j:=maxo to 255 do begin RedLUT[j]:=255; GreenLUT[j]:=255; BlueLUT[j]:=255; end; UpdateLUT; end; macro '(-' begin end; macro 'Spectrum red-blue-red [1]'; var i,j,l,min,max,sixth,coli:integer; begin min:= GetNumber('azimuth (lower limit): ',-30); max:= GetNumber('azimuth (upper limit): ',30); sixth:=(max-min)/6; coli:=255/sixth; for l:= 0 to sixth do begin j:= 180+min + l; if j > 180 then j :=j-180; RedLUT[j]:= 255; GreenLUT[j]:= l*coli; BlueLUT[j]:= 0; end; for l:= 0 to sixth do begin j:= 180+min + sixth + l; if j > 180 then j :=j-180; RedLUT[j]:= 255-l*coli; GreenLUT[j]:= 255; BlueLUT[j]:= 0; end; for l:= 0 to sixth do begin j:= 180+min + 2*sixth + l; if j > 180 then j :=j-180; RedLUT[j]:= 0; GreenLUT[j]:= 255; BlueLUT[j]:= l*coli; end; for l:= 0 to sixth do begin j:= 180+min + 3*sixth + l; if j > 180 then j :=j-180; RedLUT[j]:= 0; GreenLUT[j]:= 255-l*coli; BlueLUT[j]:= 255; end; for l:= 0 to sixth do begin j:= 180+min + 4*sixth + l; if j > 180 then j :=j-180; RedLUT[j]:= l*coli; GreenLUT[j]:= 0; BlueLUT[j]:= 255; end; for l:= 0 to sixth do begin j:= 180+min + 5*sixth + l; if j > 180 then j :=j-180; RedLUT[j]:= 255; GreenLUT[j]:= 0; BlueLUT[j]:= 255-l*coli; end; UpdateLUT; end; macro 'Spectrum dark-blue-red-dark [2]'; var i,j,l,min,max,sixth,coli:integer; begin min:= GetNumber('azimuth (lower limit): ',-30); max:= GetNumber('azimuth (upper limit): ',30); sixth:=(max-min)/6; coli:=255/sixth; for l:= 0 to sixth do begin j:= 180+min+l; if j > 180 then j :=j-180; RedLUT[j]:= 0; GreenLUT[j]:=0; BlueLUT[j]:= l*coli; end; for l:= 0 to sixth do begin j:= 180+min + sixth+l; if j > 180 then j :=j-180; RedLUT[j]:= 0; GreenLUT[j]:= l*coli; BlueLUT[j]:= 255; end; for l:= 0 to sixth do begin j:= 180+min + 2*sixth+l; if j > 180 then j :=j-180; RedLUT[j]:= 0; GreenLUT[j]:= 255; BlueLUT[j]:= 255-l*coli; end; for l:= 0 to sixth do begin j:= 180+min + 3*sixth+l; if j > 180 then j :=j-180; RedLUT[j]:= l*coli; GreenLUT[j]:= 255; BlueLUT[j]:= 0; end; for l:= 0 to sixth do begin j:= 180+min + 4*sixth+l; if j > 180 then j :=j-180; RedLUT[j]:= 255; GreenLUT[j]:= 255-l*coli; BlueLUT[j]:= 0; end; for l:= 0 to sixth do begin j:= 180+min + 5*sixth + l; if j > 180 then j :=j-180; RedLUT[j]:= 255-l*coli; GreenLUT[j]:= 0; BlueLUT[j]:= 0; end; UpdateLUT; end; macro 'Spectrum black-blue-purple [3]'; var i,j,l,min,max,sixth,coli, coliB,coliD:integer; begin min:= GetNumber('azimuth (lower limit): ',-30); max:= GetNumber('azimuth (upper limit): ',30); sixth:=(max-min)/6; coli:=255/sixth; coliB:=180/sixth; coliD:=75/sixth; for l:= 0 to sixth do begin j:= 180+min + l; if j > 180 then j :=j-180; RedLUT[j]:= 0; GreenLUT[j]:=0; BlueLUT[j]:= l*coli; end; for l:= 0 to sixth do begin j:= 180+min + sixth + l; if j > 180 then j :=j-180; RedLUT[j]:= 0; GreenLUT[j]:= l*coliB; BlueLUT[j]:= 255; end; for l:= 0 to sixth do begin j:= 180+min + 2*sixth + l; if j > 180 then j :=j-180; RedLUT[j]:= 0; GreenLUT[j]:=180+l*coliD; BlueLUT[j]:= 255-l*coli; end; for l:= 0 to sixth do begin j:= 180+min + 3*sixth + l; if j > 180 then j :=j-180; RedLUT[j]:= l*coli; GreenLUT[j]:=255; BlueLUT[j]:= 0; end; for l:= 0 to sixth do begin j:= 180+min + 4*sixth + l; if j > 180 then j :=j-180; RedLUT[j]:= 255; GreenLUT[j]:= 255-l*coli; BlueLUT[j]:= 0; end; for l:= 0 to sixth do begin j:= 180+min + 5*sixth + l; if j > 180 then j :=j-180; RedLUT[j]:= 255; GreenLUT[j]:= 0; BlueLUT[j]:= l*coli; end; UpdateLUT; end; macro 'Spectrum black-black [4]'; var i,j,l,min,max,sixth,coli, coliB,coliD:integer; begin min:= GetNumber('azimuth (lower limit): ',-30); max:= GetNumber('azimuth (upper limit): ',30); sixth:=(max-min)/6; coli:=255/sixth; coliB:=180/sixth; coliD:=75/sixth; for l:= 0 to sixth do begin j:= 180+min + l; if j > 180 then j :=j-180; RedLUT[j]:= 0; GreenLUT[j]:=0; BlueLUT[j]:= l*coli; end; for l:= 0 to sixth do begin j:= 180+min + sixth + l; if j > 180 then j :=j-180; RedLUT[j]:= 0; GreenLUT[j]:= l*coliB; BlueLUT[j]:= 255; end; for l:= 0 to sixth do begin j:= 180+min + 2*sixth + l; if j > 180 then j :=j-180; RedLUT[j]:= 0; GreenLUT[j]:=180+l*coliD; BlueLUT[j]:= 255-l*coli; end; for l:= 0 to sixth do begin j:= 180+min + 3*sixth + l; if j > 180 then j :=j-180; RedLUT[j]:= l*coli; GreenLUT[j]:= 255; BlueLUT[j]:= 0; end; for l:= 0 to sixth do begin j:= 180+min + 4*sixth + l; if j > 180 then j :=j-180; RedLUT[j]:= 255; GreenLUT[j]:= 255-l*coli; BlueLUT[j]:= 0; end; for l:= 0 to sixth do begin j:= 180+min + 5*sixth + l; if j > 180 then j :=j-180; RedLUT[j]:= 255- l*coli; GreenLUT[j]:= 0; BlueLUT[j]:=0; end; for l:= max to (180+min) do begin RedLUT[l]:= 0; GreenLUT[l]:= 0; BlueLUT[l]:=0; end; for l:=181 to 255 do begin RedLUT[l]:= 0; GreenLUT[l]:= 0; BlueLUT[l]:=0; end; end; macro 'Spectrum black-black all > 0 [5]'; var i,j,l,min,max,sixth,coli, coliB,coliD:integer; begin min:= GetNumber('azimuth (lower limit): ',90); max:= GetNumber('azimuth (upper limit): ',120); sixth:=(max-min)/6; coli:=255/sixth; coliB:=180/sixth; coliD:=75/sixth; for l:= 0 to sixth do begin j:= 180+min + l; if j > 180 then j :=j-180; RedLUT[j]:= 0; GreenLUT[j]:=0; BlueLUT[j]:= l*coli; end; for l:= 0 to sixth do begin j:= 180+min + sixth + l; if j > 180 then j :=j-180; RedLUT[j]:= 0; GreenLUT[j]:= l*coliB; BlueLUT[j]:= 255; end; for l:= 0 to sixth do begin j:= 180+min + 2*sixth + l; if j > 180 then j :=j-180; RedLUT[j]:= 0; GreenLUT[j]:=180+l*coliD; BlueLUT[j]:= 255-l*coli; end; for l:= 0 to sixth do begin j:= 180+min + 3*sixth + l; if j > 180 then j :=j-180; RedLUT[j]:= l*coli; GreenLUT[j]:= 255; BlueLUT[j]:= 0; end; for l:= 0 to sixth do begin j:= 180+min + 4*sixth + l; if j > 180 then j :=j-180; RedLUT[j]:= 255; GreenLUT[j]:= 255-l*coli; BlueLUT[j]:= 0; end; for l:= 1 to sixth do begin j:= 180+min + 5*sixth + l; if j > 180 then j :=j-180; RedLUT[j]:= 255- l*coli; GreenLUT[j]:= 0; BlueLUT[j]:=0; end; for l:= max to 255 do begin RedLUT[l]:= 0; GreenLUT[l]:= 0; BlueLUT[l]:=0; end; for l:=0 to (min-1) do begin RedLUT[l]:= 0; GreenLUT[l]:= 0; BlueLUT[l]:=0; end; UpdateLUT; end; macro '(-' begin end; macro 'Misor LUT 45¡=black [M]'; var i,j,l:integer; begin AddConstant (1); for j:=1 to 46 do begin i:=j; RedLUT[i]:=255-5*i; GreenLUT[i]:=0; BlueLUT[i]:=255-5*i; end; for j:=1 to 45 do begin i:=j+46; RedLUT[i]:=0; GreenLUT[i]:=5*j; BlueLUT[i]:=i; end; for j:=92 to 255 do begin RedLUT[j]:=0; GreenLUT[j]:=0; BlueLUT[j]:=0; end; UpdateLUT; end; macro 'Misor 0-30 [I]'; var cone,i,j,l:integer; factor:integer; begin cone:=30; cone:=GetNumber('cone width ? ',cone); factor:=254/cone; for j:=1 to cone do begin i:=j*factor; RedLUT[j]:=255-i; GreenLUT[j]:=255-i; BlueLUT[j]:=255-i; end; for j:=cone+1 to 255 do begin RedLUT[j]:=0; GreenLUT[j]:=0; BlueLUT[j]:=0; end; UpdateLUT; end; macro 'Misor 30-60 [J]'; var cone1,cone2,i,j,l:integer; factor:integer; begin cone1:=30; cone2:=60; cone1:=GetNumber('min. angle to sigma1 ? ',cone1); cone2:=GetNumber('max. angle to sigma1 ? ',cone2); factor:=254/cone2; for j:=1 to cone1 do begin RedLUT[j]:=0; GreenLUT[j]:=0; BlueLUT[j]:=0; end; for j:=cone1 to cone2 do begin i:=(j-cone1)*factor; RedLUT[j]:=255-i; GreenLUT[j]:=255-i; BlueLUT[j]:=255-i; end; for j:=cone2 to 255 do begin RedLUT[j]:=0; GreenLUT[j]:=0; BlueLUT[j]:=0; end; UpdateLUT; end; macro 'Misor 60-90 [N]'; var cone,i,j,l:integer; factor:integer; begin cone:=60; cone:=GetNumber('minimal angle to sigma1 ? ',cone); factor:=254/90; for j:=1 to cone do begin RedLUT[j]:=0; GreenLUT[j]:=0; BlueLUT[j]:=0; end; for j:=cone+1 to 90 do begin i:=(j-cone)*factor; RedLUT[j]:=255-i; GreenLUT[j]:=255-i; BlueLUT[j]:=255-i; end; for j:=91 to 255 do begin RedLUT[j]:=0; GreenLUT[j]:=0; BlueLUT[j]:=0; end; UpdateLUT; end; macro 'Misor inv.spectrum 0¡=red 90¡=dark [O]'; var i,j,l,min,max,sixth,coli:integer; begin min:= 0; max:= 90; sixth:=15; coli:=255/sixth; for l:= 1 to sixth do begin j:= 180+min + l -1; if j > 180 then j :=j-180; RedLUT[j]:= 255; GreenLUT[j]:= (l-1)*coli; BlueLUT[j]:= 0; end; for l:= 1 to sixth do begin j:= 180+min + sixth + l -1; if j > 180 then j :=j-180; RedLUT[j]:= 255-l*coli; GreenLUT[j]:= 255; BlueLUT[j]:= 0; end; for l:= 1 to sixth do begin j:= 180+min + 2*sixth + l -1; if j > 180 then j :=j-180; RedLUT[j]:= 0; GreenLUT[j]:= 255; BlueLUT[j]:= l*coli; end; for l:= 1 to sixth do begin j:= 180+min + 3*sixth + l -1; if j > 180 then j :=j-180; RedLUT[j]:= 0; GreenLUT[j]:= 255-l*coli; BlueLUT[j]:= 255; end; for l:= 1 to sixth do begin j:= 180+min + 4*sixth + l -1; if j > 180 then j :=j-180; RedLUT[j]:= l*10; GreenLUT[j]:= 0; BlueLUT[j]:= 255; end; for l:= 1 to sixth do begin j:= 180+min + 5*sixth + l -1; if j > 180 then j :=j-180; RedLUT[j]:= 150-l*10; GreenLUT[j]:= 0; BlueLUT[j]:= 255-l*coli; end; for l:= 90 to 255 do begin j:=l; RedLUT[j]:= 0; GreenLUT[j]:= 0; BlueLUT[j]:= 0; end; UpdateLUT; end; macro '(-' begin end; macro 'Sawtooth 90 [S]'; var i,j,k,k2,m:integer; begin for m:=1 to 90 do begin i:=m; j:=m+90; k:=2*m; RedLUT[i]:=255-k; GreenLUT[i]:=255-k; BlueLUT[i]:=255-k; RedLUT[j]:=255-k; GreenLUT[j]:=255-k; BlueLUT[j]:=255-k; end; for j:=181 to 255 do begin RedLUT[j]:=0; GreenLUT[j]:=0; BlueLUT[j]:=0; end; UpdateLUT; end; macro 'EDG2 & EDG4 -> histo [E]'; var i,j,k,k2,m:integer; begin Measure; ShowHistogram; for m:=1 to 90 do begin i:=m; j:=m+90; k:=m; RedLUT[i]:=255-k; GreenLUT[i]:=255-k; BlueLUT[i]:=255-k; RedLUT[j]:=255-k; GreenLUT[j]:=255-k; BlueLUT[j]:=255-k; end; for j:=181 to 255 do begin RedLUT[j]:=0; GreenLUT[j]:=0; BlueLUT[j]:=0; end; ApplyLUT; Invert; AddConstant(-165); Measure; ShowHistogram; end; macro 'Contrast low edges [K]'; var i,j,l,minu,maxu,diffu,mino,maxo,diffo:integer; factor: real; begin maxu:= GetNumber('max. value: ',60); factor:=254/maxu; for j:=1 to maxu do begin RedLUT[j]:=255-j*factor; GreenLUT[j]:=255-j*factor; BlueLUT[j]:=255-j*factor; end; for j:=maxu to 253 do begin RedLUT[j]:=255; GreenLUT[j]:=255; BlueLUT[j]:=0; end; for j:=253 to 255 do begin RedLUT[j]:=255; GreenLUT[j]:=255; BlueLUT[j]:=255; end; UpdateLUT; end; macro 'Colour edges [U]'; var i,j,l,minu,maxu,diffu,mino,maxo,diffo:integer; factor: real; begin minu:= GetNumber('min. value: ',2); maxu:= GetNumber('max. value: ',10); diffu:=maxu-minu; factor:=200/diffu; AddConstant(1); for j:=0 to minu do begin RedLUT[j]:=180; GreenLUT[j]:=0; BlueLUT[j]:=200; end; for j:=minu to maxu do begin l:=(j-minu)*factor; RedLUT[j]:=200-l; GreenLUT[j]:=55+l; BlueLUT[j]:=255; end; for j:=maxu to 90 do begin RedLUT[j]:=0; GreenLUT[j]:=0; BlueLUT[j]:=0; end; for j:=91 to 255 do begin RedLUT[j]:=0; GreenLUT[j]:=0; BlueLUT[j]:=0; end; UpdateLUT; end; macro '(-' begin end; macro 'Enhance & Apply [Q]'; var i,j,l:integer; begin EnhanceContrast; ApplyLUT; end; macro 'Plot LUT [T]'; var i,xscale,yscale:real; width,height,margin,pwidth,pheight:integer; xbase,ybase:integer; begin SaveState; margin:=25; pwidth:=400; pheight:=125; width:=pwidth+2*margin; height:=pheight*3+2*margin; SetNewSize(width,height); SetBackground(0); MakeNewWindow('LUT'); xscale:=(pwidth-2)/256; yscale:=(pheight-1)/256; SetForeground(252); xbase:=margin; ybase:=margin; MoveTo(xbase,ybase); for i:=0 to 255 do LineTo(xbase+i*xscale,ybase+RedLUT[i]*yscale); SetForeground(255); MakeRoi(xbase,ybase,pwidth,pheight); FlipVertical; DrawBoundary; SetForeground(253); ybase:=ybase+pheight-1; MoveTo(xbase,ybase); for i:=0 to 255 do LineTo(xbase+i*xscale,ybase+GreenLUT[i]*yscale); SetForeground(255); MakeRoi(xbase,ybase,pwidth,pheight); FlipVertical; DrawBoundary; SetForeground(254); ybase:=ybase+pheight-1; MoveTo(xbase,ybase); for i:=0 to 255 do LineTo(xbase+i*xscale,ybase+BlueLUT[i]*yscale); SetForeground(255); MakeRoi(xbase,ybase,pwidth,pheight); FlipVertical; DrawBoundary; KillRoi; RedLUT[252]:=255; GreenLUT[252]:=0; BlueLUT[252]:=0; RedLUT[253]:=0; GreenLUT[253]:=255; BlueLUT[253]:=0; RedLUT[254]:=0; GreenLUT[254]:=0; BlueLUT[254]:=255; UpdateLUT; SetFont('Geneva'); SetFontSize(9); SetText('Centered'); MoveTo(margin+4,height-margin+8); writeln(0:1:2); MoveTo(margin+pwidth,height-margin+8); writeln(255:1:2); RestoreState; end; macro 'Export LUT [E]'; { Copies the current look-up table to the Area(Red), Mean(Green) and Perimeter/Length(blue) columns. Max Measurements must be set to 256 or greater. } var i:integer; v:real; begin RequiresVersion(1.45); SetCounter(256); SetOptions('Area,Mean, Perimeter'); for i:=0 to 255 do begin rArea[i+1]:=RedLut[i]; rMean[i+1]:=GreenLut[i]; rLength[i+1]:=BlueLut[i]; end; ShowResults; SetExport('Measurements'); Export('RGB LUT'); end; macro 'Reset [R]'; BEGIN SetPalette('Grayscale'); END;