//$MENU window=fprintimage;popup=Normalization;insertafter=auto assign using standard (curves);name=Auto assign (sequencer profiles) string st,st1,comments; integer refsyscount,lanecount,laneresol,lanenr,i,j,p,cert,bandcount,ok,refband1,refband2,band1,band2; float h,w,refps1,refps2,ps1,ps2,a,b; float refsyspos[],refsysdiff[],bandh[],diff,score,bestscore; integer bandpos[],bestband1,bestband2; DIALOG dlg; if AnFprGetCurrent="" then AnFprAttach; if AnFprGetCurrent="" then { message("No fingerprint analysis present"); stop; } st=AnFprGetRefSystem; refsyscount=0; while st<>"" do { st1=splitstring(st," "); splitstring(st1,":"); refsyscount=refsyscount+1; refsyspos[refsyscount]=val(st1); } if refsyscount<2 then { message("Insufficient number of reference bands"); stop; } for i=1 to refsyscount do { if (i>1) and (i1 then if bandh[i]2 then if bandh[i]1 then if bandpos[i]-bandpos[i-1]1.0/1.5) and (b<1.5) then { j=1;score=0; for i=1 to refsyscount do { while (j0 then score=score+diff*diff; } if score>bestscore then { bestscore=score; bestband1=band1; bestband2=band2; } } } if bestband1>0 then { ps1=bandpos[bestband1]/laneresol*100; ps2=bandpos[bestband2]/laneresol*100; b=(refps2-refps1)/(ps2-ps1); a=refps1-ps1*b; j=1;score=0; for i=1 to refsyscount do { while (j0 then AnFprSetRefLink(lanenr,i,bandpos[j]); } // AnFprSetRefLink(lanenr,refband1,bandpos[bestband1]); // AnFprSetRefLink(lanenr,refband2,bandpos[bestband2]); } } if comments<>"" then { DlgAddEdit(dlg,comments,15,15,400,300); DlgAddButton(dlg,"Close",11,350,325,65,25); DlgShow(dlg,"Error report",450,400); }