Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small improvement to intro tutorial #633

Merged
merged 2 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
273 changes: 239 additions & 34 deletions tutorials/html/intro.html

Large diffs are not rendered by default.

Binary file modified tutorials/intro.mlx
Binary file not shown.
31 changes: 14 additions & 17 deletions tutorials/private/mcode/intro.m
Copy link
Collaborator Author

@ehennestad ehennestad Nov 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renamed:
behavior_mod -> behavior_module
Position -> position

Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,10 @@
%
% Note: These diagrams follow a standard convention called "UML class diagram"
% to express the object-oriented relationships between NWB classes. For our purposes,
% all you need to know is that an open triangle means "extends" and an open diamond
% means "is contained within." Learn more about class diagrams on <https://en.wikipedia.org/wiki/Class_diagram
% the wikipedia page>.
% all you need to know is that an open triangle means "extends" (i.e., is a specialized
% subtype of), and an open diamond means "is contained within." Learn more about
% class diagrams on <https://en.wikipedia.org/wiki/Class_diagram the wikipedia
% page>.
%
% <https://neurodatawithoutborders.github.io/matnwb/doc/+types/+core/SpatialSeries.html
% |*SpatialSeries*|> is a subclass of <https://neurodatawithoutborders.github.io/matnwb/doc/+types/+core/TimeSeries.html
Expand All @@ -149,13 +150,7 @@
);

% create Position object and add SpatialSeries
Position = types.core.Position('SpatialSeries', spatial_series_ts);

% create processing module
behavior_mod = types.core.ProcessingModule('description', 'contains behavioral data');

% add the Position object (that holds the SpatialSeries object)
behavior_mod.nwbdatainterface.set('Position', Position);
Comment on lines -154 to -158
Copy link
Collaborator Author

@ehennestad ehennestad Nov 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code segment occurred twice. Removed here because the explanation for processing modules is introduced in the next section

position = types.core.Position('SpatialSeries', spatial_series_ts);
%%
% NWB differentiates between raw, _acquired_ data, which should never change,
% and _processed_ data, which are the results of preprocessing algorithms and
Expand All @@ -171,14 +166,14 @@
% |*Position*|> object to the module.

% create processing module
behavior_mod = types.core.ProcessingModule('description', 'contains behavioral data');
behavior_module = types.core.ProcessingModule('description', 'contains behavioral data');

% add the Position object (that holds the SpatialSeries object) to the
% module and name the Position object "Position"
behavior_mod.nwbdatainterface.set('Position', Position);
% add the Position object (that holds the SpatialSeries object) to the module
% and name the Position object "Position"
behavior_module.nwbdatainterface.set('Position', position);

% add the processing module to the NWBFile object, and name the processing module "behavior"
nwb.processing.set('behavior', behavior_mod);
nwb.processing.set('behavior', behavior_module);
% Trials
% Trials are stored in a <https://neurodatawithoutborders.github.io/matnwb/doc/+types/+core/TimeIntervals.html
% |*TimeIntervals*|> object which is a subclass of <https://neurodatawithoutborders.github.io/matnwb/doc/+types/+hdmf_common/DynamicTable.html
Expand Down Expand Up @@ -207,7 +202,7 @@
trials.addRow('start_time', 1.5, 'stop_time', 2.0, 'correct', true)
trials.addRow('start_time', 2.5, 'stop_time', 3.0, 'correct', false)

trials.toTable() % visualize the table
trials.toTable() % visualize the table
nwb.intervals_trials = trials;

% If you have multiple trials tables, you will need to use custom names for
Expand Down Expand Up @@ -268,4 +263,6 @@
% Optical physiology>
%%
% See the <https://neurodatawithoutborders.github.io/matnwb/doc/index.html API
% documentation> to learn what data types are available.
% documentation> to learn what data types are available.
%
%
Loading