Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
078d0ce
Create HasGroups.m
ehennestad Apr 29, 2025
f924435
Update HasGroups.m
ehennestad Apr 29, 2025
05b4f67
Update fillClass.m
ehennestad Apr 30, 2025
e1ee36e
Update HasGroups.m
ehennestad Apr 30, 2025
53ac391
Create listGeneratedTypes.m
ehennestad May 1, 2025
95387a6
Update MetaClass.m
ehennestad May 1, 2025
6e73808
Update HasGroup mixin
ehennestad May 1, 2025
abc0363
Update HasUnnamedGroups.m
ehennestad May 1, 2025
0b3363d
Update Set.m
ehennestad May 1, 2025
3fb2965
Update HasUnnamedGroups.m
ehennestad May 1, 2025
410429b
Update matnwb generator
ehennestad May 1, 2025
95e6cf7
Update generated classes
ehennestad May 1, 2025
4a8b47a
Update HasUnnamedGroups.m
ehennestad May 1, 2025
31bc60b
Update AnonTest.m
ehennestad May 1, 2025
f830485
Refactor fillClass
ehennestad May 1, 2025
fd16470
Start adding name remapping to valid matlab names
ehennestad May 2, 2025
1f75bf1
Add name-mapping strategy for invalid or duplicate names
ehennestad May 2, 2025
cb79ebd
Fix bugs related to name remapping and custom display property names
ehennestad May 2, 2025
ebef8ab
Update Set.m
ehennestad May 2, 2025
8263dd1
Add unit test for HasUnnamedGroupsMixin
ehennestad May 2, 2025
9d45779
Add extra tests
ehennestad May 2, 2025
feeedc4
Merge branch 'main' into add-mixin-for-type-with-group-properties
ehennestad May 2, 2025
addb0fc
Update tests, remove unused/redundant method
ehennestad May 2, 2025
0cbec56
Merge branch 'add-mixin-for-type-with-group-properties' of https://gi…
ehennestad May 2, 2025
2d69d9a
Minor fixes in comments
ehennestad May 2, 2025
5d8a8ba
Refactor HasUnnamedGroups
ehennestad May 3, 2025
e7c4c0b
Refactor HasUnnamedGroups
ehennestad May 4, 2025
f661e44
Merge branch 'main' into add-mixin-for-type-with-group-properties
ehennestad May 4, 2025
160f7b2
Add new verification in test for Set
ehennestad May 4, 2025
9596254
Update HasUnnamedGroupsTest.m
ehennestad May 4, 2025
b2e27f2
Merge branch 'main' into add-mixin-for-type-with-group-properties
ehennestad May 5, 2025
13d7165
Merge branch 'main' into add-mixin-for-type-with-group-properties
ehennestad May 5, 2025
7c231c9
Merge branch 'main' into add-mixin-for-type-with-group-properties
bendichter May 8, 2025
5aa5568
Add get methods on the mixin class + unittest
ehennestad May 10, 2025
4c31aab
Add function on NwbFile to retrieve remapped names
ehennestad May 10, 2025
1385098
Add method for listing remapped names in NwbFile
ehennestad May 10, 2025
bba8564
Fix wrong property name for type in test
ehennestad May 10, 2025
85e4bdd
Merge branch 'main' into add-mixin-for-type-with-group-properties
ehennestad Jun 22, 2025
0962965
Added dynamic properties to Set (#727)
ehennestad Jun 29, 2025
dba085d
Merge branch 'main' into add-mixin-for-type-with-group-properties
ehennestad Jun 29, 2025
fba309a
Merge branch 'add-mixin-for-type-with-group-properties' of https://gi…
ehennestad Jun 29, 2025
885c139
Fix failing tests for older matlab releases
ehennestad Jun 29, 2025
2b515d7
Update DynamicPropertyManager.m
ehennestad Jun 30, 2025
3934b42
Update intro.mlx
ehennestad Jun 30, 2025
5aa8aeb
Updated read_demo_dandihub
ehennestad Jun 30, 2025
58de3aa
Updated behavior tutorial
ehennestad Jun 30, 2025
9c08b86
Added docstring for types.untyped.Set/add
ehennestad Jun 30, 2025
ac91d0c
Merge branch 'main' into add-mixin-for-type-with-group-properties
ehennestad Jun 30, 2025
2ffafc2
Regenerate schemas
ehennestad Jun 30, 2025
8dcaddc
Merge branch 'main' into add-mixin-for-type-with-group-properties
ehennestad Jun 30, 2025
6ede4d4
Merge branch 'add-mixin-for-type-with-group-properties' into update-t…
ehennestad Aug 28, 2025
7d838c8
Merge branch 'main' into add-mixin-for-type-with-group-properties
ehennestad Sep 26, 2025
b117d12
Fix failing tests
ehennestad Sep 26, 2025
4d43731
Merge branch 'main' into add-mixin-for-type-with-group-properties
ehennestad Oct 2, 2025
b3dd7d7
Merge branch 'main' into add-mixin-for-type-with-group-properties
ehennestad Oct 23, 2025
43ccee0
Merge branch 'main' into add-mixin-for-type-with-group-properties
ehennestad Nov 1, 2025
8e988be
Add unit tests for types.untyped.Set
ehennestad Nov 4, 2025
6311277
Update AnonTest.m
ehennestad Nov 4, 2025
5dfda95
Merge branch 'main' into add-mixin-for-type-with-group-properties
ehennestad Nov 4, 2025
50fea2b
Merge branch 'main' into add-mixin-for-type-with-group-properties
ehennestad Nov 18, 2025
4e868fb
Support using reserved names for property names of containers
ehennestad Nov 18, 2025
b9976ae
Add how-to guide for working with container/set entries
ehennestad Nov 18, 2025
862a739
Merge branch 'main' into add-mixin-for-type-with-group-properties
ehennestad Nov 25, 2025
0ba9d7a
Update MATLAB examples for container usage consistency
ehennestad Nov 25, 2025
01cf07b
Merge branch 'add-mixin-for-type-with-group-properties' into update-t…
ehennestad Nov 25, 2025
a205d2d
Update behavior tutorial exports after merge
ehennestad Nov 25, 2025
21b94ea
Merge branch 'main' into add-mixin-for-type-with-group-properties
ehennestad Nov 25, 2025
95bd4cb
Create public getAliasMap methods in Set / HasUnnamedGroups mixin
ehennestad Nov 27, 2025
5c18063
Update displayAliasWarning.m
ehennestad Nov 27, 2025
62d01f5
Update Set.m
ehennestad Nov 27, 2025
b7d6a8f
Update structure of how-to for container usage
ehennestad Nov 27, 2025
be1d11e
Update working_with_containers.rst
ehennestad Nov 28, 2025
3931ae0
Fix warning message grammar in MetaClass
ehennestad Nov 28, 2025
52459fb
Update HasUnnamedGroups.m
ehennestad Nov 30, 2025
98744b3
Update HasUnnamedGroups.m
ehennestad Nov 30, 2025
10563df
Update requirements.txt
ehennestad Dec 5, 2025
e2ef715
Fix typo in 'identifiers' in container docs
ehennestad Dec 5, 2025
5d90a05
Fix failing test for HasUnnamedGroup mixin
ehennestad Dec 5, 2025
dbc7f95
Expand container documentation with Set usage and display modes
ehennestad Dec 5, 2025
923445d
Update container display mode preference and docs
ehennestad Dec 5, 2025
5639d2d
Fix typos and improve clarity in container guide
ehennestad Dec 5, 2025
6e5daec
Clarify troubleshooting section in container docs
ehennestad Dec 5, 2025
ac3e43a
Update working_with_containers.rst
ehennestad Dec 5, 2025
109f84e
Update working_with_containers.rst
ehennestad Dec 5, 2025
d49bc3c
Fix failing test
ehennestad Dec 5, 2025
b183bc5
Hide and seal addprop method in Set class
ehennestad Dec 6, 2025
0e9808e
Merge branch 'add-mixin-for-type-with-group-properties' into update-t…
ehennestad Dec 6, 2025
c87f00d
Merge branch 'main' into add-mixin-for-type-with-group-properties
ehennestad Dec 16, 2025
65cd936
Merge branch 'add-mixin-for-type-with-group-properties' into update-t…
ehennestad Dec 18, 2025
0d6e8dd
Merge branch 'main' into update-tutorials-with-dot-syntax-for-sets
ehennestad Dec 18, 2025
2638606
Merge branch 'main' into update-tutorials-with-dot-syntax-for-sets
bendichter Jan 13, 2026
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
42 changes: 21 additions & 21 deletions docs/source/_static/html/tutorials/behavior.html

Large diffs are not rendered by default.

50 changes: 25 additions & 25 deletions docs/source/_static/html/tutorials/intro.html

Large diffs are not rendered by default.

61 changes: 36 additions & 25 deletions docs/source/_static/html/tutorials/read_demo_dandihub.html

Large diffs are not rendered by default.

Binary file modified tutorials/behavior.mlx
Binary file not shown.
Binary file modified tutorials/intro.mlx
Binary file not shown.
36 changes: 18 additions & 18 deletions tutorials/private/mcode/behavior.m
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@
% |SpatialSeries|> objects.

position = types.core.Position();
position.spatialseries.set('SpatialSeries', position_spatial_series);
position.add('SpatialSeries', position_spatial_series);
%% Create a Behavior Processing Module
% Create a processing module called "behavior" for storing behavioral data in
% the NWBFile, then add the <https://matnwb.readthedocs.io/en/latest/pages/neurodata_types/core/Position.html
% |Position|> object to the processing module.

behavior_processing_module = types.core.ProcessingModule('description', 'stores behavioral data.');
behavior_processing_module.nwbdatainterface.set("Position", position);
nwb.processing.set("behavior", behavior_processing_module);
behavior_processing_module.add("Position", position);
nwb.processing.add("behavior", behavior_processing_module);
%% CompassDirection: Storing view angle measured over time
% Analogous to how position can be stored, we can create a <https://matnwb.readthedocs.io/en/latest/pages/neurodata_types/core/SpatialSeries.html
% |SpatialSeries|> object for representing the view angle of the subject.
Expand All @@ -77,13 +77,13 @@
'data_unit', 'radians' ...
);
direction = types.core.CompassDirection();
direction.spatialseries.set('spatial_series', direction_spatial_series);
direction.add('SpatialSeries', direction_spatial_series);
%%
% We can add a <https://matnwb.readthedocs.io/en/latest/pages/neurodata_types/core/CompassDirection.html
% |CompassDirection|> object to the behavior processing module the same way we
% have added the position data.

behavior_processing_module.nwbdatainterface.set('CompassDirection', direction);
behavior_processing_module.add('CompassDirection', direction);
%% BehaviorTimeSeries: Storing continuous behavior data
% <https://matnwb.readthedocs.io/en/latest/pages/neurodata_types/core/BehavioralTimeSeries.html
% |BehavioralTimeSeries|> is an interface for storing continuous behavior data,
Expand All @@ -100,10 +100,10 @@
);

behavioral_time_series = types.core.BehavioralTimeSeries();
behavioral_time_series.timeseries.set('speed', speed_time_series);
behavioral_time_series.add('speed', speed_time_series);

% Add behavioral_time_series to the processing module
behavior_processing_module.nwbdatainterface.set('BehavioralTimeSeries', behavioral_time_series);
behavior_processing_module.add('BehavioralTimeSeries', behavioral_time_series);
%% BehavioralEvents: Storing behavioral events
% <https://matnwb.readthedocs.io/en/latest/pages/neurodata_types/core/BehavioralEvents.html
% |BehavioralEvents|> is an interface for storing behavioral events. We can use
Expand All @@ -121,10 +121,10 @@
);

behavioral_events = types.core.BehavioralEvents();
behavioral_events.timeseries.set('lever_presses', time_series);
behavioral_events.add('lever_presses', time_series);

% Add behavioral_events to the processing module
behavior_processing_module.nwbdatainterface.set('BehavioralEvents', behavioral_events);
behavior_processing_module.add('BehavioralEvents', behavioral_events);
%%
% Storing only the timestamps of the events is possible with the ndx-events
% NWB extension. You can also add labels associated with the events with this
Expand All @@ -146,7 +146,7 @@
);

behavioral_epochs = types.core.BehavioralEpochs();
behavioral_epochs.intervalseries.set('running', run_intervals);
behavioral_epochs.add('running', run_intervals);
%%
% You can add more than one <https://matnwb.readthedocs.io/en/latest/pages/neurodata_types/core/IntervalSeries.html
% |IntervalSeries|> to a <https://matnwb.readthedocs.io/en/latest/pages/neurodata_types/core/BehavioralEpochs.html
Expand All @@ -157,10 +157,10 @@
'data', [1, -1, 1, -1], ...
'timestamps', [15.0, 30.0, 60.0, 95.0] ...
);
behavioral_epochs.intervalseries.set('sleeping', sleep_intervals);
behavioral_epochs.add('sleeping', sleep_intervals);

% Add behavioral_epochs to the processing module
behavior_processing_module.nwbdatainterface.set('BehavioralEpochs', behavioral_epochs);
behavior_processing_module.add('BehavioralEpochs', behavioral_epochs);
% Another approach: TimeIntervals
% Using <https://matnwb.readthedocs.io/en/latest/pages/neurodata_types/core/TimeIntervals.html
% |TimeIntervals|> to represent time intervals is often preferred over <https://matnwb.readthedocs.io/en/latest/pages/neurodata_types/core/BehavioralEpochs.html
Expand All @@ -179,7 +179,7 @@
sleep_intervals.addRow('start_time', 0.7, 'stop_time', 0.9, 'stage', 2);
sleep_intervals.addRow('start_time', 1.3, 'stop_time', 3.0, 'stage', 3);

nwb.intervals.set('sleep_intervals', sleep_intervals);
nwb.intervals.add('sleep_intervals', sleep_intervals);
%% EyeTracking: Storing continuous eye-tracking data of gaze direction
% <https://matnwb.readthedocs.io/en/latest/pages/neurodata_types/core/EyeTracking.html
% |EyeTracking|> is for storing eye-tracking data which represents direction of
Expand Down Expand Up @@ -209,10 +209,10 @@
);

eye_tracking = types.core.EyeTracking();
eye_tracking.spatialseries.set('right_eye_position', right_eye_position);
eye_tracking.spatialseries.set('left_eye_position', left_eye_position);
eye_tracking.add('right_eye_position', right_eye_position);
eye_tracking.add('left_eye_position', left_eye_position);

behavior_processing_module.nwbdatainterface.set('EyeTracking', eye_tracking);
behavior_processing_module.add('EyeTracking', eye_tracking);
%% PupilTracking: Storing continuous eye-tracking data of pupil size
% <https://matnwb.readthedocs.io/en/latest/pages/neurodata_types/core/PupilTracking.html
% |PupilTracking|> is for storing eye-tracking data which represents pupil size.
Expand All @@ -230,9 +230,9 @@
);

pupil_tracking = types.core.PupilTracking();
pupil_tracking.timeseries.set('pupil_diameter', pupil_diameter);
pupil_tracking.add('pupil_diameter', pupil_diameter);

behavior_processing_module.nwbdatainterface.set('PupilTracking', pupil_tracking);
behavior_processing_module.add('PupilTracking', pupil_tracking);
%% Writing the behavior data to an NWB file
% All of the above commands build an NWBFile object in-memory. To write this
% file, use <https://matnwb.readthedocs.io/en/latest/pages/functions/nwbExport.html
Expand Down
11 changes: 5 additions & 6 deletions tutorials/private/mcode/intro.m
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
);

% Add the AnnotationSeries to the NWBFile's stimulus group
nwb.stimulus_presentation.set('Airpuffs', annotations)
nwb.stimulus_presentation.add('Airpuffs', annotations)
%% Behavior
% SpatialSeries and Position
% Many types of data have special data types in NWB. To store the spatial position
Expand Down Expand Up @@ -170,10 +170,10 @@

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

% add the processing module to the NWBFile object, and name the processing module "behavior"
nwb.processing.set('behavior', behavior_module);
nwb.processing.add('behavior', behavior_module);
% Trials
% Trials are stored in a <https://matnwb.readthedocs.io/en/latest/pages/neurodata_types/core/TimeIntervals.html
% |*TimeIntervals*|> object which is a subclass of <https://matnwb.readthedocs.io/en/latest/pages/neurodata_types/hdmf_common/DynamicTable.html
Expand Down Expand Up @@ -207,7 +207,7 @@

% If you have multiple trials tables, you will need to use custom names for
% each one:
nwb.intervals.set('custom_intervals_table_name', trials);
nwb.intervals.add('custom_intervals_table_name', trials);
%% Write
% Now, to write the NWB file that we have built so far:

Expand All @@ -229,8 +229,7 @@
% |*Position*|> object contains our <https://matnwb.readthedocs.io/en/latest/pages/neurodata_types/core/SpatialSeries.html
% |*SpatialSeries*|> object named |'SpatialSeries'|.

read_spatial_series = read_nwbfile.processing.get('behavior'). ...
nwbdatainterface.get('Position').spatialseries.get('SpatialSeries')
read_spatial_series = read_nwbfile.processing.behavior.Position.SpatialSeries
% Reading Data
% Counter to normal MATLAB workflow, data arrays are read passively from the
% file. Calling |*read_spatial_series.data*| does not read the data values, but
Expand Down
25 changes: 15 additions & 10 deletions tutorials/private/mcode/read_demo_dandihub.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@
% <https://nwb-overview.readthedocs.io/en/latest/file_read/file_read.html#reading-with-matnwb
% NWB Overview Documentation>
%% Download the Dataset
% Use the pre-installed |dandi| Python package to download the dataset to the
% user-local dandisets folder:
% Use the |dandi| Python package to download the dataset to the user-local dandisets
% folder. If you are running this livescript on DandiHub, the |dandi| package
% is already pre-installed. On a local environment, you need to install the |dandi|
% package in the python environment returned by running |pyenv()| in MATLAB. For
% more details on using Python from MATLAB, please refer to the <https://se.mathworks.com/help/matlab/matlab_external/install-supported-python-implementation.html
% MATLAB documentation>.

environment = "Local";
environment = "Local"; % Local or DandiHub
switch environment
case "DandiHub"
targetFolder = "/home/jovyan/dandisets/000004";
Expand All @@ -36,18 +40,19 @@

nwb.stimulus_presentation
%%
% This results shows us that |nwb.stimulus_presentation| is a |Set| object that
% contains a single data object called |StimulusPresentation|, which is an |OpticalSeries|
% neurodata type. Use the |get| method to return this |OpticalSeries|. |Set| objects
% store a collection of other NWB objects.
% This result shows that |nwb.stimulus_presentation| is a |Set| object. In MatNWB,
% a |Set| object stores a collection of other NWB objects. In this case, the |Set|
% contains a single data object named |StimulusPresentation|, which is of the
% |OpticalSeries| neurodata type. You can use dot notation of the form |Set.objectName|
% to access this |OpticalSeries|:

nwb.stimulus_presentation.get('StimulusPresentation')
nwb.stimulus_presentation.StimulusPresentation
%%
% |OpticalSeries| is a neurodata type that stores information about visual stimuli
% presented to subjects. This print out shows all of the attributes in the |OpticalSeries|
% object named |StimulusPresentation|. The images are stored in |StimulusPresentation.data|

StimulusImageData = nwb.stimulus_presentation.get('StimulusPresentation').data
StimulusImageData = nwb.stimulus_presentation.StimulusPresentation.data
%%
% When calling a data object directly, the data is not read but instead a |DataStub|
% is returned. This is because data is read "lazily" in MatNWB. Instead of reading
Expand All @@ -73,7 +78,7 @@
% arguments. We will use this approach to read all of the image display timestamps
% into memory.

stimulus_times = nwb.stimulus_presentation.get('StimulusPresentation').timestamps.load();
stimulus_times = nwb.stimulus_presentation.StimulusPresentation.timestamps.load();
%% Quick PSTH and raster
% Here, I will pull out spike times of a particular unit, align them to the
% image display times, and finally display the results.
Expand Down
Binary file modified tutorials/read_demo_dandihub.mlx
Binary file not shown.