############################################################################# # LENGTH MEASUREMENTS ON VIDEO # # v1.1E - Oct 10,1993 # # by Vincenzo Della Mea, Dept. of Pathology, University of Udine, Italy # ############################################################################# write "MEASTOOL v1.1E - by Vincenzo Della Mea, Dept. of Pathology, Udine, Italy" write "Initialization. Wait..." vmcset 2,1 vmcamp 1000,255 setframe "F512" makeim "F2",256,0,768,512,128,128 makeim "F1",0,0,768,512,768,512 setframe "F512" loadlut "grey" clearallio 0 ovcolour 3 #database db="measdb" global length lunghezza = 0.0 fvd[]=length DBerase db DBcreate db,"fvd" setframe "F1" clearallov Grectg 1,0,0,256,512,-1,0 Grectg 1,0,0,256,100,-1,7 Gstring 1,30,20,"MEASTOOL",-2,2,0 Gstring 1,20,60,"Dept. of Pathology",-2,1,0 Gstring 1, 2,80,"Univ. of Udine, Italy",-2,1,0 Gstring 1,230, 5,"VDM",-2,0,0 Gstring 1,5, 5,"v1.1E",-2,0,0 for i=0,i<7,i=i+1 Grectg 1,0,100+i*40,256,40,-1,0 endfor Gstring 1,50,105,"0.625x",-1,2,0 Gstring 1,50,145,"2.5x",-1,2,0 Gstring 1,50,185,"10x",-1,2,0 Gstring 1,50,225,"20x",-1,2,0 Gstring 1,50,265,"40x",-1,2 Gstring 1,50,305,"63x",-1,2,0 Gstring 1,50,345,"100x",-1,2,0 Gvector 1,0,450,256,450,-1 Gstring 1,80,465,"END",-1,2,0 Grectg 1,2,381,252,68,-1,7 Gstring 1,180,430,"micron",-2,1,0 scalgeom 1, "cplx2.5",_OFF,_OFF sx=SCALEX sy=SCALEY Grectg 1,5,155,20,10,-1,7 mag=1 magy=160 n=1 com=256 stato=0 ancora=1 numero="0123456789" ax=ay=dx=dy=512 tvon while ancora if (n!=0) : tvon Gcursori "display.def",px,py,0 if px450 ancora=0 else if n>=0 if n==0 setframe "F512" scalgeom 1,"cplx2.5",_OFF,_OFF SCALEX = SCALEX*4 SCALEY = SCALEY*4 scanin 5,_OFF setopt 1,2.500,1.25,1.54,0.00,8.00,_OFF lx = 4 ly = 4 setframe "F1" clear 1,0 display 1 write "This function needs motorized microscope and 2.5x objective" Grectg 1,256,100,511,411,-2,7 Gstring 1,280,100,"Select 2.5x objective",-1,1,0 Gstring 1,280,200,"Search first field",-1,1,0 Gstring 1,280,300,"Focus",-1,1,0 Gstring 1,280,400,"and hit a key",-1,1,0 setframe "F512" tvon pause movmea lx,ly,_ON, _ON setframe "F2" tvinp 1 tvon _STATUS = 13 riga=1 colonna=0 uno=1 while _STATUS == 13 setframe "F2" movwait 0 tvinp riga+colonna*lx display riga+colonna*lx setframe "F1" display 1 colonna=colonna+uno if (colonna==lx) uno=-uno riga=riga+1 colonna=colonna + uno endif if (colonna==-1) uno=-uno riga=riga+1 colonna=colonna+uno endif write riga," ",colonna setframe "F512" movmea lx,ly,_OFF,_ON if _STATUS == 5 :break movwait _STATUS=13 endwhile loadlut "grey" setframe "F1" Grectg 1,256,100,511,411,-2,7 display 1 endif if n==1 : scalgeom 1,"cplx2.5",_OFF,_OFF if n==2 : scalgeom 1,"cplx10",_OFF,_OFF if n==3 : scalgeom 1,"cplx20",_OFF,_OFF if n==4 : scalgeom 1,"cplx40",_OFF,_OFF if n==5 : scalgeom 1,"cplx63",_OFF,_OFF if n==6 : scalgeom 1,"cplx100",_OFF,_OFF if ((n>=0)&&(n<=6)) sx=SCALEX sy=SCALEY Grectg "display.def",5,magy-5,20,10,-2,7 mag=n magy=120+40*mag Grectg "display.def",5,magy-5,20,10,-1,7 endif endif endif else if stato==0 Gvector "display.def",dx,dy,ax,ay,-2 dx=px dy=py stato=1 Grectg "display.def",49,381,205,48,-1,7 else ax=px ay=py stato=0 dist=sqrt((ax*sx-dx*sx)*(ax*sx-dx*sx)+(ay*sy-dy*sy)*(ay*sy-dy*sy)) numero=string(int(dist)) Gvector "display.def",dx,dy,ax,ay,-1 Gstring "display.def",50,395,numero,-2,2,0 length=dist DBopen db,"fvd" DBappend db DBclose db endif endif endwhile nome="" read "File name to save the results:", nome if (flength(nome)>0) : dos "copy d:/varie/data/measdb.d00 d:/varie/data/"+nome+".d00" outhist "measdb","length",15,_OFF,_OFF,0,_ON,_ON,0.00,100.00,100.00,"","MEASTOOL" setframe "F512" delim "F1" delim "F2" clearallio stop