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 CMAX(I,ALL)
	IMPLICIT LOGICAL*1(A)
	IMPLICIT INTEGER*2 (D-Z)
C*****RETURNS MAXIMUM VALUE IN CURVE I
	COMMON//SAVDES(256),CURVE1(512),CURVE2(512)
	COMMON/WINDOW/FST,LST
	X1=1
	X2=SAVDES(108)
	IF(ALL)GOTO 5
	X1=FST
	X2=LST
5	IOF=0
	IF(I.EQ.2)IOF=512
	CMAX=0
	DO 10 J=X1,X2
10	IF(CMAX.LT.CURVE1(J+IOF))CMAX=CURVE1(J+IOF)
	RETURN
	END
	FUNCTION CMIN(I,ALL)
	IMPLICIT LOGICAL*1(A)
	IMPLICIT INTEGER*2(D-Z)
C*****RETURNS MINIMUM VALUE IN CURVE I
	COMMON//SAVDES(256),CURVE1(512),CURVE2(512)
	COMMON/WINDOW/FST,LST
	X1=1
	X2=SAVDES(108)
	IF(ALL)GOTO 5
	X1=FST
	X2=LST
5	IOF=0
	IF(I.EQ.2)IOF=512
	CMIN=CURVE1(IOF+X1)
	DO 10 J=X1+1,X2
10	IF(CMIN.GT.CURVE1(J+IOF))CMIN=CURVE1(J+IOF)
	RETURN
	END
