Open Collections

UBC Theses and Dissertations

UBC Theses Logo

UBC Theses and Dissertations

Development of a real-time, microprocessor based, detector of epileptiform activity in EEG Panych, Lawrence Patrick 1984

Your browser doesn't seem to have a PDF viewer, please download the PDF to view this item.

Item Metadata

Download

Media
831-UBC_1984_A7 P35.pdf [ 5.26MB ]
Metadata
JSON: 831-1.0096215.json
JSON-LD: 831-1.0096215-ld.json
RDF/XML (Pretty): 831-1.0096215-rdf.xml
RDF/JSON: 831-1.0096215-rdf.json
Turtle: 831-1.0096215-turtle.txt
N-Triples: 831-1.0096215-rdf-ntriples.txt
Original Record: 831-1.0096215-source.json
Full Text
831-1.0096215-fulltext.txt
Citation
831-1.0096215.ris

Full Text

DEVELOPMENT OF A REAL-TIME, MICROPROCESSOR BASED, DETECTOR OF EPILEPTIFORM ACTIVITY IN EEG by LAWRENCE PATRICK PANYCH B.A., U n i v e r s i t y Of A l b e r t a , 1973 B.Eng. M c G i l l U n i v e r s i t y , 1979 A THESIS SUBMITTED IN PARTIAL FULFILMENT OF THE REQUIREMENTS FOR THE DEGREE OF MASTER OF APPLIED SCIENCES i n THE FACULTY OF GRADUATE STUDIES E l e c t r i c a l E n g i n e e r i n g We a c c e p t t h i s t h e s i s a s c o n f o r m i n g t o t h e r e q u i r e d s t a n d a r d THE UNIVERSITY OF BRITISH COLUMBIA O c t o b e r 1983 © Lawrence P a t r i c k P a n y c h , 1983 I n p r e s e n t i n g t h i s t h e s i s i n p a r t i a l f u l f i l m e n t o f t h e r e q u i r e m e n t s f o r an a d v a n c e d d e g r e e a t t h e U n i v e r s i t y o f B r i t i s h C o l u m b i a , I a g r e e t h a t t h e L i b r a r y s h a l l make i t f r e e l y a v a i l a b l e f o r r e f e r e n c e a n d s t u d y . I f u r t h e r a g r e e t h a t p e r m i s s i o n f o r e x t e n s i v e c o p y i n g o f t h i s t h e s i s f o r s c h o l a r l y p u r p o s e s may be g r a n t e d by t h e h e a d o f my d e p a r t m e n t o r by h i s o r h e r r e p r e s e n t a t i v e s . I t i s u n d e r s t o o d t h a t c o p y i n g o r p u b l i c a t i o n o f t h i s t h e s i s f o r f i n a n c i a l g a i n s h a l l n o t be a l l o w e d w i t h o u t my w r i t t e n p e r m i s s i o n . D e p a r t m e n t o f E l e c t r i c a l Engineering The U n i v e r s i t y o f B r i t i s h C o l u m b i a 2075 Wesbrook P l a c e V a n c o u v e r , C anada V6T 1W5 D a t e 15 November 1983 MP-C (•?/7Q) i i A b s t r a c t T h i s i s an e x p e r i m e n t a l t h e s i s d e s c r i b i n g t h e d e v e l o p m e n t of a m o n i t o r f o r t h e d e t e c t i o n of e p i l e p t i c a c t i v i t y i n t h e human EEG. The m o n i t o r , b u i l t a r o u n d an A p p l e I I P l u s m i c r o c o m p u t e r s y s t e m , has t h e c a p a b i l i t y f o r r e a l - t i m e d e t e c t i o n o f s e i z u r e a c t i v i t y and i n t e r i c t a l t r a n s i e n t s ( s p i k e s and s h a r p waves o r SSW) on 16 EEG c h a n n e l s . A dynamic g r a p h i c s d i s p l a y s y m b o l i c a l l y p r e s e n t s t o t h e u s e r a r u n n i n g sum of t h e SSW d e t e c t e d d u r i n g a m o n i t o r i n g s e s s i o n . A r e p o r t i s p r o d u c e d a t t h e end of t h e s e s s i o n w h i c h i n c l u d e s a summary of SSW d e t e c t i o n s and t h e o n - l i n e phase r e v e r s a l p r o c e s s i n g of t h e t r a n s i e n t s . An a u t o m a t i c s e i z u r e d e t e c t i o n by t h e m o n i t o r w i l l t r i g g e r t h e m a r k i n g of t h e l o c a t i o n of s e i z u r e r e c o r d s on m a g n e t i c EEG r e c o r d i n g d e v i c e s . Of s i g n i f i c a n c e i s a t h e o r e t i c a l e x p l a n a t i o n w h i c h shows why a s i m p l e s l o p e d e t e c t o r p e r f o r m s as w e l l as a c o m p l i c a t e d p a r a m e t r i c t r a n s i e n t d e t e c t o r . The r e a l - t i m e c a p a b i l i t y of t h e s l o p e d e t e c t o r makes i t s u p e r i o r i n p r a c t i c a l a p p l i c a t i o n s . S t a t i s t i c a l d e t e c t i o n t h e o r y i s a p p l i e d t o t h e p r o b l e m of EEG e p i l e p t i c t r a n s i e n t d e t e c t i o n and t h e computer model w h i c h c a l c u l a t e s a t h e o r e t i c a l p e r f o r m a n c e f a c t o r f o r d e t e c t o r s i s d e s c r i b e d . S i m p l e a l g o r i t h m s f o r s e l e c t i n g e p i l e p t i c t r a n s i e n t s b a s e d on m o r p h o l o g i c a l c o n s i d e r a t i o n s and methods o f a r t i f a c t r e j e c t i o n a r e p r e s e n t e d . The m o n i t o r was e v a l u a t e d i n a c l i n i c a l s e i z u r e i n v e s t i g a t i o n u n i t a t t h e U n i v e r s i t y of B r i t i s h C o l u m b i a . C l i n i c a l l y s i g n i f i c a n t s e i z u r e s were d e t e c t e d o v e r a s i x month p e r i o d w i t h a v e r y h i g h s u c c e s s r a t e . In t h e c a s e s of p a t i e n t s w i t h f o c a l e p i l e p s i e s , p r e d i c t i o n s of f o c u s l o c a t i o n s by t h e d e v i c e a g r e e d w i t h t h e n e u r o l o g i c a l d i a g n o s e s o f t h e p a t i e n t s . i v T a b l e of C o n t e n t s A b s t r a c t i i L i s t of T a b l e s v L i s t of F i g u r e s v i I . INTRODUCTION 1 I I . HUMAN EEG AND ITS ANALYSIS 7 2.1 O r i g i n s And C h a r a c t e r i s t i c s Of EEG 7 2 . 2 E p i l e p s y 13 2.3 A u t o m a t i o n Of EEG E v a l u a t i o n 14 2.4 A u t o m a t i c D e t e c t i o n Of SSW 15 2.4.1 N o n - p a r a m e t r i c Methods 15 2.4.2 P a r a m e t r i c Methods Of SSW D e t e c t i o n 19 I I I . DETECTION OF EPILEPTIFORM TRANSIENTS: THEORETICAL CONSIDERATIONS 23 3.1 A s s u m p t i o n s In C h a r a c t e r i z i n g B a c k g r o u n d EEG And SSW 24 3.2 E r r o r P r o b a b i l i t y In B i n a r y D e t e c t i o n Systems 25 3.3 Model F o r E v a l u a t i o n Of D e t e c t o r s 27 3.4 R e s u l t s U s i n g S i m u l a t e d S p e c t r a 30 IV. A SIMPLE DETECTOR OF SSW 40 4.1 Lowpass D i f f e r e n t i a t o r ( B a n d p a s s ) 41 4.2 T h r e s h o l d S e t t i n g s 43 4.3 Waveform S h a r p n e s s 45 4.4 Waveshape Of SSW 46 4.4.1 D u r a t i o n 46 4.4.2 Form F a c t o r 50 4.4.3 T r i a n g u l a r i t y 52 4.5 A r t i f a c t R e j e c t i o n 54 4.5.1 Movement A r t i f a c t 54 4.5.2 S p i n d l e s And A l p h a Rhythms 56 4.6 Phase R e v e r s a l D e t e c t i o n 56 V. DETECTION OF SEIZURE ACTIVITY IN EEG ...59 V I . IMPLEMENTATION OF THE EEG MONITOR .65 6.1 Hardware S t r u c t u r e 66 6.1.1 Computer Hardware 67 6.1.2 I n t e r f a c e Hardware 68 6.2 M o n i t o r S o f t w a r e S t r u c t u r e 69 6.2.1 The SSW M o n i t o r S o f t w a r e 69 6.2.2 The S e i z u r e M o n i t o r S o f t w a r e 73 V I I . RESULTS AND DISCUSSION 74 7.1 E v a l u a t i o n Of The SSW M o n i t o r 75 7.2 E v a l u a t i o n Of The S e i z u r e M o n i t o r 86 V I I I . SUMMARY 90 REFERENCES 94 APPENDIX A - SPECIALLY CONSTRUCTED HARDWARE 99 APPENDIX B - INTERICTAL MONITOR SOFTWARE 102 V L i s t of Tables I. Automatic Detection of Seizures v i L i s t of F i g u r e s 1. S e i z u r e I n v e s t i g a t i o n U n i t 4 2. EEG C h a r t R e c o r d e r 5 3. Tape R e c o r d i n g Equipment 6 4. (a)EEG e l e c t o d e s ( b ) I n t e r n a t i o n a l 10-20 s y s t e m 8 5. T y p i c a l B i p o l a r R e c o r d i n g Montages 9 6. EEG r h ythms; ( a ) a l p h a , ( b ) b e t a , ( c ) d e l t a , ( c ) t h e t a ...11 7. EEG t r a n s i e n t s ( a ) s p i k e s , ( b ) s h a r p waves, ( c ) s p i k e and wave 12 8. EEG a r t i f a c t 12 9. D i s t r i b u t i o n s of Maximum F i r s t D e r i v a t i v e s o f EEG ....18 10. Model f o r EEG S i g n a l , v ( t ) 24 11. A 3 - D i m e n s i o n a l D e c i s i o n Space 26 12. Change i n Power S p e c t r a l D e n s i t i e s due t o L i n e a r F i l t e r 28 13. S p e c t r a l Model o f EEG B a c k g r o u n d 29 14. S p i k e Model and i t s F r e q u e n c y R e p r e s e n t a t i o n 29 15. SNR G a i n : (a) A,, (b) A 2 , and ( c ) A 3 32 16. C o i n c i d e n c e of SSW and N o i s e S p e c t r a ...34 17. S e p a r a t i o n of SSW and N o i s e S p e c t r a 34 18. T y p e s o f H ( f ) f o r w h i c h SNR G a i n i s > 1.0 36 19. R e s u l t s o f SSW d e t e c t i o n 37 20. Response o f F, t o T y p i c a l EEG 39 21. F r e q u e n c y R e s p o n s e of l o w p a s s d i f f e r e n t i a t o r s 42 22. D e f i n i t i o n o f S p i k e D u r a t i o n 48 23. Pseudo d u r a t i o n u s e d by Gotman e t a l 48 24. H a l f w a v e M o d e l l e d by a h y p e r b o l a 49 25. A r e a M a t c h i n g A p p r o a c h f o r Pseudo D u r a t i o n 49 26. Waveform W i t h S u p e r i m p o s e d m u s c l e a r t i f a c t 51 27. Form F a c t o r C o m p u t a t i o n 51 28. D i f f e r e n t Waveforms w i t h e q u a l Form F a c t o r 51 29. T r i a n g u l a r i t y Measure 53 30. N o n - i d e a l Waveform Which P a s s e s t h e t e s t s 53 31. E f f e c t of P a t i e n t Movement on EEG 55 32. M a g n i t u d e Response of S i m p l e D i f f e r e n c e O p e r a t o r , F 5 .55 33. Examples of Phase R e v e r s i n g 58 34. B i p o l a r C h a i n s 58 35. F u n d a m e n t a l F r e q u e n c i e s a t S e i z u r e O n s e t , I 61 36. F u n d a m e n t a l F r e q u e n c i e s a t S e i z u r e O n s e t , I I 61 37. EEG a t S e i z u r e O n s e t 64 38. EEG M o n i t o r Hardware Components 66 39. C o l o r G r a p h i c s D i s p l a y of SSW M o n i t o r 72 40. D e t e c t i o n o f SSW ....76 41. D e t e c t i o n o f SSW; low s i g n a l t o n o i s e r a t i o 76 42. I n t e r i c t a l M o n i t o r i n g ; P a t i e n t A 78 43. I n t e r i c t a l M o n i t o r i n g ; P a t i e n t B 81 44. I n t e r i c t a l M o n i t o r i n g ; P a t i e n t C 83 v i i Acknowledgement I would l i k e to thank Dr. Michael Beddoes, my t h e s i s s u p e r v i s o r , and Dr. Juhn Wada for t h e i r generous support, advice, and patience throughout the long course of t h i s work. I would a l s o l i k e to thank members of Dr. Wada's s t a f f ; K rzysztos Drozd, Sheron S v i t o r k a , P i l a r J i minez, and Edward Cheung f o r t h e i r i n v a l u a b l e advice on matters of EEG technology and Mary Mann for her competent o r g a n i z a t i o n a l a s s i s t a n c e . I g r a t e f u l l y acknowledge the engineering c o l l a b o r a t i o n of my c o l l e g u e s ; Andre Kindsvater, Matthew Palmer, and Douglas Dean. A note of thanks i s a l s o due Ken MacDonald whose t a l e n t s I e x p l o i t e d i n the drawing of f i g u r e 1 of t h i s document. This work has been supported by the N a t i o n a l Research C o u n c i l of Canada (grant No. 67-3290) and the Vancouver Society f o r E p i l e p s y Research. Computer f a c i l i t i e s were, i n p a r t , funded by a c a p i t a l grant from the Woodward Foundation. 1 I . INTRODUCTION A c c o r d i n g t o t h e U.S. N a t i o n a l I n s t i t u t e o f N e u r o l o g i c a l and C o m m u n i c a t i v e D i s e a s e s and S t r o k e , an e s t i m a t e d 2% of t h e p o p u l a t i o n s u f f e r s from some form of e p i l e p s y . ( 3 9 ' In Canada, t h i s r e p r e s e n t s a b o u t 1/2 m i l l i o n p e o p l e o r c l o s e t o 50,000 i n B r i t i s h C o l u m b i a . Most o f t h e s e p e o p l e a r e a b l e t o l e a d p r o d u c t i v e l i v e s w i t h e f f e c t i v e use of m e d i c a t i o n . F o r a b o u t 20%, however, t h e i r c o n d i t i o n r e q u i r e s t h e y be g i v e n s p e c i a l c a r e , o f t e n l e a d i n g t o i n s t i t u t i o n a l i z a t i o n . F o r t u n a t e l y , some of t h e s e i n d i v i d u a l s a r e c a n d i d a t e s f o r a s p e c i a l c u r a t i v e s u r g e r y w h i c h can h e l p them t o l e a d n o r m a l l i v e s . B e f o r e s u c h s u r g e r y can be p e r f o r m e d an i n - d e p t h a s s e s s m e n t must be p e r f o r m e d r e q u i r i n g e x t e n s i v e p a t i e n t m o n i t o r i n g . M o n i t o r i n g p a t i e n t s w i t h e p i l e p s y i s t h e t a s k of a new S e i z u r e I n v e s t i g a t i o n U n i t , r e c e n t l y i n s t a l l e d i n t h e A c u t e C a r e H o s p i t a l a t t h e H e a l t h S c i e n c e s C e n t e r of t h e U n i v e r s i t y o f B r i t i s h C o l u m b i a ( s e e f i g u r e 1 ) . P a t i e n t s a d m i t t e d t o t h e u n i t a r e t h o s e who have n o t r e s p o n d e d w e l l t o m e d i c a t i o n and f o r whom s u r g e r y i s i n d i c a t e d . The s e i z u r e u n i t a t t h e UBC h o s p i t a l has t h e c a p a b i l i t y f o r m o n i t o r i n g two p a t i e n t s c o n c u r r e n t l y , a r o u n d t h e c l o c k . P a t i e n t s ' movements a r e m o n i t o r e d by v i d e o cameras and e l e c t r i c a l s i g n a l s r e c o r d e d a t t h e s c a l p ( e l e c t r o e n c e p h a l o g r a m or EEG) a r e r e g i s t e r e d on s p e c i a l p a p e r c h a r t r e c o r d e r s f o r v i e w i n g ( f i g u r e 2 ) . B o t h v i d e o and EEG s i g n a l s a r e s t o r e d on m a g n e t i c t a p e ( f i g u r e 3 ) . 2 A n e u r o l o g i c a l d i a g n o s i s f o l l o w s from a s t u d y of t h e v i d e o t a p e s of p a t i e n t movement d u r i n g s e i z u r e , as w e l l as from EEG t r a c i n g s of s e i z u r e and b e t w e e n - s e i z u r e ( o r i n t e r i c t a l ) a c t i v i t y . As a p r e l u d e t o s u r g e r y , a g o a l of t h e d i a g n o s i s i s t o d e t e r m i n e i f an e p i l e p t i c f o c u s e x i s t s , how many t h e r e a r e , and where t h e y a r e . The r e c o r d i n g o f s e i z u r e o r i n t e r i c t a l a c t i v i t y i s of no use i f t h e m e d i c a l s t a f f does not know t h a t i t i s t h e r e . Thus, p a t i e n t m o n i t o r i n g r e q u i r e s i n t e l l i g e n t s u p e r v i s i o n f o r i t t o be e f f e c t i v e . Most i n t e r i c t a l a c t i v i t y goes u n n o t i c e d b e c a u s e o f t h e i m p o s s i b i l i t y of r e v i e w i n g a l l d a t a . Many s e i z u r e s a r e m i s s e d b e c a u s e no one i s a v a i l a b l e t o make a n o t e o f them. The p a t i e n t has a s p e c i a l p ush b u t t o n , t o p r e s s when a s e i z u r e o c c u r s . T h i s c a u s e s a 10hz* s i g n a l t o be r e c o r d e d a l o n g w i t h t h e EEG so t h a t when t h e t a p e i s rewound a t h i g h s p e e d t h e r e i s an a u d i b l e t o n e a t t h e l o c a t i o n on t h e t a p e where t h e s e i z u r e o c c u r r e d and s e i z u r e r e c o r d s a r e e a s i l y o b t a i n e d . U n f o r t u n a t e l y , s e i z u r e s a r e o f t e n m i s s e d b e c a u s e t h e p a t i e n t f a i l s t o p r e s s t h e ( s e i z u r e ) b u t t o n . We a r e d e v e l o p i n g a m i c r o p r o c e s s o r - b a s e d EEG p r o c e s s o r f o r use i n t h e s e i z u r e u n i t . I t d e t e c t s s e i z u r e s a u t o m a t i c a l l y from p a t i e n t EEG and s i g n a l s t h e i r o c c u r r e n c e . A computer s e i z u r e d e t e c t i o n c a u s e s t h e r e c o r d i n g t a p e t o be marked a s t h o u g h t h e s e i z u r e b u t t o n had been p r e s s e d . Soon, w i t h t h e c o m p l e t i o n of a new v i d e o t a p e machine c o n t r o l l e r b e i n g d e v e l o p e d a t UBC, when t h e computer d e t e c t s a s e i z u r e , i t s v i d e o r e c o r d w i l l be 3 a u t o m a t i c a l l y t r a n s f e r r e d t o a s i n g l e m a s t e r t a p e f o r e a s y v i e w i n g a t a l a t e r t i m e . The EEG p r o c e s s o r a n a l y s e s a c t i v i t y between s e i z u r e s t o d e t e c t e p i l e p t i f o r m t r a n s i e n t s known as s p i k e s and s h a r p waves (SSW's). S t a t i s t i c s o f SSW d e t e c t i o n s a r e kept and r e p o r t e d a t t h e end o f a r e c o r d i n g s e s s i o n . The a u t o m a t i c SSW d e t e c t i o n c a n be u s e d t o c o n t r o l t h e EEG r e c o r d i n g d e v i c e s t o p r o d u c e a c o m p r e s s e d i n t e r i c t a l r e c o r d . 4 Figure j_ Seizure I n v e s t i g a t i o n U n i t . P a t i e n t movement i s monitored by a video camera(a) and mixed(b) with the video image of the EEG recording(c) to obtain a s p l i t screen image(d). The image i s then taped(e). Sixteen channels of EEG i s r e c o r d e d ( f ) , m u l t i p l e x e d , and sent v i a telemetry to the Seizure U n i t ( g ) . The mu l t i p l e x e d s i g n a l i s stored on audio tape(h). A second p a t i e n t ( i ) can be monitored at the same time. 5 F i g u r e 2 EEG C h a r t R e c o r d e r . A h a r d c o p y of t h e EEG i s o b t a i n e d from a Nihon-Kohden c h a r t r e c o r d e r . 6 F i g u r e 1 Tape R e c o r d i n g E q u i p m e n t . T w e n t y - f o u r h o u r s o f EEG i s s a v e d u s i n g TEAC a u d i o r e c o r d e r s . The l a s t 4 h o u r s o f t h e p a t i e n t v i d e o r e c o r d i s s t o r e d on P a n a s o n i c v i d e o t a p e r e c o r d e r s . 7 I I . HUMAN EEG AND ITS ANALYSIS 2.1 O r i g i n s And C h a r a c t e r i s t i c s Of EEG As e a r l y a s 1875 C a t o n d i s c o v e r e d t h a t t h e b r a i n p r o d u c e d e l e c t r i c a l a c t i v i t y b u t t h e f i r s t r e c o r d e d measurement of p o t e n t i a l s a t t h e human s c a l p was by B e r g e r i n 1924. These p o t e n t i a l s have s i n c e been known as e l e c t r o e n c e p h a l o g r a m s (EEG) as o p p o s e d t o e l e c t r o c o r t i o g r a m s (ECoG) w h i c h a r e r e c o r d e d a t th e c o r t i c a l s u r f a c e . EEG p o t e n t i a l s o r i g i n a t e f r o m a summation o f t h e i n d i v i d u a l n e u r o n s of t h e b r a i n . ' 3 8 ' I n t r a c e l l u l a r r e c o r d i n g s i n d i c a t e t h a t t h e s o u r c e c an be t r a c e d t o g r a d e d s y n a p t i c p o t e n t i a l s g e n e r a t e d by t h e p y r a m i d a l c e l l s of t h e c e r e b r a l c o r t e x . ' 8 ) The p o t e n t i a l s a r e a t t e n u a t e d and d i f f u s e d when c o n d u c t e d t h r o u g h t h e c e r e b r o s p i n a l f l u i d , t h e s k u l l , and t h e s c a l p . They a r e n o r m a l l y l e s s t h a n 100 m i c r o v o l t s i n a m p l i t u d e b u t may be as h i g h a s 1 m i l l i v o l t . S c a l p p o t e n t i a l s a r e a m p l i f i e d by d i f f e r e n t i a l a m p l i f i e r s w i t h i n p u t impedances o f 1 t o 10 megohms and Common Mode R e j e c t i o n R a t i o i n e x c e s s of 500 t o 1.' 7 > S i n g l e o r d e r low and h i g h p a s s f i l t e r s ( c o r n e r f r e q u e n c i e s a t 70hz and 1hz) a r e i n s e r t e d t o r e d u c e a r t i f a c t . E l e c t r o d e s a r e p l a c e d a c c o r d i n g t o th e i n t e r n a t i o n a l 10-20 s y s t e m ( f i g u r e s 4a and 4 b ) . R e c o r d i n g may be e i t h e r b i p o l a r ( d i f f e r e n c e o f a d j a c e n t e l e c t r o d e s ) o r u n i p o l a r ( w i t h r e s p e c t t o a r e f e r e n c e l e a d p l a c e d on t h e nose or 8 o c c i p i t a l bone,, a l t h o u g h , b i p o l a r r e c o r d i n g f a v o r e d £ o r U s W s e n s i t i v i t y t 0 n o i s e . H a n y ^ . ^ ^ montages ( f i g u r e 5) a r e p o s s i b l e . 9 10 The EEG i s i n f l u e n c e d by s e v e r a l f a c t o r s : age, m e n t a l s t a t e , r e g i o n o f b r a i n , h e r e d i t y , d i s e a s e or d r u g s , t e c h n i c a l and b i o l o g i c a l d i s t u r b a n c e s . ( 1 6 > T r a d i t i o n a l l y , t h e EEG has been d e s c r i b e d i n t e r m s o f c h a r a c t e r i s t i c rhythms ( a l p h a , b e t a , d e l t a , t h e t a - f i g u r e 6 ) , t r a n s i e n t s ( s p i k e s , s h a r p waves -f i g u r e 7 ) , and a r t i f a c t u a l c o n t e n t ( f i g u r e 8 ) . S c i e n t i s t s have been a b l e t o c o r r e l a t e c e r t a i n b r a i n a b n o r m a l i t i e s and s t a t e s o f c o n c i o u s n e s s w i t h t h e s e s i g n a l c h a r a c t e r i s t i c s . V a r i o u s s t a g e s o f s l e e p , f o r example, a r e d e f i n e d p a r t i a l l y by dominant EEG r h y t h m s . I t i s p o s s i b l e i n many c a s e s t o d i s t i n g u i s h between n o r m a l and a b n o r m a l EEG. The e x a c t p h y s i o l o g i c a l mechanisms w h i c h g e n e r a t e p a t t e r n s , however, i s not known. A t y p i c a l EEG r e c o r d i n g s e s s i o n w i l l l a s t f o r h a l f an h o u r . The e n v i r o n m e n t i s d e s i g n e d t o m i n i m i z e i n t e r f e r e n c e . As movement u s u a l l y c a u s e s t h e g r e a t e s t p r o b l e m s , t h e p a t i e n t i s a s k e d t o r e m a i n s t i l l f o r t h e e n t i r e p e r i o d . The s e s s i o n may i n c l u d e s e v e r a l p e r i o d s o f e y e s open and c l o s e d , h y p e r v e n t i l a t i o n , or p h o t i c s t i m u l a t i o n . I t may a l s o be n e c e s s a r y t o s t u d y s u b j e c t s o v e r p r o l o n g e d p e r i o d s , w i t h s u c h s e s s i o n s l a s t i n g d a y s o r weeks. The p a t i e n t has much more f r e e d o m t o move ab o u t ( t h a n k s t o t h e i n t r o d u c t i o n o f t e l e m e t r y e q u i p m e n t ) , t h u s , EEG r e c o r d e d d u r i n g t h e s e s e s s i o n s i s c o r r u p t e d t o a l a r g e d e g r e e by a r t i f a c t . 11 A. 8 1 1 - ^ V I A M M I V ^ V ^ 1 sec B. D. Figure 6 EEG rhythms; (a)alpha, (b)beta, ( c ) d e l t a , ' ( c ) t h e t a . 12 1 sec A. B. Figure 7 EEG t r a n s i e n t s ( a ) s p i k e s , (b)sharp waves, ( c ) s p i k e and wave. 8. 1 sec B. Figure 8 EEG a r t i f a c t . 1 3 2.2 E p i l e p s y E p i l e p s y f i r s t came t o be known by i t s c l i n i c a l m a n i f e s t a t i o n s . M u s c u l a r spasms, d i s o r i e n t a t i o n , l o s s of v i s i o n , a g g r e s s i v e o r v i o l e n t b e h a v i o r a r e a l l p o s s i b l e s i g n s . O n l y w i t h t h e i n t r o d u c t i o n o f e l e c t r o e n c e p h a l o g r a p h y as a c l i n i c a l s c i e n c e d i d e p i l e p s y a l s o b e g i n t o become c h a r a c t e r i z e d e l e c t r o g r a p h i c a l l y . E l e c t r i c a l l y , e p i l e p s y i s c h a r a c t e r i z e d by " s y n c h r o n o u s d i s c h a r g e s o f l a r g e g r o u p s of n e u r o n s , o f t e n i n c l u d i n g t h e whole b r a i n " . ' 3 8 } T h e r e a r e many m a n i f e s t a t i o n s o f s e i z u r e a c t i v i t y i n t h e EEG i n c l u d i n g : d e s y n c h r o n i z a t i o n of EEG and d e c r e a s e i n a m p l i t u d e ; m oderate o r h i g h a m p l i t u d e r h y t h m i c a c t i v i t y i n t h e r a n g e o f 1 t o 30 hz, h i g h a m p l i t u d e EMG, o r i r r e g u l a r p a r o x y s m a l a c t i v i t y . P e t i t mal s e i z u r e s a r e i d e n t i f i e d by a f e a t u r e known as s p i k e and wave ( f i g u r e 7 c ) . In s e v e r e g r a n d mal s e i z u r e s EEG waveforms a r e c h a r a c t e r i z e d by h i g h a m p l i t u d e a c t i v i t y o v e r t h e whole o f t h e c o r t e x . S e i z u r e a c t i v i t y may be c o n t a i n e d i n one h e m i s p h e r e of t h e b r a i n - i t may be i n b o t h . Some s m a l l e r s e i z u r e s may e x h i b i t no o b v i o u s change i n t h e EEG a t a l l . A n o t h e r t y p e o f s e i z u r e ( s u b c l i n i c a l o r e l e c t r o g r a p h i c ) i s c h a r a c t e r i z e d s o l e l y by EEG m a n i f e s t a t i o n . T h e r e i s a l s o e v i d e n c e o f i n t e r m i t t e n t , n o n - p e r i o d i c , between s e i z u r e ( i n t e r i c t a l ) a c t i v i t y . T h i s t a k e s t h e form of s h a r p t r a n s i e n t s known as s p i k e s or s h a r p waves (SSW). The m o r p h o l o g y o f i n t e r i c t a l a c t i v i t y i s us e d as a d i a g n o s t i c t o o l , 1 4 p a r t i c u l a r l y f o r l o c a t i n g e p i l e p t i c f o c i i . U n f o r t u n a t e l y , t h e r e i s no s i m p l e d e f i n i t i o n of SSW's. N e u r o l o g i s t s o f t e n d i f f e r a s t o whether or n o t an i n d i v i d u a l waveform i s an SSW ( 2' and d e c i s i o n s a r e b a s e d more on e x p e r i e n c e and i n t u i t i o n t h a n t h e a p p l i c a t i o n o f f i x e d r u l e s . Some w o r k e r s ' 6 1 9 ) have a t t e m p t e d t o q u a n t i f y SSW a c c o r d i n g t o s t a n d a r d p a r a m e t e r s ; a m p l i t u d e , s l o p e , and d u r a t i o n . O t h e r s ' 9 2 1 ' have examined shape c h a r a c t e r i s t i c s s u c h a s asymmetry between r i s i n g and f a l l i n g p h a s e s o f t h e SSW. D u r a t i o n ( s p i k e s - 80 m i l l i s e c o n d s , s h a r p waves - 200 m i l l i s e c o n d s ) i s an i m p o r t a n t d i s t i n g u i s h i n g f e a t u r e , however, s h a r p n e s s i s t h e p r i n c i p l e one. The s h a r p n e s s n e c e s s a r y t o d e f i n e SSW depends on t h e b a c k g r o u n d a c t i v i t y , a l t h o u g h some w o r k e r s ' 2 0 ' have a t t e m p t e d t o d e f i n e i t i n a b s o l u t e t e r m s . 2.3 A u t o m a t i o n Of EEG E v a l u a t i o n E l e c t r o e n c e p h a l o g r a p h y was s l o w e r t o t a k e a d v a n t a g e o f au t o m a t e d t e c h n i q u e s t h a n o t h e r c l i n i c a l s c i e n c e s but i n t h e l a s t d e c a d e and a h a l f t h e r e h as been a l a r g e i n c r e a s e of work i n t h i s a r e a . No d o u b t , t h e a v a i l a b i l i t y of i n t e g r a t e d c i r c u i t s and m i n i c o m p u t e r s was t h e key f a c t o r s p u r r i n g on t h e a u t o m a t i o n o f c l i n i c a l e l e c t r o e n c e p h a l o g r a p h y . The g o a l o f f u l l y a u t o m a t i n g r o u t i n e c l i n i c a l EEG e x a m i n a t i o n s h a s , however, not been r e a l i z e d . Two f a c t o r s a r e i m p o r t a n t : l a c k of knowledge o f EEG and i t s o r i g i n s and t h e l a c k o f n e c e s s a r y c o m p u t i n g power. 15 The impact of m i c r o p r o c e s s o r s and VLSI t e c h n o l o g y on t h e l a t t e r p r o b l e m r e m a i n s t o be s e e n . Automated EEG a n a l y s i s has f o c u s e d on s e v e r a l a r e a s : 1 8 1 (1) S t u d y i n g t h e ra n g e of EEG v a r i a t i o n i n t e r m s of s t a n d a r d p a r a m e t e r s and d e v e l o p m e n t of s t a n d a r d i z e d d a t a b a s e s , (2) F r e q u e n c y a n a l y s i s of b a c k g r o u n d a c t i v i t y , (3) D e t e c t i o n of c l i n i c a l l y s i g n i f i c a n t t r a n s i e n t a c t i v i t y , (4) Development o f s i m p l e , m e a n i n g f u l d i s p l a y s , and (5) C l a s s i f i c a t i o n o f s t a n d a r d p a t t e r n s and f e a t u r e e x t r a c t i o n . Computer a n a l y s i s of EEG o f f e r s t h e p o t e n t i a l f o r a i d i n (1) f r e e i n g t h e s p e c i a l i s t from t e d i o u s , t i m e c o n s u m i n g t a s k s of c l a s s i f i c a t i o n and (2) g a t h e r i n g i n f o r m a t i o n w h i c h was h i t h e r t o u n a v a i l a b l e . The l a t t e r may i n v o l v e (a), a p p l y i n g s t a n d a r d a n a l y s i s t o v e r y l o n g r e c o r d i n g s t o i n c r e a s e t h e amount o f i n f o r m a t i o n ( 1 2 ' o r (b) d e f i n i n g new f e a t u r e s and p a r a m e t e r s i n v i s i b l e t o t h e human eye t o i n c r e a s e t h e t y p e s o f i n f o r m a t i o n a v a i l a b l e . 2.4 A u t o m a t i c D e t e c t i o n Of SSW 2.4.1 N o n - p a r a m e t r i c Methods A t t e n t i o n has f o c u s e d on t h e t a s k o f d e v e l o p i n g a u t o m a t e d methods f o r d e t e c t i n g e p i l e p t i f o r m s p i k e s and s h a r p waves (SSW). C l a i m s have been made of l i m i t e d s u c c e s s i n a c c u r a t e l y l o c a t i n g r e g i o n s where e p i l e p t i c a c t i v i t y o r i g i n a t e s ' 1 * 2 * ' , however, 16 much work r e m a i n s t o be done. The most p o p u l a r p a r a m e t e r u s e d i n e x i s t i n g SSW d e t e c t i o n schemes i s t h e s h a r p n e s s o f a waveform. T h e r e i s some s u p p o r t f o r t h e h y p o t h e s i s t h a t e p i l e p t i f o r m and n o n - e p i l e p t i f o r m waves form two s e p a r a t e s t a t i s t i c a l p o p u l a t i o n s i n terms of t h e i r s h a r p n e s s ' 2 5 3 6 ' ( s e e f i g u r e S ) . S e v e r a l methods u s i n g some fo r m of s h a r p n e s s c r i t e r i o n ( f i r s t or s e c o n d d e r i v a t i v e ) a r e d e s c r i b e d i n t h e l i t e r a t u r e . E a r l i e r s y s t e m s ' 5 3 " 3 7 ' employed o p e r a t i o n a l a m p l i f i e r d i f f e r e n t i a t o r s , t i m e r s , and o t h e r s p e c i a l i z e d a n a l o g c i r c u i t r y . One p r o b l e m w i t h t h e a n a l o g methods i s t h e i n a b i l i t y t o r e j e c t h i g h f r e q u e n c y a r t i f a c t . F i l t e r s w h i c h a d e q u a t e l y a t t e n u a t e m u s c l e a c t i v i t y a l s o d i s t o r t t h e s p i k e waveforms. C u r r e n t a p p r o a c h e s i n v o l v e d i g i t a l b a n d p a s s f i l t e r s . T h e s e t e c h n i q u e s ' 2 2 2 9 3 6 1 d o n ' t e l i m i n a t e t h e p r o b l e m o f m u s c l e a r t i f a c t but r e c o r d s can be f u r t h e r p r o c e s s e d u s i n g n o n - l i n e a r o p e r a t i o n s . Gotman and G l o o r < 1 1 ) have had c o n s i d e r a b l e s u c c e s s w i t h a h e u r i s t i c method w h i c h e xamines s e v e r a l p a r a m e t e r s , i n c l u d i n g s h a r p n e s s o f t h e wave. The EEG s i g n a l i s decomposed i n t o s e q u e n c e s o r h a l f waves. T h e s e a r e c h a r a c t e r i z e d by a r e l a t i v e a m p l i t u d e and a d u r a t i o n w h i c h form a two d i m e n s i o n a l d e c i s i o n s p a c e f o r a c c e p t a n c e of t h e h a l f waves as b e i n g p o t e n t i a l components o f an e p i l e p t i c t r a n s i e n t . A f t e r t r e a t i n g h a l f waves s e p a r a t e l y , f u l l waves a r e examined a c c o r d i n g t o a m p l i t u d e and s h a r p n e s s . T e s t s a r e p e r f o r m e d t o r e j e c t major s o u r c e s of a r t i f a c t . 1 7 T e m p l a t e m a t c h i n g schemes have been u s e d w i t h l i m i t e d s u c c e s s . P o l a and R o m a g n o l i ( 3 1 1 r e p o r t e d u s i n g a t e m p l a t e m a t c h i n g method f o r s p i k e d e t e c t i o n i n t h e d i f f e r e n t i a t e d s i g n a l of s t e r e o e l e c t r d e n c e p h a l o g r a m s ( S E E G ) . The a u t h o r s s t a t e t h a t " t h e a c c u r a c y o f t h e method r a n g e s between 67% and 95%. Such a r a n g e depends e x c l u s i v e l y on m o r p h o l o g y o f t h e examined s p i k e s . " The p r o b l e m i s t h a t m o r p h o l o g y i s w i d e l y v a r i a n t and i t i s q u e s t i o n a b l e i f a s y s t e m w h i c h u s e s a s m a l l enough s e t o f t e m p l a t e s t o be p r a c t i c a l can be i m p l e m e n t e d . S a l z b e r g e t a l ( 3 3 > d e s c r i b e d a more s o p h i s t o c a t e d , a d a p t i v e a p p r o a c h w h i c h i n v o l v e s t r a i n i n g t h e s y s t e m on EEG s p i k e s . D e p t h e l e c t r o d e s were u s e d t o d e t e c t t h e p r e s e n c e o f s p i k e s . The EEG was summed c o h e r e n t l y e a c h t i m e t h e r e was a s p i k e i n a d e p t h e l e c t r o d e . The s p e c t r u m of t h i s c o h e r e n t sum was d i v i d e d by t h e n o i s e s p e c t r u m ( b a c k g r o u n d EEG) and t h e n , u s i n g t h e i n v e r s e F o u r i e r T r a n s f o r m , a t e m p l a t e was o b t a i n e d w h i c h c o u l d t h e n be c o n v o l v e d w i t h EEG f o r s p i k e d e t e c t i o n . T h i s method was a p p l i e d t o a v e r y l i m i t e d number o f s p i k e s , w i t h d i s c o u r a g i n g r e s u l t s . A l l t h e s e methods a r e s i m i l a r i n t h a t t h e y assume a model of t h e i d e a l SSW w h i c h c a n be r e p r e s e n t e d by a f i x e d s e t o f p a r a m e t e r s . The s i g n a l i s t h e n p r o c e s s e d t o f i n d s e c t i o n s whose p a r a m e t r i c m e a s u r e s a r e w i t h i n an a c c e p t a b l e t o l e r a n c e . 18 I I *pike activity B non-spike activity 1 s t d e r i v a t l v e ( a r b i t r a r y u n f t s ) Figure 9 D i s t r i b u t i o n s of Maximum F i r s t D e r i v a t i v e s of EEG. SSW and background appear to form separate populations i n terms of waveform sharpness. 19 2.4.2 P a r a m e t r i c Methods Of SSW D e t e c t i o n Some i n v e s t i g a t o r s have a t t e m p t e d t o i n s t e a d d e v e l o p a l i n e a r , p a r a m e t r i c model of t h e b a c k g r o u n d o r n o r m a l EEG a c t i v i t y . In p r o c e s s i n g t h e s i g n a l , t h e y l o o k f o r s e c t i o n s w h i c h do n o t have t h e same b a c k g r o u n d s t a t i s t i c s . T h e s e s e c t i o n s a r e c a n d i d a t e s f o r e p i l e p t i c t r a n s i e n t s . We assume t h a t EEG i s s t a t i o n a r y o v e r , a t l e a s t , some s m a l l p e r i o d o f t i m e ( i e . 5 s e c o n d s ) . We assume f u r t h e r t h a t t h e s i g n a l , y ( n ) , i s t h e o u t p u t of a l i n e a r s y s t e m , h ( n ) , w i t h i n p u t g ( n ) , a w h i t e G a u s s i a n s e q u e n c e . Then, y ( n ) = - Z a ( k ) - y ( n - k ) + Ko-L b ( i ) » g ( n - i ) ...2.1 k=1,p i=0,q o r , i f H ( z ) i s t h e t r a n s f e r f u n c t i o n o f t h e s y s t e m ; H ( z ) = Y ( z ) / G ( z ) . . .2.2 - i -k =[Ko-( 1+ Z b ( i ) - z ) ] / ( 1 + Z a ( k ) - z ) ...2.3 i= 1 , q k=1,p N o r m a l l y , an a l l - p o l e o r a u t o r e g r e s s i v e model i s u s e d . The c o e f f i c i e n t s b ( i ) = 0 f o r i>0. The g a i n f a c t o r , Ko, i s an a r b i t r a r y c o n s t a n t w h i c h can be s e t t o 1. y ( n ) = -Z a ( k ) - y ( n - k ) + g ( n ) ...2.4 k=1 ,p 20 -k H(z) = 1 / ( 1 + 1 a(k)-z ) = 1 / A(z) ...2.5 k=1 ,p I f the input, cf(n), i s unknown and the s i g n a l i s p r e d i c t e d from past values, then we have the p r e d i c t e d s i g n a l , y'(n), such t h a t ; y'(n) =-I a(k)-y(n-k) . . .2.6 k=1,p Thus, g ( n ) = y ( n ) - y ' ( n ) = e ( n ) ...2.7 In determining the c o e f f i c i e n t s , a ( k ) , we want to minimize the p r e d i c t i o n e r r o r , g(n)=e(n). Using l e a s t squares m i n i m i z a t i o n , we obtain a matrix equation which can be solved to get the c o e f f i c i e n t s , a ( k ) . R(0) R(1) R(2) ...R(p-1) a ( l ) R(1) R(1) R(2) R(3) ...R(p-2) a(2) R(2) R(2) • R(3) • R(4) • ...R(p-3) • a(3) • = -R(3) • • • R(p-• • 1) • • • • ...R(0) • • a(p) • • R(p) •••2.8 A method by D u r b i n < 2 6 ) i n v o l v e s a simple r e c u r s i v e procedure for s o l v i n g equation 2.8. We now have a model of the s t a t i o n a r y EEG s i g n a l whose output i s the product of passing white, Gaussian noise through a l i n e a r system, H=1/A. In other words, the EEG i s modelled as 21 c o l o r e d G a u s s i a n n o i s e . I t i s c l e a r from t h i s d i s c u s s i o n t h a t A ( z ) i s a w h i t e n i n g f i l t e r . In t h e o r y , i f EEG i s p a s s e d t h r o u g h i t we o b t a i n a random, u n c o r r e l a t e d s e q u e n c e , e ( n ) , whose s p e c t r u m i s f l a t . I f t h e r e i s a t r a n s i e n t ( i e . SSW) i n t h e EEG w h i c h i s s t a t i s t i c a l l y i n s i g n i f i c a n t i n t h e c a l c u l a t i o n o f t h e a ( k ) ' s , t h e n t h e o u t p u t o f t h e w h i t e n i n g ( o r i n v e r s e ) f i l t e r w i l l have a h i g h e r a m p l i t u d e s i n c e i t i s t h e p r e d i c t i o n e r r o r . As s u c h , t h e i n v e r s e f i l t e r i n g o p e r a t i o n i s u s e d as a d e t e c t o r o f e p i l e p t i f o r m t r a n s i e n t s . The p a r a m e t r i c a p p r o a c h has been u s e d by a number o f w o r k e r s . A l l use t h e . w h i t e n i n g f i l t e r , b u t once e ( n ) i s o b t a i n e d , t h e s i m i l a r i t y i n methods d i s a p p e a r s . Some use a s i m p l e a m p l i t u d e t h r e s h o l d on e ( n ) f o r t r a n s i e n t d e t e c t i o n w h i l e o t h e r s ( Z e t t e r b e r g ) u s e d e ( n ) 2 . L o p e z da S i l v a ' 2 3 ) sum e ( n ) 2 o v e r a s h o r t i n t e r v a l b e f o r e t e s t i n g a g a i n s t a t h r e s h o l d . O t h e r s have a p p l i e d a s e c o n d d i f f e r e n t i a l o p e r a t o r t o e ( n ) and s e t a t h r e s h o l d l e v e l f o r t h a t . ' 3 ' S t i l l o t h e r s s u g g e s t c o m b i n i n g t h e w h i t e n i n g f i l t e r w i t h t h e matched f i l t e r . ' 1 3 0 ' A d v a n t a g e s t o u s i n g t h e p a r a m e t r i c a p p r o a c h i n c l u d e an a p p a r e n t a b i l i t y t o d e t e c t SSW so o b s c u r e d by b a c k g r o u n d n o i s e t h a t t h e y a r e m i s s e d by t h e human e y e . A n o t h e r a d v a n t a g e i s t h a t , as a . b y p r o d u c t o f t h e method, we g e t a r e l i a b l e s p e c t r a l e s t i m a t e o f t h e b a c k g r o u n d a c t i v i t y . The D u r b i n method even makes i t p o s s i b l e t o s p e c i f y t h e d e g r e e of s p e c t r a l r e s o l u t i o n of t h e e s t i m a t e , so t h a t o n l y s i g n i f i c a n t r e s o n a n c e s a r e 22 r e s o l v e d . T h e r e a r e p r o b l e m s w i t h t h e p a r a m e t r i c a p p r o a c h . The a n a l y s i s assumes s t a t i o n a r i t y of t h e s i g n a l . S i n c e s i g n a l s t a t i s t i c s c a n change a b r u p t l y , however, t h e r e l i a b i l i t y of t h e f i l t e r may be q u e s t i o n e d . B o d e n s t e i n * " ' and M i c h a e l 1 2 8 ' have a t t e m p t e d t o t a c k l e t h i s p r o b l e m by f i r s t s e g m e n t i n g t h e d a t a a c c o r d i n g t o s t a t i s t i c a l r e q u i r e m e n t s . T h e r e may a l s o be p r o b l e m s when t h e t r a i n i n g segment c o n t a i n s a r t i f a c t or a number of SSW. T h i s w i l l b i a s t h e s p e c t r a l e s t i m a t i o n and so d e g r a d e t h e e f f e c t i v e n e s s o f t h e d e t e c t i o n . The c o s t i n c o m p u t a t i o n t i m e o f t h e p a r a m e t r i c method m i g h t be c o n s i d e r e d p r o b l e m a t i c f o r c e r t a i n a p p l i c a t i o n s ( e s p e c i a l l y f o r r e a l - t i m e d e t e c t i o n ) . F i n a l l y , i t s h o u l d be n o t e d t h a t t h e p a r a m e t r i c method i s not an SSW d e t e c t i o n method: i t i s a t r a n s i e n t d e t e c t i o n method. O n l y a s m a l l number of EEG t r a n s i e n t s a r e SSW, t h u s i t i s s t i l l n e c e s s a r y t o d i s t i n g u i s h t h e SSW f r o m t h e o t h e r c l a s s e s of s h o r t t r a n s i e n t s . 23 I I I . DETECTION OF EPILEPTIFORM TRANSIENTS: THEORETICAL CONSIDERATIONS We know of o n l y one c o m p a r a t i v e s t u d y ' 3 ' o f SSW d e t e c t i o n methods and i t i s s t r i c t l y e m p i r i c a l i n a p p r o a c h . U s i n g s t a t i s t i c a l d e t e c t i o n t h e o r y , we w i l l i n t r o d u c e t h e n o t i o n of e r r o r p r o b a b i l i t y as a p e r f o r m a n c e c r i t e r i o n f o r SSW d e t e c t i o n . We w i l l d e s c r i b e a computer model w h i c h computes a t h e o r e t i c a l p e r f o r m a n c e l e v e l f o r SSW d e t e c t o r s u s i n g s i g n a l - t o - n o i s e r a t i o (SNR). T h i s model i s u s e d t o a n a l y s e a p a r a m e t r i c method and t h e s i m p l e s l o p e d e t e c t i o n scheme ( b a n d p a s s ) we have implemented i n our EEG m o n i t o r . 24 3.1 Assumptions In C h a r a c t e r i z i n g Background EEG And SSW In the SSW d e t e c t i o n problem we w i l l assume that EEG, v ( t ) , i s a s u p e r p o s i t i o n of SSW, s ( t ) , and noise, n ( t ) (see f i g u r e 10). The noise i s random, but assumed to be c o l o r e d , Gaussian, and s t a t i o n a r y . The assumptions of Gau s s i a n i t y and s t a t i o n a r i t y have been shown, f o r short segments of 5 seconds or l e s s , to have some experimental j u s t i f i c a t i o n . ( 2 7 } We w i l l assume that the presence of s ( t ) does not a f f e c t the s t a t i s t i c a l p r o p e r t i e s of v ( t ) . Thus, s t a t i s t i c s of n ( t ) can be obtained d i r e c t l y from v ( t ) . What i s known about spikes i s vague. There i s c o nsiderable v a r i a t i o n i n amplitude, d u r a t i o n , and waveshape. Sharp waves, which are q u i t e d i f f e r e n t from s p i k e s , can a l s o occur. L a t e r , we w i l l d escribe SSW i n s t a t i s t i c a l terms, i e . power spectrum only. Here too, however, v a r i a t i o n s permit only a general d e s c r i p t i o n . SSW, sft) Gaussian white noise, g(t) coloring EEG background, J filter n(t) v composite EEG, v(t) Figure 10 Model f o r EEG S i g n a l , v ( t ) . 25 3.2 E r r o r P r o b a b i l i t y In Binary Detection Systems Detection of e p i l e p t i f o r m t r a n s i e n t s f a l l s i n t o the most elementary c l a s s of d e t e c t i o n systems; those which ask i f a s i g n a l i s present or not. In such systems, a u s e f u l performance c r i t e r i o n i s d e t e c t i o n p r o b a b i l i t y and a basic measure of performance i s p r o b a b i l i t y of e r r o r , Pe. There are two types of e r r o r p r o b a b i l i t y i n t h i s system; (1) that an SSW i s present and the system misses i t ( f a l s e r e s t p r o b a b i l i t y = P f r ) and (2) that there i s noise alone but the system f a l s e l y detects an SSW ( f a l s e alarm p r o b a b i l i t y = P f a ) . In an N-dimensional d e c i s i o n space we have N parameters, v 1 v 2 . . . v n , that are outputs of the system ( f i g u r e 11). Then P f r = dv,dv 2...dv n p s ( v , v 2 . . . v n ) ...3.1 Rn Pfa = ^ j . . . ^ dv 1dv 2...dv n pn(v,v 2...v n) ...3.2 RS where p s ( v , v 2 . . . v n ) i s the j o i n t p r o b a b i l i t y f u n c t i o n f o r v , v 2 . . . v n i f an SSW occurs and pn(v,v 2...v n) i f noise alone occurs. Rs i s the region of acceptance for SSW i n the t r i -dimensional space, while Rn i s the region f o r noise alone. T h e o r e t i c a l l y , i f the above p r o b a b i l i t y d e n s i t y f u n c t i o n s are known, we know the p r o b a b i l i t y of d e t e c t i o n e r r o r , Pe, i n the system. Pe = P f r + Pfa ...3.3 Our goal i s to reduce Pe. We can reduce the region Rn to 26 minimize P f r , but that increases P f a : reducing Rs w i l l increase P f r . F alse r e s t e r r o r can only be decreased at the cost of increased f a l s e alarm e r r o r and v i c e versa. The combination of these e r r o r s , Pe, should be minimized subject to one of the c r i t e r i a d e f i n e d below. 1) The i d e a l observer c r i t e r i o n - o v e r a l l e r r o r p r o b a b i l i t y i s minimized. 2) The minimum average l o s s c r i t e r i o n - a l o s s f a c t o r i s assigned to each type of e r r o r , P f r and P f a , and the combined l o s s i s minimized. 3) The Neyman-Pearson c r i t e r i o n - f a l s e r e s t p r o b a b i l i t y i s minimized f o r some f i x e d f a l s e alarm p r o b a b i l i t y . Figure 11 A 3-Dimensional D e c i s i o n Space. 27 3.3 Model For Eva l u a t i o n Of Detectors In l i n e a r systems, e r r o r p r o b a b i l i t y i s a monotonically decreasing f u n c t i o n of s i g n a l - t o - n o i s e r a t i o at the output of the system (SNRo). Therefore, SNRo i s a good measure of system performance, which i s fortunate because i t i s easy to c a l c u l a t e . To b e t t e r understand the usefulness of p a r t i c u l a r f i l t e r s , F^ , we have created a computer model that generates simulated EEG spectra and c a l c u l a t e s t h e o r e t i c a l input and output SNR for each f i l t e r . A = SNRo/SNRi ...3.4 k The q u a n t i t y , A , of equation 3.4 i s an improvement r a t i o i n SNR from input to output. I t provides a good comparative measure for f i l t e r s . We would hope that Afc be at l e a s t 1.0 f o r a l l p o s s i b l e EEG spectra and cons i d e r a b l y greater than 1.0 f o r a lar g e c l a s s of them. C a l c u l a t i o n of A f o r a p a r t i c u l a r f i l t e r i s q u i t e s t r a i g h t forward. Output power s p e c t r a l d e n s i t y (psd), P o ( f ) , from a l i n e a r system i s simply; Po(f) = |F ( f ) | 2 • P i ( f ) .. .3.5 k where F ( f ) i s the f i l t e r t r a n s f e r f u n c t i o n and P i ( f ) i s k the input power s p e c t r a l d e n s i t y . Making use of the model of EEG background as f i l t e r e d white noise we have the s i t u a t i o n as shown i n f i g u r e 12. The psd of EEG background, N ( f ) , i s 28 | H ( f ) j 2 • G n ( f ) , where Gn(f) i s the psd of white noise and H(f) i s the system f u n c t i o n which c o l o r s the noise. Thus, SNRi = J Q(f)df / j N(f)df • • • 3 • 6 SNRo = \ |F ( f ) | 2 - Q ( f ) d f / [ |F ( f ) | 2 - N ( f ) d f - J k J k ...3.7 where Q(f) i s the psd of the SSW whose F o u r i e r Transform i s S ( f ) . Using the r e l a t i o n s i n the above equations, A, can be c a l c u l a t e d for each f i l t e r . SSW, Q(f) white noise, Gn(f) H(f) N(f) k x EEG F ( f ) ) k detector output, |F ( f ) | 2 - Q ( f ) + |F (f) | 2 - N ( f ) k Figure 12 Change i n Power S p e c t r a l D e n s i t i e s due to Linear F i l t e r . 29 FREQUENCY (In) Figure 13 S p e c t r a l Model of EEG Background. EEG spectrum i s modelled using a second order f u n c t i o n of n a t u r a l frequency fo and damping f a c t o r $. A l i n e a r f u n c t i o n takes over f o r higher frequencies. Figure 14 Spike Model and i t s Frequency Representation. 30 To model the EEG spectrum, H ( f ) , we used the scheme shown in f i g u r e 1 3 . The t r a n s f e r f u n c t i o n , H ( f ) , was generated using a second order f u n c t i o n of n a t u r a l frequency, f o , and damping f a c t o r , £. In order to more r e a l i s t i c a l l y represent the high frequency content, we used a second, l i n e a r f u n c t i o n beginning at .05 of the maximum height of the second order f u n c t i o n and d e c l i n i n g to 0 at 50 hz. This i s necessary when c o n s i d e r i n g the inverse s p e c t r a l f i l t e r s , otherwise high frequencies are u n r e a l i s t i c a l l y magnified i n the model. The psd f o r SSW was obtained by t a k i n g a c t u a l SSW ( f i g u r e 14) from EEG records and performing FFT's to get S ( f ) . The i n t e g r a l s of equations 3 . 6 and 3 . 7 were solved n u m e r i c a l l y on a general purpose computer. I n i t i a l l y we compared three f i l t e r i n g methods: (1) a simple bandpass, F, = 2 j • { s i n (2wf ) + sin(47rf)}, (2) the inverse s p e c t r a l f i l t e r , F 2 = 1/H(f), and ( 3 ) the u n r e a l i z a b l e , optimal matched f i l t e r , F 3 = {S* ( f ) • exp( 2 j irt)} / { H(f) } ( u n r e a l i z a b l e because i n p r a c t i c e we don't know S ( f ) ) . 3.4 Results Using Simulated Spectra R e s u l t s are shown i n f i g u r e 15. The f i r s t observation of i n t e r e s t i s the su b - o p t i m a l i t y of f i l t e r s F, and F 2 compared with the matched f i l t e r , F 3. A 3 never f a l l s below 1.0 and only approaches i t i n a very small r e g i o n . Where A 3 approaches 1.0 i s understandable because i t i s for H(f) which are s i m i l a r i n form to S ( f ) . I f s i g n a l and noise have i d e n t i c a l s p e c t r a , the matched f i l t e r w i l l pass both unattenuated and the SNR ga i n , A 3, 31 w i l l be 1.0. A n o t h e r i n t e r e s t i n g r e s u l t i s t h a t , a l t h o u g h t h e a c t u a l v a l u e s of A 2 and A 3 a r e much d i f f e r e n t , t h e c o n t o u r p l o t s a r e s i m i l a r i n s h a p e . F 2 i s m e r e l y a w h i t e n i n g f i l t e r and t h e f i r s t s t a g e i n t h e i m p l e m e n t a t i o n of F 3 . S i n c e t h e SNR g a i n i n d e t e c t i n g a s i g n a l i n w h i t e n o i s e w i t h a matched f i l t e r i s a p p r o x i m a t e l y c o n s t a n t ( 3 2 ' , A 2 and A 3 s h o u l d a l s o d i f f e r by a c o n s t a n t . The c o n s t a n t f a c t o r i s Bn/Bs, where Bs i s t h e s p i k e b a n d w i d t h and Bn i s t h e b a n d w i d t h o f t h e w h i t e n e d n o i s e . In f a c t , t h i s w i l l not be e x a c t l y c o n s t a n t s i n c e t h e w h i t e n i n g p r o c e s s o f F 2 a l t e r s t h e s p e c t r u m of s ( t ) . T h e o r e t i c a l l y , i f t h e SSW s p e c t r u m r e a c h e s i n t o any r a n g e of f r e q u e n c i e s where t h e r e i s no n o i s e power, t h e measure, A 2 , goes t o i n f i n i t y ( f l a w l e s s d e t e c t i o n ) . T h i s i s b e c a u s e t h e i n v e r s e f i l t e r w i l l i n f i n i t e l y b o o s t s i g n a l power i n t h e bands where t h e r e i s no n o i s e . In p r a c t i c e , t h i s d o e s n ' t happen. The r e s u l t s h e r e d e m o n s t r a t e what happens f o r t h e n o n - i d e a l c a s e s . 32 Figure 15 SNR Gain: (a) , (b) A 2, and (c) A 3. 33 When t h e r e i s a c o i n c i d e n c e of SSW s p e c t r a and n o i s e s p e c t r a t h e r e s u l t s c a n be d e v a s t a t i n g f o r o u t p u t SSW power ( f i g u r e 16). The i n v e r s e f i l t e r s u p p r e s s e s n o i s e b u t i t i s t o t a l l y i n d i s c r i m i n a t e i n d e a l i n g w i t h SSW power b e c a u s e i t assumes no p r i o r knowledge o f i t . Even when t h e r e i s c o n s i d e r a b l e s e p a r a t i o n o f t h e SSW and n o i s e s p e c t r a , t h e r e s u l t may n o t be good. In t h e c a s e shown i n f i g u r e 17 t h e i n v e r s e f i l t e r w i l l b o o s t power by a f a c t o r of R. B e c a u s e t h i s i s done a c r o s s t h e whole s p e c t r u m , however, n o i s e power i s a l s o i n c r e a s e d by a f a c t o r of Bn/Bc, where Bc i s t h e b a n d l i m i t of t h e c o l o r e d n o i s e . The SNR improvement from i n p u t t o o u t p u t w i l l be R « ( B c / B n ) w h i c h c o u l d be l e s s t h a n 1 i f t h e r a t i o Bc/Bn i s t o o s m a l l . I f we s t u d y t h e c o n t o u r s , A 2 , i n f i g u r e 15b we see t h a t t h e b e s t r e s u l t s a r e o b t a i n e d a t v e r y low f r e q u e n c i e s o r a t h i g h e r f r e q u e n c i e s i f t h e n o i s e power i s c o n c e n t r a t e d i n a narrow band. When t h e n o i s e s p e c t r u m i s s p r e a d o u t , t h e SSW power i s s e v e r e l y r e d u c e d by t h e i n v e r s e f i l t e r . 34 1 FREQUENCY Figure 16 Coincidence of SSW and Noise Spectra. For t h i s kind of EEG spectrum ( H(f) ) the inverse f i l t e r d / | H ( f ) | 2 ) favors frequencies outside the range where most SSW power i s l o c a t e d . FREQUENCY Figure 17 Separation of SSW and Noise Spectra. Since A 2 = R«(Bc/Bn), i f R = 10 and Bc = .1«Bn, then A 2 i s only 1. 35 One parametric method u s u a l l y f o l l o w s the inverse f i l t e r , F 2 , with a squaring and summing op e r a t i o n . We have already seen the e f f e c t of the inverse f i l t e r i n g . To c a l c u l a t e the c o n t r i b u t i o n of the squaring and summing ( a u t o c o r r e l a t i o n ) we make use of the r e l a t i o n 1 3 2 ' ; Ap = A 3•{ 1/ (1+4Bn-T)} . . .3.8 where Ap i s the SNR improvement for the parametric method ( i n c l u d i n g a u t o c o r r e l a t i o n ) , T i s the i n t e g r a t i o n time = (N-1)*to (to = sampling p e r i o d ) , and T>>l/Bn. Since A 3 i s the improvement f a c t o r for a matched f i l t e r , i t can be expressed as A 2«(Bn/Bs). The e f f e c t of the a u t o c o r r e l a t i o n operation i t s e l f , Aa, i s ; Aa = Ap / A 2 = (Bn/Bs)/(1+4Bn-T) = 1 / 4Bs«T ...3.9 Lopez da S i l v a ' 2 3 ' r e p o r t s using a value of 25 m i l l i s e c o n d s for T. S u b s t i t u t i n g t h i s i n t o equation 3.9, we must have that Bs i s l e s s than 10 hz i n order that Aa be greater than 1. Thus, the d e t e c t a b i l i t y of a s i g n a l i n white noise by t h i s method i s dependent on the s i g n a l ' s bandwidth. Values f o r Ap can be obtained d i r e c t l y from the contours of A 3. Since Ap = .2A 3, the 1.0 contour of Ap i s equivalent to the 5.0 contour of A 3. Comparing t h i s to f i g u r e 15b, we see that the summing and squaring operation o f f e r s some small improvement i n d e t e c t i o n c a p a b i l i t y over simply applying the inverse f i l t e r ( i e . Aa > 1). I t should be noted, though, that we have been l e n i e n t i n a l l o w i n g T = 25 m i l l i s e c o n d s and so v i o l a t i n g the c o n d i t i o n that T>>l/Bn. In r e a l i t y , T should be made much l a r g e r , thus 36 reducing the f a c t o r , l/(1+4Bn•T), i n equation 3.9. Figure 18 shows a comparison of the SNR improvement r a t i o s f o r the inverse f i l t e r and the simple bandpass de t e c t o r . The bandpass, F,, works best at lower frequencies and when the EEG spectra i s more d i s t r i b u t e d . I f most of the noise background i s concentrated i n a resonant peak, F, can even worsen the s i t u a t i o n unless the resonant frequency i s low. In g e n e r a l , however, i t compares very favorably to the inverse f i l t e r i n g method. The only advantage of the inverse f i l t e r over the bandpass method i s f o r a few spectra with strong resonant peaks at higher frequencies. FREQUENCY, f. (hz) Figure 18 Types of H(f) for which SNR Gain i s > 1.0. 37 A. B. c. 0.0 1.25 2.5 3 7 5 TIME (seconds) Figure 19 R e s u l t s of SSW d e t e c t i o n . (a) The inverse f i l t e r and (b) a bandpass d e t e c t o r . 38 In t h e o r y , t h e SNR g a i n from i n p u t t o o u t p u t of t h e i n v e r s e f i l t e r c o u l d be i n f i n i t e . In p r a c t i c e , we have f o u n d ( f i g u r e 19) t h e i n v e r s e f i l t e r t o g i v e r e s u l t s no b e t t e r t h a n a s i m p l e b a n d p a s s d e t e c t o r . T h i s model shows, t h e o r e t i c a l l y , t h a t t h i s c a n be e x p e c t e d f o r many t y p e s o f EEG b a c k g r o u n d . I n t u i t i v e l y , t h e b a n d p a s s f i l t e r , F 1 r seemed l i k e a good c h o i c e a s a d e t e c t o r s i n c e SSW a r e o f t e n c h a r a c t e r i z e d by t h e i r s t e e p s l o p e s . In a d d i t i o n , i t i s a l m o s t t r i v i a l t o implement when compared t o t h e c o m p l e x i t y o f t h e i n v e r s e f i l t e r . We have seen t h a t i t i s a good d e t e c t o r o f SSW i n low f r e q u e n c y a c t i v i t y s u c h as d e l t a o r t h e t a . I t has p r o b l e m s w i t h h i g h e r f r e q u e n c y a c t i v i t y s u c h as a l p h a or m u s c l e ( f i g u r e 20) b u t i t would be d i f f i c u l t t o f i n d any s i n g l e o p e r a t o r t h a t f u n c t i o n s w e l l a s a d e t e c t o r o f SSW i n a l l k i n d s o f EEG b a c k g r o u n d . Our a p p r o a c h has been t o use t h i s o p e r a t o r , w h i c h f u n c t i o n s w e l l a s a d e t e c t o r o f SSW i n a b r o a d c l a s s o f EEG, and t o d e v e l o p s e p a r a t e s t r a t e g i e s f o r t h e c a s e s where i t i s p o o r ( m u s c l e and a l p h a a c t i v i t y ) . 39 Figure 20 Response of F, to T y p i c a l EEG. SNR Improvement r a t i o , A 1 f was c a l c u l a t e d using background s p e c t r a l model f o r (a) alpha, (b) d e l t a , (c) t h e t a , and (d) muscle a c t i v i t y . 40 IV. A SIMPLE DETECTOR OF SSW D e t e c t i n g SSW i n EEG w i t h s u c c e s s has been r e p o r t e d by many w o r k e r s . Most o f t h e s e s y s t e m s p r o c e s s t h e EEG o f f - l i n e and on s e c t i o n s of d a t a p r e s e l e c t e d t o c o n t a i n a minimum amount o f a r t i f a c t . We a r e i n t e r e s t e d i n r e a l - t i m e d e t e c t i o n f o r l o n g t e r m r e c o r d i n g s e s s i o n s u s i n g a s i m p l e m i c r o p r o c e s s o r b a s e d s y s t e m . Our s t r a t e g y f o r d e t e c t i o n of SSW i s t o s e l e c t c a n d i d a t e t r a n s i e n t s on a f i r s t p a s s w i t h a l o w - l e v e l o p e r a t o r . The more complex and t i m e c o n s u m i n g p r o c e s s i n g i s t h e n a p p l i e d o n l y t o t h e r e d u c e d d a t a . S p e c i f i c a l l y we w i l l d e s c r i b e t h e d e s i g n o f : (1) t h e l o w - l e v e l o p e r a t o r (a b a n d p a s s ) (2) shape t e s t s a) d u r a t i o n b) form f a c t o r o r ' w i g g l i n e s s ' c) t r i a n g u l a r i t y (3) a r t i f a c t r e j e c t i o n f i l t e r s a) m u s c l e b) a l p h a rhythm and s p i n d l e s We w i l l a l s o d e s c r i b e a method f o r d e t e c t i n g phase r e v e r s a l s when b i p o l a r montages a r e u s e d . 41 4.1 Lowpass D i f f e r e n t i a t o r ( Bandpass) A d i f f e r e n t i a t o r h i g h l i g h t s t h e s h a r p p o s i t i v e and n e g a t i v e s l o p e s o f a waveform. S i n c e waveform s h a r p n e s s i s t h e main d i s t i n g u i s h i n g f e a t u r e o f SSW, t h e d i f f e r e n t i a t o r i s an o b v i o u s c h o i c e a s an SSW d e t e c t o r . H i g h f r e q u e n c y a r t i f a c t , s u c h a s m u s c l e a c t i v i t y , g r e a t l y a f f e c t s t h e o u t p u t of a p u r e d i f f e r e n t i a t o r . F o r t h i s r e a s o n , d i f f e r e n t i a t o r s w h i c h i n c l u d e a l o w p a s s c h a r a c t e r i s t i c a r e d e s i r e a b l e . N i n o m i y a and M a t s u b a r a ( 2 9 > u s e d a l i n e a r r e g r e s s i o n o p e r a t o r f o r d i f f e r e n t i a t i o n ( e q u a t i o n 4. 1 ) . M M b ( k ) = Z n-x(n+k) / I n 2 ...4.1 n=-M n=-M The v a l u e b ( k ) i s c a l c u l a t e d f o r e a c h sample t i m e and r e p r e s e n t s an a p p r o x i m a t e d i f f e r e n t i a t i o n of t h e s i g n a l . T h i s i s a l i n e a r t r a n s f o r m w i t h Z - t r a n s f o r m , F „ ( z ) , as shown i n e q u a t i o n 4.2. M n F o ( Z ) = Ko- L {n-Z } . ..4.2 n = -M where Ko = 1 / E n 2 T h i s i s an e a s y o p e r a t o r t o implement d e p e n d i n g on t h e v a l u e o f M c h o s e n . I t i s p a r t i c u l a r l y w e l l s u i t e d t o a r e c u r s i v e c a l c u l a t i o n o f v a l u e s . An i n t e r e s t i n g p a p e r by U s u i and A m i d r o r ' 3 5 ' compares a l a r g e number of d i g i t a l l o w p a s s d i f f e r e n t i a t o r s . One of t h e s i m p l e s t , and t h e one we c h o s e f o r our l o w - l e v e l o p e r a t o r , has t h e f o l l o w i n g Z - t r a n s f o r m . 42 M +n -n F,(z) = [ 2 {Z - Z } ] / K, ...4.3 n=1 M or b(k) =[ L {x(n) - x(-n)} ] / K, ...4.4 n=1 This i s s i m i l a r to equation 4.2 except for the weighting f a c t o r of each term i n n. We see from the magnitude responses of the two operators, that they are q u i t e s i m i l a r ( f i g u r e 21). F, i s s l i g h t l y broader i n the main lobe but has a lower side lobe. F, a l s o lends i t s e l f to r e c u r s i v e computation. K,-b(k) = K,-b(k-1) + [x(k-M-1)+x(k+M)] - [x(k)+x(k+1 ) ] • • • 4 • 5 This c a l c u l a t i o n i s considerably simpler than for F„, p a r t i c u l a r l y when M i s not a convenient number. Figure 21 Frequency Response of lowpass d i f f e r e n t i a t o r s . 43 4.2 T h r e s h o l d S e t t i n g s We must p u t some t h r e s h o l d on t h e o u t p u t of t h e b a n d p a s s f i l t e r i n o r d e r t o d e t e c t c a n d i d a t e SSW. The human eye does a c o n s i d e r a b l e amount o f p r o c e s s i n g t o s e t a t h r e s h o l d . In a d d i t i o n t o c o n s i d e r i n g b a c k g r o u n d l e v e l , t h e t y p e o f b a c k g r o u n d i s a l s o i m p o r t a n t ; ( l ) A m p l i f i e r g a i n s a r e a d j u s t e d so t h a t c h a r a c t e r i s t i c rhythms have a p a r t i c u l a r l o o k , ( 2 ) I f b a c k g r o u n d s t a t i s t i c s change a b r u p t l y , t h e eye w i l l s e p a r a t e t h e s i g n a l i n t o s e c t i o n s and c o n s i d e r e a c h i n d i v i d u a l l y , ( 3 ) T r a n s i e n t s a r e v i s u a l l y f i l t e r e d o u t b e f o r e s e t t i n g a l e v e l , ( 4 ) T h e eye t a k e s i n a c t i v i t y f r o m o t h e r c h a n n e l s . In a u t o m a t e d s y s t e m s i t i s v e r y d i f f i c u l t t o match ' t h e p r o c e s s i n g done by t h e t r a i n e d e y e . S i n c e t h e human c o n s i d e r s a more g l o b a l p i c t u r e ( a c t i v i t y o v e r t i m e and i n a l l c h a n n e l s ) an a u t o m a t e d s y s t e m would r e q u i r e a p o w e r f u l p r o c e s s o r and a huge amount o f memory. S e t t i n g an a b s o l u t e l e v e l i s t h e s i m p l e s t p o s s i b l e a p p r o a c h . At l e a s t one o b j e c t i o n t o t h i s , f r o m t h e n e u r o l o g i s t ' s p o i n t o f v i e w , i s t h a t SSW a r e d e f i n e d i n terms o f t h e b a c k g r o u n d a c t i v i t y . A l s o , s e t t i n g a b s o l u t e t h r e s h o l d s r e q u i r e s a c a l i b r a t i o n p r o c e d u r e and t h i s c a n be d i f f i c u l t s i n c e t h e s i g n a l may change d r a s t i c a l l y f r o m one c a l i b r a t i o n p e r i o d t o th e n e x t . An a d a p t i v e p r o c e d u r e w h i c h s e t s t h r e s h o l d l e v e l s a c c o r d i n g t o t h e b a c k g r o u n d a few s e c o n d s b e f o r e and a f t e r t h e p o i n t c o n c e r n e d would be p r e f e r a b l e . We s e t a t h r e s h o l d on t h e 44 bandpass output by c o n s i d e r i n g 5 seconds of past a c t i v i t y . We assume that the EEG (and thus the bandpass output a l s o ) can be modelled as the output of a l i n e a r system whose input i s Gaussian white noise (see Chapter 3). Following from t h i s model i t i s a r e l a t i v e l y simple matter to set .some thr e s h o l d l e v e l which corresponds to a low p r o b a b i l i t y of acceptance of a given bandpass output value. The t h r e s h o l d , Th', i s c a l c u l a t e d from the r e l a t i o n 4.6. where Th i s the appropriate value from the t a b l e of the Normal P r o b a b i l i t y I n t e g r a l , o i s the standard d e v i a t i o n of the background a c t i v i t y , and assuming the bandpass output to have zero mean over the 5 seconds. This i s not a d i f f i c u l t computation i f i t doesn't have to be done too o f t e n . I t i s even e a s i e r i f we take advantage of an i n t e r e s t i n g property of Gaussian d i s t r i b u t i o n s described below. The p r o b a b i l i t y d e n s i t y f u n c t i o n , ^ ( x ) , of a Gaussian d i s t r i b u t i o n , N ( 0 , a 2 ) , i s given i n equation 4.7. Th' = Th«a 4.6 *(x) = (]/o/2ir) .exp(-x 2/2a 2) ...4.7 thus, E(x) dx 4.8 which i s e a s i l y shown to be = 0. (p.139 i n ref.15) But now consider |x| i n s t e a d . E(|x|) = 2 ( (1/o/2ir)'exp( dx .. .4.9 o 45 Since the pdf of x i s symmetric about the y a x i s r °° E( | x [ ) = (-2a//27r) .exp(-x 2/2) = 2a//Tit ...4.10 o and so, a = (/2lr/2)-E( |x|) ...4.11 Using t h i s r e s u l t , the c a l c u l a t i o n of a i n equation 4.11 i s very simple. Rather than c a l c u l a t i n g a using the r e l a t i o n that a2 = E ( x 2 ) - E ( x ) 2 , we have only to f i n d the mean of the absolute v a l u e s , which i s considerably e a s i e r . This r e s u l t depends on the assumption of a zero mean, which i s reasonable since the th r e s h o l d c a l c u l a t i o n i s done f o r 5 seconds of data. 4.3 Waveform Sharpness In r e a l i t y we are more i n t e r e s t e d i n a second d i f f e r e n t i a l measure, since i t i s the sharpness of the waveform which i s considered. We can achieve a double d i f f e r e n t i a t i o n with two passes of F, or F„. We could a l s o use a s i n g l e pass operator such as i n equation 4.12 below. I t i s obtained by a l e a s t squares e r r o r f i t t i n g of a curve y=a«x2 + b«x + c to a set of p o i n t s . M a = {N- Z [n2»x(n) - N 2-S]} / {N-Nft - N 2 2} ...4.12 n=-M M where N = Z n i n=-M i M ,S = L x(n) n=-M and N = 2M+1 A l t e r n a t i v e l y , we can take the d i f f e r e n c e of slopes from r i s i n g and f a l l i n g phases. This approach, which i s the one we 46 i m p lemented, i s s i m p l e and has t h e a d v a n t a g e o f a l l o w i n g us t o s e t a minimum s l o p e t h r e s h o l d f o r r i s i n g and f a l l i n g p h a s e s i n d e p e n d e n t l y . A waveform w i t h one s t e e p r i s i n g phase but a g r a d u a l o p p o s i t e phase would not be a c c e p t e d . A d o u b l e d i f f e r e n t i a t o r may end up p a s s i n g i t as a p o s s i b l e c a n d i d a t e b e c a u s e the two p h a s e s c a n n o t be c o n s i d e r e d s e p a r a t e l y . 4.4 Waveshape Of SSW The b a n d p a s s o p e r a t o r a l o n e l e a d s t o an e x c e s s of f a l s e d e t e c t i o n s and so a s e c o n d s t a g e of f i l t e r i n g i s r e q u i r e d b a s e d on waveform p a r a m e t e r s , d u r a t i o n , f o r m f a c t o r , and t r i a n g u l a r i t y . 4.4.1 D u r a t i o n S p i k e s a r e g e n e r a l l y d e f i n e d as h a v i n g a d u r a t i o n of 80 m i l l i s e c o n d s and s h a r p waves 200 m i l l i s e c o n d s . L e a v i n g a s i d e d i s a g r e e m e n t s o v e r t h e s e f i g u r e s , we must d e a l w i t h t h e d e f i n i t i o n of d u r a t i o n i t s e l f . C o n s i d e r i n g f i g u r e 22, we would i n t u i t i v e l y c h o s e d u r a t i o n t o be S 1 f but i f we were l o o k i n g f o r a d e f i n i t i o n t h a t was s i m p l e t o implement, s u c h as d i s t a n c e between s l o p e z e r o c r o s s i n g s , we would end up w i t h 5 2 . Gotman and G l o o r ( 1 1 > d e s c r i b e a somewhat a r b i t r a r y method t h a t a p p e a r s t o work w e l l . They d e f i n e a p s e u d o d u r a t i o n as shown i n f i g u r e 23. T h i s p s e u d o d u r a t i o n i s o b t a i n e d by f i n d i n g t h e p o i n t on t h e h a l f wave w h i c h c o r r e s p o n d s t o t h e s i g n a l v a l u e 47 a t t h e h a l f d u r a t i o n . A l i n e i s drawn from t h e apex of t h e wave and where i t c r o s s e s t h e b a s e l i n e d e f i n e s t h e p s e u d o d u r a t i o n , 5'. T h i s method i s q u i t e s i m p l e . L e t us model a h a l f wave by a r e c t a n g l e and a h y p e r b o l a as shown i n f i g u r e 24 and c o n s i d e r t h e two c a s e s , A and B, shown. In A, as t h e a r e a under t h e h y p e r b o l a goes t o z e r o , t h e pseudo d u r a t i o n goes t o 6/2. T h e r e i s a d i r e c t d ependence on t h e l e n g t h o f t h e t a i l . C l e a r l y f o r t h e c a s e of B, p s e u d o d u r a t i o n goes t o i n f i n i t y . T hus, i n t h e l i m i t i n g c a s e s t h e Gotman-Gloor method i s n o t a good r e p r e s e n t a t i o n o f d u r a t i o n . As an a l t e r n a t i v e t o t h i s method, we have u s e d an a p p r o a c h w h i c h f i n d s t h e pseudo d u r a t i o n , 6'', by m a t c h i n g t h e a r e a of an i d e a l t r i a n g u l a r wave of a m p l i t u d e , Vm, and w i d t h , 5'', t o t h e a c t u a l a r e a o f t h e h a l f wave of a m p l i t u d e , Vm, and w i d t h , 5. R e f e r r i n g t o f i g u r e 25, we can w r i t e t h e r e l a t i o n shown i n e q u a t i o n 4.13 t o d e f i n e pseudo d u r a t i o n . 6'' = 2A/Vm ...4.13 In t h e l i m i t i n g c a s e s d i s c u s s e d a b o v e , when t h e a r e a under t h e h y p e r b o l a goes t o z e r o ( c a s e A) t h e pseudo d u r a t i o n goes t o t w i c e t h e w i d t h o f t h e r e c t a n g u l a r p a r t . In c o n t r a s t t o t h e Gotman-Gloor method, t h e l e n g t h o f t h e t a i l i s i m p o r t a n t o n l y i n s o f a r as i t c o n t r i b u t e s more a r e a t o t h e h a l f wave. As t h e h a l f wave becomes r e c t a n g u l a r i n shape ( c a s e B) t h e pseudo d u r a t i o n g o e s t o 25. T h i s i s not i d e a l but c o n s i d e r a b l y b e t t e r t h a n t h e Gotman-Gloor method. 48 Figure 22 D e f i n i t i o n of Spike Duration. An i n t u i t i v e choice f o r dur a t i o n measure i s 6, but 6 2 i s e a s i e r to compute. Figure 23 Pseudo d u r a t i o n used by Gotman et a l . A pseudo d u r a t i o n , 6', i s obtained by drawing a l i n e from the h a l f wave apex, A, through the poin t B on the waveform. 49 A. B. Figure 24 Halfwave Modelled by a hyperbola. Figure 25 Area Matching Approach f o r Pseudo Duration. A pseudo d u r a t i o n , 6'', i s obtained by matching the a c t u a l halfwave of area, A, amplitude, Vm, and d u r a t i o n , 6, with a t r i a n g u l a r halfwave of the same area and amplitude but d u r a t i o n 6''. 50 4.4.2 Form F a c t o r In t h e p r e s e n c e o f m u s c l e a r t i f a c t i t i s p o s s i b l e t o g e t f a l s e d e t e c t i o n s t h a t l o o k n o t h i n g l i k e SSW ( s e e f i g u r e 2 6 ) . S u ch f a l s e d e t e c t i o n s a r e e a s i l y e l i m i n a t e d by demanding a minimum of m o n o t o n i c i t y on t h e r i s i n g and f a l l i n g p h a s e s o f t h e s p i ke. C o n s i d e r t h e r i s i n g s l o p e i n f i g u r e 27 and l e t , N-1 A , =L |x -x | ...4.14 n=0 n+1 n w h i c h i s t h e sum o f a b s o l u t e d i f f e r e n c e s of a d j a c e n t s amples from A, t o A 2 . L e t , A 2 = |x -x | ...4.15 N-1 0 Then, a s a 'form f a c t o r ' we have t h a t , T J = ( A 1 + A 2 ) / A 2 ...4.16 T h i s measure w i l l p a s s many t y p e s o f s h a p e s ( s e e f i g u r e 2 8 ) . I t i s a c r u d e measure o f h i g h e r f r e q u e n c y n o i s e w h i c h i s s u p e r i m p o s e d on t h e waveform. 51 Figure 28 D i f f e r e n t Waveforms with equal Form F a c t o r . 52 4.4.3 T r i a n g u l a r i t y None of t h e shape measures so f a r m e n t i o n e d i s u s e f u l i n r e j e c t i n g t h o s e waveforms w i t h s h a r p r i s i n g and f a l l i n g p h a s e s but f l a t or s q u a r e d t o p s . U s i n g t h e a r e a measure d i s c u s s e d i n t h e s e c t i o n on pseudo d u r a t i o n , i t i s p o s s i b l e t o d e f i n e a measure w h i c h g i v e s some i n d i c a t i o n . We a r e i n t e r e s t e d i n r e j e c t i n g waves as seen i n f i g u r e 29. I f A = t o t a l a r e a under t h e h a l f wave and A' = a r e a under t h e t r i a n g l e o n l y t h e n T = ( A - A' ) / A' where T g i v e s a measure of d i v e r g e n c e from t h e i d e a l . T h e r e a r e s e v e r a l c a s e s ( f i g u r e 30) w h i c h c a n p a s s - t h e s e s i m p l e t e s t s , but a r e s t i l l q u i t e d i f f e r e n t from t h e i d e a l . W i t h t h e s e t e s t s , however, we e l i m i n a t e a l a r g e c a t e g o r y of f a l s e d e t e c t i o n s w i t h r e l a t i v e l y s i m p l e a l g o r i t h m s . 53 F i g u r e - 3 0 Non-ideal Waveform Which Passes the t e s t s . 54 4.5 A r t i f a c t R e j e c t i o n I t i s p o s s i b l e t o o b t a i n waveforms w h i c h a r e s i m i l a r t o SSW but a r e g e n e r a t e d by n o n - e p i l e p t i c p r o c e s s e s , a r t i f i c i a l o r o t h e r w i s e . D i s t i n g u i s h i n g t h e s e f r o m SSW r e q u i r e s t h a t t h e c o n t e x t be c o n s i d e r e d , i e . we must l o o k a t t h e t y p e o f b a c k g r o u n d o r what t h e a c t i v i t y i s l i k e i n t h e o t h e r c h a n n e l s . SSW r a r e l y o c c u r i n o n l y one c h a n n e l . Thus, we c a n demand t h a t t h e r e be s i m u l t a n e o u s d e t e c t i o n s on s e v e r a l c h a n n e l s b e f o r e an SSW i s a c c e p t e d . U n f o r t u n a t e l y , w i t h c e r t a i n t y p e s of a r t i f a c t , t h e e v e n t s c a u s i n g t h e f a l s e d e t e c t i o n ( i e . e l e c t r o d e p o p s ) e x t e n d t o more t h a n one c h a n n e l and o t h e r a p p r o a c h e s must be u s e d . 4.5.1 Movement A r t i f a c t P a t i e n t movement c a u s e s t h e most s e v e r e d i s t u r b a n c e s i n EEG r e c o r d i n g ( s e e f i g u r e 3 1 ) . D u r i n g p e r i o d s of movement i t i s b e s t n o t t o a t t e m p t t o d e t e c t SSW a t a l l due t o t h e heavy c o r r u p t i o n of t h e s i g n a l . To i g n o r e s e c t i o n s c o n t a i n i n g a l o t o f a r t i f a c t , i t i s n e c e s s a r y t o be a b l e t o d e t e c t t h e a r t i f a c t . S i n c e h i g h f r e q u e n c y EMG i s p r e s e n t d u r i n g p a t i e n t movement, i t i s a good f l a g f o r c o r r u p t i n g a r t i f a c t . The s i m p l e d i f f e r e n c e o p e r a t o r , x ( n ) - x ( n - l ) , c a n be u s e d t o d e t e c t m u s c l e a c t i v i t y . I t i s a h i g h p a s s o p e r a t o r w i t h a f r e q u e n c y r e s p o n s e , F 5 , as shown i n f i g u r e 32. The measure, 55 i n equation 4.17 i s an i n d i c a t o r of muscle a c t i v i t y i n the s i g n a l . With t h i s measure, no c a l i b r a t i o n procedure i s re q u i r e d . *(£) = ( | F 5 | 2 - | F , | 2 ) / | F 5 | 2 ...4.17 The measure i s not d i f f i c u l t to obtain using the r e l a t i o n 4.11 discussed e a r l i e r . * ( f ) ranges from 0 to 1. I t i s 0 when |F*i | and |F 5| are equal ( i e . not much power above lOhz) and 1 when |F 5| i s much greater than | F i | . 1 sec Figure 31 E f f e c t of P a t i e n t Movement on EEG. ideal d i f ferent ia tor Figure 32 Magnitude Response of Simple D i f f e r e n c e Operator, F 5. 56 4.5.2 S p i n d l e s And A l p h a Rhythms T h e r e a r e some t y p i c a l rhythms w h i c h have s i m i l a r shape and d u r a t i o n t o s p i k e s . B o t h a l p h a rhythms and s l e e p s p i n d l e s c a n c a u s e f a l s e d e t e c t i o n s . The t h r e s h o l d v a l u e o f t h e band p a s s o u t p u t i s s e t a c c o r d i n g t o b a c k g r o u n d s t a t i s t i c s but t h i s d o e s n ' t h e l p i f t h e rhythms come i n s h o r t b u r s t s ( 3 o r 4 w a v e s ) . The s i m p l e s t a p p r o a c h i s t o d e t e c t t h e rhythms t h e m s e l v e s and not t o a l l o w s p i k e d e t e c t i o n s d u r i n g t h e p e r i o d when rhythms a r e p r e s e n t . S i m p l e p e r i o d measurements a r e e f f e c t i v e i n d e t e c t i n g t h e p r e s e n c e o f t h e s e r h y t h m s . 4.6 Phase R e v e r s a l D e t e c t i o n In t h e c a s e o f f o c a l e p i l e p s y , d e t e r m i n a t i o n o f t h e l o c a t i o n o f a p o t e n t i a l maximum i s of s p e c i a l i n t e r e s t . I f r e c o r d i n g i s b i p o l a r , i t i s n o t s t r a i g h t f o r w a r d where t h e maximum i s . C o n s i d e r t h e f i g u r e 33a. I f r e c o r d i n g i s d i f f e r e n t i a l between e l e c t r o d e s A & B and B & C as shown, t h e n i f a p o t e n t i a l maximum o c c u r s a t e l e c t r o d e B, we w i l l o b t a i n SSW i n c h a n n e l A-B and B-C but t h e y w i l l be r e v e r s e d i n p h a s e . In f i g u r e 33b t h e p o t e n t i a l maximum midway between e l e c t r o d e s B and C c a u s e s SSW o f o p p o s i t e p o l a r i t y i n A-B and C-D and none i n B-C. S i n c e t h e r e a r e many montages, l o c a t i n g phase r e v e r s a l s and the a r e a s o f p o t e n t i a l maximum i s d i f f i c u l t . The t a s k i s made 57 more t r a c t a b l e i f t h e montage i s d i v i d e d i n t o b i p o l a r c h a i n s ( f i g u r e 34 ). In d e s i g n i n g an a l g o r i t h m f o r phase r e v e r s a l d e t e c t i o n , t h e f o l l o w i n g c o n d i t i o n s a r e imposed: (1) SSW a r e c o n s i d e r e d f o r phase r e v e r s i n g i f t h e i r a p e x e s a r e s h i f t e d no more t h a n 10 m i l l i s e c o n d s i n t i m e . (2) We c o n s i d e r b i p o l a r c h a i n s w i t h a maximum of s e v e n c h a n n e l s . (3) We c o n s i d e r c h a i n s w i t h a minimum of 2 c h a n n e l s . (4) O n l y 3 a d j a c e n t c h a n n e l s a r e c o n s i d e r e d a t a t i m e . (5) O n l y one phase r e v e r s a l i s a l l o w e d p e r c h a i n e x c e p t i n t h e c a s e where t h e d e t e c t e d r e v e r s a l s a r e i n homologous a r e a s o f t h e b r a i n . (6) T h e r e i s a maximum o f f o u r c h a i n s i n a g i v e n montage. Th e s e r e s t r i c t i o n s a r e l e n i e n t enough t o a l l o w f o r d e t e c t i o n o f p hase r e v e r s a l s i n a l l t h e p o p u l a r montages. The a l g o r i t h m f i r s t d i v i d e s t h e montage i n t o s e p a r a t e c h a i n s and p r o c e s s e s t h e c h a i n s i n s u b c h a i n s o f 3 c h a n n e l s . C u r r e n t l y , we a r e c a p a b l e o f h a n d l i n g 8 d i f f e r e n t montages but t h e main s u b r o u t i n e s a r e g e n e r a l enough t h a t o t h e r montages can be added a s l o n g as some i n f o r m a t i o n a b o u t t h e number and k i n d of c h a i n s i s p r o v i d e d . 58 Figure 34 B i p o l a r Chains. 59 V. DETECTION OF SEIZURE ACTIVITY IN EEG A p a r t f r o m s y s t e m s f o r s p i k e and wave d e t e c t i o n , t h e r e a r e v e r y few r e p o r t s of a u t o m a t e d s e i z u r e d e t e c t i o n s y s t e m s . The o n l y c o n s i s t e n t work r e p o r t e d i s by t h e team of Gotman e t a l 1 , 0 1 7 1 8 > who have i n c o r p o r a t e d a u t o m a t i c s e i z u r e d e t e c t i o n i n t o t h e i r m o n i t o r i n g u n i t a t t h e M o n t r e a l N e u r o l o g i c a l I n s t i t u t e (MNI). In t h i s c h a p t e r , we w i l l examine some f e a t u r e s o f s e i z u r e s w h i c h can a i d i n t h e i r d e t e c t i o n by c o m p u t e r . L a t e r , we d e s c r i b e an a p p r o a c h u s e d by us i n t h e s e i z u r e m o n i t o r a t t h e U n i v e r s i t y of B r i t i s h C o l u m b i a . The f i r s t r e p o r t e d a u t o m a t i c s e i z u r e m o n i t o r a t t h e MNI employed a PDP-12 m i n i c o m p u t e r and o p e r a t e d on e i g h t c h a n n e l s o f EEG i n r e a l - t i m e . S e i z u r e d e t e c t i o n depended on t h e a m p l i t u d e of t h e EEG and t h e o u t p u t o f a b a n d p a s s f i l t e r . The MNI s y s t e m has s i n c e been r e d e v e l o p e d and t h e s e i z u r e d e t e c t i o n s y s t e m i s p a r t of an i n t e g r a t e d s y s t e m w h i c h a l s o i n c l u d e s d e t e c t i o n of i n t e r i c t a l a c t i v i t y . S e i z u r e d e t e c t i o n c r i t e r i a have been c h a n g e d . The s y s t e m does n o t a t t e m p t t o d e t e c t a l l s e i z u r e a c t i v i t y ; o n l y t h a t i n w h i c h t h e r e i s s u s t a i n e d p a r o x y s m a l a c t i v i t y w i t h a f u n d a m e n t a l f r e q u e n c y between 3 and 20 h z . I n a r e c e n t s t u d y o f f r e q u e n c y c o n t e n t of EEG a t s e i z u r e o n s e t by t h e Gotman t e a m ' 1 3 ' t h e f u n d a m e n t a l s e i z u r e rhythm was most o f t e n f o u n d t o be i n t h e 3 t o 6 o r t h e 15 t o 20 hz r a n g e ( f i g u r e 3 5 ) . In our own s t u d y o f t h e f r e q u e n c y c h a r a c t e r i s t i c s of EEG a t s e i z u r e o n s e t we f o u n d t h e same c o n c e n t r a t i o n of 60 f u n d a m e n t a l s e i z u r e rhythms i n t h e 3 t o 6 hz r a n g e as t h e Gotman team, but we had no s e i z u r e s w i t h f u n d a m e n t a l f r e q u e n c y i n t h e h i g h e r range ( f i g u r e 3 6 ) . We were o n l y a b l e t o s t u d y 1/3 t h e number of s e i z u r e s t h a t t h e Gotman g r o u p c o n s i d e r e d , and, u n l i k e them, we i n c l u d e d s e i z u r e s c o r r u p t e d by EMG a r t i f a c t . C o n s i d e r i n g t h e p r o b l e m o f EMG o b s c u r r i n g h i g h e r f r e q u e n c y r hythms and t h e n o r m a l l y l o w e r l e v e l of c e r e b r a l a c t i v i t y i n t h e h i g h e r f r e q u e n c i e s , t h a t we f o u n d no h i g h e r f r e q u e n c y f u n d a m e n t a l rhythms i n t h e s e i z u r e s we s t u d i e d i s t h e r e f o r e n o t s u r p r i s i n g . I n i t i a l r e s u l t s o f s e i z u r e d e t e c t i o n from t h e MNI s y s t e m do n o t , a t f i r s t , a p p e a r e n c o u r a g i n g . From s u r f a c e r e c o r d i n g s , o n l y 22% o f t h e d e t e c t i o n s were o f e p i l e p t i f o r m a c t i v i t y and f r o m d e p t h r e c o r d i n g s a mere 2.5% were t r u e d e t e c t i o n s . F a l s e d e t e c t i o n s a r e n o t n e c e s s a r i l y a p r o b l e m , however, s i n c e t h e o n l y f u n c t i o n o f t h e i r s e i z u r e d e t e c t o r i s t o t r i g g e r an EEG r e c o r d i n g d e v i c e so t h a t a r e d u c e d amount of d a t a c an be examined l a t e r by an e l e c t r o e n c e p h a l o g r a p h e r . Even i f t h e number of f a l s e d e t e c t i o n s i s l a r g e , t h e amount of d a t a r e d u c t i o n due t o i n c o r p o r a t i n g a u t o m a t e d s e i z u r e d e t e c t i o n i s s t i l l s i g n i f i c a n t . 61 N = 50 Figure 35 Fundamental Frequencies at Seizure Onset, I . The team of Gotman et a l s t u d i e d 50 s e i z u r e s and recorded the fundamental frequency of the EEG a c t i v i t y at the s e i z u r e onset. Only s e i z u r e s f r e e of EMG a c t i v i t y were included i n the study. N=15 10 ' frequency (hz) Figure 36 Fundamental Frequencies at Seizure Onset, I I . At the UBC H o s p i t a l 15 s e i z u r e s were s t u d i e d and the fundamental frequency of the EEG at se i z u r e onset was recorded. Seizures corrupted by EMG were included i f there was a c l e a r resonant peak i n the spectrum. 62 In t h e S e i z u r e I n v e s t i g a t i o n U n i t a t t h e UBC H e a l t h S c i e n c e s C e n t e r H o s p i t a l we a r e d e v e l o p i n g a d e t e c t o r o f s e i z u r e a c t i v i t y i n EEG. I n i t i a l l y t h e g o a l has been l i m i t e d t o d e t e c t i n g s e i z u r e s w i t h moderate t o h i g h a m p l i t u d e EEG a c t i v i t y . Such s e i z u r e s a r e most o f t e n a c c o m p a n i e d by c l i n i c a l m a n i f e s t a t i o n s w h i c h , a l o n g w i t h t h e EEG p a t t e r n s a t s e i z u r e o n s e t a r e s t u d i e d p r i o r t o a n e u r o l o g i c a l d i a g n o s i s . A d e f i n i t i o n was p r o v i d e d by a n e u r o l o g i s t t h a t a c t i v i t y would be a c a n d i d a t e f o r s e i z u r e l e v e l a c t i v i t y i f i t was of h i g h a m p l i t u d e f o r a s u s t a i n e d p e r i o d on a m a j o r i t y of t h e r e c o r d i n g c h a n n e l s ( f i g u r e 3 7 ) . S u s t a i n e d m u s c l e a c t i v i t y c o u l d a l s o be c o n s i d e r e d a s i g n of s e i z u r e . An o b v i o u s a p p r o a c h was t o p u t a t h r e s h o l d on t h e RMS v a l u e o f t h e EEG as a d e t e c t o r of s e i z u r e l e v e l a c t i v i t y . I n s t e a d , t h e EEG i s f i r s t f i l t e r e d by a b andpass ( t h e l o w p a s s d i f f e r e n t i a t o r d i s c u s s e d e a r l i e r ) and t h e n t h e RMS v a l u e of t h e o u t p u t i s c a l c u l a t e d . M o t i v a t i o n f o r use of t h e b andpass was r a t h e r s i m p l e : s i n c e i n t e r i c t a l e p i l e p t i f o r m a c t i v i t y was l i m i t e d t o a f r e q u e n c y r a n g e c o i n c i d e n t w i t h t h e p a s s band o f t h e f i l t e r , t h e same might be e x p e c t e d o f s e i z u r e a c t i v i t y . As t h e l a t e r f r e q u e n c y s t u d i e s o f s e i z u r e s showed, t h e a s s u m p t i o n of a d i r e c t c o r r e l a t i o n between t h e f r e q u e n c y d i s t r i b u t i o n o f SSW and of s e i z u r e s was w i t h o u t j u s t i f i c a t i o n . We d i d f i n d , however, t h a t a t s e i z u r e o n s e t t h e r e i s a s h i f t of s i g n a l power i n t o t h e f r e q u e n c i e s f a v o r e d by t h e b a n d p a s s f o r most of t h e s e i z u r e s s t u d i e d . S e v e r a l s e i z u r e s were a n a l y s e d as t o t h e i r f r e q u e n c y c o n t e n t f o r s e v e r a l 5 s e c o n d p e r i o d s l e a d i n g i n t o t h e 63 b e g i n n i n g of t h e s e i z u r e . Two r a t i o s were t h e n c a l c u l a t e d . R1 = So / S i ...5.1 R2 = So' / S i ' ...5.2 where So = EEG s i g n a l power a f t e r s e i z u r e o n s e t , S i = EEG power b e f o r e o n s e t , So' = power of b a n d p a s s e d EEG a f t e r s e i z u r e o n s e t , and S i ' = power o f b a n d p a s s e d EEG b e f o r e o n s e t . E i g h t s e i z u r e s were s t u d i e d and i n 6 c a s e s R2 > R1. In 1 c a s e R2 = R1 and i n o n l y 1 c a s e was R1 > R2. F o r t h e c a s e where R1 > R2, R2 was s t i l l v e r y much g r e a t e r t h a n 1. The b r i e f s t u d y m e n t i o n e d h e r e t e n d s t o s u p p o r t u s i n g a b a n d p a s s o p e r a t o r i n t h e d e t e c t i o n o f s e i z u r e s . The r e a s o n f o r t h e s h i f t of s i g n a l power i n t o t h e b a n d p a s s r a n g e i s n o t c l e a r . A l a r g e p e r c e n t a g e of s e i z u r e r e c o r d s a r e c o r r u p t e d by EMG. Gotman and G l o o r e s t i m a t e 30%, t h o u g h our e x p e r i e n c e i s t h a t t h i s f i g u r e i s c o n s i d e r a b l y h i g h e r ( >50% ). The bandpass w i l l n o t e n t i r e l y a t t e n u a t e m u s c l e a c t i v i t y , t h u s , t h i s c o u l d be a p a r t i a l e x p l a n a t i o n f o r t h e improvement g a i n e d by t h e b a n d p a s s . We have f o u n d , however, even i n s e i z u r e s t h a t a r e f r e e of EMG t h e r e l a t i v e s h i f t of power i n t o t h e b a n d p a s s r a n g e i s s t i l l e v i d e n t . F o l l o w i n g t h e bandpass o p e r a t i o n , t h e s i g n a l i s f u r t h e r p r o c e s s e d . The RMS o u t p u t of t h e b a n d p a s s i s a v e r a g e d o v e r 5 s e c o n d p e r i o d s and i t must p a s s a p r e s e t t h r e s h o l d t o be c o n s i d e r e d o f s e i z u r e l e v e l . The t h r e s h o l d must be p a s s e d i n t h r e e s u c c e s s i v e , 5 s e c o n d i n t e r v a l s and t h i s must happen i n a m a j o r i t y o f t h e 16 c h a n n e l s o r 3/4 o f t h e c h a n n e l s o f one 64 hemisphere. The requirement that a c t i v i t y be of a s u f f i c i e n t l e v e l on a number of channels r e f l e c t s the f a c t that s e i z u r e a c t i v i t y comes to inv o l v e l a r g e s e c t i o n s of the b r a i n . I t i s a l s o p o s s i b l e that s e i z u r e s remain confined to one hemisphere and, f o r t h i s reason, each i s a l s o considered s e p a r a t e l y . Since the arrangement of channels v a r i e s from montage to montage, the detector had to be f l e x i b l e enough to adapt to d i f f e r e n t ones. —y^-A^ V — ^ ^^VVVY t^ V^^ Figure 37 EEG at Seizure Onset. In many s e i z u r e s the EEG s i g n a l l e v e l r i s e s d r a m a t i c a l l y i n most of the recording channels. 65 V I . IMPLEMENTATION OF THE EEG MONITOR Many t e c h n i q u e s f o r t h e d e t e c t i o n of e p i l e p t i f o r m a c t i v i t y i n t h e human EEG a r e d e s c r i b e d i n t h e l i t e r a t u r e . T h e r e a r e f a r fewer d e s c r i p t i o n s of i n t e g r a t e d s y s t e m s which i n c o r p o r a t e t h e s e t e c h n i q u e s i n t o r e a l - t i m e m o n i t o r i n g d e v i c e s . We w i l l d e s c r i b e t h e i m p l e m e n t a t i o n of an EEG m o n i t o r i n g s y s t e m d e v e l o p e d a t t h e S e i z u r e I n v e s t i g a t i o n U n i t o f t h e U n i v e r s i t y of B r i t i s h C o l u m b i a . Hardware s c h e m a t i c s and s o f t w a r e f l o w c h a r t s c a n be f o u n d i n t h e A p p e n d i x . Our r e a l - t i m e m o n i t o r i s c o m p r i s e d of a p o p u l a r m i c r o p r o c e s s o r s y s t e m , some s p e c i a l p u r p o s e e l e c t r o n i c h a r d w a r e , and s e v e r a l s o f t w a r e p a c k a g e s . The d e t e c t i o n o f s e i z u r e s and d e t e c t i o n of i n t e r i c t a l a c t i v i t y i s ' d o n e by s e p a r a t e s o f t w a r e m o d u l e s , o n l y one of w h i c h i s r e s i d e n t i n t h e s y s t e m d u r i n g a m o n i t o r i n g s e s s i o n . O n l y one p a t i e n t i s m o n i t o r e d a t any g i v e n t i m e . 66 6.1 Hardware Structure Hardware for the EEG monitor constructed f o r use i n the Seizure I n v e s t i g a t i o n Unit of the UBC Acute Care H o s p i t a l c o n s i s t s of the u n i t s shown i n f i g u r e 38. The b a s i c pieces are a general purpose d i g i t a l computer, c o l o r graphics monitor, and s p e c i a l purpose i n t e r f a c e e l e c t r o n i c s . Figure 38 EEG Monitor Hardware Components. (a) Computer, (b) graphics monitor, and (c) i n t e r f a c e e l e c t r o n i c s . 67 6.1.1 Computer Hardware The computer i s an A p p l e I I P l u s , a m i c r o p r o c e s s o r - b a s e d d e v i c e . A l t h o u g h d e v e l o p e d f o r t h e home m a r k e t , i t i s w i d e l y u s e d f o r r e s e a r c h and e d u c a t i o n a l a p p l i c a t i o n s . The A p p l e I I P l u s i s e q u i p p e d w i t h 48K b y t e s o f random a c c e s s memory on i t s main b o a r d . The machine i n c l u d e s a k e y b o a r d , power s u p p l y , c i r c u i t r y f o r t h e g e n e r a t i o n o f memory mapped g r a p h i c s , s y s t e m r e a d o n l y memory (ROM) w i t h m o n i t o r and e x t e n d e d BASIC i n t e r p r e t e r , s p e c i a l p u r p o s e I/O i n t e r f a c e , and 8 e x p a n s i o n s l o t s . F i v e of t h e a v a i l a b l e 8 e x p a n s i o n s l o t s a r e p r e s e n t l y o c c u p i e d by s p e c i a l p u r p o s e b o a r d s . T h e r e i s a 16K b y t e memory e x p a n s i o n b o a r d , a t i m e r b o a r d ( w h i c h g e n e r a t e s t i m e d i n t e r r u p t s ) , a s e r i a l c o m m u n i c a t i o n s c a r d , a d i s k c o n t r o l l e r ( t h a t c an h a n d l e 2, 5 and 1/4 i n c h f l o p p y d i s k d r i v e s ) , and an A/D-D/A b o a r d . A l l t h e p e r i p h e r a l b o a r d s , w i t h t h e e x c e p t i o n of the t i m e r , were p u r c h a s e d o f f t h e s h e l f . The A/D b o a r d has 16 c h a n n e l s f o r a n a l o g t o d i g i t a l c o n v e r s i o n ( c o n v e r s i o n t i m e o f 9 m i c r o s e c o n d s ) and 16 c h a n n e l s f o r d i g i t a l t o a n a l o g c o n v e r s i o n ( c o n v e r s i o n t i m e o f 16 m i c r o s e c o n d s ) . The c o n v e r s i o n r e s o l u t i o n i s 8 b i t . The t i m e r b o a r d i s s o f t w a r e programmable and i s e n a b l e d o r d i s a b l e d by commands w h i c h a c c e s s s p e c i f i c l o c a t i o n i n t h e A p p l e ' s memory. A Sanyo c o l o r m o n i t o r i s u s e d f o r d i s p l a y i n g t e x t i n f o r m a t i o n and c o l o r g r a p h i c s . A l l t e x t and g r a p h i c s a r e c r e a t e d by hardware w h i c h i s i n h e r e n t t o t h e 68 c o m p u t e r . I n p u t t o t h e m o n i t o r i s a s i n g l e c o m p o s i t e v i d e o s i g n a l g e n e r a t e d by t h e c o m p u t e r . 6.1.2 I n t e r f a c e Hardware A bank o f f i l t e r s and a m p l i f i e r s was b u i l t t o p r o v i d e an i n t e r f a c e between t h e EEG r e c o r d i n g e q uipment and t h e A/D c o n v e r t e r r e s i d e n t i n t h e c o m p u t e r . A s i n g l e o r d e r h i g h p a s s f i l t e r w i t h .1 hz c u t o f f removes v e r y low f r e q u e n c y a r t i f a c t . F o u r t h o r d e r B u t t e r w o r t h f i l t e r s w i t h a 25 hz c o r n e r f r e q u e n c y p r o v i d e s u f f i c i e n t a n t i - a l i a s i n g f o r a 1OOhz s a m p l i n g r a t e a s w e l l as 60 hz r e j e c t i o n o f a b o u t 20db. We have d e s i g n e d a s p e c i a l p u r p o s e b o a r d w h i c h i n c l u d e s low c u r r e n t r e l a y s t h a t a r e opened by d i g i t a l o u t p u t s i n c l u d e d w i t h t h e A p p l e . T h i s b o a r d i n t e r f a c e s t h e A p p l e t o a s e t u p i n t h e S e i z u r e I n v e s t i g a t i o n U n i t f o r m a r k i n g t h e a u d i o t a p e s on w h i c h EEG i s r e c o r d e d . When t h e p a t i e n t p r e s s e s a ( s e i z u r e ) b u t t o n a c i r c u i t i s o p e n e d and t h e t a p e i s marked so t h e EEG s e i z u r e r e c o r d can be f o u n d l a t e r . Our i n t e r f a c e i s w i r e d i n s e r i e s so t h a t i t s r e l a y s c a n a l s o open t h e c i r c u i t and mark t h e t a p e i f t h e computer d e t e c t s a s e i z u r e . R e l a y s a r e u s e d i n o r d e r t o p r o v i d e t o t a l i s o l a t i o n o f t h e computer from t h e r e s t of t h e e q u ipment s e t u p . The r e l a y i s h e l d open by a m o n o s t a b l e so t h a t , even i f t h e d i g i t a l o u t p u t of t h e computer i s t o g g l e d by a c c i d e n t , t h e r e l a y w i l l o n l y r e m a i n open m o m e n t a r i l y and have m i n i m a l c o n s e q u e n c e s i n t h e o p e r a t i o n of t h e s e i z u r e u n i t . 69 6.2 M o n i t o r S o f t w a r e S t r u c t u r e M o n i t o r s o f t w a r e i s d e s i g n e d f o r (1) d e t e c t i n g and c a t a l o g i n g i n t e r i c t a l SSW and (2) d e t e c t i n g s e i z u r e s . As w e l l as d e t e c t i o n r o u t i n e s , t h e r e a r e programs f o r c a l i b r a t i o n , a d j u s t i n g key s y s t e m p a r a m e t e r s , and m a i n t a i n i n g p a t i e n t f i l e s . A l l r o u t i n e s a r e l o a d e d and s t a r t e d v i a a main menu p r o g r a m . 6.2.1 The SSW M o n i t o r S o f t w a r e The i n t e r i c t a l m o n i t o r i s w r i t t e n e n t i r e l y i n a s s e m b l e r , a l t h o u g h i t s program modules a r e l o a d e d and l i n k e d f r o m a BASIC r o u t i n e c a l l e d from t h e main menu. On s t a r t u p , t h e e n t i r e c o n t e n t s o f t h e s t a c k and z e r o page a r e r e l o c a t e d t o a s a f e s p o t so t h a t t h e m o n i t o r may make use of them w i t h o u t c o m p r o m i s i n g t h e i n t e g r i t y o f A p p l e s o f t BASIC o r t h e d i s k o p e r a t i n g s y s t e m . On e x i t , t h e s y s t e m i s r e s t o r e d and t h e main menu program i s r e -e n t e r e d . The SSW m o n i t o r i s i n t e r r u p t d r i v e n - i n t e r r u p t s a r e g e n e r a t e d a t e q u a l i n t e r v a l s a c c o r d i n g t o t h e s a m p l i n g r a t e d e s i r e d ( l O O h z ) . On e a c h i n t e r r u p t , c o n v e r s i o n s a r e made on e a c h o f 16 c h a n n e l s o f i n c o m i n g EEG and v a l u e s a r e l o a d e d i n t o a b u f f e r t o a w a i t p r o c e s s i n g . B u f f e r i n g i s n e c e s s a r y so t h a t t h e more complex p r o c e s s i n g , w h i c h i s done on c a n d i d a t e s f r o m t h e f i r s t p a s s , c a n t a k e s e v e r a l sample i n t e r v a l s . Samples a r e p r o c e s s e d , one a f t e r t h e n e x t , u n t i l t h e s y s t e m b u f f e r i s empty. 70 N o r m a l l y , s p i k e c a n d i d a t e s a r e few so t h a t t h e r e i s ample p r o c e s s i n g t i m e . The b u f f e r i s l a r g e enough (4K b y t e s ) t o d e a l w i t h s h o r t b u r s t s of a c t i v i t y . In t h e u n l i k e l y c a s e t h a t t h e b u f f e r o v e r f l o w s , t h e s y s t e m t u r n s o f f s p i k e d e t e c t i o n u n t i l enough s p a c e i s a v a i l a b l e t o c o n t i n u e . The m o n i t o r c o n s i s t s of 4 t a s k s w h i c h r u n i n p a r a l l e l on t h r e e p r i o r i t y l e v e l s . The s y s t e m a c c o m o d a t e s m u l t i p l e t a s k s a t th e m i d d l e p r i o r i t y l e v e l . E a c h t a s k has i t s own s e c t i o n of s t a c k and workspace t o a v o i d c o n f l i c t s o v e r memory and r e s o u r c e s . The r u n n i n g of t a s k s i s o r g a n i z e d by a t a s k h a n d l i n g p r o g r a m . The 4 t a s k s , a c c o r d i n g t o p r i o r i t y , a r e t h e f o l l o w i n g : 1) The Main A n a l y s i s R o u t i n e . I t i s queued t o run e a c h t i m e a new s e t o f sam p l e s i s p l a c e d i n t h e s i g n a l b u f f e r . I t i s t h e h i g h e s t p r i o r i t y t a s k i n th e s y s t e m . As l o n g a s t h e r e a r e any samples l e f t i n t h e b u f f e r , t h i s t a s k w i l l c o n t i n u e t o r u n , t a k i n g p r e c e d e n c e o v e r a l l t a s k s a t o t h e r l e v e l s , e ven t h e i n t e r r u p t e d t a s k s t h a t a r e w a i t i n g t o be r e s t a r t e d . 2) The U s e r I n q u i r y I n t e r f a c e . T h i s t a s k i s queued t o run i n r e s p o n s e t o u s e r i n q u i r i e s a b out t h e s y s t e m s t a t u s . I t i s a l e v e l 2 t a s k . A l t h o u g h t h e k e y b o a r d p o r t i s p o l l e d d u r i n g t h e i n t e r r u p t s e r v i c e r o u t i n e , e x c e p t f o r a few s i n g l e c h a r a c t e r commands, r e s p o n s e must w a i t a c c o r d i n g t o t h e p r i o r i t y s t r u c t u r e o f t h e s y s t e m . 71 3) The G r a p h i c s R o u t i n e . T h i s r o u t i n e i s queued t o run e v e r y 1/4 o f a s e c o n d . I t u p d a t e s a c o n t i n u o u s c o l o r g r a p h i c s d i s p l a y ( f i g u r e 39) of t h e r e s u l t s of SSW d e t e c t i o n . T h i s a l s o i s a p r i o r i t y l e v e l 2 t a s k . I f b o t h t a s k number 2 and number 3 a r e queued t h e n number 2 w i l l be r u n f i r s t , but t a s k 3 must be run n e x t . A l s o , any i n t e r r u p t e d l e v e l 2 t a s k t a k e s p r i o r i t y o v e r o t h e r l e v e l 2 t a s k s y e t t o be s t a r t e d . 4) The B a c k g r o u n d Task T h i s t a s k i s run when no t a s k o f any o t h e r k i n d i s w a i t i n g . I t has t h e l o w e s t p r i o r i t y o f a l l . A t p r e s e n t , i t does n o t h i n g b u t k i l l t i m e . I t i s a n u l t a s k . 72 F i g u r e 39 C o l o r G r a p h i c s D i s p l a y of SSW M o n i t o r . The r u n n i n g sums of d e t e c t e d SSW a r e d y n a m i c a l l y d i s p l a y e d u s i n g c i r c l e s a p p r o p r i a t e l y p l a c e d on a map of e l e c t r o d e l o c a t i o n s . Sums a r e r e p r e s e n t e d by b o t h s i z e and c o l o r of t h e c i r c l e s . 7 3 6.2.2 The S e i z u r e M o n i t o r S o f t w a r e The s e i z u r e m o n i t o r i s a l s o w r i t t e n i n a s s e m b l e r , t h o u g h i t i s l o a d e d by a BASIC r o u t i n e c a l l e d by t h e menu pr o g r a m . E s s e n t i a l l y , i t i s a s u b s e t of t h e s p i k e m o n i t o r . The s y s t e m s t r u c t u r e i s i d e n t i c a l , a l t h o u g h t h e r e i s r e a l l y o n l y one t a s k i n t h e s y s t e m . O t h e r t h a n t h e r e a l t i m e c l o c k and a l i s t of t i m e s of s e i z u r e d e t e c t i o n s , t h e r e i s no g r a p h i c s d i s p l a y . When a s e i z u r e d e t e c t i o n i s made, t h e m o n i t o r marks t h e i n f o r m a t i o n ( t i m e ) on t h e s c r e e n and h o l d s a s i n g l e d i g i t a l o u t p u t low f o r 1 s e c o n d t o s i g n a l t h e f a c t t o t h e o u t s i d e w o r l d . The o u t p u t c a n be u s e d t o sound a l a r m s , t u r n on r e c o r d e r s , e t c . P r e s e n t l y , i t i s u s e d t o put a mark on t h e t a p e r e c o r d i n g of t h e EEG. 74 V I I . RESULTS AND DISCUSSION In t h i s c h a p t e r we e v a l u a t e t h e a c c u r a c y of t h e EEG m o n i t o r i n d e t e c t i n g SSW and s e i z u r e a c t i v i t y . E v a l u a t i o n o f t h e s e i z u r e m o n i t o r i s c o n s i d e r a b l y e a s i e r t h a n t h e SSW m o n i t o r . T h e r e a r e f a r fewer s e i z u r e s and t h e y a r e u s u a l l y v e r y d r a m a t i c e v e n t s . I t i s , t h e r e f o r e , c l e a r when t h e computer d e t e c t s a s e i z u r e o r m i s s e s i t . SSW a r e v e r y s h o r t e v e n t s . When t h e y o c c u r , i t may be i n g r e a t numbers. We a r e i n t e r e s t e d i n t h e a g g r e g a t e of t h e SSW d e t e c t i o n and n o t so much i n t h e d e t e c t i o n of any s i n g l e e v e n t . We may want t o o b t a i n t o t a l s s i m p l y t o see i f a c e r t a i n d r u g has been e f f e c t i v e i n r e d u c i n g t h e amount of a b n o r m a l a c t i v i t y . We may a l s o want t o use t h e i n f o r m a t i o n t o a i d i n l o c a l i z i n g t h e s o u r c e o f t h e a b n o r m a l a c t i v i t y . 75 7.1 E v a l u a t i o n Of The SSW M o n i t o r As can be seen from f i g u r e 40, our s i m p l e d e t e c t o r i s a b l e t o d i s c r i m i n a t e e p i l e p t i f o r m a c t i v i t y from t h e b a c k g r o u n d . Even i n t h e c a s e shown i n f i g u r e 41, where t h e s p i k e a m p l i t u d e i s lo w e r t h a n t h e b a c k g r o u n d , a d e t e c t i o n i s made. When t h e EEG i s r e l a t i v e l y f r e e from a r t i f a c t t h e d e t e c t i o n r a t e i s q u i t e good. T h e r e i s a r a t e o f b e t t e r t h a n 80% a c c u r a t e d e t e c t i o n s w i t h a f a l s e d e t e c t i o n r a t e of l e s s t h a n 5%. When t h e r e i s a g r e a t d e a l of a r t i f a c t , p a r t i c u l a r l y t h a t due t o movement, t h e r a t e of f a l s e d e t e c t i o n s c an r e a c h a s much as 50% o r more. The i n t r o d u c t i o n o f a m u s c l e a r t i f a c t d e t e c t o r has g r e a t l y r e d u c e d t h e r a t e o f f a l s e d e t e c t i o n s but i t has n o t c o m p l e t e l y e l i m i n a t e d t h e p r o b l e m . I t i s d i f f i c u l t t o measure t h e e f f e c t i v e n e s s of t h e m o n i t o r on an e v e n t by e v e n t b a s i s b e c a u s e of t h e v a s t amounts o f d a t a t h a t a r e p r o c e s s e d even o v e r a s h o r t p e r i o d o f t i m e . I n s t e a d , we have c h o s e n t o s e l e c t a few p a t i e n t s and s t u d y t h e r e s u l t s o f a m o n i t o r i n g s e s s i o n i n r e l a t i o n t o t h e n e u r o l o g i c a l d i a g n o s i s . T h r e e p a t i e n t s s u f f e r i n g f r o m f o c a l e p i l e p s y were c h o s e n . R e s u l t s f r o m 1 hour l o n g m o n i t o r i n g p e r i o d s were o b t a i n e d and t h e r e s u l t s a r e shown i n f i g u r e s 42 t o 44. The n e u r o l o g i c a l d i a g n o s e s of t h e p a t i e n t s u s e d i n t h i s s t u d y were b a s e d on t h e f u l l t i m e t h e p a t i e n t s were i n t h e s e i z u r e i n v e s t i g a t i o n u n i t . T h i s was s e v e r a l d a y s i n some c a s e s . B e c a u s e t h e computer m o n i t o r i n g was done o n l y o v e r s h o r t p e r i o d s , some o f t h e 76 a c t i v i t y analysed by the n e u r o l o g i s t was not a v a i l a b l e to the computer. Figure'41 Detection of SSW; low s i g n a l to noise r a t i o . The bottom tr a c e i n d i c a t e s where a d e t e c t i o n i s made. 77 P a t i e n t A was d i a g n o s e d as h a v i n g m u l t i f o c a l e p i l e p s y w i t h one f o c u s i n t h e l e f t o c c i p i t a l r e g i o n and t h e o t h e r i n t h e l e f t t e m p o r a l . P a t i e n t B has i n t e r i c t a l a b n o r m a l i t i e s i n t h e m e s i o -t e m p o r a l r e g i o n w i t h a t e n d e n c y t o b i l a t e r a l i z a t i o n and p a t i e n t C has a b n o r m a l a c t i v i t y n e a r t h e m i d l i n e i n t h e f r o n t a l r e g i o n . From t h e r e s u l t s p r e s e n t e d i n f i g u r e s 42b, 43b, and 44b, we see t h a t t h e r e i s o n l y a r o u g h c o r r e l a t i o n between t h e n e u r o l o g i c a l d i a g n o s i s and t h e SSW d e t e c t i o n r e s u l t s . T h i s i s n o t s u r p r i s i n g s i n c e , w i t h b i p o l a r r e c o r d i n g montages, s i m p l e SSW i n f o r m a t i o n d o e s n ' t d i r e c t l y i n d i c a t e t h e s i t e o f maximal a c t i v i t y . Phase r e v e r s a l i n f o r m a t i o n i s a more u s e f u l i n d i c a t o r o f t h e s i t e . I t i s a l s o l e s s s u s c e p t i b l e t o f a l s e d e t e c t i o n s s i n c e t h e c r i t e r i a f o r phase r e v e r s a l d e t e c t i o n i s q u i t e s t r i n g e n t . In t h e f o l l o w i n g d i s c u s s i o n we w i l l r e l y p r i m a r i l y on t h e phase r e v e r s a l d e t e c t i o n s f o r t h e e v a l u a t i o n o f t h e SSW m o n i t o r . From f i g u r e 42c we see a good c o r r e s p o n d e n c e between t h e p l o t of phase r e v e r s a l s and t h e n e u r o l o g i c a l d i a g n o s i s ( p a t i e n t A ) . B o t h n e u r o l o g i s t and computer n o t e t h e e x i s t e n c e o f a f o c u s i n t h e l e f t f r o n t o - t e m p o r a l r e g i o n and a m i r r o r f o c u s on t h e r i g h t s i d e . T h e r e i s no s i g n of a f o c u s i n t h e l e f t o c c i p i t a l r e g i o n f r o m t h e computer r e s u l t s as was n o t e d by t h e n e u r o l o g i s t . U n f o r t u n a t e l y , no computer a n a l y s i s was done o f a montage c o v e r i n g t h a t a r e a . T h e r e f o r e , i t would n o t have been p o s s i b l e f o r t h e computer t o p r e d i c t t h e o c c i p i t a l f o c u s . 7 8 D. Figure 42 I n t e r i c t a l M o n i t o r i n g ; P a t i e n t A. (a) Montage used i n monitoring. (b) I n t e r i c t a l SSW d e t e c t i o n t o t a l s f o r P a t i e n t A (1 c i r c l e = 3 detected SSW). (c) Phase r e v e r s a l t o t a l s f o r the same p a t i e n t (1 c i r c l e = 1 phase r e v e r s a l detected). (d)The l o c a t i o n s are marked where p a t i e n t A has m u l t i p l e f o c i i according to the n e u r o l o g i s t . One focus i s the l e f t f r o n t o -temporal region has a m i r r o r focus on the r i g h t s i d e . The n e u r o l o g i s t a l s o noted a focus i n the l e f t o c c i p i t a l region. 79 P a t i e n t B ( f i g u r e 43) e x h i b i t s a b n o r m a l a c t i v i t y n e a r t h e m i d l i n e o f t h e f r o n t a l r e g i o n . The v e r y l a r g e number of phase r e v e r s a l s d e t e c t e d i n t h i s a r e a a g a i n i n d i c a t e s a good c o r r e s p o n d e n c e of t h e c o m p u t e r ' s r e s u l t s and t h e n e u r o l o g i c a l d i a g n o s i s . The computer d e t e c t e d a l a r g e number of SSW i n c h a n n e l 13. When SSW o c c u r a t t h e ends of a b i p o l a r c h a i n , t h e m o n i t o r makes a s p e c i a l n o t e of i t b e c a u s e i t c o u l d mean t h a t t h e r e i s a p o t e n t i a l maximum a t t h e l a s t e l e c t r o d e i n t h e c h a i n . I n f o r m a t i o n i n t h e s e c h a n n e l s i s s i m i l a r t o t h a t o b t a i n e d from p h a s e r e v e r s a l s . SSW w h i c h a p p e a r a l o n e a t t h e end o f a c h a i n a r e sometimes c o n s i d e r e d phase r e v e r s a l s f o r t h i s r e a s o n , even t h o u g h t h e r e i s no a c t u a l phase r e v e r s a l i n t h e c h a i n . S i n c e t h e s e t y p e s o f 'phase r e v e r s a l s ' o n l y r e q u i r e t h e d e t e c t i o n of a s i n g l e SSW, t h e y a r e more l i k e l y t o be f a l s e d e t e c t i o n s and we must be c a r e f u l when i n t e r p r e t i n g t h e r e s u l t s . In t h e c a s e o f p a t i e n t B, t h e d e t e c t i o n o f a l a r g e number o f e n d - o f - c h a i n phase r e v e r s a l s a t Fp2 ( c h a n n e l 13) has some s i g n i f i c a n c e s i n c e we have d e t e c t e d a number of phase r e v e r s a l s a t t h e m i d l i n e n e a r b y . T h e r e were no phase r e v e r s a l s d e t e c t e d a t Fp2 i n v o l v i n g c h a n n e l s 9 and 10 as would be e x p e c t e d i f i n d e e d t h e r e was a s t r o n g p o t e n t i a l maximum a t Fp2. T h e r e f o r e , t h e SSW d e t e c t e d i n c h a n n e l 13 a r e more l i k e l y due t o a p o t e n t i a l maximum n e a r t h e m i d l i n e r a t h e r t h a n a t Fp2. S i n c e t h e r e a r e f a r more SSW i n c h a n n e l 13 on t h e r i g h t t h a n i n c h a n n e l 15 on t h e l e f t , however, we would e x p e c t t h a t t h e a c t i v i t y i s more l a t e r a l i z e d t o t h e r i g h t s i d e o f t h e m i d l i n e . In f a c t , t h e n e u r o l o g i c a l r e p o r t m e n t i o n s f r o n t a l a b n o r m a l i t y 80 n e a r t h e m i d l i n e . T h e r e i s some t e n d e n c y t o b i l a t e r a l i z a t i o n , w h i c h c o i n c i d e s w i t h our d e t e c t i o n of a s m a l l e r number o f SSW and r e v e r s a l s i n t h e l e f t f r o n t a l r e g i o n . T h e r e were a number of phase r e v e r s a l s d e t e c t e d a r o u n d t h e s p h e n o i d a l e l e c t r o d e , Sp2. The n e u r o l o g i c a l r e p o r t makes no m e n t i o n of t h i s , b u t i t seems t h e r e p o r t was b a s e d p r i m a r i l y on slow wave a n a l y s i s . E x t e n s i v e damage was done i n t h e f r o n t a l r e g i o n of t h e p a t i e n t ' s b r a i n due t o t h e e n t r y o f a s m a l l b u l l e t , s t i l l l o d g e d i n t h e s u p r a v e n t r i c l e . I t i s , t h e r e f o r e , q u i t e p o s s i b l e t h a t a b n o r m a l a c t i v i t y would be coming from a r o u n d Sp2. T h e r e i s a l s o t h e same t e n d e n c y t o b i l a t e r a l i z a t i o n a t t h e s p h e n o i d a l e l e c t r o d e s w i t h a maximum o c c u r r i n g on t h e r i g h t s i d e . T h i s w o u l d f u r t h e r i n d i c a t e t h a t t h e r e v e r s a l s d e t e c t e d t h e r e a r e n o t m e r e l y due t o a r t i f a c t . 81 D. Figure 43 I n t e r i c t a l M o n i t o r i n g ; P a t i e n t B. (a) Montage used i n monitoring. (b) I n t e r i c t a l SSW d e t e c t i o n t o t a l s f o r P a t i e n t B (1 c i r c l e =10 SSW dete c t e d ) . (c) Phase r e v e r s a l t o t a l s f o r the same p a t i e n t (1 c i r c l e = 1 phase r e v e r s a l detected). (d)The l o c a t i o n s are marked where, according to the n e u r o l o g i s t , p a t i e n t B e x h i b i t s abnormal a c t i v i t y . This i s near the m i d l i n e i n the f r o n t a l r e g i o n . There i s r i g h t f r o n t a l a c t i v i t y near the mid l i n e with some tendency to b i l a t e r a l i z a t i o n . 82 P a t i e n t C e x h i b i t e d i n t e r i c t a l a c t i v i t y i n t h e a n t e r i o r m e s i o - t e m p o r a l a r e a . T h e r e was a t e n d e n c y t o i n d e p e n d e n t b i l a t e r a l i z a t i o n . L o o k i n g a t f i g u r e 44c, we see t h a t r e v e r s a l s were d e t e c t e d - n e a r t h e s p h e n o i d a l e l e c t r o d e s Sp1 and Sp2. C o n s i d e r i n g t h a t t h e e x a c t l o c a t i o n o f t h e s u r g i c a l l y i m p l a n t e d s p h e n o i d a l e l e c t r o d e s i s d i f f i c u l t t o d e t e r m i n e , t h e computer p r e d i c t i o n i s r e a s o n a b l e . The r e p o r t a l s o m e n t i o n s t h a t a c t i v i t y i s g r e a t e r on t h e l e f t s i d e t h a n on t h e r i g h t but t h e computer d e t e c t e d more p h a s e r e v e r s a l s on t h e r i g h t s i d e . I f we l o o k a t f i g u r e 44b, however, t h e p i c t u r e i s somewhat d i f f e r e n t . T h e r e a r e a c o n s i d e r a b l e number of SSW a t t h e ends o f b i p o l a r c h a i n s i n c h a n n e l s 1,5,6, and 10. The computer d e t e r m i n e d t h a t most o f t h e s e r e p r e s e n t e d e n d - o f - c h a i n p h a s e r e v e r s a l s . I t i s p r o b a b l e t h a t many a r e bona f i d e p o t e n t i a l maxima a t t h e ends o f t h e i r r e s p e c t i v e b i p o l a r c h a i n s . Many more of them were d e t e c t e d on t h e l e f t t h a n on t h e r i g h t w h i c h w o u l d a g r e e w i t h t h e f i n d i n g s of t h e n e u r o l o g i s t . 83 D. Figure 44 I n t e r i c t a l M o n i t oring; P a t i e n t C. (a) Montage used i n monitoring. (b) I n t e r i c t a l SSW d e t e c t i o n t o t a l s f o r P a t i e n t C (1 c i r c l e = 6 SSW detected). (c) Phase r e v e r s a l t o t a l s f o r the same p a t i e n t (1 c i r c l e =,1 phase r e v e r s a l d e t e c t e d ) . (d)The l o c a t i o n s are marked where, according the the n e u r o l o g i s t , P a t i e n t C e x h i b i t s abnormal a c t i v i t y . This i s i n the mesio-temporal reg i o n . There i s a tendency to independent b i l a t e r a l i z a t i o n . 8 4 From t h i s b r i e f s t u d y , we can see t h a t t h e i n t e r i c t a l SSW m o n i t o r , a t i t s p r e s e n t s t a g e o f d e v e l o p m e n t , i s c a p a b l e of p r e d i c t i n g t h e f o c u s or f o c i i of a c t i v i t y w h i c h c o r r e l a t e q u i t e w e l l w i t h t h e f i n d i n g s o f a n e u r o l o g i s t . In one of t h e c a s e s p r e s e n t e d h e r e ( p a t i e n t B) t h e m o n i t o r i n g s e s s i o n i n c l u d e d s e v e r a l l e n g t h y p e r i o d s of c o r r u p t i n g m u s c l e and movement a r t i f a c t . In s p i t e of t h e a r t i f a c t , we were a b l e t o g e t r e s u l t s w h i c h c o r r e s p o n d e d w e l l w i t h t h e f i n d i n g s of t h e n e u r o l o g i s t . In o r d e r t o i n s u r e t h e a c c e p t a n c e o f a l a r g e enough p e r c e n t a g e o f a c t u a l SSW ( i e . a s m a l l f a l s e r e s t p r o b a b i l i t y ) , we u s u a l l y end up w i t h a l a r g e number of c a n d i d a t e s from t h e f i r s t p a s s o f t h e d e t e c t i o n a l g o r i t h m . T h a t number i s g r e a t l y r e d u c e d by s u b s e q u e n t p r o c e s s i n g b u t we s t i l l c a n have a h i g h l e v e l of f a l s e d e t e c t i o n s i n t h e p r e s e n c e of s e r i o u s a r t i f a c t . F o r l o n g t e r m r e c o r d i n g s e s s i o n s t h i s i s n o t good enough. A t p r e s e n t , t h e r e s u l t s a r e o b t a i n e d f r o m 1 hour r e c o r d i n g s e s s i o n s w i t h an o p e r a t o r i n a t t e n d a n c e . The dynamic g r a p h i c s d i s p l a y l e t s t h e o p e r a t o r know how w e l l t h e m o n i t o r i s d o i n g so t h a t , i f t h e r e a r e l o n g segments w i t h f a l s e d e t e c t i o n s , t h e s e s s i o n c a n be a b o r t e d . A g o a l f o r f u t u r e d e v e l o p m e n t of t h e m o n i t o r s h o u l d be t o r e d u c e t h e r a t e o f f a l s e d e t e c t i o n s . The s t r a t e g y f o r a c h i e v i n g t h i s i s t w o f o l d . F i r s t , a l t h o u g h we have i n c l u d e d some t e s t s o f SSW shape, we have not e x p l o i t e d a l l t h a t i s known a b o u t SSW mo r p h o l o g y i n t h e d e t e c t i o n a l g o r i t h m . S e cond, we must d e v e l o p b e t t e r a r t i f a c t d e t e c t o r s . D e t e c t i n g t h e p r e s e n c e o f m u s c l e 8 5 a r t i f a c t has a i d e d i n r e d u c i n g f a l s e d e t e c t i o n s but some movement and e l e c t r o d e a r t i f a c t c o n t i n u e s t o be p r o b l e m a t i c . D e v e l o p i n g d e t e c t o r s ( f o r SSW or a r t i f a c t ) r e q u i r e s t h e a b i l i t y t o i d e n t i f y enough u s e f u l p a r a m e t e r s of t h e waveforms t o d i s c r i m i n a t e them from n o r m a l a c t i v i t y . I d e n t i f i c a t i o n o f s u c h p a r a m e t e r s u l t i m a t e l y i n v o l v e s t h e a n a l y s i s o f l a r g e amounts o f d a t a from a l a r g e number o f p a t i e n t s . 86 7.2 E v a l u a t i o n Of The S e i z u r e M o n i t o r The EEG s e i z u r e m o n i t o r , a l t h o u g h s t i l l i n a d e v e l o p m e n t a l s t a t e , has been i n o p e r a t i o n i n t h e S e i z u r e I n v e s t i g a t i o n U n i t f o r some t i m e . T h i s has made i t p o s s i b l e t o o b t a i n a good measure of i t s p e r f o r m a n c e . Over t h e p e r i o d of 6 months, t h e s e i z u r e m o n i t o r was o p e r a t i n g a l m o s t c o n t i n u a l l y . B e c a u se we a r e s t i l l u n a b l e t o m o n i t o r b o t h p a t i e n t s i n t h e u n i t a t t h e same t i m e , we were o n l y a b l e t o o b t a i n r e s u l t s f r o m a b o u t h a l f t h e p a t i e n t s who went t h r o u g h t h e u n i t . Of t h e s e , a few had no s e i z u r e s a t a l l . In t o t a l , we have r e s u l t s f r o m 12 d i f f e r e n t p a t i e n t s and t h e s e a r e shown i n t a b l e I . The r e q u i r e m e n t s o f s e i z u r e d e t e c t i o n a r e d i f f e r e n t from SSW d e t e c t i o n . The g o a l i s t o d e t e c t s e i z u r e s b u t , s i n c e we o n l y want t o s i g n a l t h e i r o c c u r r e n c e f o r l a t e r s c r u t i n y by humans, we c a n t o l e r a t e a r e l a t i v e l y h i g h d e g r e e o f f a l s e d e t e c t i o n s . M i s s i n g a few i n t e r i c t a l SSW i s n o t of much c o n s e q u e n c e s i n c e g e n e r a l l y t h e r e a r e a l o t of them. T h i s i s n o t t r u e o f s e i z u r e s . I f a t a l l p o s s i b l e , we want t o d e t e c t 100% o f t h e s e i z u r e s b e c a u s e t h e r e a r e so few o f them. We aim f o r a p e r f e c t r a t e o f d e t e c t i o n even a t t h e e x p e n s e of a h i g h e r r a t e o f f a l s e d e t e c t i o n s . 87 Number o f p a t i e n t s 12 T o t a l number o f s e i z u r e s 30 T o t a l number of d e t e c t i o n s by t h e computer 54 T o t a l number o f f a l s e d e t e c t i o n s by t h e computer 26 T o t a l number o f t r u e d e t e c t i o n s by t h e computer 28 T o t a l number o f s e i z u r e s m i s s e d by t h e computer 2 T o t a l number o f s e i z u r e s d e t e c t e d o n l y by t h e computer 11 TABLE I A u t o m a t i c D e t e c t i o n o f S e i z u r e s . R e s u l t s of computer d e t e c t i o n of s e i z u r e s i n t h e S e i z u r e I n v e s t i g a t i o n U n i t f o r a p e r i o d of 6 months b e g i n n i n g November 1982. From t h e r e s u l t s p r e s e n t e d i n T a b l e I , we see t h a t , of 54 computer s e i z u r e d e t e c t i o n s , 52% were bona f i d e s e i z u r e s and 48% were f a l s e d e t e c t i o n s . The r a t e o f f a l s e d e t e c t i o n s i s q u i t e a c c e p t a b l e . I t means t h a t f o r e v e r y two s e i z u r e s t h e computer d e t e c t s , one i s v a l i d . T h i s i s an enormous s a v i n g i n t i m e f o r t h e human o b s e r v e r , c o n s i d e r i n g t h a t t h e a l t e r n a t i v e i s t o s t u d y t h e EEG r e c o r d f o r t h e e n t i r e m o n i t o r i n g p e r i o d . The r e l a t i v e l y low r a t e o f f a l s e d e t e c t i o n s c an o n l y be c o n s i d e r e d good i f t h e r a t e o f f a l s e r e s t s i n v e r y low o r 0. In f a c t , i n 30 v a l i d s e i z u r e s t h e computer m i s s e d 2 ( f r o m t h e same p a t i e n t ) o f them o r o n l y 7%. We s h o u l d a l s o l o o k a t t h e number t h a t would have been m i s s e d w i t h o u t computer m o n i t o r i n g . Some 11 s e i z u r e s , o r 37% of t h e t o t a l number, would have gone 88 u n d e t e c t e d i f not f o r t h e computer m o n i t o r i n g . C o m p aring t h i s w i t h t h e 7% of t h e m i s s e s by t h e computer, t h e m o n i t o r seems v e r y good. S i n c e t h e m o n i t o r was a c t i v e r o u g h l y t w i c e as l o n g as t h e r e were human o b s e r v e r s a v a i l a b l e t o d e t e c t t h e c o m p u t e r ' s m i s s e s , however, we c o u l d e x p e c t t h e a c t u a l f a l s e r e s t r a t e t o be a l m o s t d o u b l e a t a r o u n d 13%. The s e i z u r e s t h a t were m i s s e d d i d n o t c o n f o r m t o t h e d e f i n i t i o n we were w o r k i n g w i t h - m o derate t o h i g h a m p l i t u d e a c t i v i t y on a m a j o r i t y o f c h a n n e l s . T h a t we m i s s e d some s e i z u r e s i s , t h e r e f o r e , more a s h o r t c o m i n g of our o r i g i n a l d e f i n i t i o n of a s e i z u r e t h a t i t i s a p r o b l e m o f t h e d e t e c t o r . The o r i g i n a l d e f i n i t i o n i s s u f f i c i e n t f o r most c l i n i c a l l y s i g n i f i c a n t s e i z u r e s , however, t h e r e a r e s e i z u r e s o f i n t e r e s t t o t h e m e d i c a l s t a f f w h i c h a r e n o t b e i n g d e t e c t e d . The main d i s t i n g u i s h i n g f e a t u r e of t h e s e i z u r e s m i s s e d by t h e computer i s a s t r o n g r h y t h m i c c o n t e n t on most c h a n n e l s . I t i s n o t n e c e s s a r y t o i n c l u d e a c a p a b i l i t y f o r s o p h i s t o c a t e d f r e q u e n c y a n a l y s i s t o d e t e c t s u c h s e i z u r e r h y t h m s . A s i m p l e a n a l y s i s , w h i c h g i v e s t h e a v e r a g e p e r i o d and t h e amount of d e v i a t i o n f r o m t h e a v e r a g e would be s u f f i c i e n t . The i n t e r i c t a l m o n i t o r a l r e a d y u s e s t h i s t e c h n i q u e i n d e t e c t i n g a l p h a r hythms, a l t h o u g h i n t h a t c a s e we o n l y l o o k a t v e r y s h o r t s e c t i o n s o f t h e waveform (4 p e r i o d s ) . In s e i z u r e d e t e c t i o n , we a r e o n l y i n t e r e s t e d i n rhythms t h a t a r e s u s t a i n e d o v e r a l o n g t i m e ( i n e x c e s s of 5 s e c o n d s ) and a r e on many c h a n n e l s . 89 I n t h i s c h a p t e r we have e v a l u a t e d t h e e f f e c t i v e n e s s of t h e EEG m o n i t o r t o d e t e c t SSW and s e i z u r e s . F o r b o t h m o n i t o r s t h e e v a l u a t i o n i n d i c a t e s t h e need f o r f u r t h e r d e v e l o p m e n t . T h i s i s p a r t i c u l a r l y t r u e f o r t h e i n t e r i c t a l m o n i t o r . We have shown, t h o u g h , t h a t b o t h m o n i t o r s g i v e v e r y p o s i t i v e r e s u l t s . The s e i z u r e m o n i t o r i s a l r e a d y i n use i n t h e S e i z u r e I n v e s t i g a t i o n U n i t and t h e i n t e r i c t a l SSW m o n i t o r , i f u s e d s u b j e c t t o some r e s t r i c t i o n s , c a n a l s o e x t r a c t u s e f u l i n f o r m a t i o n . 90 V I I I . SUMMARY We have d e s c r i b e d t h e d e v e l o p m e n t of a r e a l - t i m e EEG p r o c e s s o r t o be u s e d f o r p a t i e n t m o n i t o r i n g i n t h e S e i z u r e I n v e s t i g a t i o n U n i t o f t h e A c u t e C a r e H o s p i t a l a t t h e U n i v e r s i t y of B r i t i s h C o l u m b i a . T h i s m o n i t o r a u t o m a t i c a l l y d e t e c t s e p i l e p t i f o r m a b n o r m a l i t i e s i n p a t i e n t EEG as an a i d i n n e u r o l o g i c a l d i a g n o s i s . B o t h s e i z u r e and between s e i z u r e a c t i v i t y a r e t a r g e t s o f t h e i n v e s t i g a t i o n . The s e i z u r e d e t e c t o r o p e r a t e s w i t h a d e f i n i t i o n of s e i z u r e l e v e l a c t i v i t y as t h a t w h i c h i s of c o n s i s t e n t l y h i g h a m p l i t u d e on a m a j o r i t y o f r e c o r d i n g c h a n n e l s . The d e f i n i t i o n i s n o t s u f f i c i e n t t o d e t e c t a l l s e i z u r e s but i s s u f f i c i e n t t o f l a g most c l i n i c a l l y s i g n i f i c a n t o n e s . The EEG i s f i r s t s u b j e c t e d t o a b a n d p a s s o p e r a t i o n , b e c a u s e we have f o u n d t h a t , a t t h e o n s e t o f s e i z u r e , s i g n a l power s h i f t s i n t o t h e r a n g e o f f r e q u e n c i e s f a v o r e d by t h e band p a s s f i l t e r . A s e i z u r e i s d e t e c t e d when t h e o u t p u t power of t h e b a n d p a s s e d s i g n a l r e a c h e s a t h r e s h o l d l e v e l on a m a j o r i t y o f a l l c h a n n e l s o r 3/4 o f t h e c h a n n e l s i n one h e m i s p h e r e . I n i t i a l r e s u l t s of s e i z u r e d e t e c t i o n s a r e e n c o u r a g i n g . Over 90% of s e i z u r e s o c c u r r i n g d u r i n g a 6 month p e r i o d were a c c u r a t e l y d e t e c t e d by computer i n t h e S e i z u r e I n v e s t i g a t i o n U n i t . The f a l s e a l a r m r a t e was a b o u t 50% b u t t h i s i s c o n s i d e r e d a c c e p t a b l e s i n c e t h e p u r p o s e o f t h e m o n i t o r i s o n l y t o n o t e t h e o c c u r r e n c e o f t h e s e i z u r e s f o r l a t e r v e r i f i c a t i o n by a 91 n e u r o l o g i s t or e l e c t r o e n c e p h a l o g r a p h e r . The EEG m o n i t o r i s a l s o d e s i g n e d t o d e t e c t between s e i z u r e e p i l e p t i f o r m a c t i v i t y known as s p i k e s and s h a r p waves (SSW). T h e s e a r e s h o r t t r a n s i e n t e v e n t s o f l e s s t h a n 250 m i l l i s e c o n d s i n d u r a t i o n whose main d i s t i n g u i s h i n g f e a t u r e i s t h e i r r e l a t i v e s h a r p n e s s compared t o t h e b a c k g r o u n d EEG. Many a p p r o a c h e s have been t r i e d i n t h e a u t o m a t i c d e t e c t i o n o f SSW and t h e s e c a n be d i v i d e d i n t o two c a t e g o r i e s ; p a r a m e t r i c and n o n - p a r a m e t r i c d e t e c t o r s . N o n - p a r a m e t r i c d e t e c t o r s a t t e m p t t o match an i d e a l model of t h e SSW t o t h e i n p u t waveforms. The model may be a t e m p l a t e , a s e t of p a r a m e t e r s , a s e t o f r u l e s , or some c o m b i n a t i o n o f a l l o f t h e s e . Such d e t e c t i o n methods, on some l e v e l , t r y t o mimic t h e a c t i o n of t h e human o b s e r v e r . The p a r a m e t r i c a p p r o a c h assumes an i d e a l model of t h e b a c k g r o u n d EEG. When t h e s i g n a l f a i l s t o c o n f o r m t o t h e model, i t i s assumed t o be due t o a b n o r m a l e v e n t s s u c h as SSW. T h e r e i s no m i m i c i n g of t h e human i n t h i s a p p r o a c h . In f a c t , a p a r a m e t r i c f i l t e r i s a p p a r e n t l y a b l e t o d e t e c t SSW o t h e r w i s e i n v i s i b l e t o th e human e y e . C o n s i d e r i n g t h e d i f f i c u l t y i n e x a c t l y d e f i n i n g SSW, i t t h e r e f o r e a p p e a r s q u i t e a t t r a c t i v e a s a d e t e c t i o n scheme. Our e x p e r i e n c e has been t h a t , i n p r a c t i c e , t h e p a r a m e t r i c a p p r o a c h i s no more e f f e c t i v e t h a n s i m p l e r n o n - p a r a m e t r i c d e t e c t o r s . U s i n g p e r c e n t a g e g a i n i n s i g n a l - t o - n o i s e r a t i o from i n p u t t o o u t p u t of a s y s t e m as a measure c f p e r f o r m a n c e , we t h e o r e t i c a l l y compared t h e i n v e r s e s p e c t r a l f i l t e r ( p a r a m e t r i c 92 d e t e c t o r ) t o a s i m p l e b a n d p a s s f i l t e r ( n o n - p a r a m e t r i c d e t e c t o r ) a s SSW d e t e c t o r s . From a s i g n a l - t o - n o i s e p o i n t o f v i e w , we f o u n d no t h e o r e t i c a l a d v a n t a g e o f t h e i n v e r s e f i l t e r o v e r t h e b a n d p a s s . The p a r a m e t r i c a p p r o a c h i s t o m o d e l t h e b a c k g r o u n d EEG, b u t l i t t l e i s a c t u a l l y known a b o u t t h e m e c h a n i s m s w h i c h g e n e r a t e EEG p a t t e r n s . The n o n - p a r a m e t r i c a p p r o a c h i s t o m o d el t h e SSW, b u t d e f i n i t i o n s o f SSW a r e v a g u e . T h e r e a r e p r o b l e m s , t h e r e f o r e , w i t h b o t h a p p r o a c h e s . The n o n - p a r a m e t r i c methods a r e , h o w e v e r , g e n e r a l l y much e a s i e r t o i m p l e m e n t and a r e a l m o s t a l w a y s u s e d i n p r a c t i c a l , r e a l - t i m e d e t e c t i o n s y s t e m s . Our a p p r o a c h t o SSW d e t e c t i o n i s t o p r o c e s s EEG on a f i r s t p a s s w i t h a l o w - l e v e l o p e r a t o r t h a t d i s c r i m i n a t e s SSW c a n d i d a t e s on t h e b a s i s o f a s h a r p n e s s c r i t e r i o n . The l o w - l e v e l o p e r a t o r i s a b a n d p a s s f i l t e r . I t a c t s a s a good d e t e c t o r o f SSW i n EEG whose power i s c o n c e n t r a t e d i n l o w e r f r e q u e n c i e s . When h i g h e r f r e q u e n c y a c t i v i t y s u c h a s a l p h a r h y t h m s o r m u s c l e a r t i f a c t i s p r e s e n t , SSW d e t e c t i o n i s d i s a b l e d c o m p l e t e l y . Waveforms a c c e p t e d on t h e f i r s t p a s s d e t e c t i o n a r e t h e n s u b j e c t e d t o a s e r i e s o f t e s t s b a s e d on t h e i r m o r p h o l o g i c a l c h a r a c t e r i s t i c s . The a c c u r a c y o f t h e m o n i t o r f o r d e t e c t i n g SSW was e v a l u a t e d by c o m p a r i n g r e s u l t s o b t a i n e d f r o m s e v e r a l c o m p u t e r m o n i t o r i n g s e s s i o n s w i t h t h e n e u r o l o g i c a l d i a g n o s i s o f 3 p a t i e n t s s u f f e r i n g f r o m f o c a l e p i l e p s y . I n a l l c a s e s , i n s p i t e o f some p r o b l e m s c a u s e d by a r t i f a c t , t h e m o n i t o r was a b l e t o a c c u r a t e l y p r e d i c t t h e l o c a t i o n o f e p i l e p t i c f o c i i a s n o t e d by t h e n e u r o l o g i s t . 93 V e r y p o s i t i v e r e s u l t s were o b t a i n e d i n d e t e c t i n g b o t h s e i z u r e and between s e i z u r e a c t i v i t y . The EEG p r o c e s s o r , t h e r e f o r e , has immediate v a l u e as a c l i n i c a l d e v i c e . Much of t h e e p i l e p t i f o r m a c t i v i t y r e c o r d e d i s n e v e r v i e w e d by t h e m e d i c a l s t a f f b e c a u s e of t h e i m p o s s i b i l i t y of s e a r c h i n g t h r o u g h a l l t h e d a t a . Now, w i t h t h e i n t r o d u c t i o n o f computer m o n i t o r i n g , d a t a c a n be p r e p r o c e s s e d t o s a v e o n l y r e l e v a n t i n f o r m a t i o n f o r l a t e r s c r u t i n y by humans. An immediate g o a l f o r f u t u r e work i s t h e improvement o f t h e p r o c e s s o r t o m i n i m i z e d e t e c t i o n e r r o r . A f u r t h e r g o a l i s t o move beyond d e t e c t i o n and a t t e m p t t o answer some of t h e b a s i c q u e s t i o n s o f t h e g e n e r a t i o n o f e p i l e p t i f o r m a c t i v i t y : Do SSW o c c u r r a n d o m l y i n t i m e or a r e t h e y g e n e r a t e d a c c o r d i n g t o some d e t e r m i n i s t i c p a t t e r n ? What i s t h e r e l a t i o n s h i p , i f any, between i c t a l and i n t e r i c t a l a c t i v i t y ? What s i g n i f i c a n c e i s t h e r e t o s e i z u r e r h ythms? Can a model be d e v e l o p e d f o r t h e g e n e r a t i o n of e p i l e p t i f o r m a c t i v i t y ? P r o v i d i n g a n s wers t o s u c h q u e s t i o n s r e q u i r e s t h e s t u d y o f m a s s i v e amounts of d a t a . In t h e p a s t , t h e a b i l i t y t o a n a l y s e d a t a has been l i m i t e d p r i m a r i l y by t h e l a c k o f a u t o m a t e d s y s t e m s o f a n a l y s i s . R e a l - t i m e , a u t o m a t i c , computer d e t e c t i o n of e p i l e p t i f o r m a c t i v i t y i n EEG p r o v i d e s a s t r o n g base from w h i c h we c a n b e g i n t o t a c k l e some of t h e s e p u z z l i n g q u e s t i o n s . 94 REFERENCES 1. B a r l o w , J o h n S . "EEG T r a n s i e n t D e t e c t i o n by M a t c h e d I n v e r s e D i g i t a l F i l t e r i n g " E l e c t r o e n c e p h a l o g r a p h y and C l i n i c a l N e u r o p h y s i o l o g y 1980,48:246-248 2. B a r l o w , J o h n S. " C o m p u t e r i z e d C l i n i c a l E l e c t r o e n c e p h a l o g r a p h y i n P e r s p e c t i v e " IEEE.T.BME No.7 J u l y 1979 pp.377-388 3. B i r k e m e i e r , W i l l i a m P. , F o n t a i n e , A . B u r r , C e l e s i a , G a s t o n e G. ,and Ma,Ken M. " P a t t e r n R e c o g n i t i o n T e c h n i q u e s f o r t h e D e t e c t i o n of E p i l e p t i c T r a n s i e n t s i n EEG" IEEE.T-BME May 1978 4. B o d e n s t e i n , G u n t e r and P r a e t o r i u s , H . M i c h a e l " F e a t u r e E x t r a c t i o n from E l e c t r o e n c e p h a l o g r a m by A d a p t i v e S e g m e n t a t i o n " P r o c . I E E E Vol.65,No.5,May 1977,pp.642-652 5. C a r r i e , J . R . G . "A H y b r i d Computer T e c h n i q u e f o r D e t e c t i n g S h a r p EEG T r a n s i e n t s " ECN 1972,33:336-338 6. C h a t r i a n , G . E . , B e r g a m i n i , L . ,Dondey,M. ,Klass,D.W. , L e n n o x - B u c h t h a l , M . ,and P e t e r s e n , I . A . " G l o s s a r y of Terms Most Commonly Used by C l i n i c a l E l e c t r o e n c e p h a l o g r a p h e r s " ECN 1974,37:538-548 7. Cooper,R. , O s s e l t o n , J . W . ,and Shaw,J.C. EEG T e c h n o l o g y L o n d o n : B u t t e r w o r t h 1969 8. G e v i n s , A l a n S. , Y e a g e r , C h a s . L . ,Diamond,S.L. , S p i r e , J e a n - P a u l , Z e i t l i n , G e r r y M., and G e v i n s , A d r i a H. "Automated A n a l y s i s of t h e E l e c t r i c a l A c t i v i t y o f t h e Human B r a i n ( E E G ) : A P r o g r e s s R e p o r t " P r o c . I E E E V o l . 6 3 No.10,Oct.1975,pp.1382-97 95 9. Gotman,J. " Q u a n t i t a t i v e Measurements of E p i l e p t i c S p i k e M o r p h o l o g y i n t h e Human EEG" ECn 1980,48:551-557 10. Gotman,J. " A u t o m a t i c R e c o g n i t i o n of E p i l e p t i c S e i z u r e s i n t h e EEG" ECN 1982,54:530-540 11. Gotman,J. and G l o o r , P . " A u t o m a t i c R e c o g n i t i o n and Q u a n t i f i c a t i o n o f I n t e r i c t a l E p i l e p t i c A c t i v i t y i n t h e Human S c a l p EEG" ECN 1976,41:513-529 12. Gotman,J. , I v e s , J . R . ,and G l o o r , P . " A u t o m a t i c R e c o g n i t i o n o f I n t e r i c t a l E p i l e p t i c A c t i v i t y i n P r o l o n g e d EEG R e c o r d i n g s " ECN 1979,46:510-520 13. Gotman,J. , I v e s , J . R . ,and G l o o r , P . " F r e q u e n c y C o n t e n t of EEG and EMG a t S e i z u r e O n s e t : P o s s i b i l i t y o f Removal of EMG A r t i f a c t by D i g i t a l F i l t e r i n g " ECN 1981,52:626-639 14. Guedes de O l i v e i r a , P e d r o H.H. and L o p e s da S i l v a , F . H . "A T o p o g r a p h i c a l D i s p l a y o f E p i l e p t i f o r m T r a n s i e n t s B a s e d on a S t a t i s t i c a l A p p r o a c h " ECN 1980,48:710-714 15. Gutman,Irwin , W i l k e s , S . S . ,and H u n t e r , J . S t u a r t I n t r o d u c t o r y E n g i n e e r i n g S t a t i s t i c s J o h n W i l e y and Sons, 1971 16. I s a k s s o n , A n d e r s ,Wennberg,Arne ,and Z e t t e r b e r g , L a r s H. "Computer A n a l y s i s o f EEG S i g n a l w i t h P a r a m e t r i c M o d e l s " P r o c . I E E E V o l . 6 9 No.4,Apr.1981,pp.451-461 17. I v e s , J . R . and G l o o r , P . "A Long-Term T i m e - L a p s e V i d e o System t o Document t h e P a t i e n t ' s S p o n t a n e o u s C l i n i c a l S e i z u r e S y n c h r o n i z e d w i t h t h e EEG" ECN 1978,45:412-416 96 18. I v e s , J . R . ,Thompson,C.J. ,and G l o o r , P . " S e i z u r e M o n i t o r i n g : A New T o o l i n E l e c t r o e n c e p h a l o g r a p h y " ECN 1 976,41 -.422-427 19. J a s p e r , H . and Kershman,J. " A p p l i c a t i o n of t h e EEG i n E p i l e p s y " ECN 1949,1:123-131 20. K o o i , K . A . " V o l t a g e - T i m e C h a r a c t e r i s t i c s of S p i k e s and O t h e r R a p i d E l e c t r o e n c e p h a l o g r a p h i c T r a n s i e n t s : S e m a n t i c and M o r p h o l o g i c a l C o n s i d e r a t i o n s " N e u r o l o g y ( M i n n e a p o l i s ) , 1 9 6 6 , 1 6 : 5 9 - 6 6 21. L e m i e u x , J o h n F. and Blume,Warren T. "Automated M o r p h o l o g i c a l A n a l y s i s o f S p i k e s and S h a r p Waves i n Human E l e c t r o c o r t i o g r a m s " ECN 1983,55:45-50 22. L i e b , J e f f r e y P. ,Woods,Stephen C. , S i c c a r d i , A n t o n i o , C r a n d a l l , P a u l H. , W a l t e r , D o n a l d 0. ,and L e a k e , B a r b a r a " Q u a n t i t a t i v e A n a l y s i s of D e p t h S p i k i n g i n R e l a t i o n t o S e i z u r e F o c i i i n P a t i e n t s w i t h T e m p o r a l Lobe E p i l e p s y " ECN 1978,44:641-663 23. Lopez da S i l v a , F . H . ,van H u l t e n , K . ,Lommen,J.G. ,van Leeuwen,W.Storm van Veelen,C.W.M. ,and V I i e g e n t h a r t , W . " A u t o m a t i c D e t e c t i o n and L o c a l i z a t i o n of E p i l e p t i c F o c i i " ECN 1977,43:1-13 24. L o p e z da S i l v a , F . H . , t e n Broeke,W. ,van H u l t e n , K . ,and Lommen,J.G. "EEG N o n - S t a t i o n a r i t i e s D e t e c t e d by I n v e r s e F i l t e r i n g i n S c a l p and C o r t i c a l R e c o r d i n g s o f E p i l e p t i c s : S t a t i s t i c a l A n a l y s i s and D i s p l a y " Q u a n t i t a t i v e A n a l y t i c S t u d i e s i n E p i l e p s y ( e d ) K e l l a w a y and P e d e r s e n , Raven Press,N.Y.1976 25. Ma,K.M. , C e l e s i a , G . G . ,and B i r k e m e i e r , W . P . " N o n - L i n e a r B o u n d a r i e s f o r D i f f e r e n t i a t i o n Between E p i l e p t i c T r a n s i e n t s and B a c k g r o u n d A c t i v i t i e s i n EEG" IEEE.T-BME May 1977 pp.288-290 26. M a k h o u l , J o h n 97 " L i n e a r P r e d i c t i o n : A T u t o r i a l Review" P r o c . I E E E Vol.63,No.4,Apr.1975,pp.561-578 27. McEwan,James A. and A n d e r s o n , G r a n t B. " M o d e l i n g t h e S t a t i o n a r i t y and G a u s s i a n i t y of S p o n t a n e o u s E l e c t r o e n c e p h a l o g r a p h i c A c t i v i t y " IEEE.T-BME Sept.1975 28. M i c h a e l , D . and H o u c h i n , J . " A u t o m a t i c EEG A n a l y s i s : A S e g m e n t a t i o n P r o c e d u r e B a sed on th e A u t o c o r r e l a t i o n F u n c t i o n " ECN 1979,46:222-235 29. N i n o m i y a , S a t o k i ,Matsubara,Masako ,and Wada,Juhn " A u t o m a t i c S p i k e D e t e c t i o n f r o m Human EEG R e c o r d " MEDINFO'80 ( e d ) L i n d b e r g / K a i h a r a 30. P f u r t s c h e l l e r , G . and F i s c h e r , G . "A New A p p r o a c h t o S p i k e D e t e c t i o n U s i n g a C o m b i n a t i o n o f I n v e r s e and Ma t c h e d F i l t e r T e c h n i q u e s " ECN 1978,44:243-247 31. P o l a , P . and R o m a g n o l i , 0 . " A u t o m a t i c A n a l y s i s o f I n t e r i c t a l E p i l e p t i c A c t i v i t y R e l a t e d t o i t s M o r p h o l o g i c a l A s p e c t s " ECN 1979,46:227-231 32. Raemer S t a t i s t i c a l C o m m u n i c a t i o n s - T h e o r y and A p p l i c a t i o n s P r e n t i c e H a l l , 1969 33. S a l t z b e r g , B . , L u s t i c k , L . S . ,and Heath,R.G. " D e t e c t i o n of F o c a l D e p t h S p i k i n g i n t h e S c a l p EEG of Monkeys" ECN 1971,31:327-333 34. S m i t h , J a c k R. " A u t o m a t i c A n a l y s i s and D e t e c t i o n o f EEG" IEEE T-BME Vol.BME~21,No.1 Jan.1974 35. U s u i , S h i r o and A m i d r o r , I t z h a k " D i g i t a l Low-Pass D i f f e r e n t i a t i o n f o r B i o l o g i c a l S i g n a l P r o c e s s i n g " IEEE T-BME Vol.BME 29,No.10,Oct.1982 98 36. V e r a , R . S . and Blume,W.T. "A C l i n i c a l l y E f f e c t i v e S p i k e R e c o g n i t i o n Program: I t s Use a t E l e c t r o c o r t i o g r a p h y " ECN 1978,45:545-548 37. W a l t e r , D . O . , M i l l e r , H . F . ,and J e l l , R . M . " S e m i a u t o m a t i c Q u a n t i f i c a t i o n o f S h a r p n e s s o f EEG Phenomenon" IEE E T-BME Jan.1973 pp.53-55 38. W e b s t e r , J o h n G. and C o o k , A l b e r t M. C l i n i c a l E n g i n e e r i n g ; P r i n c i p l e s and P r a c t i c e s P r e n t i c e H a l l , 1979 39. E p i l e p s y I n t e r n a t i o n a l Symposium V a n c o u v e r , B.C., Canada September 1978 99 APPENDIX A - SPECIALLY CONSTRUCTED HARDWARE IRQ •5V GND DO-D7I *0 AO Al A2 A3 DS_ R/W — RES — computer expansion bus Vcc GATE 0 GND GATE 1 GATE 2 OUT 0 CLKO CLK 1 AO OUT 1 A1 WR CS RD 6253 74LS04 MLS05 ^o-t>-[> 74LSQ4 Figure A1 Programmable Timer 100 220KG. vW-:18KH 330KA •VW-.47/rf 22 KA -VW—i LM324 22 KH 22Kft L-VvV—i—W/-r-:i20Kn m 22KR 3.3KH -VW 1 22KD. 22KQ m .22 pi 22yf Figure A2 S i g n a l C o n d i t i o n i n g F i l t e r 101 5volts from computer 74LS05 1N4 seizure button moa a2nia 220 pf to tape marking circuitry OUTn marking interface seizure _ button —XJLS-logic tone Igeneratorj computer to tape machine Figure A3 Tape marking i n t e r f a c e . When a s e i z u r e i s detected a 10 hz tone i s recorded on the audio tape machine which stores the EEG s i g n a l . 102 APPENDIX B - INTERICTAL MONITOR SOFTWARE relocate •tack and tero page Initialize a l l variables i n i t i a l i z e a l l buffers, queues, tables, and the pointers for a l l tasks load task 1 atack pointer get task 1 starting address and push i t on the atack load task 2 stack pointer get task 2 starting address and push It on the stack load task H stack pointer get taak N starting address and push It on the stack post interrupt vector enable tiaer enable Interrupts Jump into the background task save registers td progrea counter on task's stack save stack pointer In pointer buffer update interrupted task queue do A/0 conversions for 16 EEC channels store aaaplea in buffer set flag to disable SSW detection 0 TASK HANDLER save the y — character In buffer Figure A4 SSW Monitor Software; I n i t i a l i z a t i o n , S t a r t u p , and In t e r r u p t Routines. 103 Figure A5 SSW Monitor Software; Task Handler Routines. qure A6 SSW Monitor Software; Main Routines. 105 load waveform into buffer for shape tests load polarity and duration intonation into delay buffer ^ return / QT1K \ I ROUTINE I Update average period over last four periods average period in range of alpha or sleep spindles? > YES ^•^low devi8tion S s sj YES , set flag to indicate that ^s^from average?^ rhythms are detected NO update SSW totals update running SUBS queue graphics task to run and paaa the BUBS to display update statistics; t)new thresholds 2)Buscle artifact detection Muap to Subroutine" TASK HANDLER return ^ actual entry point to MAIN prograa via "return from subroutine" In TASK HANDLER qure A 7 SSW Monitor Software; Main Routines. 106 read In the running SUBS panned by MAIN enable I n t e r r u p t s © d l u b l e i n t e r r u p t * d i e t l • b l e •er r e l o a d sero page and stack update d i s p l a y r a a t o r s r e g i s t e r s switch d i s p l a y b u f f e r s c "Jusip to Subroutine** hack i n t o the BASIC c a l l i n g r o u t i n e "jimp to subroutine ' TASK HANDLER Q JUMP GRAPHICS a c t u a l entry point to GRAPHICS program v i a " r e t u r n from subroutine" i n the TASK HANDLER gure A8 SSW Monitor Software; Graphics and E x i t Routines 

Cite

Citation Scheme:

        

Citations by CSL (citeproc-js)

Usage Statistics

Share

Embed

Customize your widget with the following options, then copy and paste the code below into the HTML of your page to embed this item in your website.
                        
                            <div id="ubcOpenCollectionsWidgetDisplay">
                            <script id="ubcOpenCollectionsWidget"
                            src="{[{embed.src}]}"
                            data-item="{[{embed.item}]}"
                            data-collection="{[{embed.collection}]}"
                            data-metadata="{[{embed.showMetadata}]}"
                            data-width="{[{embed.width}]}"
                            async >
                            </script>
                            </div>
                        
                    
IIIF logo Our image viewer uses the IIIF 2.0 standard. To load this item in other compatible viewers, use this url:
http://iiif.library.ubc.ca/presentation/dsp.831.1-0096215/manifest

Comment

Related Items