For mouse SCS procedures.
Following steps assume you are running an experiment for "Pilot_SCS_N_CEJ_07"
on 2024-07-25
:
- Open MATLAB R202b and navigate to
C:/MyRepos/NML/Mouse_SCS
. - Copy
experiment_2024_07_17.m
toexperiment_2024_07_25.m
. Rename theSUBJECT_NAME
from"Pilot_SCS_N_CEJ_06"
to"Pilot_SCS_N_CEJ_07"
. - Copy
processing_2024_07_17.m
toprocessing_2024_07_25.m
. RenameSUBJ
from"Pilot_SCS_N_CEJ_06"
to"Pilot_SCS_N_CEJ_07"
. Make sureYYYY
,MM
, andDD
accurately reflect today's date. - Copy
Pilot_SCS_N_CEJ_06_Channel_Map.txt
toPilot_SCS_N_CEJ_07_Channel_Map.txt
. Draw the Picasso Rat on the whiteboard with numbers according to channels in that file. - Copy
Muscle_Response_Times_Exponential_2024_07_17.xlsx
toMuscle_Response_Times_Exponential_2024_07_25.xlsx
. Adjust latencies in this file as needed during experiment (make sure the file is otherwise closed). - Leave this MATLAB instance open on
processing_2024_07_25.m
. You will updateSWEEP
number to reflect any experiment you want to export figures for.
- Make sure that Intan 512ch RECORDING CONTROLLER is powered on and plugged into the computer via USB.
- Start Intan RHX software. Select 20kHz for sample rate.
- In RHX UI, click
File > Load Settings
and selectMouse_SCS.xml
. - On the
Triggers
tab you can toggle "Triggered" mode on and off, which can be helpful to enable during the actual stimulation runs but otherwise should be toggled off. - The Spike Scope is accessed from the menu bar at the top. Make sure to toggle
Lock to Selected
so the scope shows the current channel you click in the main interface. - In RHX UI, click
Network > Remote TCP Control
, set Host to127.0.0.1
and clickConnect
.
- Get the stimulation leads and plug into the anode/cathode ports on AM4100.
- Make sure that AM4100 is powered on.
- Make sure the green ENABLE switch is pressed.
- After depressing the switch, click OK when it gives the high voltage warning.
- Connect BNC from AM4100
Sync 1
to IntanDIGITAL IN 1
, and from AM4100Sync 2
to IntanDIGITAL IN 2
. Connect BNC from AM4100MONITOR
to IntanANALOG IN 1
.
- Right-click MATLAB icon and then click MATLAB R2020b to open a second MATLAB instance.
- Open
experiment_2024_07_25.m
and clickRun
from theEditor
tab in the UI.
- This should cause the stim controller GUI to populate. Move that somewhere convenient on-screen.
- Make this MATLAB instance a small window and minimize it- DO NOT RUN
processing...m
from this window or you'll need to restart everything. Go back to the other previously opened MATLAB instance. - Enter experimental parameters and click
RUN
from the stimulation controller GUI. - After each sweep, update the
SWEEP
constant at the top ofprocessing_2024_07_25.m
and then clickRun
from theEditor
tab in the UI.
- This should generate a new Powerpoint for each sweep with the stimulus response curves, on the Google Drive mapped in
parameters.m
.
- Configuration
- Experiments
- Main Experiment Functions
- AM4100 Interface
- TMSi Interface
- Initializers
- Loaders
- Plotting
parameters
- Return parameters struct, which sets default values for things like epoch durations etc.
example_run_experiment
- Script for testing/setup prior to experiment.
runStimRecSweep
- Returns a table of the stim/rec sweep intensity and block indices.runStimRecSweepAllChannels
- Returns a table of the stim/rec sweep intensity and block indices, for ALL channels. Requires Raspberry Pi v4b with Relay module to MUX the AM4100 anode to the stimulation channels.
AM4100_sendCommand
- Send message to stimulator and return formatted response message.AM4100_setInterPhaseInterval
- Sets the interval between the two phases of asymmetric/biphasic pulses.AM4100_setStimEventPeriodAndCount
- Set the AM4100 stimulation event period and number of stimuli.AM4100_setStimParameters
- Set the stimulation parameters for AM4100 experiment.AM4100_stimulate
- Stimulate using the AM4100, while recording this event.
SAGA_impedances
- Measure impedances on HD-EMG array(s).SAGA_record
- Run and increment the recording for TMSi-SAGAs AND Plexon (do not manually increment Plexon!).SAGA_setBufferSize
- Updates tmsi client recording buffer samples for the next record.SAGA_stop
- Stop the current recording/running SAGA state.SAGA_updateFileNames
- Update filenames for SAGA A and SAGA B devices.
initAM4100
- Initialize TCP interface to AM4100.initInterfaces
- Initialize interfaces to TMSi and AM4100, plus logging.initTMSi
- Create UDP client to control SAGA state machine running on some host device over IPv4 + UDP.
loadData
- Load all data associated with a single sweep.loadMultiData
- Load multiple sweeps into single sweep table.loadSweepSpreadsheet
- Load spreadsheet for sweeps based onsweep
folder and raw data root folder.
plotRecruitment
- Plot recruitment summary figure.plotSagaRecruitmentRaw
- Plot recruitment for individual SAGA channel data.
Code that was run on the Raspberry Pi v4b that managed stimulation switching is saved in the following gist.