c** facelift.mac cw 1/15/96 c** optimize facelift parameters by correcting c** a small submatrix (fingerprint) with a range of parameters c** needs subsequent visual analysis and manual removal c** of trial matrizes ; conditional definitions... ; preparation ... def mnupf3 ./macs/ ; change this if necessary def x0pnt 512 eva x1pnt (&x0pnt+256) def y0pnt 1000 eva y1pnt (&y0pnt+256) cdf d1fw1 32 cdf d1fw2 64 cdf d1fwin 32 cdf dim 1 cdf d2fw1 3 cdf d2fw2 5 cdf d2fwin 2 cdf std1 1.5 cdf std2 2.5 cdf stdin 1.0 def nbuf &nframe def siz &frsize c** save current plot limits c** culled from limits2d.mac def matrix &matfil exr matisppm ppmsta if &ppmsta eq 1 then exr matpnt2ppm lolim loppm exr matpnt2ppm hilim hippm eif def limfil '&dimenD_tmp' def savpfx &macpfx def macpfx &limpfx opn mac '&limfil' 0 if &ppmsta eq 0 then for idimen 1 &dimen put def lolim&idimen &lolim&idimen put def hilim&idimen &hilim&idimen nex els for idimen 1 &dimen put def loppm&idimen &loppm&idimen put def hippm&idimen &hippm&idimen nex put exr matppm2pnt loppm lolim put exr matppm2pnt hippm hilim eif put ret put end cls def macpfx &savpfx c** extract submatrix c** pick region interactively c** 256 * 256 points (fixed), location determined by user c** (cur 2 1 2 1 puts up a box of fixed size and can be moved) ty ty --------------------------- ty ty Select a region of interest ty cur 2 1 2 1 ;ty &x0pnt &x1pnt &y0pnt &y1pnt def d1strt &x0pnt def d1stop &x1pnt def d2strt &y0pnt def d2stop &y1pnt cfg &d1size 65 ty ty ------------------------------------------ ty ty Reconfigured memory and building submatrix ty ty please be patient... ty bld raw 2 256 256 0 y cmx c** the bookkeeping over what rows are extracted and stuffed c** into buffers or already written to the submatrix c** isn't pretty, but it works ... c**-) mat &matrix def count 0 def buf 0 eva endrow (&d2strt+63) submatrix: if &endrow lt &d2stop then for lrow &d2strt &endrow eva count (&count+1) eva buf (&buf+1) loa 0 &lrow shl &d1strt def datsiz 256 stb &buf next def buf 0 eva nrow (&count-63) cmx mat raw w eva srowmx (&nrow+63) for srow &nrow &srowmx eva buf (&buf+1) ldb &buf sto 0 &srow next def buf 0 mat &matrix eva d2strt (&d2strt+64) eva endrow (&endrow+64) go submatrix eif c** setup: def button 0 mnu p facelift 15 2 if &button eq 0 quit c** loop through all parameter values c** write shell script to run facelift for fw &d1fw1 &d1fw2 &d1fwin ; need kludge for looping through real numbers def std &std1 loop: if &std gt &std2 continue for smo &d2fw1 &d2fw2 &d2fwin ; ty Running facelift with fw= &fw std= &std smo= &smo opn nul f.sh 0 putfacelift <