#skrypt przeznaczony do konwersji wartosci logarytmowanych do DN #z wyrównaniem wartości do obrazu oryginalnego clear(); raster A; GetInputRaster(A); #wskazanie jednego z rastrów RGB - pozyskanie informacji o pełnej sciezce do pliku string f$=GetObjectFileName(A);print(f$); string path$=FileNameGetPath(f$);print(path$); CloseRaster(A); class RVC_OBJITEM list[]; # ponizej wskazanie wszystkich rastrów rgb DlgGetObjects("Select a bunch of rasters", "Raster", list, "ExistingOnly", 1, 1032); # Get the keys for the HASH class STRINGLIST listkeys = list.GetKeys(); #petla obliczeniowa numeric i; for i = 0 to listkeys.GetNumItems()-1 { local class RASTER R, C, R1; R.Open(list[listkeys.GetString(i)], "Read"); numeric l, c; l=NumLins(R); c=NumCols(R); string type$="16-bit unsigned"; string o$=R.$Info.Name+"-korDN"; string fo$=path$+"/"+o$+".rvc"; string a2$=R.$Info.FileName; numeric a2=strlen(a2$); numeric b=strlen(path$); string o1$=mid$(a2$, a2-(a2-b-2),a2-b-1-25);print(o1$); string o11$=o1$+"-log"; string fo1$=path$+"/"+o1$+"-log.rvc"; OpenRaster(R1, fo1$,o11$); numeric mR1=GlobalMean(R1);print("mR1=",mR1); numeric mR=GlobalMean(R);print("mR=",mR); numeric offset=mR-mR1; CreateRaster(C, fo$, o$, o$, l, c, type$); C=ceil(exp(R-offset)); print(i, " : ", R.$Info.Filename, " / ", R.$Info.Name); R.Close(); CloseRaster(C); }