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 ICVG(ISV)
C*****COPIES THE CURVE ISV IN OPEN BUFFER ICB INTO CURVE1
C*****RETURNS ICVG<0 IF SAVE AREA NOT OPEN
	IMPLICIT INTEGER*2(D-Z)
	COMMON//SAVDES(256),CURVE1(512),CURVE2(512),ICS,ICB
	ICVG=0
	IF(GCV(1,ISV).LT.0)GOTO 50
C*****NO. CELLS
	SAVDES(225)=SAVDES(213+ISV)
	RETURN
50	ICVG=-1
	RETURN
	END
	FUNCTION ICVS(ISV)
C*****READS FROM CURVE 1 TO OPEN BUFFER(ICB) CURVE ISV
C*****RETURNS ICVS=-1 SAVE AREA NOT OPEN OTHERWISE ICVS=0
	IMPLICIT LOGICAL*1 (A)
	IMPLICIT INTEGER*2 (D-Z)
	COMMON//SAVDES(256),CURVE1(512),CURVE2(512),ICS,ICB
	DIMENSION MAX(2)
	EQUIVALENCE(CMA,MAX(1))
	ALL=.TRUE.
	ICVS=0
	IF(PCV(1,ISV).LT.0)GOTO 50
C*****NO.CELLS
	SAVDES(213+ISV)=SAVDES(225)
C*****MAX CELL COUNT
	ISV2=ISV*2
	CMA=CMAX(1,ALL)
	SAVDES(227+ISV2)=MAX(1)
	SAVDES(228+ISV2)=MAX(2)
	IF(ISV.GT.SAVDES(184))SAVDES(184)=ISV
C*****SET ROI FLAG DEFINED
	IF(ISV.EQ.0)RETURN
	SAVDES(183+ISV2)=257
	SAVDES(184+ISV2)=257
	RETURN
50	ICVS=-1
	RETURN
	END
