Ripple detection graphΒΆ

The graph is divided in two parts :

  • server-side template

  • user-side graph

The user should called the server-side template and only modified the option is interested on. The graph below is an example :

falcon:
  version: 1.0

graph: graphs://neuralynx/ripple_detection.yaml

options:
    source:
       options:
          address:      # Ip address of Cheetah system
          channelmap:
           hp: []       # Hippocampus channel to analyze
           cx: []       # Cortex channel to analyze

    HIPPOCAMPUS_detector:
        options:
            threshold dev: 3
            smooth time: 7 # in seconds
            analysis lockout time: 50 #ms  # Post-detection lock-out - remove all detections

    CORTEX_detector :
        options:
            threshold dev: 12
            smooth time: 8 # in seconds
            analysis lockout time: 40 #ms  # Stop multiple detections of ripples

    eventfilter:
        options:
            block duration: 40  # Filter out all detections after detecting a "ripple" aka artefact in the cortex signal
            sync time: 1.5      #  Time between two detections to consider it as only one.
            block wait time: 4  # Filter out all detections arrived before detecting a "ripple" aka artefact in the cortex signal
                                # below 3.5, asynch can occur

    stimulation_trigger:
        options:
            delayed: true
            event trigger lockout time:   # Stop the trigger of events but still are counted in the statistics of the ripple detector
                period:  250
                detection: false    # Remove duplicate stimulations
                stimulation: true   #  Avoid overstimulation lock-out -

            analysis lockout time:   # Stop artefacts lock-out - Stop the detection in the ripple detector after a stimulation
                period: 50
                starting time: [0]
            delay range:
            - 30
            - 50

    ttl_output:
        options:
            port address:  # port usb where the arduino is plugged

For more information, this is the template graph called in background :

processors:
    source:
        class: NlxReader
        advanced:
            threadpriority: 100
            threadcore: 0
        options:
            address: 127.0.0.1
            port: 5000
            batch size: 3
            update interval: 10
            channelmap:
                hp: [13,20]
                cx: [9]
    ripple_filter (1-2):
        class: MultiChannelFilter
        options:
            filter:
                file: iir_ripple_low_delay/matlab_design/iir_ripple_low_delay.filter
    HIPPOCAMPUS_detector:
        class: RippleDetector
        options:
            threshold dev: 14
            smooth time: 7 # in seconds
            analysis lockout time: 50 #ms
            stream events: true
            stream statistics: true
            statistics buffer size: 1.0 # sec
            statistics downsample factor: 4
            use power: true
    CORTEX_detector:
        class: RippleDetector
        options:
            threshold dev: 12
            smooth time: 8 # in seconds
            analysis lockout time: 40 #ms
            stream events: true
            stream statistics: false
            statistics buffer size: 1.0 # sec
            statistics downsample factor: 4
            use power: true
    eventfilter:
        class: EventFilter
        options:
            target event: ripple
            block duration: 40
            sync time: 1.5
            block wait time: 4 # below 3.5, asynch can occur
            detection criterion: "any" # 'any', 'all' or number
            discard warnings: false
    networksink:
        class: ZMQSerializer
        options:
            encoding: binary
            format: compact
    eventsink:
        class: EventLogger
        options:
            target event: ripple
    datasink_ev:
        class: FileSerializer
        options:
            encoding: yaml
            format: full
    datasink_ripplestats:
        class: FileSerializer
        options:
            encoding: binary
            format: compact
    stimulation_trigger:
        class: EventDelayed
        options:
            detection only mode: false
            delayed mode: false # switch for true if you want delayed events
            event trigger lockout time:     # Stop the trigger of events but still are counted in the statistics of the ripple detector
               period:  250
               detection: false
               stimulation: true
   
            analysis lockout time: # Stop the detection in the ripple detector after a stimulation
               period: 50
               starting time: [0]

            delayed range: [150, 200]
    ttl_output:
        class: SerialOutput

connections:
    - source.hp=ripple_filter1.data
    - source.cx=ripple_filter2.data
    - ripple_filter1.data=HIPPOCAMPUS_detector.data
    - ripple_filter2.data=CORTEX_detector.data
    - HIPPOCAMPUS_detector.events=eventfilter.events
    - HIPPOCAMPUS_detector.events=eventsink.events
    - eventfilter.events=datasink_ev.data
    - stimulation_trigger.events=networksink.data
    - HIPPOCAMPUS_detector.statistics=datasink_ripplestats.data
    - HIPPOCAMPUS_detector.statistics=networksink.data
    - CORTEX_detector.statistics=networksink.data
    - CORTEX_detector.events=eventfilter.blocking_events
    - eventfilter.events=stimulation_trigger.events
    - stimulation_trigger.events=ttl_output.events

states:
    - [stimulation_trigger.analysis enabled, HIPPOCAMPUS_detector.detection enabled]