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

Support NWB Schema 2.7.0 #575

Merged
merged 4 commits into from
Sep 10, 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
14 changes: 14 additions & 0 deletions +types/+core/AnnotationSeries.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,20 @@
validshapes = {[Inf]};
types.util.checkDims(valsz, validshapes);
end
function val = validate_data_resolution(obj, val)
if isequal(val, -1)
val = -1;
else
error('Unable to set the ''data_resolution'' property of class ''<a href="matlab:doc types.core.AnnotationSeries">AnnotationSeries</a>'' because it is read-only.')
end
end
function val = validate_data_unit(obj, val)
if isequal(val, 'n/a')
val = 'n/a';
else
error('Unable to set the ''data_unit'' property of class ''<a href="matlab:doc types.core.AnnotationSeries">AnnotationSeries</a>'' because it is read-only.')
end
end
%% EXPORT
function refs = export(obj, fid, fullpath, refs)
refs = [email protected](obj, fid, fullpath, refs);
Expand Down
2 changes: 1 addition & 1 deletion +types/+core/CorrectedImageStack.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
classdef CorrectedImageStack < types.core.NWBDataInterface & types.untyped.GroupClass
% CORRECTEDIMAGESTACK Reuslts from motion correction of an image stack.
% CORRECTEDIMAGESTACK Results from motion correction of an image stack.


% REQUIRED PROPERTIES
Expand Down
7 changes: 7 additions & 0 deletions +types/+core/CurrentClampSeries.m
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,13 @@
end
function val = validate_data(obj, val)

end
function val = validate_data_unit(obj, val)
if isequal(val, 'volts')
val = 'volts';
else
error('Unable to set the ''data_unit'' property of class ''<a href="matlab:doc types.core.CurrentClampSeries">CurrentClampSeries</a>'' because it is read-only.')
end
end
%% EXPORT
function refs = export(obj, fid, fullpath, refs)
Expand Down
7 changes: 7 additions & 0 deletions +types/+core/CurrentClampStimulusSeries.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@

function val = validate_data(obj, val)

end
function val = validate_data_unit(obj, val)
if isequal(val, 'amperes')
val = 'amperes';
else
error('Unable to set the ''data_unit'' property of class ''<a href="matlab:doc types.core.CurrentClampStimulusSeries">CurrentClampStimulusSeries</a>'' because it is read-only.')
end
end
%% EXPORT
function refs = export(obj, fid, fullpath, refs)
Expand Down
7 changes: 7 additions & 0 deletions +types/+core/ElectricalSeries.m
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,13 @@
validshapes = {[Inf,Inf,Inf], [Inf,Inf], [Inf]};
types.util.checkDims(valsz, validshapes);
end
function val = validate_data_unit(obj, val)
if isequal(val, 'volts')
val = 'volts';
else
error('Unable to set the ''data_unit'' property of class ''<a href="matlab:doc types.core.ElectricalSeries">ElectricalSeries</a>'' because it is read-only.')
end
end
function val = validate_electrodes(obj, val)
val = types.util.checkDtype('electrodes', 'types.hdmf_common.DynamicTableRegion', val);
end
Expand Down
7 changes: 7 additions & 0 deletions +types/+core/IZeroClampSeries.m
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@
validshapes = {[1]};
types.util.checkDims(valsz, validshapes);
end
function val = validate_stimulus_description(obj, val)
if isequal(val, 'N/A')
val = 'N/A';
else
error('Unable to set the ''stimulus_description'' property of class ''<a href="matlab:doc types.core.IZeroClampSeries">IZeroClampSeries</a>'' because it is read-only.')
end
end
%% EXPORT
function refs = export(obj, fid, fullpath, refs)
refs = [email protected](obj, fid, fullpath, refs);
Expand Down
2 changes: 1 addition & 1 deletion +types/+core/ImageSeries.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
device; % Device
dimension; % (int32) Number of pixels on x, y, (and z) axes.
external_file; % (char) Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.
external_file_starting_frame; % (int32) Each external image may contain one or more consecutive frames of the full ImageSeries. This attribute serves as an index to indicate which frames each file contains, to faciliate random access. The 'starting_frame' attribute, hence, contains a list of frame numbers within the full ImageSeries of the first frame of each file listed in the parent 'external_file' dataset. Zero-based indexing is used (hence, the first element will always be zero). For example, if the 'external_file' dataset has three paths to files and the first file has 5 frames, the second file has 10 frames, and the third file has 20 frames, then this attribute will have values [0, 5, 15]. If there is a single external file that holds all of the frames of the ImageSeries (and so there is a single element in the 'external_file' dataset), then this attribute should have value [0].
external_file_starting_frame; % (int32) Each external image may contain one or more consecutive frames of the full ImageSeries. This attribute serves as an index to indicate which frames each file contains, to facilitate random access. The 'starting_frame' attribute, hence, contains a list of frame numbers within the full ImageSeries of the first frame of each file listed in the parent 'external_file' dataset. Zero-based indexing is used (hence, the first element will always be zero). For example, if the 'external_file' dataset has three paths to files and the first file has 5 frames, the second file has 10 frames, and the third file has 20 frames, then this attribute will have values [0, 5, 15]. If there is a single external file that holds all of the frames of the ImageSeries (and so there is a single element in the 'external_file' dataset), then this attribute should have value [0].
format; % (char) Format of image. If this is 'external', then the attribute 'external_file' contains the path information to the image files. If this is 'raw', then the raw (single-channel) binary data is stored in the 'data' dataset. If this attribute is not present, then the default format='raw' case is assumed.
end

Expand Down
2 changes: 1 addition & 1 deletion +types/+core/ImagingRetinotopy.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
classdef ImagingRetinotopy < types.core.NWBDataInterface & types.untyped.GroupClass
% IMAGINGRETINOTOPY Intrinsic signal optical imaging or widefield imaging for measuring retinotopy. Stores orthogonal maps (e.g., altitude/azimuth; radius/theta) of responses to specific stimuli and a combined polarity map from which to identify visual areas. This group does not store the raw responses imaged during retinotopic mapping or the stimuli presented, but rather the resulting phase and power maps after applying a Fourier transform on the averaged responses. Note: for data consistency, all images and arrays are stored in the format [row][column] and [row, col], which equates to [y][x]. Field of view and dimension arrays may appear backward (i.e., y before x).
% IMAGINGRETINOTOPY DEPRECATED. Intrinsic signal optical imaging or widefield imaging for measuring retinotopy. Stores orthogonal maps (e.g., altitude/azimuth; radius/theta) of responses to specific stimuli and a combined polarity map from which to identify visual areas. This group does not store the raw responses imaged during retinotopic mapping or the stimuli presented, but rather the resulting phase and power maps after applying a Fourier transform on the averaged responses. Note: for data consistency, all images and arrays are stored in the format [row][column] and [row, col], which equates to [y][x]. Field of view and dimension arrays may appear backward (i.e., y before x).


% REQUIRED PROPERTIES
Expand Down
7 changes: 7 additions & 0 deletions +types/+core/IndexSeries.m
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,13 @@
validshapes = {[1]};
types.util.checkDims(valsz, validshapes);
end
function val = validate_data_unit(obj, val)
if isequal(val, 'N/A')
val = 'N/A';
else
error('Unable to set the ''data_unit'' property of class ''<a href="matlab:doc types.core.IndexSeries">IndexSeries</a>'' because it is read-only.')
end
end
function val = validate_indexed_images(obj, val)
val = types.util.checkDtype('indexed_images', 'types.core.Images', val);
end
Expand Down
14 changes: 14 additions & 0 deletions +types/+core/IntervalSeries.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,20 @@
validshapes = {[Inf]};
types.util.checkDims(valsz, validshapes);
end
function val = validate_data_resolution(obj, val)
if isequal(val, -1)
val = -1;
else
error('Unable to set the ''data_resolution'' property of class ''<a href="matlab:doc types.core.IntervalSeries">IntervalSeries</a>'' because it is read-only.')
end
end
function val = validate_data_unit(obj, val)
if isequal(val, 'n/a')
val = 'n/a';
else
error('Unable to set the ''data_unit'' property of class ''<a href="matlab:doc types.core.IntervalSeries">IntervalSeries</a>'' because it is read-only.')
end
end
%% EXPORT
function refs = export(obj, fid, fullpath, refs)
refs = [email protected](obj, fid, fullpath, refs);
Expand Down
7 changes: 7 additions & 0 deletions +types/+core/IntracellularElectrodesTable.m
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@
end
%% VALIDATORS

function val = validate_description(obj, val)
if isequal(val, 'Table for storing intracellular electrode related metadata.')
val = 'Table for storing intracellular electrode related metadata.';
else
error('Unable to set the ''description'' property of class ''<a href="matlab:doc types.core.IntracellularElectrodesTable">IntracellularElectrodesTable</a>'' because it is read-only.')
end
end
function val = validate_electrode(obj, val)
val = types.util.checkDtype('electrode', 'types.hdmf_common.VectorData', val);
end
Expand Down
7 changes: 7 additions & 0 deletions +types/+core/IntracellularRecordingsTable.m
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@
end
%% VALIDATORS

function val = validate_description(obj, val)
if isequal(val, 'A table to group together a stimulus and response from a single electrode and a single simultaneous recording and for storing metadata about the intracellular recording.')
val = 'A table to group together a stimulus and response from a single electrode and a single simultaneous recording and for storing metadata about the intracellular recording.';
else
error('Unable to set the ''description'' property of class ''<a href="matlab:doc types.core.IntracellularRecordingsTable">IntracellularRecordingsTable</a>'' because it is read-only.')
end
end
function val = validate_electrodes(obj, val)
val = types.util.checkDtype('electrodes', 'types.core.IntracellularElectrodesTable', val);
end
Expand Down
7 changes: 7 additions & 0 deletions +types/+core/IntracellularResponsesTable.m
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@
end
%% VALIDATORS

function val = validate_description(obj, val)
if isequal(val, 'Table for storing intracellular response related metadata.')
val = 'Table for storing intracellular response related metadata.';
else
error('Unable to set the ''description'' property of class ''<a href="matlab:doc types.core.IntracellularResponsesTable">IntracellularResponsesTable</a>'' because it is read-only.')
end
end
function val = validate_response(obj, val)
val = types.util.checkDtype('response', 'types.core.TimeSeriesReferenceVectorData', val);
end
Expand Down
22 changes: 22 additions & 0 deletions +types/+core/IntracellularStimuliTable.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
properties
stimulus; % REQUIRED (TimeSeriesReferenceVectorData) Column storing the reference to the recorded stimulus for the recording (rows).
end
% OPTIONAL PROPERTIES
properties
stimulus_template; % (TimeSeriesReferenceVectorData) Column storing the reference to the stimulus template for the recording (rows).
end

methods
function obj = IntracellularStimuliTable(varargin)
Expand All @@ -20,9 +24,11 @@
p.StructExpand = false;
addParameter(p, 'description',[]);
addParameter(p, 'stimulus',[]);
addParameter(p, 'stimulus_template',[]);
misc.parseSkipInvalidName(p, varargin);
obj.description = p.Results.description;
obj.stimulus = p.Results.stimulus;
obj.stimulus_template = p.Results.stimulus_template;
if strcmp(class(obj), 'types.core.IntracellularStimuliTable')
cellStringArguments = convertContainedStringsToChars(varargin(1:2:end));
types.util.checkUnset(obj, unique(cellStringArguments));
Expand All @@ -35,18 +41,34 @@
function set.stimulus(obj, val)
obj.stimulus = obj.validate_stimulus(val);
end
function set.stimulus_template(obj, val)
obj.stimulus_template = obj.validate_stimulus_template(val);
end
%% VALIDATORS

function val = validate_description(obj, val)
if isequal(val, 'Table for storing intracellular stimulus related metadata.')
val = 'Table for storing intracellular stimulus related metadata.';
else
error('Unable to set the ''description'' property of class ''<a href="matlab:doc types.core.IntracellularStimuliTable">IntracellularStimuliTable</a>'' because it is read-only.')
end
end
function val = validate_stimulus(obj, val)
val = types.util.checkDtype('stimulus', 'types.core.TimeSeriesReferenceVectorData', val);
end
function val = validate_stimulus_template(obj, val)
val = types.util.checkDtype('stimulus_template', 'types.core.TimeSeriesReferenceVectorData', val);
end
%% EXPORT
function refs = export(obj, fid, fullpath, refs)
refs = [email protected]_common.DynamicTable(obj, fid, fullpath, refs);
if any(strcmp(refs, fullpath))
return;
end
refs = obj.stimulus.export(fid, [fullpath '/stimulus'], refs);
if ~isempty(obj.stimulus_template)
refs = obj.stimulus_template.export(fid, [fullpath '/stimulus_template'], refs);
end
end
end

Expand Down
2 changes: 1 addition & 1 deletion +types/+core/MotionCorrection.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

% REQUIRED PROPERTIES
properties
correctedimagestack; % REQUIRED (CorrectedImageStack) Reuslts from motion correction of an image stack.
correctedimagestack; % REQUIRED (CorrectedImageStack) Results from motion correction of an image stack.
end

methods
Expand Down
15 changes: 7 additions & 8 deletions +types/+core/NWBFile.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
end
% OPTIONAL PROPERTIES
properties
acquisition; % (DynamicTable|NWBDataInterface) Tabular data that is relevent to acquisition | Acquired, raw data.
analysis; % (DynamicTable|NWBContainer) Tabular data that is relevent to data stored in analysis | Custom analysis results.
acquisition; % (DynamicTable|NWBDataInterface) Tabular data that is relevant to acquisition | Acquired, raw data.
analysis; % (DynamicTable|NWBContainer) Tabular data that is relevant to data stored in analysis | Custom analysis results.
general; % (LabMetaData) Place-holder than can be extended so that lab-specific meta-data can be placed in /general.
general_data_collection; % (char) Notes about data collection and analysis.
general_devices; % (Device) Data acquisition devices.
Expand All @@ -33,7 +33,7 @@
general_intracellular_ephys_repetitions; % (RepetitionsTable) A table for grouping different sequential intracellular recordings together. With each SequentialRecording typically representing a particular type of stimulus, the RepetitionsTable table is typically used to group sets of stimuli applied in sequence.
general_intracellular_ephys_sequential_recordings; % (SequentialRecordingsTable) A table for grouping different sequential recordings from the SimultaneousRecordingsTable table together. This is typically used to group together sequential recordings where the a sequence of stimuli of the same type with varying parameters have been presented in a sequence.
general_intracellular_ephys_simultaneous_recordings; % (SimultaneousRecordingsTable) A table for grouping different intracellular recordings from the IntracellularRecordingsTable table together that were recorded simultaneously from different electrodes
general_intracellular_ephys_sweep_table; % (SweepTable) [DEPRECATED] Table used to group different PatchClampSeries. SweepTable is being replaced by IntracellularRecordingsTable and SimultaneousRecordingsTable tabels. Additional SequentialRecordingsTable, RepetitionsTable and ExperimentalConditions tables provide enhanced support for experiment metadata.
general_intracellular_ephys_sweep_table; % (SweepTable) [DEPRECATED] Table used to group different PatchClampSeries. SweepTable is being replaced by IntracellularRecordingsTable and SimultaneousRecordingsTable tables. Additional SequentialRecordingsTable, RepetitionsTable and ExperimentalConditions tables provide enhanced support for experiment metadata.
general_keywords; % (char) Terms to search over.
general_lab; % (char) Laboratory where experiment was performed.
general_notes; % (char) Notes about the experiment.
Expand All @@ -56,15 +56,15 @@
intervals_trials; % (TimeIntervals) Repeated experimental events that have a logical grouping.
processing; % (ProcessingModule) Intermediate analysis of acquired data.
scratch; % (DynamicTable|NWBContainer|ScratchData) Any one-off tables | Any one-off containers | Any one-off datasets
stimulus_presentation; % (TimeSeries) TimeSeries objects containing data of presented stimuli.
stimulus_presentation; % (DynamicTable|NWBDataInterface|TimeSeries) DynamicTable objects containing data of presented stimuli. | Generic NWB data interfaces, usually from an extension, containing data of presented stimuli. | TimeSeries objects containing data of presented stimuli.
stimulus_templates; % (Images|TimeSeries) Images objects containing images of presented stimuli. | TimeSeries objects containing template data of presented stimuli.
units; % (Units) Data about sorted spike units.
end

methods
function obj = NWBFile(varargin)
% NWBFILE Constructor for NWBFile
varargin = [{'nwb_version' '2.6.0'} varargin];
varargin = [{'nwb_version' '2.7.0'} varargin];
obj = [email protected](varargin{:});


Expand Down Expand Up @@ -805,9 +805,8 @@
types.util.checkDims(valsz, validshapes);
end
function val = validate_stimulus_presentation(obj, val)
namedprops = struct();
constrained = {'types.core.TimeSeries'};
types.util.checkSet('stimulus_presentation', namedprops, constrained, val);
constrained = {'types.hdmf_common.DynamicTable', 'types.core.NWBDataInterface', 'types.core.TimeSeries'};
types.util.checkSet('stimulus_presentation', struct(), constrained, val);
end
function val = validate_stimulus_templates(obj, val)
constrained = {'types.core.Images', 'types.core.TimeSeries'};
Expand Down
9 changes: 8 additions & 1 deletion +types/+core/OptogeneticSeries.m
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,16 @@
else
valsz = size(val);
end
validshapes = {[Inf]};
validshapes = {[Inf,Inf], [Inf]};
types.util.checkDims(valsz, validshapes);
end
function val = validate_data_unit(obj, val)
if isequal(val, 'watts')
val = 'watts';
else
error('Unable to set the ''data_unit'' property of class ''<a href="matlab:doc types.core.OptogeneticSeries">OptogeneticSeries</a>'' because it is read-only.')
end
end
function val = validate_site(obj, val)
val = types.util.checkDtype('site', 'types.core.OptogeneticStimulusSite', val);
end
Expand Down
Loading