![]()
REM ** EXAM_16.PRO **
REM Ctrl-Quad to 90% & calls two NonCtrl-s
SetFileTypes ListModeFile, "FCLM", "TEXT", "SFWF"
SelectFile ListModeFile, "Control LM file (4 parameters)"
SelectFile ListModeFile, "First LM file (4 parameters)"
SelectFile ListModeFile, "Second LM file (4 parameters)"
OpenLMFile "", "Control LM file (4 parameters)"
NewHgr 1, 2, "All[FS,SS]" of All
HgrName$="All[FS,SS]"
Classify
qhor=10:qver=10
minpercent=90:incr=300
SetQuadrant "All[FS,SS]",qhor, qver
if QuadPercent ("All[FS,SS]",3)>minpercent then goto @goodis
gosub @quadopt
@goodis:
ShowHgr "All[FS,SS]", 0.7, 5.3, 49.2, 49.2, MD
Print:print "Control LL Quadrant Statistics of histogram "+ HgrName$
print "Quadrant intersection at:"
print " x = ";qhor
print " y = ";qver
print "(1) Number and Percent of Events:"
print " No. =";QuadEventNum ("All[FS,SS]",3);
print ", ";QuadPercent ("All[FS,SS]",3);" %"
print "(2) Mean +/- SD:"
print " Hor: ";QuadMean ("All[FS,SS]",3,1);
print " +/- ";QuadSD ("All[FS,SS]",3,1)
print " Ver: ";QuadMean ("All[FS,SS]",3,2);
print " +/- ";QuadSD ("All[FS,SS]",3,2)
OpenLMFile "", "First LM file (4 parameters)"
gosub @quadstat
OpenLMFile "", "Second LM file (4 parameters)"
gosub @quadstat
end
@quadstat:
NewHgr 1, 2, "All[FS,SS]" of All
HgrName$="All[FS,SS]"
Classify
SetQuadrant "All[FS,SS]",qhor, qver
Print:print " Quadrant Statistics of histogram "+ HgrName$
print "Quadrant intersection at:"
print " x = ";qhor
print " y = ";qver
for i=1 to 4
if i=1 then QName$="Upper Left":goto @tedd
if i=2 then QName$="Upper Right":goto @tedd
if i=3 then QName$="Lower Left":goto @tedd
QName$="Lower Right"
@tedd:
Print:print QName$+" Quadrant"
print "(1) Number and Percent of Events:"
print " No. =";QuadEventNum ("All[FS,SS]",i);
print ", ";QuadPercent ("All[FS,SS]",i);" %"
print "(2) Mean +/- SD:"
print " Hor: ";QuadMean ("All[FS,SS]",i,1);
print " +/- ";QuadSD ("All[FS,SS]",i,1)
print " Ver: ";QuadMean ("All[FS,SS]",i,2);
print " +/- ";QuadSD ("All[FS,SS]",i,2)
next i
return
@quadopt:
rem Subroutine: Finds quadrant intersection to have 90% of
rem events in the lower right quadrant region
@setopt:
SetQuadrant "All[FS,SS]",qhor, qver
if QuadPercent ("All[FS,SS]",3)>minpercent then goto @lowerincr
SetQuadrant "All[FS,SS]",qhor+incr, qver
LLNohor=QuadEventNum ("All[FS,SS]",3)
SetQuadrant "All[FS,SS]",qhor, qver+incr
LLNover=QuadEventNum ("All[FS,SS]",3)
hincr=0:vincr=0
if LLNohor+LLNover=0 then hincr=incr:vincr=incr:goto @case0
if LLNohor>LLNover then hincr=incr else vincr=incr
@case0:
qhor=qhor+hincr:qver=qver+vincr
if qhor>1023 then qhor=1023
if qver>1023 then qver=1023
goto @setopt
@lowerincr:
incr=incr/5
rem incr=int(incr)
if incr<2 then return
qhor=qhor-hincr:qver=qver-vincr
if qhor<10 then qhor=10
if qver<10 then qver=10
goto @setopt
![]()
Soft
Flow home page | List of Examples | Library
of FCAP BASIC Applications