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 INTEG(IP)
C*****INTEGRATES THE CURVE (IN N1,N2,I)
C*****I MUST BE A STORAGE REGISTER
	IMPLICIT LOGICAL*1(A)
	IMPLICIT INTEGER*2(D-Z)
	COMMON//SAVDES(256),CURVE1(512)
	COMMON/INPARA/CPAR(10)
	COMMON/CH/F(4),CSR(20)
	IF(IP.NE.3)GOTO 200
	IF(CPAR(3).GE.0)GOTO 200
	INTEG=0
	IX1=INTPAR(1)
	IX2=INTPAR(2)
	IF(IX2.LT.IX1)GOTO 200
	IF(IX1.LT.1.OR.IX2.GT.SAVDES(108))GOTO 200
	CSUM=0
	DO 20 I=IX1,IX2
20	CSUM=CSUM+CURVE1(I)
	CSR(-INT(CPAR(3)))=CSUM
	RETURN
200	INTEG=-1
	RETURN
	END
