Google
 

Trailing-Edge - PDP-10 Archives - decuslib20-04 - decus/20-0110/crossh.sai
There are 2 other files named crossh.sai in the archive. Click here to see a list.
entry ;
Begin "cross hairs"
COMMENT
.SEC(CROSSH.SAI - GET CROSSHAIRS FOR PIX AND HIST)
.INDEX(CROSSH.SAI - GET CROSSHAIRS FOR PIX AND HIST)

                Richard Gordon and Peter Lemkin
                     Image Processing Unit
                   National Cancer Institute
                 National Institutes of Health
                     Building 36 Room 4D28
                 Bethesda, Maryland 20014 USA

                      phone 301-496-2394


May 27, 1976 - Lemkin, ADDED PUB TITLES
May 25, 1976 - Lemkin, fixed hist crossh
May 20, 1976 - Lemkin, added histogram crosshairs for entire
		histogram in external HIST

	PURPOSE
	-------
	This  procedure  may be invoked after a SHOW command in
PROC10, when The Tektronix  4012  graphics  terminal  is  being
used.   Each  time  any  character but "q" or "Q" is typed, the
coordinates of the crosshairs will be typed out. The coordinate
system is that of the original image, in row and column picture
elements. It may also be invoked after a HISTOGRAM in PROC10 to
find  the  value  in the hist[column] where hist is an external
array in PRCINV.
.;



Internal Procedure CROSSHAIRS;
    Begin "CROSSH.SAI"

External Integer 
	halfx,halfy;


Require "DEFINE.REQ" source!file ;
Require "PRCMAX.REQ" source!file ;
Require "PRCINV.REQ" source!file ;
Require "SYS:DISPRM.SAI" source!file ;

Real Array xy[1:2];

Internal Integer crossrow,crosscolumn;

Integer character,crosshair!requests;

String stext;
	character_0;
comment quit on q or Q;
	crosshair!requests_0;
	While not (character='161 or character='121) do
	Begin "getting coordinates of crosshair"
	    DWIND(0,779,0,779);
	    DCROSS(1,xy[1],character);
	    crosshair!requests_crosshair!requests+1;
	If (lastrow-firstrow) leq 256
		Then
		Begin "image c-h"
		stext_"R";
		crossrow_(xy[2]-halfy)/7;
		crosscolumn_(xy[1]-halfx)/7.0043;
		crossrow_firstrow+abs(sampled)*crossrow;
		crossrow_255-crossrow;
		crosscolumn_firstcolumn+abs(sampled)*crosscolumn;
		End "image c-h"
		Else
		Begin "hist c-h"
		stext_"HIST[C]";
		crosscolumn_0 Max (xy[1]*(256.0/779.0) Min 255);
		crossrow_hist[crosscolumn];
		End "hist c-h";
	    If  crosshair!requests=1
	    Then DOPEN(999)
	    Else DAPPEND(999);
	    DWIND(0,1,0,1);
	    DMOVE(0,1-crosshair!requests*.05);
	    If (lastrow-firstrow leq 256) or 
		((0 leq crossrow leq 255) And 
		 (0 leq crosscolumn leq 255))
		Then
		 DTEXT("CROSSHAIRS ("& stext &",c) at ("&cvs(crossrow)
			& ","&cvs( crosscolumn)&")")
		Else
		DTEXT("Outside of image");
	    If  crosshair!requests=1
	    Then DTEXT(" Type Q to quit");
	    DPOST(999);
	    DDONE1;
	End "getting coordinates of crosshair";
	DKILL(999);
    End "CROSSH.SAI";

End "cross hairs";