CNL Wiki

Docs: Movie Paradigm protocol: transformer closed loop

Updated on August 1, 2025

Need 2 laptops – one to remote in to NLX PC and one to remote in to closed loop laptop

 

One week before #

Contact Dr. Eliashiv with potential dates for the sleep study to confirm availability for observation of stimulation.

 

Following implant #

Review electrode localizations, select 2 possible stimulation electrodes in PFC white matter.

  • Inform neurology when selection made
  • Measure electrode impedance
    • 1-2 kOhm is preferable, up to 4kOhm ok
    • Record channels and impedances on SleepStim24Paradigm logging sheet

On the day #

Morning #

  • Confirm with participant in the morning that sleep study is planned for the evening, remind them that it has AM component, and that we really need all parts
  • Ask participant to not ingest caffeine after 3pm
  • Ask participant to not nap (or if they need to nap please do so before lunch)
  • Ask participant when they like to eat dinner
  • Tell clinical team about experiment
    • ask for no interruptions in the night
    • move antibiotics earlier
    • no bloods until 7:30 am
    • explain that there will be some extra equipment in the room but we will move it once we have completed our morning testing
  • Schedule a time in early afternoon to set up recording and stimulation systems
  • Measure electrode impedance
    • 1-2 kOhm is preferable, up to 4kOhm ok
  • Neurologist to validate stimulation site and impedance

Afternoon #

  • Do pre-sleep behaviour
    • if not already in stim-ready configuration, set up system such that only BR cart needs to be added to system
    • behavioral tasks are run as outlined in Movie Paradigm Protocol
  • Upload data to LTS immediately
  • Inform ECE that recording has finished
  • Soraya or Abdullah will pre-process the neural and TTL data and upload to box for ECE
  • ECE will train model and upload weights to box
  • Abdullah will integrate trained model into closed loop system

 

Evening #

  • If possible record drug regime currently being administered (obtain info from chart/clinical team; will be recorded on sleep questionnaire)
  • Set up closed loop (Closed Loop Stimulation Set Up)
    • But still don’t connect the blue ribbon stim cables to BR macro stim box
    • Make sure way to equipment is clear
    • Make sure curtain is shut
  • Give participant time to get ready for bed, use restroom
  • Do evening sleep questionnaire
  • Set up for polysom for sleep recording (Movie Paradigm Protocol- sleep)
  • Go to telemetry room, wait for pt to fall asleep
    • Check stim channel impedance
    • Get neurologist for observation (timing tbd)
  • Observe signals for signs of NREM sleep
    • based on visual observation of slow waves and sleep spindles in iEEG signal
  • After ~20 mins of clear, uninterrupted NREM sleep, and neurologist is observing signal, enter patient’s room to start stim paradigm
    • Plug in blue ribbon stim cable to BR macro stim box
    • Return to telemetry room
  • Remote in to stim laptop
    • Perform test stimulations with neurologist observation
      • test stim range 0.5-2.0 mA (start low, increase in increments of 0.5 mA)
      • looking for level with no after discharges
  • After approval from neurologist start closed loop paradigm (see details below)
  • After stimulation is complete return to room
    • disconnect blue ribbon stim cable from BR stim box
    • turn of BR macrostim box
    • leave NLX recording running for full night of sleep

 

Timing estimates #

  • Presleep behaviour run approx 185 mins (just over 3 hours)
    • Recording set up ~ 45 mins
    • 2 x 40 min videos
    • 2 x 30 min memory test
  • Estimated time between end of pre-sleep behavior and start of sleep to be 3 hours
    • Estimate 1 hour from recording data to clusterless output (data upload to LTS, unpacking, processing, upload to Box for ECE)
    • Yuanyi estimates approx. 30 minute turnover from receiving clusterless data to uploading trained model to box.
    • 5 mins to integrate model into transformer code

 

Assuming participant bed time is 10 pm, an ideal timeline would be:

15:00-18:00 Pre-sleep behavior

18:00-20:30 Participant has dinner

20:30-21:30 Set up system ready for stimulation and sleep recording (although without the stim ribbon cables plugged in)

21:30-22:00 Participant does bedtime routine, uses restroom

22:00 Go back in to set up polysom. Then wait in telemetry room for participant to fall asleep.

 

Stimulation parameters #

  • 50ms duration, frequency of 100 Hz (i.e. five rectangular pulses with width of 100 μs).
  • Current range from 0.5 to 1.5 mA (depending on outcome of test pulses).
  • 2 second refractory period after each stimulation.

NOTE: safe maximums of charge per square centimeter per phase for long-term and short-term stimulation (30 and 57 μC, respectively)

  • Gordon B, et al. Parameters for direct cortical electrical stimulation in the human: histopathologic confirmation. Electroencephalogr. Clin. Neurophysiol. 1990;75:371–377. doi: 10.1016/0013-4694(90)90082-U.
  • Agnew WF, McCreery DB. Considerations for safety with chronically implanted nerve electrodes. Epilepsia. 1990;31:S27–S32. doi: 10.1111/j.1528-1157.1990.tb05845.x.

 

Sleep stim protocol #

Once neurologist has observed and approved the test stimulation we can set our stim parameters.

Then we can start the closed loop paradigm:

  • 5 min baseline recording to obtain mean and SD for zscore
  • 5 min baseline recording to obtain 90th percentile for stimulation threshold
  • Aiming to stimulate for whole first NREM period (expect 45-90 minutes)
    • If first NREM period interrupted within 30 mins – restart?
    • If stimulation period is <45 min
      • stop stimulation during REM
      • restart closed loop, take another set of baseline after 5-10 mins of next NREM
      • stimulate for another 30-45 mins
    • If participant has to get up (eg to use bathroom) during stim time we (…find out what we have to do re stim cables)
      • exit closed loop
      • leave neural recording running
      • make note of disruption including time and duration
      • restart closed loop, take another set of baselines after 5-10 mins of next NREM
    • If seizure
      • stop closed loop immediately, call clinical team
      • restart protocol after patient has returned to sleep
  • End closed loop paradigm
  • Wait 20-30 mins to record non-stim sleep immediately following stim before unplugging (in case we wake them up)

 

The following morning #

  • Before memory test: ask patient to report any unusual feelings or sensations (will be part of sleep questionnaire)
  • Do morning sleep questionnaire
  • Memory tests as outlined here: Movie Paradigm Protocol
  • Take stimulation equipment out of room
  • Go to the EEG Tech’s door and write down information for the EDF + Video. This should include the times half an hour before the patient slept and half an hour after waking. NB – THIS DATA WILL OTHERWISE BE DELETED AFTER 30 DAYS.
  • If not already been recorded get drug regime currently being administered (obtain info from chart/clinical team; will be recorded on sleep questionnaire)