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 SETX(K)
	IMPLICIT INTEGER*2(D-Z)
	IMPLICIT LOGICAL*1(A)
	COMMON//SAVDES(256),CURVE1(512),CURVE2(512)
	COMMON/SET2X/FG,CG(13)
	COMMON/WINDOW/FST,LST
C***** SET UP X CO-ORDS IN CURVE 2
C*****SET UP CG GROUP BOUNDARIES
C******CG(I)IS THE TIME ENDING THE FIRST GROUP
	K=0
	KK=0
	CO=0
	FG=0
C*****SET UP CURVE2 AS TIME CO-ORDINATES
C*****SET UP CG AS CHANGE OF GROUP CO-ORDINATES
	DO 20 I=1, SAVDES(118)
	CG(I)=0
	II=(I-1)*5
	CS=FLOAT(SAVDES(123+II))/FLOAT(SAVDES(122+II))
	DO 10 J=1,SAVDES(119+II)
	KK=KK+1
	IF(KK.LT.FST)GOTO 10
	IF(KK.EQ.FST)FG=I
	IF(KK.GT.LST)GOTO 30
	K=K+1
	CO=CO+CS
	CURVE2(K)=CO
10	CONTINUE
20	IF(K.NE.0)CG(I)=CO
30	RETURN
	END
