C****************************************************************
C* 								*
C*								*
C*	DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPONSIBILITY *
C*	EITHER FOR THE CREATION OR FOR THE CLINICAL EFFICACY	*
C*	OF THIS PROGRAM. USERS MUST ASSUME FULL RESPONSIBILITY	*
C*	FOR ANY RESULTS OR DIAGNOSES OBTAINED FROM THE USE	*
C*	OF THIS PROGRAM. QUESTIONS ON THE EXECUTION OF THIS	*
C*	PROGRAM MUST BE REFERRED BACK TO THE ORIGINAL AUTHOR.	*
C*								*
C* AUTHOR:	SALLY FORSTER					*
C*		C/O DEPARTMENT OF NUCLEAR MEDICINE		*
C*		GUY'S HOSPITAL				*
C*		LONDON, ENGLAND					*
C*								*
C*		TEL: 01-407-7600 EXT 2583/4			*
C*								*
C****************************************************************
	SUBROUTINE PLTRI(AS,K,JJ)
	IMPLICIT LOGICAL*1(A)
	DIMENSION AX(4),AY(4)
	J=JJ
	IF(AS)J=J+28
	M=(K-1)*2
	L=(J-1)*2
	AX(1)=M
	AX(2)=M+1
	AX(3)=M+1
	AX(4)=M
	AY(1)=L
	AY(2)=L
	AY(3)=L+1
	AY(4)=L+1
	CALL PLOTB(AX,AY,4,14,"77)
	RETURN
	END
	FUNCTION ATRACE(I,J,N,IR)
C******	DRAWS POINT IJ IF IT IS ON THE BOUNDARY OF ONE OF
C****** THE FIRST N REGIONS OF INTEREST
	IMPLICIT LOGICAL*1(A)
	IMPLICIT INTEGER*2(D-Z)
	COMMON//ROIMAP(64,36)
	DIMENSION IR(13)
	ATRACE=.FALSE.
	DO 11 K=1,N
	IRM=IR(K)
	IF((ROIMAP(I,J).AND.IRM).EQ.0)GOTO 11
	DO 10 IS=I-1,I+1
	DO 10 JS=J-1,J+1
	IF((ROIMAP(IS,JS).AND.IRM).EQ.0)GOTO 15
10	CONTINUE
11	CONTINUE
	RETURN
15	ATRACE=.TRUE.
	RETURN
	END
	FUNCTION ATMRK(I,J,N,IR)
	IMPLICIT INTEGER*2(D-Z)
	IMPLICIT LOGICAL*1(A)
	COMMON//ROIMAP(64,36)
	DIMENSION IR(13)
	ATMRK=.FALSE.
	DO 10 K=1,N
	IRM=IR(K)
	IF(ROIMAP(I,J).AND.IRM)GOTO 15
10	CONTINUE
	RETURN
15	ATMRK=.TRUE.
	RETURN
	END
