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 GAMACC(C,IX1,IX2)
C*****FINDS STARTING APPROX TO GAMMA FIT
	COMMON//IBLK(256),CURVE1(512),CURVE2(512)
	COMMON/WINDOW/IFST,ILST
	REAL*8 CDX,CDY,CLX,CLY,CYY,CYYX,CYYLX,C(9)
	DO 5 I=1,9
5	C(I)=0.
	DO 10 I=IX1,IX2
	CX=CURVE2(I-IFST+1)
	CY=CURVE1(I)
	CLX=0
	CLY=0
	IF(CX.NE.0)CLX=DBLE(ALOG(CX))
	IF(CY.NE.0)CLY=DBLE(ALOG(CY))
	CDY=DBLE(CY)
	CDX=DBLE(CX)
	CYY=CDY*CDY
	CYYX=CYY*CDX
	CYYLX=CYY*CLX
	C(1)=C(1)+CYY
	C(2)=C(2)+CYYLX*CLX
	C(3)=C(3)+CYYLX
	C(4)=C(4)+CYYLX*CDX
	C(5)=C(5)+CYYX
	C(6)=C(6)+CYYX*CDX
	C(7)=C(7)+CYYLX*CLY
	C(8)=C(8)+CYY*CLY
	C(9)=C(9)+CYYX*CLY
10	CONTINUE
	RETURN
	END
