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 ROIIRE(N)
	IMPLICIT INTEGER*2(D-Z)
	IMPLICIT LOGICAL*1(A)
	COMMON//SAVDES(256),CURVE1(512),CURVE2(512),ICS,ICB
	DIMENSION RIMAP(4)
	DATA RIMAP/3RSY ,3RGAM,3RMAM,3RSYS/
	ROIIRE=1
	ICMP=9
	IF(LOOKUP(ICMP,RIMAP).LT.0)GOTO 200
	IF(PCV(1,12).LT.0)GOTO 250
	IF(ROIMRK(N,ICMP).LT.0)GOTO 200
	IF(GCV(1,12).LT.0)GOTO 250
	IF(IREADW(256,SAVDES,0,ICB).LT.0)GOTO 250
90	CALL CLOSEC(ICMP)
100	RETURN
200	WRITE(7,210)
	ROIIRE=-1
	GOTO 100
250	ROIIRE=0
	WRITE(7,260)
	GOTO 90
210	FORMAT(1X,'GAMMAM.SYS DISK ERROR-TRY PROGRAM RESTART')
260	FORMAT(1X,'GAMMAS.SYS DISK ERROR-TRY PROGRAM RESTART')
	END
