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****************************************************************
	FUNCTION ROIMRK(N,ICMP)
	IMPLICIT LOGICAL*1(A)
	IMPLICIT INTEGER*2(D-Z)
	COMMON//ROIMAP(64,36)
	DIMENSION IR(13)
	DATA IR/1,2,4,8,16,32,64,128,256,512,1024,2048,4096/
	ROIMRK=0
	IF(IREADW(2048,ROIMAP,0,ICMP).LT.0)GOTO 200
	JS=1
	JF=32
	AS=.FALSE.
	DO 1 I=1,64
	IX=I
1	IF(ATMRK(IX,1,N,IR))CALL PLTRI(AS,IX,1)
4	DO 6 J=JS,JF
	JX=J
	IF(ATMRK(1,JX,N,IR))CALL PLTRI(AS,1,JX)
6	IF(ATMRK(64,JX,N,IR))CALL PLTRI(AS,64,JX)
	DO 60 J=JS+1,JF-1
	JX=J
	DO 60 K=2,63
	KX=K
	IF(ROIMAP(KX,JX).EQ.0)GOTO 60
	IF(ATRACE(KX,JX,N,IR))CALL PLTRI(AS,KX,JX)
60	CONTINUE
	IF(AS)GOTO 80
	IF(IREADW(2304,ROIMAP,7,ICMP).LT.0)GOTO 200
	JS=3
	JF=36
	AS=.TRUE.
	GOTO 4
80	DO 90 I=1,64
	IX=I
	IF(ATMRK(IX,36,N,IR))CALL PLTRI(AS,IX,36)
90	CONTINUE
	RETURN
200	ROIMRK=-1
	RETURN
	END
