Skip to content

Commit

Permalink
Update icephys tutorial (#632)
Browse files Browse the repository at this point in the history
  • Loading branch information
ehennestad authored Nov 25, 2024
1 parent d46adae commit da75e95
Showing 3 changed files with 118 additions and 20 deletions.
85 changes: 67 additions & 18 deletions tutorials/html/icephys.html

Large diffs are not rendered by default.

Binary file modified tutorials/icephys.mlx
Binary file not shown.
53 changes: 51 additions & 2 deletions tutorials/private/mcode/icephys.m
Original file line number Diff line number Diff line change
@@ -69,7 +69,8 @@
% * <https://neurodatawithoutborders.github.io/matnwb/doc/+types/+core/IZeroClampSeries.html
% |*IZeroClampSeries*|>
%%
% Below we create a simple example stimulus/response recording data pair.
% Below we create a simple example stimulus/response recording data pair for
% a voltage clamp recording.

ccss = types.core.VoltageClampStimulusSeries( ...
'data', [1, 2, 3, 4, 5], ...
@@ -80,7 +81,6 @@
'sweep_number', uint64(15), ...
'stimulus_description', 'N/A' ...
);

nwbfile.stimulus_presentation.set('ccss', ccss);

vcs = types.core.VoltageClampSeries( ...
@@ -97,6 +97,55 @@
'sweep_number', uint64(15) ...
);
nwbfile.acquisition.set('vcs', vcs);
%%
% You can add stimulus/response recording data pair from a current clamp recording
% in the same way:

% Create a CurrentClampStimulusSeries object
ccss = types.core.CurrentClampStimulusSeries(...
'data', [1, 2, 3, 4, 5], ...
'starting_time', 123.6, ...
'starting_time_rate', 10e3, ...
'electrode', types.untyped.SoftLink(electrode), ...
'gain', 0.02, ...
'sweep_number', uint16(16), ...
'stimulus_description', 'N/A' ...
);
nwbfile.stimulus_presentation.set('ccss', ccss);

% Create a CurrentClampSeries object
ccs = types.core.CurrentClampSeries(...
'data', [0.1, 0.2, 0.3, 0.4, 0.5], ...
'data_conversion', 1e-12, ...
'data_resolution', NaN, ...
'starting_time', 123.6, ...
'starting_time_rate', 20e3, ...
'electrode', types.untyped.SoftLink(electrode), ...
'gain', 0.02, ...
'bias_current', 1e-12, ...
'bridge_balance', 70e6, ...
'capacitance_compensation', 1e-12, ...
'stimulus_description', 'N/A', ...
'sweep_number', uint16(16) ...
);
nwbfile.acquisition.set('ccs', ccs);

%%
% <https://neurodatawithoutborders.github.io/matnwb/doc/+types/+core/IZeroClampSeries.html
% |*IZeroClampSeries*|> is used when the current is clamped to 0.

% Create an IZeroClampSeries object
izcs = types.core.IZeroClampSeries(...
'data', [0.1, 0.2, 0.3, 0.4, 0.5], ...
'electrode', types.untyped.SoftLink(electrode), ...
'gain', 0.02, ...
'data_conversion', 1e-12, ...
'data_resolution', NaN, ...
'starting_time', 345.6, ...
'starting_time_rate', 20e3, ...
'sweep_number', uint16(17) ...
);
nwbfile.acquisition.set('izcs', izcs);
% Adding an intracellular recording
% The <https://neurodatawithoutborders.github.io/matnwb/doc/+types/+core/IntracellularRecordingsTable.html
% |*IntracellularRecordingsTable*|> relates electrode, stimulus and response pairs

0 comments on commit da75e95

Please sign in to comment.