Working recursion! and also handling multiple array shapes, and properly handling unnamed classes

This commit is contained in:
sneakers-the-rat 2023-08-31 20:56:21 -07:00
parent c45458e748
commit 9dd7304334
92 changed files with 2735 additions and 3131 deletions

View file

@ -46,6 +46,26 @@ class BuildResult:
self.types.extend(other.types) self.types.extend(other.types)
return self return self
def __repr__(self):
out_str = "\nBuild Result:\n"
out_str += '-'*len(out_str)
for label, alist in (
('Schemas', self.schemas),
('Classes', self.classes),
('Slots', self.slots),
('Types', self.types)):
if len(alist) == 0:
continue
name_str = "\n\n" + label + ':'
name_str += "\n" + '-'*len(name_str) + '\n'
name_list = sorted([i.name for i in alist])
item_str = '\n '.join(name_list)
out_str += name_str + item_str
return out_str
T = TypeVar T = TypeVar
Ts = TypeVarTuple('Ts') Ts = TypeVarTuple('Ts')
@ -59,7 +79,14 @@ class Adapter(BaseModel):
def walk(self, input: BaseModel | list | dict): def walk(self, input: BaseModel | list | dict):
yield input yield input
if isinstance(input, BaseModel): if isinstance(input, BaseModel):
for key in input.__fields__.keys():
for key in input.model_fields.keys():
# Special case where SchemaAdapter Imports are themselves
# SchemaAdapters that should be located under the same
# NamespacesAdapter when it's important to query across SchemaAdapters,
# so skip to avoid combinatoric walking
if key == 'imports' and type(input).__name__ == "SchemaAdapter":
continue
val = getattr(input, key) val = getattr(input, key)
yield (key, val) yield (key, val)
if isinstance(val, (BaseModel, dict, list)): if isinstance(val, (BaseModel, dict, list)):

View file

@ -51,25 +51,28 @@ class ClassAdapter(Adapter):
# Build this class # Build this class
#name = self._get_full_name() #name = self._get_full_name()
kwargs = {}
if self.parent is not None: if self.parent is not None:
name = self._get_full_name() kwargs['name'] = self._get_full_name()
else: else:
name = self._get_attr_name() kwargs['name'] = self._get_attr_name()
kwargs['tree_root'] = True
# Get vanilla top-level attributes # Attributes
attrs = self.build_attrs(self.cls)
name_slot = self.build_name_slot() name_slot = self.build_name_slot()
attrs.append(name_slot) kwargs['attributes'] = [name_slot]
# Get vanilla top-level attributes
kwargs['attributes'].extend(self.build_attrs(self.cls))
if extra_attrs is not None: if extra_attrs is not None:
if isinstance(extra_attrs, SlotDefinition): if isinstance(extra_attrs, SlotDefinition):
extra_attrs = [extra_attrs] extra_attrs = [extra_attrs]
attrs.extend(extra_attrs) kwargs['attributes'].extend(extra_attrs)
kwargs['description'] = self.cls.doc
kwargs['is_a'] = self.cls.neurodata_type_inc
cls = ClassDefinition( cls = ClassDefinition(
name = name, **kwargs
is_a = self.cls.neurodata_type_inc,
description=self.cls.doc,
attributes=attrs,
) )
slots = [] slots = []

View file

@ -23,8 +23,12 @@ class DatasetAdapter(ClassAdapter):
res = self.handle_arraylike(res, self.cls, self._get_full_name()) res = self.handle_arraylike(res, self.cls, self._get_full_name())
res = self.handle_1d_vector(res) res = self.handle_1d_vector(res)
res = self.handle_listlike(res)
res = self.handle_scalar(res) res = self.handle_scalar(res)
if len(self._handlers) > 1:
raise RuntimeError(f"Only one handler should have been triggered, instead triggered {self._handlers}")
return res return res
def handle_scalar(self, res:BuildResult) -> BuildResult: def handle_scalar(self, res:BuildResult) -> BuildResult:
@ -70,6 +74,47 @@ class DatasetAdapter(ClassAdapter):
return res return res
def handle_listlike(self, res:BuildResult) -> BuildResult:
"""
Handle cases where the dataset is just a list of a specific type.
Examples:
datasets:
- name: file_create_date
dtype: isodatetime
dims:
- num_modifications
shape:
- null
"""
if self.cls.name and ((
# single-layer list
not any([isinstance(dim, list) for dim in self.cls.dims]) and
len(self.cls.dims) == 1
) or (
# nested list
all([isinstance(dim, list) for dim in self.cls.dims]) and
len(self.cls.dims) == 1 and
len(self.cls.dims[0]) == 1
)):
res = BuildResult(
slots = [
SlotDefinition(
name = self.cls.name,
multivalued=True,
range=self.handle_dtype(self.cls.dtype),
description=self.cls.doc,
required=False if self.cls.quantity in ('*', '?') else True
)
]
)
return res
else:
return res
def handle_arraylike(self, res: BuildResult, dataset: Dataset, name: Optional[str] = None) -> BuildResult: def handle_arraylike(self, res: BuildResult, dataset: Dataset, name: Optional[str] = None) -> BuildResult:
""" """
Handling the Handling the
@ -150,6 +195,9 @@ class DatasetAdapter(ClassAdapter):
# if a dim is present in all possible combinations of dims, make it required # if a dim is present in all possible combinations of dims, make it required
if all([dims in inner_dim for inner_dim in dataset.dims]): if all([dims in inner_dim for inner_dim in dataset.dims]):
required = True required = True
# or if there is just a single list of possible dimensions
elif not any([isinstance(inner_dim, list) for inner_dim in dataset.dims]):
required = True
else: else:
required = False required = False

View file

@ -6,7 +6,7 @@ from typing import List
from linkml_runtime.linkml_model import ClassDefinition, SlotDefinition from linkml_runtime.linkml_model import ClassDefinition, SlotDefinition
from nwb_schema_language import Dataset, Group, ReferenceDtype, CompoundDtype, DTypeType from nwb_schema_language import Dataset, Group, ReferenceDtype, CompoundDtype, DTypeType
from nwb_linkml.adapters.classes import ClassAdapter from nwb_linkml.adapters.classes import ClassAdapter, camel_to_snake
from nwb_linkml.adapters.dataset import DatasetAdapter from nwb_linkml.adapters.dataset import DatasetAdapter
from nwb_linkml.adapters.adapter import BuildResult from nwb_linkml.adapters.adapter import BuildResult
from nwb_linkml.maps import QUANTITY_MAP from nwb_linkml.maps import QUANTITY_MAP
@ -16,6 +16,17 @@ class GroupAdapter(ClassAdapter):
def build(self) -> BuildResult: def build(self) -> BuildResult:
# Handle container groups with only * quantity unnamed groups
if len(self.cls.groups) > 0 and \
all([self._check_if_container(g) for g in self.cls.groups]) and \
self.parent is not None:
return self.handle_container_group(self.cls)
# handle if we are a terminal container group without making a new class
if len(self.cls.groups) == 0 and \
self.cls.neurodata_type_inc is not None and \
self.parent is not None:
return self.handle_container_slot(self.cls)
nested_res = self.build_subclasses() nested_res = self.build_subclasses()
# we don't propagate slots up to the next level since they are meant for this # we don't propagate slots up to the next level since they are meant for this
@ -26,21 +37,78 @@ class GroupAdapter(ClassAdapter):
return res return res
def handle_children(self, children: List[Group]) -> BuildResult: def handle_container_group(self, cls: Group) -> BuildResult:
""" """
Make a special LinkML `children` slot that can Make a special LinkML `children` slot that can
have any number of the objects that are of `neurodata_type_inc` class have any number of the objects that are of `neurodata_type_inc` class
Examples:
- name: templates
groups:
- neurodata_type_inc: TimeSeries
doc: TimeSeries objects containing template data of presented stimuli.
quantity: '*'
- neurodata_type_inc: Images
doc: Images objects containing images of presented stimuli.
quantity: '*'
Args: Args:
children (List[:class:`.Group`]): Child groups children (List[:class:`.Group`]): Child groups
""" """
child_slot = SlotDefinition(
name='children', # don't build subgroups as their own classes, just make a slot
multivalued=True, # that can contain them
any_of=[{'range': cls.neurodata_type_inc} for cls in children] if not self.cls.name:
name = 'children'
else:
name = cls.name
res = BuildResult(
slots = [SlotDefinition(
name=name,
multivalued=True,
description=cls.doc,
any_of=[{'range': subcls.neurodata_type_inc} for subcls in cls.groups]
)]
) )
return BuildResult(slots=[child_slot]) return res
def handle_container_slot(self, cls:Group) -> BuildResult:
"""
Handle subgroups that contain arbitrarily numbered classes,
eg. *each* of the groups in
Examples:
- name: trials
neurodata_type_inc: TimeIntervals
doc: Repeated experimental events that have a logical grouping.
quantity: '?'
- name: invalid_times
neurodata_type_inc: TimeIntervals
doc: Time intervals that should be removed from analysis.
quantity: '?'
- neurodata_type_inc: TimeIntervals
doc: Optional additional table(s) for describing other experimental time intervals.
quantity: '*'
"""
if not self.cls.name:
name = camel_to_snake(self.cls.neurodata_type_inc)
else:
name = cls.name
return BuildResult(
slots = [
SlotDefinition(
name=name,
range=self.cls.neurodata_type_inc,
description=self.cls.doc,
**QUANTITY_MAP[cls.quantity]
)
]
)
def build_subclasses(self) -> BuildResult: def build_subclasses(self) -> BuildResult:
""" """
@ -66,24 +134,35 @@ class GroupAdapter(ClassAdapter):
# eg. a group can have multiple groups with `neurodata_type_inc`, no name, and quantity of *, # eg. a group can have multiple groups with `neurodata_type_inc`, no name, and quantity of *,
# the group can then contain any number of groups of those included types as direct children # the group can then contain any number of groups of those included types as direct children
# group_res = BuildResult()
# children = []
# for group in self.cls.groups:
# if not group.name and \
# group.quantity == '*' and \
# group.neurodata_type_inc:
# children.append(group)
# else:
# group_adapter = GroupAdapter(cls=group, parent=self)
# group_res += group_adapter.build()
#
# group_res += self.handle_children(children)
group_res = BuildResult() group_res = BuildResult()
for group in self.cls.groups: for group in self.cls.groups:
group_adapter = GroupAdapter(cls=group, parent=self) group_adapter = GroupAdapter(cls=group, parent=self)
group_res += group_adapter.build() group_res += group_adapter.build()
res = dataset_res + group_res res = dataset_res + group_res
return res return res
def _check_if_container(self, group:Group) -> bool:
"""
Check if a given subgroup is a container subgroup,
ie. whether it's used to indicate a possible type for a child, as in:
- name: templates
groups:
- neurodata_type_inc: TimeSeries
doc: TimeSeries objects containing template data of presented stimuli.
quantity: '*'
- neurodata_type_inc: Images
doc: Images objects containing images of presented stimuli.
quantity: '*'
"""
if not group.name and \
group.quantity == '*' and \
group.neurodata_type_inc:
return True
else:
return False

View file

@ -74,6 +74,8 @@ class NamespacesAdapter(Adapter):
def find_type_source(self, name:str) -> SchemaAdapter: def find_type_source(self, name:str) -> SchemaAdapter:
""" """
Given some neurodata_type_inc, find the schema that it's defined in. Given some neurodata_type_inc, find the schema that it's defined in.
Rather than returning as soon as a match is found, check all
""" """
# First check within the main schema # First check within the main schema
internal_matches = [] internal_matches = []
@ -82,6 +84,12 @@ class NamespacesAdapter(Adapter):
if name in class_names: if name in class_names:
internal_matches.append(schema) internal_matches.append(schema)
if len(internal_matches) > 1:
raise KeyError(
f"Found multiple schemas in namespace that define {name}:\ninternal: {pformat(internal_matches)}\nimported:{pformat(import_matches)}")
elif len(internal_matches) == 1:
return internal_matches[0]
import_matches = [] import_matches = []
for imported_ns in self.imported: for imported_ns in self.imported:
for schema in imported_ns.schemas: for schema in imported_ns.schemas:
@ -89,12 +97,10 @@ class NamespacesAdapter(Adapter):
if name in class_names: if name in class_names:
import_matches.append(schema) import_matches.append(schema)
all_matches = [*internal_matches, *import_matches] if len(import_matches)>1:
if len(all_matches)>1:
raise KeyError(f"Found multiple schemas in namespace that define {name}:\ninternal: {pformat(internal_matches)}\nimported:{pformat(import_matches)}") raise KeyError(f"Found multiple schemas in namespace that define {name}:\ninternal: {pformat(internal_matches)}\nimported:{pformat(import_matches)}")
elif len(all_matches) == 1: elif len(import_matches) == 1:
return all_matches[0] return import_matches[0]
else: else:
raise KeyError(f"No schema found that define {name}") raise KeyError(f"No schema found that define {name}")

View file

@ -2,10 +2,10 @@
Since NWB doesn't necessarily have a term for a single nwb schema file, we're going Since NWB doesn't necessarily have a term for a single nwb schema file, we're going
to call them "schema" objects to call them "schema" objects
""" """
import pdb
from typing import Optional, List, TYPE_CHECKING from typing import Optional, List, TYPE_CHECKING, Type
from pathlib import Path from pathlib import Path
from pydantic import Field from pydantic import Field, PrivateAttr
from nwb_linkml.adapters.adapter import Adapter, BuildResult from nwb_linkml.adapters.adapter import Adapter, BuildResult
from nwb_linkml.adapters.dataset import DatasetAdapter from nwb_linkml.adapters.dataset import DatasetAdapter
@ -21,7 +21,7 @@ from linkml_runtime.linkml_model import SchemaDefinition
class SplitSchema(NamedTuple): class SplitSchema(NamedTuple):
main: BuildResult main: BuildResult
split: BuildResult split: Optional[BuildResult]
class SchemaAdapter(Adapter): class SchemaAdapter(Adapter):
""" """
@ -38,6 +38,7 @@ class SchemaAdapter(Adapter):
True, True,
description="Split anonymous subclasses into a separate schema file" description="Split anonymous subclasses into a separate schema file"
) )
_created_classes: List[Type[Group | Dataset]] = PrivateAttr(default_factory=list)
@property @property
def name(self) -> str: def name(self) -> str:
@ -118,7 +119,8 @@ class SchemaAdapter(Adapter):
# need to mutually import the two schemas because the subclasses # need to mutually import the two schemas because the subclasses
# could refer to the main classes # could refer to the main classes
main_imports = imports main_imports = imports
main_imports.append(split_sch_name) if len(split_classes)>0:
main_imports.append(split_sch_name)
imports.append(self.name) imports.append(self.name)
main_sch = SchemaDefinition( main_sch = SchemaDefinition(
name=self.name, name=self.name,
@ -128,6 +130,7 @@ class SchemaAdapter(Adapter):
slots=classes.slots, slots=classes.slots,
types=classes.types types=classes.types
) )
split_sch = SchemaDefinition( split_sch = SchemaDefinition(
name=split_sch_name, name=split_sch_name,
id=split_sch_name, id=split_sch_name,
@ -136,17 +139,23 @@ class SchemaAdapter(Adapter):
slots=classes.slots, slots=classes.slots,
types=classes.types types=classes.types
) )
res = BuildResult( if len(split_classes) > 0:
schemas=[main_sch, split_sch] res = BuildResult(
) schemas=[main_sch, split_sch]
)
else:
res = BuildResult(
schemas=[main_sch]
)
return res return res
@property @property
def created_classes(self) -> List[Group|Dataset]: def created_classes(self) -> List[Type[Group | Dataset]]:
classes = [t for t in self.walk_types([self.groups, self.datasets], (Group, Dataset)) if t.neurodata_type_def is not None] if len(self._created_classes) == 0:
return classes self._created_classes = [t for t in self.walk_types([self.groups, self.datasets], (Group, Dataset)) if t.neurodata_type_def is not None]
return self._created_classes
@property @property
def needed_imports(self) -> List[str]: def needed_imports(self) -> List[str]:
@ -164,5 +173,3 @@ class SchemaAdapter(Adapter):
return need return need

View file

@ -131,6 +131,9 @@ class {{ c.name }}
{{attr.name}}: {{ attr.annotations['python_range'].value }} = Field( {{attr.name}}: {{ attr.annotations['python_range'].value }} = Field(
{%- if predefined_slot_values[c.name][attr.name] -%} {%- if predefined_slot_values[c.name][attr.name] -%}
{{ predefined_slot_values[c.name][attr.name] }} {{ predefined_slot_values[c.name][attr.name] }}
{%- if attr.equals_string -%}
, const=True
{%- endif -%}
{%- elif attr.required -%} {%- elif attr.required -%}
... ...
{%- else -%} {%- else -%}
@ -182,6 +185,10 @@ class NWBPydanticGenerator(PydanticGenerator):
for slot_name, slot in cls.attributes.items(): for slot_name, slot in cls.attributes.items():
if slot.range in all_classes: if slot.range in all_classes:
needed_classes.append(slot.range) needed_classes.append(slot.range)
if slot.any_of:
for any_slot_range in slot.any_of:
if any_slot_range.range in all_classes:
needed_classes.append(any_slot_range.range)
needed_classes = [cls for cls in set(needed_classes) if cls is not None] needed_classes = [cls for cls in set(needed_classes) if cls is not None]
imports = {} imports = {}
@ -245,16 +252,16 @@ class NWBPydanticGenerator(PydanticGenerator):
if not base_range_subsumes_any_of: if not base_range_subsumes_any_of:
raise ValueError("Slot cannot have both range and any_of defined") raise ValueError("Slot cannot have both range and any_of defined")
def _get_numpy_slot_range(self, cls:ClassDefinition) -> str: def _make_npytyping_range(self, attrs: Dict[str, SlotDefinition]) -> str:
# slot always starts with... # slot always starts with...
prefix='NDArray[' prefix = 'NDArray['
# and then we specify the shape: # and then we specify the shape:
shape_prefix = 'Shape["' shape_prefix = 'Shape["'
# using the cardinality from the attributes # using the cardinality from the attributes
dim_pieces = [] dim_pieces = []
for attr in cls.attributes.values(): for attr in attrs.values():
if attr.maximum_cardinality: if attr.maximum_cardinality:
shape_part = str(attr.maximum_cardinality) shape_part = str(attr.maximum_cardinality)
@ -271,16 +278,41 @@ class NWBPydanticGenerator(PydanticGenerator):
# all dimensions should be the same dtype # all dimensions should be the same dtype
try: try:
dtype = flat_to_npytyping[list(cls.attributes.values())[0].range] dtype = flat_to_npytyping[list(attrs.values())[0].range]
except KeyError as e: except KeyError as e:
warnings.warn(e) warnings.warn(e)
range = list(cls.attributes.values())[0].range range = list(attrs.values())[0].range
return f'List[{range}] | {range}' return f'List[{range}] | {range}'
suffix = "]" suffix = "]"
slot = ''.join([prefix, shape_prefix, dimension, shape_suffix, dtype, suffix]) slot = ''.join([prefix, shape_prefix, dimension, shape_suffix, dtype, suffix])
return slot return slot
def _get_numpy_slot_range(self, cls:ClassDefinition) -> str:
# if none of the dimensions are optional, we just have one possible array shape
if all([s.required for s in cls.attributes.values()]):
return self._make_npytyping_range(cls.attributes)
# otherwise we need to make permutations
# but not all permutations, because we typically just want to be able to exlude the last possible dimensions
# the array classes should always be well-defined where the optional dimensions are at the end, so
requireds = {k:v for k,v in cls.attributes.items() if v.required}
optionals = [(k,v) for k, v in cls.attributes.items() if not v.required]
annotations = []
if len(requireds) > 0:
# first the base case
annotations.append(self._make_npytyping_range(requireds))
# then add back each optional dimension
for i in range(len(optionals)):
attrs = {**requireds, **{k:v for k, v in optionals[0:i+1]}}
annotations.append(self._make_npytyping_range(attrs))
# now combine with a union:
union = "Union[\n" + ' '*8
union += (',\n' + ' '*8).join(annotations)
union += '\n' + ' '*4 + ']'
return union
def sort_classes(self, clist: List[ClassDefinition], imports:List[str]) -> List[ClassDefinition]: def sort_classes(self, clist: List[ClassDefinition], imports:List[str]) -> List[ClassDefinition]:
""" """

View file

@ -24,7 +24,7 @@ flat_to_linkml = {
"utf_8" : "string", "utf_8" : "string",
"ascii" : "string", "ascii" : "string",
"bool" : "boolean", "bool" : "boolean",
"isodatetime" : "date" "isodatetime" : "datetime"
} }
""" """
Map between the flat data types and the simpler linkml base types Map between the flat data types and the simpler linkml base types

View file

@ -15,13 +15,9 @@ else:
metamodel_version = "None" metamodel_version = "None"
version = "2.6.0-alpha" version = "2.6.0-alpha"
class WeakRefShimBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel,
__slots__ = '__weakref__'
class ConfiguredBaseModel(WeakRefShimBaseModel,
validate_assignment = True, validate_assignment = True,
validate_all = True, validate_default = True,
underscore_attrs_are_private = True,
extra = 'forbid', extra = 'forbid',
arbitrary_types_allowed = True, arbitrary_types_allowed = True,
use_enum_values = True): use_enum_values = True):
@ -29,5 +25,6 @@ class ConfiguredBaseModel(WeakRefShimBaseModel,
# Update forward refs # Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/postponed_annotations/ # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model

View file

@ -11,39 +11,32 @@ else:
from typing_extensions import Literal from typing_extensions import Literal
from .core_nwb_base_include import ( from .hdmf_common_table import (
TimeSeriesSync, DynamicTable,
TimeSeriesControlDescription, VectorData
# ImageReferencesArray,
ImageArray,
TimeSeriesControl,
TimeSeriesData,
# ImagesOrderOfImages,
TimeSeriesTimestamps,
TimeSeriesStartingTime
) )
from .hdmf_common_base import ( from .hdmf_common_base import (
Container, Data,
Data Container
) )
# from .hdmf_common_table import ( from .core_nwb_base_include import (
# DynamicTable, TimeSeriesStartingTime,
# VectorData ImageArray,
# ) ImageReferencesArray,
TimeSeriesSync,
ImagesOrderOfImages,
TimeSeriesData
)
metamodel_version = "None" metamodel_version = "None"
version = "None" version = "None"
class WeakRefShimBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel,
__slots__ = '__weakref__'
class ConfiguredBaseModel(WeakRefShimBaseModel,
validate_assignment = True, validate_assignment = True,
validate_all = True, validate_default = True,
underscore_attrs_are_private = True,
extra = 'forbid', extra = 'forbid',
arbitrary_types_allowed = True, arbitrary_types_allowed = True,
use_enum_values = True): use_enum_values = True):
@ -54,88 +47,104 @@ class NWBData(Data):
""" """
An abstract data type for a dataset. An abstract data type for a dataset.
""" """
None name: str = Field(...)
# class TimeSeriesReferenceVectorData(VectorData): class TimeSeriesReferenceVectorData(VectorData):
# """ """
# Column storing references to a TimeSeries (rows). For each TimeSeries this VectorData column stores the start_index and count to indicate the range in time to be selected as well as an object reference to the TimeSeries. Column storing references to a TimeSeries (rows). For each TimeSeries this VectorData column stores the start_index and count to indicate the range in time to be selected as well as an object reference to the TimeSeries.
# """ """
# description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") name: str = Field(...)
# array: Optional[NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any]] = Field(None) description: Optional[str] = Field(None, description="""Description of what these vectors represent.""")
# array: Optional[Union[
NDArray[Shape["* dim0"], Any],
NDArray[Shape["* dim0, * dim1"], Any],
NDArray[Shape["* dim0, * dim1, * dim2"], Any],
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any]
]] = Field(None)
class Image(NWBData): class Image(NWBData):
""" """
An abstract data type for an image. Shape can be 2-D (x, y), or 3-D where the third dimension can have three or four elements, e.g. (x, y, (r, g, b)) or (x, y, (r, g, b, a)). An abstract data type for an image. Shape can be 2-D (x, y), or 3-D where the third dimension can have three or four elements, e.g. (x, y, (r, g, b)) or (x, y, (r, g, b, a)).
""" """
name: str = Field(...)
resolution: Optional[float] = Field(None, description="""Pixel resolution of the image, in pixels per centimeter.""") resolution: Optional[float] = Field(None, description="""Pixel resolution of the image, in pixels per centimeter.""")
description: Optional[str] = Field(None, description="""Description of the image.""") description: Optional[str] = Field(None, description="""Description of the image.""")
array: Optional[NDArray[Shape["* x, * y, 3 r_g_b, 4 r_g_b_a"], Number]] = Field(None) array: Optional[Union[
NDArray[Shape["* x, * y"], Number],
NDArray[Shape["* x, * y, 3 r_g_b"], Number],
NDArray[Shape["* x, * y, 3 r_g_b, 4 r_g_b_a"], Number]
]] = Field(None)
# class ImageReferences(NWBData): class ImageReferences(NWBData):
# """ """
# Ordered dataset of references to Image objects. Ordered dataset of references to Image objects.
# """ """
# array: Optional[List[Image] | Image] = Field(None) name: str = Field(...)
# array: Optional[List[Image] | Image] = Field(None)
class NWBContainer(Container): class NWBContainer(Container):
""" """
An abstract data type for a generic container storing collections of data and metadata. Base type for all data and metadata containers. An abstract data type for a generic container storing collections of data and metadata. Base type for all data and metadata containers.
""" """
None name: str = Field(...)
class NWBDataInterface(NWBContainer): class NWBDataInterface(NWBContainer):
""" """
An abstract data type for a generic container storing collections of data, as opposed to metadata. An abstract data type for a generic container storing collections of data, as opposed to metadata.
""" """
None name: str = Field(...)
class TimeSeries(NWBDataInterface): class TimeSeries(NWBDataInterface):
""" """
General purpose time series. General purpose time series.
""" """
name: str = Field(...)
description: Optional[str] = Field(None, description="""Description of the time series.""") description: Optional[str] = Field(None, description="""Description of the time series.""")
comments: Optional[str] = Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") comments: Optional[str] = Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""")
data: TimeSeriesData = Field(..., description="""Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first dimension should always represent time. This can also be used to store binary data (e.g., image frames). This can also be a link to data stored in an external file.""") data: TimeSeriesData = Field(..., description="""Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first dimension should always represent time. This can also be used to store binary data (e.g., image frames). This can also be a link to data stored in an external file.""")
starting_time: Optional[TimeSeriesStartingTime] = Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") starting_time: Optional[TimeSeriesStartingTime] = Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""")
timestamps: Optional[TimeSeriesTimestamps] = Field(None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") timestamps: Optional[List[float]] = Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""")
control: Optional[TimeSeriesControl] = Field(None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") control: Optional[List[int]] = Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""")
control_description: Optional[TimeSeriesControlDescription] = Field(None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") control_description: Optional[List[str]] = Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""")
sync: Optional[TimeSeriesSync] = Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") sync: Optional[TimeSeriesSync] = Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""")
# class ProcessingModule(NWBContainer): class ProcessingModule(NWBContainer):
# """ """
# A collection of processed data. A collection of processed data.
# """ """
# description: Optional[str] = Field(None, description="""Description of this collection of processed data.""") name: str = Field(...)
# NWBDataInterface: Optional[List[NWBDataInterface]] = Field(default_factory=list, description="""Data objects stored in this collection.""") description: Optional[str] = Field(None, description="""Description of this collection of processed data.""")
# DynamicTable: Optional[List[DynamicTable]] = Field(default_factory=list, description="""Tables stored in this collection.""") nwb_data_interface: Optional[List[NWBDataInterface]] = Field(default_factory=list, description="""Data objects stored in this collection.""")
# dynamic_table: Optional[List[DynamicTable]] = Field(default_factory=list, description="""Tables stored in this collection.""")
# class Images(NWBDataInterface): class Images(NWBDataInterface):
# """ """
# A collection of images with an optional way to specify the order of the images using the \"order_of_images\" dataset. An order must be specified if the images are referenced by index, e.g., from an IndexSeries. A collection of images with an optional way to specify the order of the images using the \"order_of_images\" dataset. An order must be specified if the images are referenced by index, e.g., from an IndexSeries.
# """ """
# description: Optional[str] = Field(None, description="""Description of this collection of images.""") name: str = Field(...)
# Image: List[Image] = Field(default_factory=list, description="""Images stored in this collection.""") description: Optional[str] = Field(None, description="""Description of this collection of images.""")
# order_of_images: Optional[ImagesOrderOfImages] = Field(None, description="""Ordered dataset of references to Image objects stored in the parent group. Each Image object in the Images group should be stored once and only once, so the dataset should have the same length as the number of images.""") Image: List[Image] = Field(default_factory=list, description="""Images stored in this collection.""")
# order_of_images: Optional[ImagesOrderOfImages] = Field(None, description="""Ordered dataset of references to Image objects stored in the parent group. Each Image object in the Images group should be stored once and only once, so the dataset should have the same length as the number of images.""")
# Update forward refs # Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/postponed_annotations/ # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
NWBData.update_forward_refs() NWBData.model_rebuild()
# TimeSeriesReferenceVectorData.update_forward_refs() TimeSeriesReferenceVectorData.model_rebuild()
Image.update_forward_refs() Image.model_rebuild()
# ImageReferences.update_forward_refs() ImageReferences.model_rebuild()
NWBContainer.update_forward_refs() NWBContainer.model_rebuild()
NWBDataInterface.update_forward_refs() NWBDataInterface.model_rebuild()
TimeSeries.update_forward_refs() TimeSeries.model_rebuild()
# ProcessingModule.update_forward_refs() ProcessingModule.model_rebuild()
# Images.update_forward_refs() Images.model_rebuild()

View file

@ -15,22 +15,18 @@ from .nwb_language import (
Arraylike Arraylike
) )
# from .core_nwb_base import ( from .core_nwb_base import (
# ImageReferences, ImageReferences,
# Image Image
# ) )
metamodel_version = "None" metamodel_version = "None"
version = "None" version = "None"
class WeakRefShimBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel,
__slots__ = '__weakref__'
class ConfiguredBaseModel(WeakRefShimBaseModel,
validate_assignment = True, validate_assignment = True,
validate_all = True, validate_default = True,
underscore_attrs_are_private = True,
extra = 'forbid', extra = 'forbid',
arbitrary_types_allowed = True, arbitrary_types_allowed = True,
use_enum_values = True): use_enum_values = True):
@ -45,21 +41,27 @@ class ImageArray(Arraylike):
r_g_b_a: Optional[float] = Field(None) r_g_b_a: Optional[float] = Field(None)
# class ImageReferencesArray(Arraylike): class ImageReferencesArray(Arraylike):
#
# num_images: Image = Field(...) num_images: Image = Field(...)
class TimeSeriesData(ConfiguredBaseModel): class TimeSeriesData(ConfiguredBaseModel):
""" """
Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first dimension should always represent time. This can also be used to store binary data (e.g., image frames). This can also be a link to data stored in an external file. Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first dimension should always represent time. This can also be used to store binary data (e.g., image frames). This can also be a link to data stored in an external file.
""" """
name: str = Field("data", const=True)
conversion: Optional[float] = Field(None, description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""") conversion: Optional[float] = Field(None, description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""")
offset: Optional[float] = Field(None, description="""Scalar to add to the data after scaling by 'conversion' to finalize its coercion to the specified 'unit'. Two common examples of this include (a) data stored in an unsigned type that requires a shift after scaling to re-center the data, and (b) specialized recording devices that naturally cause a scalar offset with respect to the true units.""") offset: Optional[float] = Field(None, description="""Scalar to add to the data after scaling by 'conversion' to finalize its coercion to the specified 'unit'. Two common examples of this include (a) data stored in an unsigned type that requires a shift after scaling to re-center the data, and (b) specialized recording devices that naturally cause a scalar offset with respect to the true units.""")
resolution: Optional[float] = Field(None, description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""") resolution: Optional[float] = Field(None, description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""")
unit: Optional[str] = Field(None, description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion' and add 'offset'.""") unit: Optional[str] = Field(None, description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion' and add 'offset'.""")
continuity: Optional[str] = Field(None, description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""") continuity: Optional[str] = Field(None, description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""")
array: Optional[NDArray[Shape["* num_times, ..."], Number]] = Field(None) array: Optional[Union[
NDArray[Shape["* num_times"], Any],
NDArray[Shape["* num_times, * num_DIM2"], Any],
NDArray[Shape["* num_times, * num_DIM2, * num_DIM3"], Any],
NDArray[Shape["* num_times, * num_DIM2, * num_DIM3, * num_DIM4"], Any]
]] = Field(None)
class TimeSeriesDataArray(Arraylike): class TimeSeriesDataArray(Arraylike):
@ -74,57 +76,34 @@ class TimeSeriesStartingTime(ConfiguredBaseModel):
""" """
Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute. Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.
""" """
name: str = Field("starting_time", const=True)
rate: Optional[float] = Field(None, description="""Sampling rate, in Hz.""") rate: Optional[float] = Field(None, description="""Sampling rate, in Hz.""")
unit: Optional[str] = Field(None, description="""Unit of measurement for time, which is fixed to 'seconds'.""") unit: Optional[str] = Field(None, description="""Unit of measurement for time, which is fixed to 'seconds'.""")
class TimeSeriesTimestamps(ConfiguredBaseModel):
"""
Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.
"""
interval: Optional[int] = Field(None, description="""Value is '1'""")
unit: Optional[str] = Field(None, description="""Unit of measurement for timestamps, which is fixed to 'seconds'.""")
timestamps: Optional[List[float]] = Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""")
class TimeSeriesControl(ConfiguredBaseModel):
"""
Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.
"""
control: Optional[List[int]] = Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""")
class TimeSeriesControlDescription(ConfiguredBaseModel):
"""
Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.
"""
control_description: Optional[List[str]] = Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""")
class TimeSeriesSync(ConfiguredBaseModel): class TimeSeriesSync(ConfiguredBaseModel):
""" """
Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes. Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.
""" """
None name: str = Field("sync", const=True)
# class ImagesOrderOfImages(ImageReferences): class ImagesOrderOfImages(ImageReferences):
# """ """
# Ordered dataset of references to Image objects stored in the parent group. Each Image object in the Images group should be stored once and only once, so the dataset should have the same length as the number of images. Ordered dataset of references to Image objects stored in the parent group. Each Image object in the Images group should be stored once and only once, so the dataset should have the same length as the number of images.
# """ """
# array: Optional[List[Image] | Image] = Field(None) name: str = Field("order_of_images", const=True)
array: Optional[List[Image] | Image] = Field(None)
# Update forward refs # Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/postponed_annotations/ # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
ImageArray.update_forward_refs() ImageArray.model_rebuild()
# ImageReferencesArray.update_forward_refs() ImageReferencesArray.model_rebuild()
TimeSeriesData.update_forward_refs() TimeSeriesData.model_rebuild()
TimeSeriesDataArray.update_forward_refs() TimeSeriesDataArray.model_rebuild()
TimeSeriesStartingTime.update_forward_refs() TimeSeriesStartingTime.model_rebuild()
TimeSeriesTimestamps.update_forward_refs() TimeSeriesSync.model_rebuild()
TimeSeriesControl.update_forward_refs() ImagesOrderOfImages.model_rebuild()
TimeSeriesControlDescription.update_forward_refs()
TimeSeriesSync.update_forward_refs()
# ImagesOrderOfImages.update_forward_refs()

View file

@ -11,15 +11,15 @@ else:
from typing_extensions import Literal from typing_extensions import Literal
from .core_nwb_behavior_include import (
SpatialSeriesData
)
from .core_nwb_base import ( from .core_nwb_base import (
TimeSeries, TimeSeries,
NWBDataInterface NWBDataInterface
) )
from .core_nwb_behavior_include import (
SpatialSeriesData
)
from .core_nwb_misc import ( from .core_nwb_misc import (
IntervalSeries IntervalSeries
) )
@ -28,13 +28,9 @@ from .core_nwb_misc import (
metamodel_version = "None" metamodel_version = "None"
version = "None" version = "None"
class WeakRefShimBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel,
__slots__ = '__weakref__'
class ConfiguredBaseModel(WeakRefShimBaseModel,
validate_assignment = True, validate_assignment = True,
validate_all = True, validate_default = True,
underscore_attrs_are_private = True,
extra = 'forbid', extra = 'forbid',
arbitrary_types_allowed = True, arbitrary_types_allowed = True,
use_enum_values = True): use_enum_values = True):
@ -45,14 +41,15 @@ class SpatialSeries(TimeSeries):
""" """
Direction, e.g., of gaze or travel, or position. The TimeSeries::data field is a 2D array storing position or direction relative to some reference frame. Array structure: [num measurements] [num dimensions]. Each SpatialSeries has a text dataset reference_frame that indicates the zero-position, or the zero-axes for direction. For example, if representing gaze direction, 'straight-ahead' might be a specific pixel on the monitor, or some other point in space. For position data, the 0,0 point might be the top-left corner of an enclosure, as viewed from the tracking camera. The unit of data will indicate how to interpret SpatialSeries values. Direction, e.g., of gaze or travel, or position. The TimeSeries::data field is a 2D array storing position or direction relative to some reference frame. Array structure: [num measurements] [num dimensions]. Each SpatialSeries has a text dataset reference_frame that indicates the zero-position, or the zero-axes for direction. For example, if representing gaze direction, 'straight-ahead' might be a specific pixel on the monitor, or some other point in space. For position data, the 0,0 point might be the top-left corner of an enclosure, as viewed from the tracking camera. The unit of data will indicate how to interpret SpatialSeries values.
""" """
name: str = Field(...)
data: SpatialSeriesData = Field(..., description="""1-D or 2-D array storing position or direction relative to some reference frame.""") data: SpatialSeriesData = Field(..., description="""1-D or 2-D array storing position or direction relative to some reference frame.""")
reference_frame: Optional[str] = Field(None, description="""Description defining what exactly 'straight-ahead' means.""") reference_frame: Optional[str] = Field(None, description="""Description defining what exactly 'straight-ahead' means.""")
description: Optional[str] = Field(None, description="""Description of the time series.""") description: Optional[str] = Field(None, description="""Description of the time series.""")
comments: Optional[str] = Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") comments: Optional[str] = Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""")
starting_time: Optional[TimeSeriesStartingTime] = Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") starting_time: Optional[TimeSeriesStartingTime] = Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""")
timestamps: Optional[TimeSeriesTimestamps] = Field(None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") timestamps: Optional[List[float]] = Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""")
control: Optional[TimeSeriesControl] = Field(None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") control: Optional[List[int]] = Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""")
control_description: Optional[TimeSeriesControlDescription] = Field(None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") control_description: Optional[List[str]] = Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""")
sync: Optional[TimeSeriesSync] = Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") sync: Optional[TimeSeriesSync] = Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""")
@ -60,59 +57,67 @@ class BehavioralEpochs(NWBDataInterface):
""" """
TimeSeries for storing behavioral epochs. The objective of this and the other two Behavioral interfaces (e.g. BehavioralEvents and BehavioralTimeSeries) is to provide generic hooks for software tools/scripts. This allows a tool/script to take the output one specific interface (e.g., UnitTimes) and plot that data relative to another data modality (e.g., behavioral events) without having to define all possible modalities in advance. Declaring one of these interfaces means that one or more TimeSeries of the specified type is published. These TimeSeries should reside in a group having the same name as the interface. For example, if a BehavioralTimeSeries interface is declared, the module will have one or more TimeSeries defined in the module sub-group 'BehavioralTimeSeries'. BehavioralEpochs should use IntervalSeries. BehavioralEvents is used for irregular events. BehavioralTimeSeries is for continuous data. TimeSeries for storing behavioral epochs. The objective of this and the other two Behavioral interfaces (e.g. BehavioralEvents and BehavioralTimeSeries) is to provide generic hooks for software tools/scripts. This allows a tool/script to take the output one specific interface (e.g., UnitTimes) and plot that data relative to another data modality (e.g., behavioral events) without having to define all possible modalities in advance. Declaring one of these interfaces means that one or more TimeSeries of the specified type is published. These TimeSeries should reside in a group having the same name as the interface. For example, if a BehavioralTimeSeries interface is declared, the module will have one or more TimeSeries defined in the module sub-group 'BehavioralTimeSeries'. BehavioralEpochs should use IntervalSeries. BehavioralEvents is used for irregular events. BehavioralTimeSeries is for continuous data.
""" """
IntervalSeries: Optional[List[IntervalSeries]] = Field(default_factory=list, description="""IntervalSeries object containing start and stop times of epochs.""") name: str = Field(...)
interval_series: Optional[List[IntervalSeries]] = Field(default_factory=list, description="""IntervalSeries object containing start and stop times of epochs.""")
class BehavioralEvents(NWBDataInterface): class BehavioralEvents(NWBDataInterface):
""" """
TimeSeries for storing behavioral events. See description of <a href=\"#BehavioralEpochs\">BehavioralEpochs</a> for more details. TimeSeries for storing behavioral events. See description of <a href=\"#BehavioralEpochs\">BehavioralEpochs</a> for more details.
""" """
TimeSeries: Optional[List[TimeSeries]] = Field(default_factory=list, description="""TimeSeries object containing behavioral events.""") name: str = Field(...)
time_series: Optional[List[TimeSeries]] = Field(default_factory=list, description="""TimeSeries object containing behavioral events.""")
class BehavioralTimeSeries(NWBDataInterface): class BehavioralTimeSeries(NWBDataInterface):
""" """
TimeSeries for storing Behavoioral time series data. See description of <a href=\"#BehavioralEpochs\">BehavioralEpochs</a> for more details. TimeSeries for storing Behavoioral time series data. See description of <a href=\"#BehavioralEpochs\">BehavioralEpochs</a> for more details.
""" """
TimeSeries: Optional[List[TimeSeries]] = Field(default_factory=list, description="""TimeSeries object containing continuous behavioral data.""") name: str = Field(...)
time_series: Optional[List[TimeSeries]] = Field(default_factory=list, description="""TimeSeries object containing continuous behavioral data.""")
class PupilTracking(NWBDataInterface): class PupilTracking(NWBDataInterface):
""" """
Eye-tracking data, representing pupil size. Eye-tracking data, representing pupil size.
""" """
TimeSeries: List[TimeSeries] = Field(default_factory=list, description="""TimeSeries object containing time series data on pupil size.""") name: str = Field(...)
time_series: List[TimeSeries] = Field(default_factory=list, description="""TimeSeries object containing time series data on pupil size.""")
class EyeTracking(NWBDataInterface): class EyeTracking(NWBDataInterface):
""" """
Eye-tracking data, representing direction of gaze. Eye-tracking data, representing direction of gaze.
""" """
SpatialSeries: Optional[List[SpatialSeries]] = Field(default_factory=list, description="""SpatialSeries object containing data measuring direction of gaze.""") name: str = Field(...)
spatial_series: Optional[List[SpatialSeries]] = Field(default_factory=list, description="""SpatialSeries object containing data measuring direction of gaze.""")
class CompassDirection(NWBDataInterface): class CompassDirection(NWBDataInterface):
""" """
With a CompassDirection interface, a module publishes a SpatialSeries object representing a floating point value for theta. The SpatialSeries::reference_frame field should indicate what direction corresponds to 0 and which is the direction of rotation (this should be clockwise). The si_unit for the SpatialSeries should be radians or degrees. With a CompassDirection interface, a module publishes a SpatialSeries object representing a floating point value for theta. The SpatialSeries::reference_frame field should indicate what direction corresponds to 0 and which is the direction of rotation (this should be clockwise). The si_unit for the SpatialSeries should be radians or degrees.
""" """
SpatialSeries: Optional[List[SpatialSeries]] = Field(default_factory=list, description="""SpatialSeries object containing direction of gaze travel.""") name: str = Field(...)
spatial_series: Optional[List[SpatialSeries]] = Field(default_factory=list, description="""SpatialSeries object containing direction of gaze travel.""")
class Position(NWBDataInterface): class Position(NWBDataInterface):
""" """
Position data, whether along the x, x/y or x/y/z axis. Position data, whether along the x, x/y or x/y/z axis.
""" """
SpatialSeries: List[SpatialSeries] = Field(default_factory=list, description="""SpatialSeries object containing position data.""") name: str = Field(...)
spatial_series: List[SpatialSeries] = Field(default_factory=list, description="""SpatialSeries object containing position data.""")
# Update forward refs # Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/postponed_annotations/ # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
SpatialSeries.update_forward_refs() SpatialSeries.model_rebuild()
BehavioralEpochs.update_forward_refs() BehavioralEpochs.model_rebuild()
BehavioralEvents.update_forward_refs() BehavioralEvents.model_rebuild()
BehavioralTimeSeries.update_forward_refs() BehavioralTimeSeries.model_rebuild()
PupilTracking.update_forward_refs() PupilTracking.model_rebuild()
EyeTracking.update_forward_refs() EyeTracking.model_rebuild()
CompassDirection.update_forward_refs() CompassDirection.model_rebuild()
Position.update_forward_refs() Position.model_rebuild()

View file

@ -19,13 +19,9 @@ from .nwb_language import (
metamodel_version = "None" metamodel_version = "None"
version = "None" version = "None"
class WeakRefShimBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel,
__slots__ = '__weakref__'
class ConfiguredBaseModel(WeakRefShimBaseModel,
validate_assignment = True, validate_assignment = True,
validate_all = True, validate_default = True,
underscore_attrs_are_private = True,
extra = 'forbid', extra = 'forbid',
arbitrary_types_allowed = True, arbitrary_types_allowed = True,
use_enum_values = True): use_enum_values = True):
@ -36,8 +32,14 @@ class SpatialSeriesData(ConfiguredBaseModel):
""" """
1-D or 2-D array storing position or direction relative to some reference frame. 1-D or 2-D array storing position or direction relative to some reference frame.
""" """
name: str = Field("data", const=True)
unit: Optional[str] = Field(None, description="""Base unit of measurement for working with the data. The default value is 'meters'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion' and add 'offset'.""") unit: Optional[str] = Field(None, description="""Base unit of measurement for working with the data. The default value is 'meters'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion' and add 'offset'.""")
array: Optional[NDArray[Shape["* num_times, 1 x, 2 x_y, 3 x_y_z"], Number]] = Field(None) array: Optional[Union[
NDArray[Shape["* num_times"], Number],
NDArray[Shape["* num_times, 1 x"], Number],
NDArray[Shape["* num_times, 1 x, 2 x_y"], Number],
NDArray[Shape["* num_times, 1 x, 2 x_y, 3 x_y_z"], Number]
]] = Field(None)
class SpatialSeriesDataArray(Arraylike): class SpatialSeriesDataArray(Arraylike):
@ -49,7 +51,8 @@ class SpatialSeriesDataArray(Arraylike):
# Update forward refs # Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/postponed_annotations/ # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
SpatialSeriesData.update_forward_refs() SpatialSeriesData.model_rebuild()
SpatialSeriesDataArray.update_forward_refs() SpatialSeriesDataArray.model_rebuild()

View file

@ -19,13 +19,9 @@ from .core_nwb_base import (
metamodel_version = "None" metamodel_version = "None"
version = "None" version = "None"
class WeakRefShimBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel,
__slots__ = '__weakref__'
class ConfiguredBaseModel(WeakRefShimBaseModel,
validate_assignment = True, validate_assignment = True,
validate_all = True, validate_default = True,
underscore_attrs_are_private = True,
extra = 'forbid', extra = 'forbid',
arbitrary_types_allowed = True, arbitrary_types_allowed = True,
use_enum_values = True): use_enum_values = True):
@ -36,11 +32,13 @@ class Device(NWBContainer):
""" """
Metadata about a data acquisition device, e.g., recording system, electrode, microscope. Metadata about a data acquisition device, e.g., recording system, electrode, microscope.
""" """
name: str = Field(...)
description: Optional[str] = Field(None, description="""Description of the device (e.g., model, firmware version, processing software version, etc.) as free-form text.""") description: Optional[str] = Field(None, description="""Description of the device (e.g., model, firmware version, processing software version, etc.) as free-form text.""")
manufacturer: Optional[str] = Field(None, description="""The name of the manufacturer of the device.""") manufacturer: Optional[str] = Field(None, description="""The name of the manufacturer of the device.""")
# Update forward refs # Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/postponed_annotations/ # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
Device.update_forward_refs() Device.model_rebuild()

View file

@ -1,33 +0,0 @@
from __future__ import annotations
from datetime import datetime, date
from enum import Enum
from typing import List, Dict, Optional, Any, Union
from pydantic import BaseModel as BaseModel, Field
from nptyping import NDArray, Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64
import sys
if sys.version_info >= (3, 8):
from typing import Literal
else:
from typing_extensions import Literal
metamodel_version = "None"
version = "None"
class WeakRefShimBaseModel(BaseModel):
__slots__ = '__weakref__'
class ConfiguredBaseModel(WeakRefShimBaseModel,
validate_assignment = True,
validate_all = True,
underscore_attrs_are_private = True,
extra = 'forbid',
arbitrary_types_allowed = True,
use_enum_values = True):
pass
# Update forward refs
# see https://pydantic-docs.helpmanual.io/usage/postponed_annotations/

View file

@ -11,42 +11,29 @@ else:
from typing_extensions import Literal from typing_extensions import Literal
from .core_nwb_ecephys_include import (
ClusteringPeakOverRms,
FeatureExtractionDescription,
FeatureExtractionFeatures,
EventDetectionSourceIdx,
ClusteringTimes,
SpikeEventSeriesTimestamps,
EventDetectionTimes,
ClusterWaveformsWaveformMean,
SpikeEventSeriesData,
FeatureExtractionTimes,
ClusteringNum,
ElectricalSeriesChannelConversion,
ClusterWaveformsWaveformSd,
ElectricalSeriesData,
ElectricalSeriesElectrodes,
FeatureExtractionElectrodes
)
from .core_nwb_base import ( from .core_nwb_base import (
TimeSeries, TimeSeries,
NWBContainer, NWBContainer,
NWBDataInterface NWBDataInterface
) )
from .core_nwb_ecephys_include import (
FeatureExtractionElectrodes,
ClusterWaveformsWaveformSd,
ClusterWaveformsWaveformMean,
SpikeEventSeriesData,
ElectricalSeriesElectrodes,
ElectricalSeriesData,
FeatureExtractionFeatures
)
metamodel_version = "None" metamodel_version = "None"
version = "None" version = "None"
class WeakRefShimBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel,
__slots__ = '__weakref__'
class ConfiguredBaseModel(WeakRefShimBaseModel,
validate_assignment = True, validate_assignment = True,
validate_all = True, validate_default = True,
underscore_attrs_are_private = True,
extra = 'forbid', extra = 'forbid',
arbitrary_types_allowed = True, arbitrary_types_allowed = True,
use_enum_values = True): use_enum_values = True):
@ -57,16 +44,17 @@ class ElectricalSeries(TimeSeries):
""" """
A time series of acquired voltage data from extracellular recordings. The data field is an int or float array storing data in volts. The first dimension should always represent time. The second dimension, if present, should represent channels. A time series of acquired voltage data from extracellular recordings. The data field is an int or float array storing data in volts. The first dimension should always represent time. The second dimension, if present, should represent channels.
""" """
name: str = Field(...)
filtering: Optional[str] = Field(None, description="""Filtering applied to all channels of the data. For example, if this ElectricalSeries represents high-pass-filtered data (also known as AP Band), then this value could be \"High-pass 4-pole Bessel filter at 500 Hz\". If this ElectricalSeries represents low-pass-filtered LFP data and the type of filter is unknown, then this value could be \"Low-pass filter at 300 Hz\". If a non-standard filter type is used, provide as much detail about the filter properties as possible.""") filtering: Optional[str] = Field(None, description="""Filtering applied to all channels of the data. For example, if this ElectricalSeries represents high-pass-filtered data (also known as AP Band), then this value could be \"High-pass 4-pole Bessel filter at 500 Hz\". If this ElectricalSeries represents low-pass-filtered LFP data and the type of filter is unknown, then this value could be \"Low-pass filter at 300 Hz\". If a non-standard filter type is used, provide as much detail about the filter properties as possible.""")
data: ElectricalSeriesData = Field(..., description="""Recorded voltage data.""") data: ElectricalSeriesData = Field(..., description="""Recorded voltage data.""")
electrodes: ElectricalSeriesElectrodes = Field(..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""") electrodes: ElectricalSeriesElectrodes = Field(..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""")
channel_conversion: Optional[ElectricalSeriesChannelConversion] = Field(None, description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""") channel_conversion: Optional[List[float]] = Field(default_factory=list, description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""")
description: Optional[str] = Field(None, description="""Description of the time series.""") description: Optional[str] = Field(None, description="""Description of the time series.""")
comments: Optional[str] = Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") comments: Optional[str] = Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""")
starting_time: Optional[TimeSeriesStartingTime] = Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") starting_time: Optional[TimeSeriesStartingTime] = Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""")
timestamps: Optional[TimeSeriesTimestamps] = Field(None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") timestamps: Optional[List[float]] = Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""")
control: Optional[TimeSeriesControl] = Field(None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") control: Optional[List[int]] = Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""")
control_description: Optional[TimeSeriesControlDescription] = Field(None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") control_description: Optional[List[str]] = Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""")
sync: Optional[TimeSeriesSync] = Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") sync: Optional[TimeSeriesSync] = Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""")
@ -74,16 +62,17 @@ class SpikeEventSeries(ElectricalSeries):
""" """
Stores snapshots/snippets of recorded spike events (i.e., threshold crossings). This may also be raw data, as reported by ephys hardware. If so, the TimeSeries::description field should describe how events were detected. All SpikeEventSeries should reside in a module (under EventWaveform interface) even if the spikes were reported and stored by hardware. All events span the same recording channels and store snapshots of equal duration. TimeSeries::data array structure: [num events] [num channels] [num samples] (or [num events] [num samples] for single electrode). Stores snapshots/snippets of recorded spike events (i.e., threshold crossings). This may also be raw data, as reported by ephys hardware. If so, the TimeSeries::description field should describe how events were detected. All SpikeEventSeries should reside in a module (under EventWaveform interface) even if the spikes were reported and stored by hardware. All events span the same recording channels and store snapshots of equal duration. TimeSeries::data array structure: [num events] [num channels] [num samples] (or [num events] [num samples] for single electrode).
""" """
name: str = Field(...)
data: SpikeEventSeriesData = Field(..., description="""Spike waveforms.""") data: SpikeEventSeriesData = Field(..., description="""Spike waveforms.""")
timestamps: SpikeEventSeriesTimestamps = Field(..., description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time. Timestamps are required for the events. Unlike for TimeSeries, timestamps are required for SpikeEventSeries and are thus re-specified here.""") timestamps: List[float] = Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time. Timestamps are required for the events. Unlike for TimeSeries, timestamps are required for SpikeEventSeries and are thus re-specified here.""")
filtering: Optional[str] = Field(None, description="""Filtering applied to all channels of the data. For example, if this ElectricalSeries represents high-pass-filtered data (also known as AP Band), then this value could be \"High-pass 4-pole Bessel filter at 500 Hz\". If this ElectricalSeries represents low-pass-filtered LFP data and the type of filter is unknown, then this value could be \"Low-pass filter at 300 Hz\". If a non-standard filter type is used, provide as much detail about the filter properties as possible.""") filtering: Optional[str] = Field(None, description="""Filtering applied to all channels of the data. For example, if this ElectricalSeries represents high-pass-filtered data (also known as AP Band), then this value could be \"High-pass 4-pole Bessel filter at 500 Hz\". If this ElectricalSeries represents low-pass-filtered LFP data and the type of filter is unknown, then this value could be \"Low-pass filter at 300 Hz\". If a non-standard filter type is used, provide as much detail about the filter properties as possible.""")
electrodes: ElectricalSeriesElectrodes = Field(..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""") electrodes: ElectricalSeriesElectrodes = Field(..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""")
channel_conversion: Optional[ElectricalSeriesChannelConversion] = Field(None, description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""") channel_conversion: Optional[List[float]] = Field(default_factory=list, description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""")
description: Optional[str] = Field(None, description="""Description of the time series.""") description: Optional[str] = Field(None, description="""Description of the time series.""")
comments: Optional[str] = Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") comments: Optional[str] = Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""")
starting_time: Optional[TimeSeriesStartingTime] = Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") starting_time: Optional[TimeSeriesStartingTime] = Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""")
control: Optional[TimeSeriesControl] = Field(None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") control: Optional[List[int]] = Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""")
control_description: Optional[TimeSeriesControlDescription] = Field(None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") control_description: Optional[List[str]] = Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""")
sync: Optional[TimeSeriesSync] = Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") sync: Optional[TimeSeriesSync] = Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""")
@ -91,9 +80,10 @@ class FeatureExtraction(NWBDataInterface):
""" """
Features, such as PC1 and PC2, that are extracted from signals stored in a SpikeEventSeries or other source. Features, such as PC1 and PC2, that are extracted from signals stored in a SpikeEventSeries or other source.
""" """
description: FeatureExtractionDescription = Field(..., description="""Description of features (eg, ''PC1'') for each of the extracted features.""") name: str = Field(...)
description: List[str] = Field(default_factory=list, description="""Description of features (eg, ''PC1'') for each of the extracted features.""")
features: FeatureExtractionFeatures = Field(..., description="""Multi-dimensional array of features extracted from each event.""") features: FeatureExtractionFeatures = Field(..., description="""Multi-dimensional array of features extracted from each event.""")
times: FeatureExtractionTimes = Field(..., description="""Times of events that features correspond to (can be a link).""") times: List[float] = Field(default_factory=list, description="""Times of events that features correspond to (can be a link).""")
electrodes: FeatureExtractionElectrodes = Field(..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""") electrodes: FeatureExtractionElectrodes = Field(..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""")
@ -101,36 +91,41 @@ class EventDetection(NWBDataInterface):
""" """
Detected spike events from voltage trace(s). Detected spike events from voltage trace(s).
""" """
name: str = Field(...)
detection_method: str = Field(..., description="""Description of how events were detected, such as voltage threshold, or dV/dT threshold, as well as relevant values.""") detection_method: str = Field(..., description="""Description of how events were detected, such as voltage threshold, or dV/dT threshold, as well as relevant values.""")
source_idx: EventDetectionSourceIdx = Field(..., description="""Indices (zero-based) into source ElectricalSeries::data array corresponding to time of event. ''description'' should define what is meant by time of event (e.g., .25 ms before action potential peak, zero-crossing time, etc). The index points to each event from the raw data.""") source_idx: List[int] = Field(default_factory=list, description="""Indices (zero-based) into source ElectricalSeries::data array corresponding to time of event. ''description'' should define what is meant by time of event (e.g., .25 ms before action potential peak, zero-crossing time, etc). The index points to each event from the raw data.""")
times: EventDetectionTimes = Field(..., description="""Timestamps of events, in seconds.""") times: List[float] = Field(default_factory=list, description="""Timestamps of events, in seconds.""")
class EventWaveform(NWBDataInterface): class EventWaveform(NWBDataInterface):
""" """
Represents either the waveforms of detected events, as extracted from a raw data trace in /acquisition, or the event waveforms that were stored during experiment acquisition. Represents either the waveforms of detected events, as extracted from a raw data trace in /acquisition, or the event waveforms that were stored during experiment acquisition.
""" """
SpikeEventSeries: Optional[List[SpikeEventSeries]] = Field(default_factory=list, description="""SpikeEventSeries object(s) containing detected spike event waveforms.""") name: str = Field(...)
spike_event_series: Optional[List[SpikeEventSeries]] = Field(default_factory=list, description="""SpikeEventSeries object(s) containing detected spike event waveforms.""")
class FilteredEphys(NWBDataInterface): class FilteredEphys(NWBDataInterface):
""" """
Electrophysiology data from one or more channels that has been subjected to filtering. Examples of filtered data include Theta and Gamma (LFP has its own interface). FilteredEphys modules publish an ElectricalSeries for each filtered channel or set of channels. The name of each ElectricalSeries is arbitrary but should be informative. The source of the filtered data, whether this is from analysis of another time series or as acquired by hardware, should be noted in each's TimeSeries::description field. There is no assumed 1::1 correspondence between filtered ephys signals and electrodes, as a single signal can apply to many nearby electrodes, and one electrode may have different filtered (e.g., theta and/or gamma) signals represented. Filter properties should be noted in the ElectricalSeries 'filtering' attribute. Electrophysiology data from one or more channels that has been subjected to filtering. Examples of filtered data include Theta and Gamma (LFP has its own interface). FilteredEphys modules publish an ElectricalSeries for each filtered channel or set of channels. The name of each ElectricalSeries is arbitrary but should be informative. The source of the filtered data, whether this is from analysis of another time series or as acquired by hardware, should be noted in each's TimeSeries::description field. There is no assumed 1::1 correspondence between filtered ephys signals and electrodes, as a single signal can apply to many nearby electrodes, and one electrode may have different filtered (e.g., theta and/or gamma) signals represented. Filter properties should be noted in the ElectricalSeries 'filtering' attribute.
""" """
ElectricalSeries: List[ElectricalSeries] = Field(default_factory=list, description="""ElectricalSeries object(s) containing filtered electrophysiology data.""") name: str = Field(...)
electrical_series: List[ElectricalSeries] = Field(default_factory=list, description="""ElectricalSeries object(s) containing filtered electrophysiology data.""")
class LFP(NWBDataInterface): class LFP(NWBDataInterface):
""" """
LFP data from one or more channels. The electrode map in each published ElectricalSeries will identify which channels are providing LFP data. Filter properties should be noted in the ElectricalSeries 'filtering' attribute. LFP data from one or more channels. The electrode map in each published ElectricalSeries will identify which channels are providing LFP data. Filter properties should be noted in the ElectricalSeries 'filtering' attribute.
""" """
ElectricalSeries: List[ElectricalSeries] = Field(default_factory=list, description="""ElectricalSeries object(s) containing LFP data for one or more channels.""") name: str = Field(...)
electrical_series: List[ElectricalSeries] = Field(default_factory=list, description="""ElectricalSeries object(s) containing LFP data for one or more channels.""")
class ElectrodeGroup(NWBContainer): class ElectrodeGroup(NWBContainer):
""" """
A physical grouping of electrodes, e.g. a shank of an array. A physical grouping of electrodes, e.g. a shank of an array.
""" """
name: str = Field(...)
description: Optional[str] = Field(None, description="""Description of this electrode group.""") description: Optional[str] = Field(None, description="""Description of this electrode group.""")
location: Optional[str] = Field(None, description="""Location of electrode group. Specify the area, layer, comments on estimation of area/layer, etc. Use standard atlas names for anatomical regions when possible.""") location: Optional[str] = Field(None, description="""Location of electrode group. Specify the area, layer, comments on estimation of area/layer, etc. Use standard atlas names for anatomical regions when possible.""")
position: Optional[Any] = Field(None, description="""stereotaxic or common framework coordinates""") position: Optional[Any] = Field(None, description="""stereotaxic or common framework coordinates""")
@ -140,6 +135,7 @@ class ClusterWaveforms(NWBDataInterface):
""" """
DEPRECATED The mean waveform shape, including standard deviation, of the different clusters. Ideally, the waveform analysis should be performed on data that is only high-pass filtered. This is a separate module because it is expected to require updating. For example, IMEC probes may require different storage requirements to store/display mean waveforms, requiring a new interface or an extension of this one. DEPRECATED The mean waveform shape, including standard deviation, of the different clusters. Ideally, the waveform analysis should be performed on data that is only high-pass filtered. This is a separate module because it is expected to require updating. For example, IMEC probes may require different storage requirements to store/display mean waveforms, requiring a new interface or an extension of this one.
""" """
name: str = Field(...)
waveform_filtering: str = Field(..., description="""Filtering applied to data before generating mean/sd""") waveform_filtering: str = Field(..., description="""Filtering applied to data before generating mean/sd""")
waveform_mean: ClusterWaveformsWaveformMean = Field(..., description="""The mean waveform for each cluster, using the same indices for each wave as cluster numbers in the associated Clustering module (i.e, cluster 3 is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should be empty (e.g., zero- filled)""") waveform_mean: ClusterWaveformsWaveformMean = Field(..., description="""The mean waveform for each cluster, using the same indices for each wave as cluster numbers in the associated Clustering module (i.e, cluster 3 is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should be empty (e.g., zero- filled)""")
waveform_sd: ClusterWaveformsWaveformSd = Field(..., description="""Stdev of waveforms for each cluster, using the same indices as in mean""") waveform_sd: ClusterWaveformsWaveformSd = Field(..., description="""Stdev of waveforms for each cluster, using the same indices as in mean""")
@ -149,22 +145,24 @@ class Clustering(NWBDataInterface):
""" """
DEPRECATED Clustered spike data, whether from automatic clustering tools (e.g., klustakwik) or as a result of manual sorting. DEPRECATED Clustered spike data, whether from automatic clustering tools (e.g., klustakwik) or as a result of manual sorting.
""" """
name: str = Field(...)
description: str = Field(..., description="""Description of clusters or clustering, (e.g. cluster 0 is noise, clusters curated using Klusters, etc)""") description: str = Field(..., description="""Description of clusters or clustering, (e.g. cluster 0 is noise, clusters curated using Klusters, etc)""")
num: ClusteringNum = Field(..., description="""Cluster number of each event""") num: List[int] = Field(default_factory=list, description="""Cluster number of each event""")
peak_over_rms: ClusteringPeakOverRms = Field(..., description="""Maximum ratio of waveform peak to RMS on any channel in the cluster (provides a basic clustering metric).""") peak_over_rms: List[float] = Field(default_factory=list, description="""Maximum ratio of waveform peak to RMS on any channel in the cluster (provides a basic clustering metric).""")
times: ClusteringTimes = Field(..., description="""Times of clustered events, in seconds. This may be a link to times field in associated FeatureExtraction module.""") times: List[float] = Field(default_factory=list, description="""Times of clustered events, in seconds. This may be a link to times field in associated FeatureExtraction module.""")
# Update forward refs # Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/postponed_annotations/ # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
ElectricalSeries.update_forward_refs() ElectricalSeries.model_rebuild()
SpikeEventSeries.update_forward_refs() SpikeEventSeries.model_rebuild()
FeatureExtraction.update_forward_refs() FeatureExtraction.model_rebuild()
EventDetection.update_forward_refs() EventDetection.model_rebuild()
EventWaveform.update_forward_refs() EventWaveform.model_rebuild()
FilteredEphys.update_forward_refs() FilteredEphys.model_rebuild()
LFP.update_forward_refs() LFP.model_rebuild()
ElectrodeGroup.update_forward_refs() ElectrodeGroup.model_rebuild()
ClusterWaveforms.update_forward_refs() ClusterWaveforms.model_rebuild()
Clustering.update_forward_refs() Clustering.model_rebuild()

View file

@ -23,13 +23,9 @@ from .nwb_language import (
metamodel_version = "None" metamodel_version = "None"
version = "None" version = "None"
class WeakRefShimBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel,
__slots__ = '__weakref__'
class ConfiguredBaseModel(WeakRefShimBaseModel,
validate_assignment = True, validate_assignment = True,
validate_all = True, validate_default = True,
underscore_attrs_are_private = True,
extra = 'forbid', extra = 'forbid',
arbitrary_types_allowed = True, arbitrary_types_allowed = True,
use_enum_values = True): use_enum_values = True):
@ -40,8 +36,13 @@ class ElectricalSeriesData(ConfiguredBaseModel):
""" """
Recorded voltage data. Recorded voltage data.
""" """
name: str = Field("data", const=True)
unit: Optional[str] = Field(None, description="""Base unit of measurement for working with the data. This value is fixed to 'volts'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion', followed by 'channel_conversion' (if present), and then add 'offset'.""") unit: Optional[str] = Field(None, description="""Base unit of measurement for working with the data. This value is fixed to 'volts'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion', followed by 'channel_conversion' (if present), and then add 'offset'.""")
array: Optional[NDArray[Shape["* num_times, * num_channels, * num_samples"], Number]] = Field(None) array: Optional[Union[
NDArray[Shape["* num_times"], Number],
NDArray[Shape["* num_times, * num_channels"], Number],
NDArray[Shape["* num_times, * num_channels, * num_samples"], Number]
]] = Field(None)
class ElectricalSeriesDataArray(Arraylike): class ElectricalSeriesDataArray(Arraylike):
@ -55,25 +56,27 @@ class ElectricalSeriesElectrodes(DynamicTableRegion):
""" """
DynamicTableRegion pointer to the electrodes that this time series was generated from. DynamicTableRegion pointer to the electrodes that this time series was generated from.
""" """
name: str = Field("electrodes", const=True)
table: Optional[DynamicTable] = Field(None, description="""Reference to the DynamicTable object that this region applies to.""") table: Optional[DynamicTable] = Field(None, description="""Reference to the DynamicTable object that this region applies to.""")
description: Optional[str] = Field(None, description="""Description of what this table region points to.""") description: Optional[str] = Field(None, description="""Description of what this table region points to.""")
array: Optional[NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], ]] = Field(None) array: Optional[Union[
NDArray[Shape["* dim0"], Any],
NDArray[Shape["* dim0, * dim1"], Any],
class ElectricalSeriesChannelConversion(ConfiguredBaseModel): NDArray[Shape["* dim0, * dim1, * dim2"], Any],
""" NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any]
Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels. ]] = Field(None)
"""
axis: Optional[int] = Field(None, description="""The zero-indexed axis of the 'data' dataset that the channel-specific conversion factor corresponds to. This value is fixed to 1.""")
channel_conversion: Optional[List[float]] = Field(default_factory=list, description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""")
class SpikeEventSeriesData(ConfiguredBaseModel): class SpikeEventSeriesData(ConfiguredBaseModel):
""" """
Spike waveforms. Spike waveforms.
""" """
name: str = Field("data", const=True)
unit: Optional[str] = Field(None, description="""Unit of measurement for waveforms, which is fixed to 'volts'.""") unit: Optional[str] = Field(None, description="""Unit of measurement for waveforms, which is fixed to 'volts'.""")
array: Optional[NDArray[Shape["* num_events, * num_samples, * num_channels"], Number]] = Field(None) array: Optional[Union[
NDArray[Shape["* num_events, * num_samples"], Number],
NDArray[Shape["* num_events, * num_samples, * num_channels"], Number]
]] = Field(None)
class SpikeEventSeriesDataArray(Arraylike): class SpikeEventSeriesDataArray(Arraylike):
@ -83,135 +86,77 @@ class SpikeEventSeriesDataArray(Arraylike):
num_channels: Optional[float] = Field(None) num_channels: Optional[float] = Field(None)
class SpikeEventSeriesTimestamps(ConfiguredBaseModel):
"""
Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time. Timestamps are required for the events. Unlike for TimeSeries, timestamps are required for SpikeEventSeries and are thus re-specified here.
"""
interval: Optional[int] = Field(None, description="""Value is '1'""")
unit: Optional[str] = Field(None, description="""Unit of measurement for timestamps, which is fixed to 'seconds'.""")
timestamps: List[float] = Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time. Timestamps are required for the events. Unlike for TimeSeries, timestamps are required for SpikeEventSeries and are thus re-specified here.""")
class FeatureExtractionDescription(ConfiguredBaseModel):
"""
Description of features (eg, ''PC1'') for each of the extracted features.
"""
description: List[str] = Field(default_factory=list, description="""Description of features (eg, ''PC1'') for each of the extracted features.""")
class FeatureExtractionFeatures(ConfiguredBaseModel): class FeatureExtractionFeatures(ConfiguredBaseModel):
""" """
Multi-dimensional array of features extracted from each event. Multi-dimensional array of features extracted from each event.
""" """
name: str = Field("features", const=True)
array: Optional[NDArray[Shape["* num_events, * num_channels, * num_features"], Float32]] = Field(None) array: Optional[NDArray[Shape["* num_events, * num_channels, * num_features"], Float32]] = Field(None)
class FeatureExtractionFeaturesArray(Arraylike): class FeatureExtractionFeaturesArray(Arraylike):
num_events: Optional[float] = Field(None) num_events: float = Field(...)
num_channels: Optional[float] = Field(None) num_channels: float = Field(...)
num_features: Optional[float] = Field(None) num_features: float = Field(...)
class FeatureExtractionTimes(ConfiguredBaseModel):
"""
Times of events that features correspond to (can be a link).
"""
times: List[float] = Field(default_factory=list, description="""Times of events that features correspond to (can be a link).""")
class FeatureExtractionElectrodes(DynamicTableRegion): class FeatureExtractionElectrodes(DynamicTableRegion):
""" """
DynamicTableRegion pointer to the electrodes that this time series was generated from. DynamicTableRegion pointer to the electrodes that this time series was generated from.
""" """
name: str = Field("electrodes", const=True)
table: Optional[DynamicTable] = Field(None, description="""Reference to the DynamicTable object that this region applies to.""") table: Optional[DynamicTable] = Field(None, description="""Reference to the DynamicTable object that this region applies to.""")
description: Optional[str] = Field(None, description="""Description of what this table region points to.""") description: Optional[str] = Field(None, description="""Description of what this table region points to.""")
array: Optional[NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], ]] = Field(None) array: Optional[Union[
NDArray[Shape["* dim0"], Any],
NDArray[Shape["* dim0, * dim1"], Any],
class EventDetectionSourceIdx(ConfiguredBaseModel): NDArray[Shape["* dim0, * dim1, * dim2"], Any],
""" NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any]
Indices (zero-based) into source ElectricalSeries::data array corresponding to time of event. ''description'' should define what is meant by time of event (e.g., .25 ms before action potential peak, zero-crossing time, etc). The index points to each event from the raw data. ]] = Field(None)
"""
source_idx: List[int] = Field(default_factory=list, description="""Indices (zero-based) into source ElectricalSeries::data array corresponding to time of event. ''description'' should define what is meant by time of event (e.g., .25 ms before action potential peak, zero-crossing time, etc). The index points to each event from the raw data.""")
class EventDetectionTimes(ConfiguredBaseModel):
"""
Timestamps of events, in seconds.
"""
unit: Optional[str] = Field(None, description="""Unit of measurement for event times, which is fixed to 'seconds'.""")
times: List[float] = Field(default_factory=list, description="""Timestamps of events, in seconds.""")
class ClusterWaveformsWaveformMean(ConfiguredBaseModel): class ClusterWaveformsWaveformMean(ConfiguredBaseModel):
""" """
The mean waveform for each cluster, using the same indices for each wave as cluster numbers in the associated Clustering module (i.e, cluster 3 is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should be empty (e.g., zero- filled) The mean waveform for each cluster, using the same indices for each wave as cluster numbers in the associated Clustering module (i.e, cluster 3 is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should be empty (e.g., zero- filled)
""" """
name: str = Field("waveform_mean", const=True)
array: Optional[NDArray[Shape["* num_clusters, * num_samples"], Float32]] = Field(None) array: Optional[NDArray[Shape["* num_clusters, * num_samples"], Float32]] = Field(None)
class ClusterWaveformsWaveformMeanArray(Arraylike): class ClusterWaveformsWaveformMeanArray(Arraylike):
num_clusters: Optional[float] = Field(None) num_clusters: float = Field(...)
num_samples: Optional[float] = Field(None) num_samples: float = Field(...)
class ClusterWaveformsWaveformSd(ConfiguredBaseModel): class ClusterWaveformsWaveformSd(ConfiguredBaseModel):
""" """
Stdev of waveforms for each cluster, using the same indices as in mean Stdev of waveforms for each cluster, using the same indices as in mean
""" """
name: str = Field("waveform_sd", const=True)
array: Optional[NDArray[Shape["* num_clusters, * num_samples"], Float32]] = Field(None) array: Optional[NDArray[Shape["* num_clusters, * num_samples"], Float32]] = Field(None)
class ClusterWaveformsWaveformSdArray(Arraylike): class ClusterWaveformsWaveformSdArray(Arraylike):
num_clusters: Optional[float] = Field(None) num_clusters: float = Field(...)
num_samples: Optional[float] = Field(None) num_samples: float = Field(...)
class ClusteringNum(ConfiguredBaseModel):
"""
Cluster number of each event
"""
num: List[int] = Field(default_factory=list, description="""Cluster number of each event""")
class ClusteringPeakOverRms(ConfiguredBaseModel):
"""
Maximum ratio of waveform peak to RMS on any channel in the cluster (provides a basic clustering metric).
"""
peak_over_rms: List[float] = Field(default_factory=list, description="""Maximum ratio of waveform peak to RMS on any channel in the cluster (provides a basic clustering metric).""")
class ClusteringTimes(ConfiguredBaseModel):
"""
Times of clustered events, in seconds. This may be a link to times field in associated FeatureExtraction module.
"""
times: List[float] = Field(default_factory=list, description="""Times of clustered events, in seconds. This may be a link to times field in associated FeatureExtraction module.""")
# Update forward refs # Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/postponed_annotations/ # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
ElectricalSeriesData.update_forward_refs() ElectricalSeriesData.model_rebuild()
ElectricalSeriesDataArray.update_forward_refs() ElectricalSeriesDataArray.model_rebuild()
ElectricalSeriesElectrodes.update_forward_refs() ElectricalSeriesElectrodes.model_rebuild()
ElectricalSeriesChannelConversion.update_forward_refs() SpikeEventSeriesData.model_rebuild()
SpikeEventSeriesData.update_forward_refs() SpikeEventSeriesDataArray.model_rebuild()
SpikeEventSeriesDataArray.update_forward_refs() FeatureExtractionFeatures.model_rebuild()
SpikeEventSeriesTimestamps.update_forward_refs() FeatureExtractionFeaturesArray.model_rebuild()
FeatureExtractionDescription.update_forward_refs() FeatureExtractionElectrodes.model_rebuild()
FeatureExtractionFeatures.update_forward_refs() ClusterWaveformsWaveformMean.model_rebuild()
FeatureExtractionFeaturesArray.update_forward_refs() ClusterWaveformsWaveformMeanArray.model_rebuild()
FeatureExtractionTimes.update_forward_refs() ClusterWaveformsWaveformSd.model_rebuild()
FeatureExtractionElectrodes.update_forward_refs() ClusterWaveformsWaveformSdArray.model_rebuild()
EventDetectionSourceIdx.update_forward_refs()
EventDetectionTimes.update_forward_refs()
ClusterWaveformsWaveformMean.update_forward_refs()
ClusterWaveformsWaveformMeanArray.update_forward_refs()
ClusterWaveformsWaveformSd.update_forward_refs()
ClusterWaveformsWaveformSdArray.update_forward_refs()
ClusteringNum.update_forward_refs()
ClusteringPeakOverRms.update_forward_refs()
ClusteringTimes.update_forward_refs()

View file

@ -11,27 +11,23 @@ else:
from typing_extensions import Literal from typing_extensions import Literal
from .core_nwb_epoch_include import (
TimeIntervalsTimeseriesIndex,
TimeIntervalsTagsIndex,
TimeIntervalsTimeseries
)
from .hdmf_common_table import ( from .hdmf_common_table import (
DynamicTable DynamicTable
) )
from .core_nwb_epoch_include import (
TimeIntervalsTimeseriesIndex,
TimeIntervalsTimeseries,
TimeIntervalsTagsIndex
)
metamodel_version = "None" metamodel_version = "None"
version = "None" version = "None"
class WeakRefShimBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel,
__slots__ = '__weakref__'
class ConfiguredBaseModel(WeakRefShimBaseModel,
validate_assignment = True, validate_assignment = True,
validate_all = True, validate_default = True,
underscore_attrs_are_private = True,
extra = 'forbid', extra = 'forbid',
arbitrary_types_allowed = True, arbitrary_types_allowed = True,
use_enum_values = True): use_enum_values = True):
@ -42,6 +38,7 @@ class TimeIntervals(DynamicTable):
""" """
A container for aggregating epoch data and the TimeSeries that each epoch applies to. A container for aggregating epoch data and the TimeSeries that each epoch applies to.
""" """
name: str = Field(...)
start_time: Optional[List[float]] = Field(default_factory=list, description="""Start time of epoch, in seconds.""") start_time: Optional[List[float]] = Field(default_factory=list, description="""Start time of epoch, in seconds.""")
stop_time: Optional[List[float]] = Field(default_factory=list, description="""Stop time of epoch, in seconds.""") stop_time: Optional[List[float]] = Field(default_factory=list, description="""Stop time of epoch, in seconds.""")
tags: Optional[List[str]] = Field(default_factory=list, description="""User-defined tags that identify or categorize events.""") tags: Optional[List[str]] = Field(default_factory=list, description="""User-defined tags that identify or categorize events.""")
@ -50,11 +47,12 @@ class TimeIntervals(DynamicTable):
timeseries_index: Optional[TimeIntervalsTimeseriesIndex] = Field(None, description="""Index for timeseries.""") timeseries_index: Optional[TimeIntervalsTimeseriesIndex] = Field(None, description="""Index for timeseries.""")
colnames: Optional[str] = Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") colnames: Optional[str] = Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""")
description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""")
id: DynamicTableId = Field(..., description="""Array of unique identifiers for the rows of this dynamic table.""") id: List[int] = Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""")
VectorData: Optional[List[VectorData]] = Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") VectorData: Optional[List[VectorData]] = Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""")
# Update forward refs # Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/postponed_annotations/ # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
TimeIntervals.update_forward_refs() TimeIntervals.model_rebuild()

View file

@ -11,25 +11,21 @@ else:
from typing_extensions import Literal from typing_extensions import Literal
from .core_nwb_base import (
TimeSeriesReferenceVectorData
)
from .hdmf_common_table import ( from .hdmf_common_table import (
VectorIndex VectorIndex
) )
from .core_nwb_base import (
TimeSeriesReferenceVectorData
)
metamodel_version = "None" metamodel_version = "None"
version = "None" version = "None"
class WeakRefShimBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel,
__slots__ = '__weakref__'
class ConfiguredBaseModel(WeakRefShimBaseModel,
validate_assignment = True, validate_assignment = True,
validate_all = True, validate_default = True,
underscore_attrs_are_private = True,
extra = 'forbid', extra = 'forbid',
arbitrary_types_allowed = True, arbitrary_types_allowed = True,
use_enum_values = True): use_enum_values = True):
@ -40,31 +36,50 @@ class TimeIntervalsTagsIndex(VectorIndex):
""" """
Index for tags. Index for tags.
""" """
name: str = Field("tags_index", const=True)
target: Optional[VectorData] = Field(None, description="""Reference to the target dataset that this index applies to.""") target: Optional[VectorData] = Field(None, description="""Reference to the target dataset that this index applies to.""")
description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") description: Optional[str] = Field(None, description="""Description of what these vectors represent.""")
array: Optional[NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], ]] = Field(None) array: Optional[Union[
NDArray[Shape["* dim0"], Any],
NDArray[Shape["* dim0, * dim1"], Any],
NDArray[Shape["* dim0, * dim1, * dim2"], Any],
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any]
]] = Field(None)
class TimeIntervalsTimeseries(TimeSeriesReferenceVectorData): class TimeIntervalsTimeseries(TimeSeriesReferenceVectorData):
""" """
An index into a TimeSeries object. An index into a TimeSeries object.
""" """
name: str = Field("timeseries", const=True)
description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") description: Optional[str] = Field(None, description="""Description of what these vectors represent.""")
array: Optional[NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], ]] = Field(None) array: Optional[Union[
NDArray[Shape["* dim0"], Any],
NDArray[Shape["* dim0, * dim1"], Any],
NDArray[Shape["* dim0, * dim1, * dim2"], Any],
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any]
]] = Field(None)
class TimeIntervalsTimeseriesIndex(VectorIndex): class TimeIntervalsTimeseriesIndex(VectorIndex):
""" """
Index for timeseries. Index for timeseries.
""" """
name: str = Field("timeseries_index", const=True)
target: Optional[VectorData] = Field(None, description="""Reference to the target dataset that this index applies to.""") target: Optional[VectorData] = Field(None, description="""Reference to the target dataset that this index applies to.""")
description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") description: Optional[str] = Field(None, description="""Description of what these vectors represent.""")
array: Optional[NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], ]] = Field(None) array: Optional[Union[
NDArray[Shape["* dim0"], Any],
NDArray[Shape["* dim0, * dim1"], Any],
NDArray[Shape["* dim0, * dim1, * dim2"], Any],
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any]
]] = Field(None)
# Update forward refs # Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/postponed_annotations/ # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
TimeIntervalsTagsIndex.update_forward_refs() TimeIntervalsTagsIndex.model_rebuild()
TimeIntervalsTimeseries.update_forward_refs() TimeIntervalsTimeseries.model_rebuild()
TimeIntervalsTimeseriesIndex.update_forward_refs() TimeIntervalsTimeseriesIndex.model_rebuild()

View file

@ -11,35 +11,35 @@ else:
from typing_extensions import Literal from typing_extensions import Literal
from .core_nwb_file_include import ( from .hdmf_common_table import (
NWBFileScratch, DynamicTable
NWBFileGeneral,
NWBFileIntervals,
NWBFileFileCreateDate,
NWBFileUnits,
SubjectAge,
NWBFileStimulus,
NWBFileAcquisition,
NWBFileProcessing,
NWBFileAnalysis
) )
from .core_nwb_base import ( from .core_nwb_base import (
NWBContainer, NWBData,
NWBData ProcessingModule,
NWBDataInterface,
NWBContainer
)
from .core_nwb_file_include import (
NWBFileGeneral,
SubjectAge,
NWBFileIntervals,
NWBFileStimulus
)
from .core_nwb_misc import (
Units
) )
metamodel_version = "None" metamodel_version = "None"
version = "None" version = "None"
class WeakRefShimBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel,
__slots__ = '__weakref__'
class ConfiguredBaseModel(WeakRefShimBaseModel,
validate_assignment = True, validate_assignment = True,
validate_all = True, validate_default = True,
underscore_attrs_are_private = True,
extra = 'forbid', extra = 'forbid',
arbitrary_types_allowed = True, arbitrary_types_allowed = True,
use_enum_values = True): use_enum_values = True):
@ -50,6 +50,7 @@ class ScratchData(NWBData):
""" """
Any one-off datasets Any one-off datasets
""" """
name: str = Field(...)
notes: Optional[str] = Field(None, description="""Any notes the user has about the dataset being stored""") notes: Optional[str] = Field(None, description="""Any notes the user has about the dataset being stored""")
@ -57,35 +58,37 @@ class NWBFile(NWBContainer):
""" """
An NWB file storing cellular-based neurophysiology data from a single experimental session. An NWB file storing cellular-based neurophysiology data from a single experimental session.
""" """
name: str = Field("root", const=True)
nwb_version: Optional[str] = Field(None, description="""File version string. Use semantic versioning, e.g. 1.2.1. This will be the name of the format with trailing major, minor and patch numbers.""") nwb_version: Optional[str] = Field(None, description="""File version string. Use semantic versioning, e.g. 1.2.1. This will be the name of the format with trailing major, minor and patch numbers.""")
file_create_date: NWBFileFileCreateDate = Field(..., description="""A record of the date the file was created and of subsequent modifications. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted strings: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. The file can be created after the experiment was run, so this may differ from the experiment start time. Each modification to the nwb file adds a new entry to the array.""") file_create_date: List[datetime ] = Field(default_factory=list, description="""A record of the date the file was created and of subsequent modifications. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted strings: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. The file can be created after the experiment was run, so this may differ from the experiment start time. Each modification to the nwb file adds a new entry to the array.""")
identifier: str = Field(..., description="""A unique text identifier for the file. For example, concatenated lab name, file creation date/time and experimentalist, or a hash of these and/or other values. The goal is that the string should be unique to all other files.""") identifier: str = Field(..., description="""A unique text identifier for the file. For example, concatenated lab name, file creation date/time and experimentalist, or a hash of these and/or other values. The goal is that the string should be unique to all other files.""")
session_description: str = Field(..., description="""A description of the experimental session and data in the file.""") session_description: str = Field(..., description="""A description of the experimental session and data in the file.""")
session_start_time: date = Field(..., description="""Date and time of the experiment/session start. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted string: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds.""") session_start_time: datetime = Field(..., description="""Date and time of the experiment/session start. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted string: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds.""")
timestamps_reference_time: date = Field(..., description="""Date and time corresponding to time zero of all timestamps. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted string: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. All times stored in the file use this time as reference (i.e., time zero).""") timestamps_reference_time: datetime = Field(..., description="""Date and time corresponding to time zero of all timestamps. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted string: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. All times stored in the file use this time as reference (i.e., time zero).""")
acquisition: NWBFileAcquisition = Field(..., description="""Data streams recorded from the system, including ephys, ophys, tracking, etc. This group should be read-only after the experiment is completed and timestamps are corrected to a common timebase. The data stored here may be links to raw data stored in external NWB files. This will allow keeping bulky raw data out of the file while preserving the option of keeping some/all in the file. Acquired data includes tracking and experimental data streams (i.e., everything measured from the system). If bulky data is stored in the /acquisition group, the data can exist in a separate NWB file that is linked to by the file being used for processing and analysis.""") acquisition: Optional[List[Union[DynamicTable, NWBDataInterface]]] = Field(default_factory=list, description="""Data streams recorded from the system, including ephys, ophys, tracking, etc. This group should be read-only after the experiment is completed and timestamps are corrected to a common timebase. The data stored here may be links to raw data stored in external NWB files. This will allow keeping bulky raw data out of the file while preserving the option of keeping some/all in the file. Acquired data includes tracking and experimental data streams (i.e., everything measured from the system). If bulky data is stored in the /acquisition group, the data can exist in a separate NWB file that is linked to by the file being used for processing and analysis.""")
analysis: NWBFileAnalysis = Field(..., description="""Lab-specific and custom scientific analysis of data. There is no defined format for the content of this group - the format is up to the individual user/lab. To facilitate sharing analysis data between labs, the contents here should be stored in standard types (e.g., neurodata_types) and appropriately documented. The file can store lab-specific and custom data analysis without restriction on its form or schema, reducing data formatting restrictions on end users. Such data should be placed in the analysis group. The analysis data should be documented so that it could be shared with other labs.""") analysis: Optional[List[Union[DynamicTable, NWBContainer]]] = Field(default_factory=list, description="""Lab-specific and custom scientific analysis of data. There is no defined format for the content of this group - the format is up to the individual user/lab. To facilitate sharing analysis data between labs, the contents here should be stored in standard types (e.g., neurodata_types) and appropriately documented. The file can store lab-specific and custom data analysis without restriction on its form or schema, reducing data formatting restrictions on end users. Such data should be placed in the analysis group. The analysis data should be documented so that it could be shared with other labs.""")
scratch: Optional[NWBFileScratch] = Field(None, description="""A place to store one-off analysis results. Data placed here is not intended for sharing. By placing data here, users acknowledge that there is no guarantee that their data meets any standard.""") scratch: Optional[List[Union[DynamicTable, NWBContainer]]] = Field(default_factory=list, description="""A place to store one-off analysis results. Data placed here is not intended for sharing. By placing data here, users acknowledge that there is no guarantee that their data meets any standard.""")
processing: NWBFileProcessing = Field(..., description="""The home for ProcessingModules. These modules perform intermediate analysis of data that is necessary to perform before scientific analysis. Examples include spike clustering, extracting position from tracking data, stitching together image slices. ProcessingModules can be large and express many data sets from relatively complex analysis (e.g., spike detection and clustering) or small, representing extraction of position information from tracking video, or even binary lick/no-lick decisions. Common software tools (e.g., klustakwik, MClust) are expected to read/write data here. 'Processing' refers to intermediate analysis of the acquired data to make it more amenable to scientific analysis.""") processing: Optional[List[ProcessingModule]] = Field(default_factory=list, description="""The home for ProcessingModules. These modules perform intermediate analysis of data that is necessary to perform before scientific analysis. Examples include spike clustering, extracting position from tracking data, stitching together image slices. ProcessingModules can be large and express many data sets from relatively complex analysis (e.g., spike detection and clustering) or small, representing extraction of position information from tracking video, or even binary lick/no-lick decisions. Common software tools (e.g., klustakwik, MClust) are expected to read/write data here. 'Processing' refers to intermediate analysis of the acquired data to make it more amenable to scientific analysis.""")
stimulus: NWBFileStimulus = Field(..., description="""Data pushed into the system (eg, video stimulus, sound, voltage, etc) and secondary representations of that data (eg, measurements of something used as a stimulus). This group should be made read-only after experiment complete and timestamps are corrected to common timebase. Stores both presented stimuli and stimulus templates, the latter in case the same stimulus is presented multiple times, or is pulled from an external stimulus library. Stimuli are here defined as any signal that is pushed into the system as part of the experiment (eg, sound, video, voltage, etc). Many different experiments can use the same stimuli, and stimuli can be re-used during an experiment. The stimulus group is organized so that one version of template stimuli can be stored and these be used multiple times. These templates can exist in the present file or can be linked to a remote library file.""") stimulus: NWBFileStimulus = Field(..., description="""Data pushed into the system (eg, video stimulus, sound, voltage, etc) and secondary representations of that data (eg, measurements of something used as a stimulus). This group should be made read-only after experiment complete and timestamps are corrected to common timebase. Stores both presented stimuli and stimulus templates, the latter in case the same stimulus is presented multiple times, or is pulled from an external stimulus library. Stimuli are here defined as any signal that is pushed into the system as part of the experiment (eg, sound, video, voltage, etc). Many different experiments can use the same stimuli, and stimuli can be re-used during an experiment. The stimulus group is organized so that one version of template stimuli can be stored and these be used multiple times. These templates can exist in the present file or can be linked to a remote library file.""")
general: NWBFileGeneral = Field(..., description="""Experimental metadata, including protocol, notes and description of hardware device(s). The metadata stored in this section should be used to describe the experiment. Metadata necessary for interpreting the data is stored with the data. General experimental metadata, including animal strain, experimental protocols, experimenter, devices, etc, are stored under 'general'. Core metadata (e.g., that required to interpret data fields) is stored with the data itself, and implicitly defined by the file specification (e.g., time is in seconds). The strategy used here for storing non-core metadata is to use free-form text fields, such as would appear in sentences or paragraphs from a Methods section. Metadata fields are text to enable them to be more general, for example to represent ranges instead of numerical values. Machine-readable metadata is stored as attributes to these free-form datasets. All entries in the below table are to be included when data is present. Unused groups (e.g., intracellular_ephys in an optophysiology experiment) should not be created unless there is data to store within them.""") general: NWBFileGeneral = Field(..., description="""Experimental metadata, including protocol, notes and description of hardware device(s). The metadata stored in this section should be used to describe the experiment. Metadata necessary for interpreting the data is stored with the data. General experimental metadata, including animal strain, experimental protocols, experimenter, devices, etc, are stored under 'general'. Core metadata (e.g., that required to interpret data fields) is stored with the data itself, and implicitly defined by the file specification (e.g., time is in seconds). The strategy used here for storing non-core metadata is to use free-form text fields, such as would appear in sentences or paragraphs from a Methods section. Metadata fields are text to enable them to be more general, for example to represent ranges instead of numerical values. Machine-readable metadata is stored as attributes to these free-form datasets. All entries in the below table are to be included when data is present. Unused groups (e.g., intracellular_ephys in an optophysiology experiment) should not be created unless there is data to store within them.""")
intervals: Optional[NWBFileIntervals] = Field(None, description="""Experimental intervals, whether that be logically distinct sub-experiments having a particular scientific goal, trials (see trials subgroup) during an experiment, or epochs (see epochs subgroup) deriving from analysis of data.""") intervals: Optional[NWBFileIntervals] = Field(None, description="""Experimental intervals, whether that be logically distinct sub-experiments having a particular scientific goal, trials (see trials subgroup) during an experiment, or epochs (see epochs subgroup) deriving from analysis of data.""")
units: Optional[NWBFileUnits] = Field(None, description="""Data about sorted spike units.""") units: Optional[Units] = Field(None, description="""Data about sorted spike units.""")
class LabMetaData(NWBContainer): class LabMetaData(NWBContainer):
""" """
Lab-specific meta-data. Lab-specific meta-data.
""" """
None name: str = Field(...)
class Subject(NWBContainer): class Subject(NWBContainer):
""" """
Information about the animal or person from which the data was measured. Information about the animal or person from which the data was measured.
""" """
name: str = Field(...)
age: Optional[SubjectAge] = Field(None, description="""Age of subject. Can be supplied instead of 'date_of_birth'.""") age: Optional[SubjectAge] = Field(None, description="""Age of subject. Can be supplied instead of 'date_of_birth'.""")
date_of_birth: Optional[date] = Field(None, description="""Date of birth of subject. Can be supplied instead of 'age'.""") date_of_birth: Optional[datetime ] = Field(None, description="""Date of birth of subject. Can be supplied instead of 'age'.""")
description: Optional[str] = Field(None, description="""Description of subject and where subject came from (e.g., breeder, if animal).""") description: Optional[str] = Field(None, description="""Description of subject and where subject came from (e.g., breeder, if animal).""")
genotype: Optional[str] = Field(None, description="""Genetic strain. If absent, assume Wild Type (WT).""") genotype: Optional[str] = Field(None, description="""Genetic strain. If absent, assume Wild Type (WT).""")
sex: Optional[str] = Field(None, description="""Gender of subject.""") sex: Optional[str] = Field(None, description="""Gender of subject.""")
@ -96,9 +99,10 @@ class Subject(NWBContainer):
# Update forward refs # Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/postponed_annotations/ # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
ScratchData.update_forward_refs() ScratchData.model_rebuild()
NWBFile.update_forward_refs() NWBFile.model_rebuild()
LabMetaData.update_forward_refs() LabMetaData.model_rebuild()
Subject.update_forward_refs() Subject.model_rebuild()

View file

@ -11,40 +11,36 @@ else:
from typing_extensions import Literal from typing_extensions import Literal
from .core_nwb_file import (
LabMetaData,
ScratchData,
Subject
)
from .core_nwb_misc import (
Units
)
from .core_nwb_base import ( from .core_nwb_base import (
TimeSeries, TimeSeries,
Images, Images
NWBContainer,
NWBDataInterface,
ProcessingModule
) )
from .core_nwb_icephys import ( from .core_nwb_icephys import (
RepetitionsTable,
ExperimentalConditionsTable, ExperimentalConditionsTable,
IntracellularElectrode,
SimultaneousRecordingsTable,
SweepTable, SweepTable,
IntracellularElectrode,
SequentialRecordingsTable, SequentialRecordingsTable,
RepetitionsTable,
SimultaneousRecordingsTable,
IntracellularRecordingsTable IntracellularRecordingsTable
) )
from .core_nwb_ogen import (
OptogeneticStimulusSite
)
from .core_nwb_epoch import ( from .core_nwb_epoch import (
TimeIntervals TimeIntervals
) )
from .core_nwb_ogen import ( from .core_nwb_file import (
OptogeneticStimulusSite LabMetaData,
Subject
)
from .hdmf_common_table import (
DynamicTable
) )
from .core_nwb_device import ( from .core_nwb_device import (
@ -55,10 +51,6 @@ from .core_nwb_ecephys import (
ElectrodeGroup ElectrodeGroup
) )
from .hdmf_common_table import (
DynamicTable
)
from .core_nwb_ophys import ( from .core_nwb_ophys import (
ImagingPlane ImagingPlane
) )
@ -67,414 +59,113 @@ from .core_nwb_ophys import (
metamodel_version = "None" metamodel_version = "None"
version = "None" version = "None"
class WeakRefShimBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel,
__slots__ = '__weakref__'
class ConfiguredBaseModel(WeakRefShimBaseModel,
validate_assignment = True, validate_assignment = True,
validate_all = True, validate_default = True,
underscore_attrs_are_private = True,
extra = 'forbid', extra = 'forbid',
arbitrary_types_allowed = True, arbitrary_types_allowed = True,
use_enum_values = True): use_enum_values = True):
pass pass
class NWBFileFileCreateDate(ConfiguredBaseModel):
"""
A record of the date the file was created and of subsequent modifications. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted strings: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. The file can be created after the experiment was run, so this may differ from the experiment start time. Each modification to the nwb file adds a new entry to the array.
"""
file_create_date: List[date] = Field(default_factory=list, description="""A record of the date the file was created and of subsequent modifications. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted strings: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. The file can be created after the experiment was run, so this may differ from the experiment start time. Each modification to the nwb file adds a new entry to the array.""")
class NWBFileAcquisition(ConfiguredBaseModel):
"""
Data streams recorded from the system, including ephys, ophys, tracking, etc. This group should be read-only after the experiment is completed and timestamps are corrected to a common timebase. The data stored here may be links to raw data stored in external NWB files. This will allow keeping bulky raw data out of the file while preserving the option of keeping some/all in the file. Acquired data includes tracking and experimental data streams (i.e., everything measured from the system). If bulky data is stored in the /acquisition group, the data can exist in a separate NWB file that is linked to by the file being used for processing and analysis.
"""
NWBDataInterface: Optional[List[NWBDataInterface]] = Field(default_factory=list, description="""Acquired, raw data.""")
DynamicTable: Optional[List[DynamicTable]] = Field(default_factory=list, description="""Tabular data that is relevant to acquisition""")
class NWBFileAnalysis(ConfiguredBaseModel):
"""
Lab-specific and custom scientific analysis of data. There is no defined format for the content of this group - the format is up to the individual user/lab. To facilitate sharing analysis data between labs, the contents here should be stored in standard types (e.g., neurodata_types) and appropriately documented. The file can store lab-specific and custom data analysis without restriction on its form or schema, reducing data formatting restrictions on end users. Such data should be placed in the analysis group. The analysis data should be documented so that it could be shared with other labs.
"""
NWBContainer: Optional[List[NWBContainer]] = Field(default_factory=list, description="""Custom analysis results.""")
DynamicTable: Optional[List[DynamicTable]] = Field(default_factory=list, description="""Tabular data that is relevant to data stored in analysis""")
class NWBFileScratch(ConfiguredBaseModel):
"""
A place to store one-off analysis results. Data placed here is not intended for sharing. By placing data here, users acknowledge that there is no guarantee that their data meets any standard.
"""
ScratchData: Optional[List[ScratchData]] = Field(default_factory=list, description="""Any one-off datasets""")
NWBContainer: Optional[List[NWBContainer]] = Field(default_factory=list, description="""Any one-off containers""")
DynamicTable: Optional[List[DynamicTable]] = Field(default_factory=list, description="""Any one-off tables""")
class NWBFileProcessing(ConfiguredBaseModel):
"""
The home for ProcessingModules. These modules perform intermediate analysis of data that is necessary to perform before scientific analysis. Examples include spike clustering, extracting position from tracking data, stitching together image slices. ProcessingModules can be large and express many data sets from relatively complex analysis (e.g., spike detection and clustering) or small, representing extraction of position information from tracking video, or even binary lick/no-lick decisions. Common software tools (e.g., klustakwik, MClust) are expected to read/write data here. 'Processing' refers to intermediate analysis of the acquired data to make it more amenable to scientific analysis.
"""
ProcessingModule: Optional[List[ProcessingModule]] = Field(default_factory=list, description="""Intermediate analysis of acquired data.""")
class NWBFileStimulus(ConfiguredBaseModel): class NWBFileStimulus(ConfiguredBaseModel):
""" """
Data pushed into the system (eg, video stimulus, sound, voltage, etc) and secondary representations of that data (eg, measurements of something used as a stimulus). This group should be made read-only after experiment complete and timestamps are corrected to common timebase. Stores both presented stimuli and stimulus templates, the latter in case the same stimulus is presented multiple times, or is pulled from an external stimulus library. Stimuli are here defined as any signal that is pushed into the system as part of the experiment (eg, sound, video, voltage, etc). Many different experiments can use the same stimuli, and stimuli can be re-used during an experiment. The stimulus group is organized so that one version of template stimuli can be stored and these be used multiple times. These templates can exist in the present file or can be linked to a remote library file. Data pushed into the system (eg, video stimulus, sound, voltage, etc) and secondary representations of that data (eg, measurements of something used as a stimulus). This group should be made read-only after experiment complete and timestamps are corrected to common timebase. Stores both presented stimuli and stimulus templates, the latter in case the same stimulus is presented multiple times, or is pulled from an external stimulus library. Stimuli are here defined as any signal that is pushed into the system as part of the experiment (eg, sound, video, voltage, etc). Many different experiments can use the same stimuli, and stimuli can be re-used during an experiment. The stimulus group is organized so that one version of template stimuli can be stored and these be used multiple times. These templates can exist in the present file or can be linked to a remote library file.
""" """
presentation: NWBFileStimulusPresentation = Field(..., description="""Stimuli presented during the experiment.""") name: str = Field("stimulus", const=True)
templates: NWBFileStimulusTemplates = Field(..., description="""Template stimuli. Timestamps in templates are based on stimulus design and are relative to the beginning of the stimulus. When templates are used, the stimulus instances must convert presentation times to the experiment`s time reference frame.""") presentation: Optional[List[TimeSeries]] = Field(default_factory=list, description="""Stimuli presented during the experiment.""")
templates: Optional[List[Union[Images, TimeSeries]]] = Field(default_factory=list, description="""Template stimuli. Timestamps in templates are based on stimulus design and are relative to the beginning of the stimulus. When templates are used, the stimulus instances must convert presentation times to the experiment`s time reference frame.""")
class NWBFileStimulusPresentation(ConfiguredBaseModel):
"""
Stimuli presented during the experiment.
"""
TimeSeries: Optional[List[TimeSeries]] = Field(default_factory=list, description="""TimeSeries objects containing data of presented stimuli.""")
class NWBFileStimulusTemplates(ConfiguredBaseModel):
"""
Template stimuli. Timestamps in templates are based on stimulus design and are relative to the beginning of the stimulus. When templates are used, the stimulus instances must convert presentation times to the experiment`s time reference frame.
"""
TimeSeries: Optional[List[TimeSeries]] = Field(default_factory=list, description="""TimeSeries objects containing template data of presented stimuli.""")
Images: Optional[List[Images]] = Field(default_factory=list, description="""Images objects containing images of presented stimuli.""")
class NWBFileGeneral(ConfiguredBaseModel): class NWBFileGeneral(ConfiguredBaseModel):
""" """
Experimental metadata, including protocol, notes and description of hardware device(s). The metadata stored in this section should be used to describe the experiment. Metadata necessary for interpreting the data is stored with the data. General experimental metadata, including animal strain, experimental protocols, experimenter, devices, etc, are stored under 'general'. Core metadata (e.g., that required to interpret data fields) is stored with the data itself, and implicitly defined by the file specification (e.g., time is in seconds). The strategy used here for storing non-core metadata is to use free-form text fields, such as would appear in sentences or paragraphs from a Methods section. Metadata fields are text to enable them to be more general, for example to represent ranges instead of numerical values. Machine-readable metadata is stored as attributes to these free-form datasets. All entries in the below table are to be included when data is present. Unused groups (e.g., intracellular_ephys in an optophysiology experiment) should not be created unless there is data to store within them. Experimental metadata, including protocol, notes and description of hardware device(s). The metadata stored in this section should be used to describe the experiment. Metadata necessary for interpreting the data is stored with the data. General experimental metadata, including animal strain, experimental protocols, experimenter, devices, etc, are stored under 'general'. Core metadata (e.g., that required to interpret data fields) is stored with the data itself, and implicitly defined by the file specification (e.g., time is in seconds). The strategy used here for storing non-core metadata is to use free-form text fields, such as would appear in sentences or paragraphs from a Methods section. Metadata fields are text to enable them to be more general, for example to represent ranges instead of numerical values. Machine-readable metadata is stored as attributes to these free-form datasets. All entries in the below table are to be included when data is present. Unused groups (e.g., intracellular_ephys in an optophysiology experiment) should not be created unless there is data to store within them.
""" """
name: str = Field("general", const=True)
data_collection: Optional[str] = Field(None, description="""Notes about data collection and analysis.""") data_collection: Optional[str] = Field(None, description="""Notes about data collection and analysis.""")
experiment_description: Optional[str] = Field(None, description="""General description of the experiment.""") experiment_description: Optional[str] = Field(None, description="""General description of the experiment.""")
experimenter: Optional[NWBFileGeneralExperimenter] = Field(None, description="""Name of person(s) who performed the experiment. Can also specify roles of different people involved.""") experimenter: Optional[List[str]] = Field(default_factory=list, description="""Name of person(s) who performed the experiment. Can also specify roles of different people involved.""")
institution: Optional[str] = Field(None, description="""Institution(s) where experiment was performed.""") institution: Optional[str] = Field(None, description="""Institution(s) where experiment was performed.""")
keywords: Optional[NWBFileGeneralKeywords] = Field(None, description="""Terms to search over.""") keywords: Optional[List[str]] = Field(default_factory=list, description="""Terms to search over.""")
lab: Optional[str] = Field(None, description="""Laboratory where experiment was performed.""") lab: Optional[str] = Field(None, description="""Laboratory where experiment was performed.""")
notes: Optional[str] = Field(None, description="""Notes about the experiment.""") notes: Optional[str] = Field(None, description="""Notes about the experiment.""")
pharmacology: Optional[str] = Field(None, description="""Description of drugs used, including how and when they were administered. Anesthesia(s), painkiller(s), etc., plus dosage, concentration, etc.""") pharmacology: Optional[str] = Field(None, description="""Description of drugs used, including how and when they were administered. Anesthesia(s), painkiller(s), etc., plus dosage, concentration, etc.""")
protocol: Optional[str] = Field(None, description="""Experimental protocol, if applicable. e.g., include IACUC protocol number.""") protocol: Optional[str] = Field(None, description="""Experimental protocol, if applicable. e.g., include IACUC protocol number.""")
related_publications: Optional[NWBFileGeneralRelatedPublications] = Field(None, description="""Publication information. PMID, DOI, URL, etc.""") related_publications: Optional[List[str]] = Field(default_factory=list, description="""Publication information. PMID, DOI, URL, etc.""")
session_id: Optional[str] = Field(None, description="""Lab-specific ID for the session.""") session_id: Optional[str] = Field(None, description="""Lab-specific ID for the session.""")
slices: Optional[str] = Field(None, description="""Description of slices, including information about preparation thickness, orientation, temperature, and bath solution.""") slices: Optional[str] = Field(None, description="""Description of slices, including information about preparation thickness, orientation, temperature, and bath solution.""")
source_script: Optional[NWBFileGeneralSourceScript] = Field(None, description="""Script file or link to public source code used to create this NWB file.""") source_script: Optional[NWBFileGeneralSourceScript] = Field(None, description="""Script file or link to public source code used to create this NWB file.""")
stimulus: Optional[str] = Field(None, description="""Notes about stimuli, such as how and where they were presented.""") stimulus: Optional[str] = Field(None, description="""Notes about stimuli, such as how and where they were presented.""")
surgery: Optional[str] = Field(None, description="""Narrative description about surgery/surgeries, including date(s) and who performed surgery.""") surgery: Optional[str] = Field(None, description="""Narrative description about surgery/surgeries, including date(s) and who performed surgery.""")
virus: Optional[str] = Field(None, description="""Information about virus(es) used in experiments, including virus ID, source, date made, injection location, volume, etc.""") virus: Optional[str] = Field(None, description="""Information about virus(es) used in experiments, including virus ID, source, date made, injection location, volume, etc.""")
LabMetaData: Optional[List[LabMetaData]] = Field(default_factory=list, description="""Place-holder than can be extended so that lab-specific meta-data can be placed in /general.""") lab_meta_data: Optional[List[LabMetaData]] = Field(default_factory=list, description="""Place-holder than can be extended so that lab-specific meta-data can be placed in /general.""")
devices: Optional[NWBFileGeneralDevices] = Field(None, description="""Description of hardware devices used during experiment, e.g., monitors, ADC boards, microscopes, etc.""") devices: Optional[List[Device]] = Field(default_factory=list, description="""Description of hardware devices used during experiment, e.g., monitors, ADC boards, microscopes, etc.""")
subject: Optional[NWBFileGeneralSubject] = Field(None, description="""Information about the animal or person from which the data was measured.""") subject: Optional[Subject] = Field(None, description="""Information about the animal or person from which the data was measured.""")
extracellular_ephys: Optional[NWBFileGeneralExtracellularEphys] = Field(None, description="""Metadata related to extracellular electrophysiology.""") extracellular_ephys: Optional[NWBFileGeneralExtracellularEphys] = Field(None, description="""Metadata related to extracellular electrophysiology.""")
intracellular_ephys: Optional[NWBFileGeneralIntracellularEphys] = Field(None, description="""Metadata related to intracellular electrophysiology.""") intracellular_ephys: Optional[NWBFileGeneralIntracellularEphys] = Field(None, description="""Metadata related to intracellular electrophysiology.""")
optogenetics: Optional[NWBFileGeneralOptogenetics] = Field(None, description="""Metadata describing optogenetic stimuluation.""") optogenetics: Optional[List[OptogeneticStimulusSite]] = Field(default_factory=list, description="""Metadata describing optogenetic stimuluation.""")
optophysiology: Optional[NWBFileGeneralOptophysiology] = Field(None, description="""Metadata related to optophysiology.""") optophysiology: Optional[List[ImagingPlane]] = Field(default_factory=list, description="""Metadata related to optophysiology.""")
class NWBFileGeneralExperimenter(ConfiguredBaseModel):
"""
Name of person(s) who performed the experiment. Can also specify roles of different people involved.
"""
experimenter: Optional[List[str]] = Field(default_factory=list, description="""Name of person(s) who performed the experiment. Can also specify roles of different people involved.""")
class NWBFileGeneralKeywords(ConfiguredBaseModel):
"""
Terms to search over.
"""
keywords: Optional[List[str]] = Field(default_factory=list, description="""Terms to search over.""")
class NWBFileGeneralRelatedPublications(ConfiguredBaseModel):
"""
Publication information. PMID, DOI, URL, etc.
"""
related_publications: Optional[List[str]] = Field(default_factory=list, description="""Publication information. PMID, DOI, URL, etc.""")
class NWBFileGeneralSourceScript(ConfiguredBaseModel): class NWBFileGeneralSourceScript(ConfiguredBaseModel):
""" """
Script file or link to public source code used to create this NWB file. Script file or link to public source code used to create this NWB file.
""" """
name: str = Field("source_script", const=True)
file_name: Optional[str] = Field(None, description="""Name of script file.""") file_name: Optional[str] = Field(None, description="""Name of script file.""")
class NWBFileGeneralDevices(ConfiguredBaseModel):
"""
Description of hardware devices used during experiment, e.g., monitors, ADC boards, microscopes, etc.
"""
Device: Optional[List[Device]] = Field(default_factory=list, description="""Data acquisition devices.""")
class NWBFileGeneralSubject(Subject):
"""
Information about the animal or person from which the data was measured.
"""
age: Optional[SubjectAge] = Field(None, description="""Age of subject. Can be supplied instead of 'date_of_birth'.""")
date_of_birth: Optional[date] = Field(None, description="""Date of birth of subject. Can be supplied instead of 'age'.""")
description: Optional[str] = Field(None, description="""Description of subject and where subject came from (e.g., breeder, if animal).""")
genotype: Optional[str] = Field(None, description="""Genetic strain. If absent, assume Wild Type (WT).""")
sex: Optional[str] = Field(None, description="""Gender of subject.""")
species: Optional[str] = Field(None, description="""Species of subject.""")
strain: Optional[str] = Field(None, description="""Strain of subject.""")
subject_id: Optional[str] = Field(None, description="""ID of animal/person used/participating in experiment (lab convention).""")
weight: Optional[str] = Field(None, description="""Weight at time of experiment, at time of surgery and at other important times.""")
class NWBFileGeneralExtracellularEphys(ConfiguredBaseModel): class NWBFileGeneralExtracellularEphys(ConfiguredBaseModel):
""" """
Metadata related to extracellular electrophysiology. Metadata related to extracellular electrophysiology.
""" """
ElectrodeGroup: Optional[List[ElectrodeGroup]] = Field(default_factory=list, description="""Physical group of electrodes.""") name: str = Field("extracellular_ephys", const=True)
electrodes: Optional[NWBFileGeneralExtracellularEphysElectrodes] = Field(None, description="""A table of all electrodes (i.e. channels) used for recording.""") electrode_group: Optional[List[ElectrodeGroup]] = Field(default_factory=list, description="""Physical group of electrodes.""")
electrodes: Optional[DynamicTable] = Field(None, description="""A table of all electrodes (i.e. channels) used for recording.""")
class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable):
"""
A table of all electrodes (i.e. channels) used for recording.
"""
x: Optional[List[float]] = Field(default_factory=list, description="""x coordinate of the channel location in the brain (+x is posterior).""")
y: Optional[List[float]] = Field(default_factory=list, description="""y coordinate of the channel location in the brain (+y is inferior).""")
z: Optional[List[float]] = Field(default_factory=list, description="""z coordinate of the channel location in the brain (+z is right).""")
imp: Optional[List[float]] = Field(default_factory=list, description="""Impedance of the channel, in ohms.""")
location: Optional[List[str]] = Field(default_factory=list, description="""Location of the electrode (channel). Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""")
filtering: Optional[List[str]] = Field(default_factory=list, description="""Description of hardware filtering, including the filter name and frequency cutoffs.""")
group: Optional[List[ElectrodeGroup]] = Field(default_factory=list, description="""Reference to the ElectrodeGroup this electrode is a part of.""")
group_name: Optional[List[str]] = Field(default_factory=list, description="""Name of the ElectrodeGroup this electrode is a part of.""")
rel_x: Optional[List[float]] = Field(default_factory=list, description="""x coordinate in electrode group""")
rel_y: Optional[List[float]] = Field(default_factory=list, description="""y coordinate in electrode group""")
rel_z: Optional[List[float]] = Field(default_factory=list, description="""z coordinate in electrode group""")
reference: Optional[List[str]] = Field(default_factory=list, description="""Description of the reference electrode and/or reference scheme used for this electrode, e.g., \"stainless steel skull screw\" or \"online common average referencing\".""")
colnames: Optional[str] = Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""")
description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""")
id: DynamicTableId = Field(..., description="""Array of unique identifiers for the rows of this dynamic table.""")
VectorData: Optional[List[VectorData]] = Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""")
class NWBFileGeneralIntracellularEphys(ConfiguredBaseModel): class NWBFileGeneralIntracellularEphys(ConfiguredBaseModel):
""" """
Metadata related to intracellular electrophysiology. Metadata related to intracellular electrophysiology.
""" """
name: str = Field("intracellular_ephys", const=True)
filtering: Optional[str] = Field(None, description="""[DEPRECATED] Use IntracellularElectrode.filtering instead. Description of filtering used. Includes filtering type and parameters, frequency fall-off, etc. If this changes between TimeSeries, filter description should be stored as a text attribute for each TimeSeries.""") filtering: Optional[str] = Field(None, description="""[DEPRECATED] Use IntracellularElectrode.filtering instead. Description of filtering used. Includes filtering type and parameters, frequency fall-off, etc. If this changes between TimeSeries, filter description should be stored as a text attribute for each TimeSeries.""")
IntracellularElectrode: Optional[List[IntracellularElectrode]] = Field(default_factory=list, description="""An intracellular electrode.""") intracellular_electrode: Optional[List[IntracellularElectrode]] = Field(default_factory=list, description="""An intracellular electrode.""")
sweep_table: Optional[NWBFileGeneralIntracellularEphysSweepTable] = Field(None, description="""[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.""") sweep_table: Optional[SweepTable] = Field(None, description="""[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.""")
intracellular_recordings: Optional[NWBFileGeneralIntracellularEphysIntracellularRecordings] = Field(None, description="""A table to group together a stimulus and response from a single electrode and a single simultaneous recording. Each row in the table represents a single recording consisting typically of a stimulus and a corresponding response. In some cases, however, only a stimulus or a response are recorded as as part of an experiment. In this case both, the stimulus and response will point to the same TimeSeries while the idx_start and count of the invalid column will be set to -1, thus, indicating that no values have been recorded for the stimulus or response, respectively. Note, a recording MUST contain at least a stimulus or a response. Typically the stimulus and response are PatchClampSeries. However, the use of AD/DA channels that are not associated to an electrode is also common in intracellular electrophysiology, in which case other TimeSeries may be used.""") intracellular_recordings: Optional[IntracellularRecordingsTable] = Field(None, description="""A table to group together a stimulus and response from a single electrode and a single simultaneous recording. Each row in the table represents a single recording consisting typically of a stimulus and a corresponding response. In some cases, however, only a stimulus or a response are recorded as as part of an experiment. In this case both, the stimulus and response will point to the same TimeSeries while the idx_start and count of the invalid column will be set to -1, thus, indicating that no values have been recorded for the stimulus or response, respectively. Note, a recording MUST contain at least a stimulus or a response. Typically the stimulus and response are PatchClampSeries. However, the use of AD/DA channels that are not associated to an electrode is also common in intracellular electrophysiology, in which case other TimeSeries may be used.""")
simultaneous_recordings: Optional[NWBFileGeneralIntracellularEphysSimultaneousRecordings] = Field(None, description="""A table for grouping different intracellular recordings from the IntracellularRecordingsTable table together that were recorded simultaneously from different electrodes""") simultaneous_recordings: Optional[SimultaneousRecordingsTable] = Field(None, description="""A table for grouping different intracellular recordings from the IntracellularRecordingsTable table together that were recorded simultaneously from different electrodes""")
sequential_recordings: Optional[NWBFileGeneralIntracellularEphysSequentialRecordings] = Field(None, description="""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.""") sequential_recordings: Optional[SequentialRecordingsTable] = Field(None, description="""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.""")
repetitions: Optional[NWBFileGeneralIntracellularEphysRepetitions] = Field(None, description="""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.""") repetitions: Optional[RepetitionsTable] = Field(None, description="""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.""")
experimental_conditions: Optional[NWBFileGeneralIntracellularEphysExperimentalConditions] = Field(None, description="""A table for grouping different intracellular recording repetitions together that belong to the same experimental experimental_conditions.""") experimental_conditions: Optional[ExperimentalConditionsTable] = Field(None, description="""A table for grouping different intracellular recording repetitions together that belong to the same experimental experimental_conditions.""")
class NWBFileGeneralIntracellularEphysSweepTable(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.
"""
sweep_number: Optional[List[int]] = Field(default_factory=list, description="""Sweep number of the PatchClampSeries in that row.""")
series: Optional[List[PatchClampSeries]] = Field(default_factory=list, description="""The PatchClampSeries with the sweep number in that row.""")
series_index: SweepTableSeriesIndex = Field(..., description="""Index for series.""")
colnames: Optional[str] = Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""")
description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""")
id: DynamicTableId = Field(..., description="""Array of unique identifiers for the rows of this dynamic table.""")
VectorData: Optional[List[VectorData]] = Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""")
class NWBFileGeneralIntracellularEphysIntracellularRecordings(IntracellularRecordingsTable):
"""
A table to group together a stimulus and response from a single electrode and a single simultaneous recording. Each row in the table represents a single recording consisting typically of a stimulus and a corresponding response. In some cases, however, only a stimulus or a response are recorded as as part of an experiment. In this case both, the stimulus and response will point to the same TimeSeries while the idx_start and count of the invalid column will be set to -1, thus, indicating that no values have been recorded for the stimulus or response, respectively. Note, a recording MUST contain at least a stimulus or a response. Typically the stimulus and response are PatchClampSeries. However, the use of AD/DA channels that are not associated to an electrode is also common in intracellular electrophysiology, in which case other TimeSeries may be used.
"""
description: Optional[str] = Field(None, description="""Description of the contents of this table. Inherited from AlignedDynamicTable and overwritten here to fix the value of the attribute.""")
electrodes: IntracellularRecordingsTableElectrodes = Field(..., description="""Table for storing intracellular electrode related metadata.""")
stimuli: IntracellularRecordingsTableStimuli = Field(..., description="""Table for storing intracellular stimulus related metadata.""")
responses: IntracellularRecordingsTableResponses = Field(..., description="""Table for storing intracellular response related metadata.""")
categories: Optional[str] = Field(None, description="""The names of the categories in this AlignedDynamicTable. Each category is represented by one DynamicTable stored in the parent group. This attribute should be used to specify an order of categories and the category names must match the names of the corresponding DynamicTable in the group.""")
DynamicTable: Optional[List[DynamicTable]] = Field(default_factory=list, description="""A DynamicTable representing a particular category for columns in the AlignedDynamicTable parent container. The table MUST be aligned with (i.e., have the same number of rows) as all other DynamicTables stored in the AlignedDynamicTable parent container. The name of the category is given by the name of the DynamicTable and its description by the description attribute of the DynamicTable.""")
colnames: Optional[str] = Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""")
id: DynamicTableId = Field(..., description="""Array of unique identifiers for the rows of this dynamic table.""")
VectorData: Optional[List[VectorData]] = Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""")
class NWBFileGeneralIntracellularEphysSimultaneousRecordings(SimultaneousRecordingsTable):
"""
A table for grouping different intracellular recordings from the IntracellularRecordingsTable table together that were recorded simultaneously from different electrodes
"""
recordings: SimultaneousRecordingsTableRecordings = Field(..., description="""A reference to one or more rows in the IntracellularRecordingsTable table.""")
recordings_index: SimultaneousRecordingsTableRecordingsIndex = Field(..., description="""Index dataset for the recordings column.""")
colnames: Optional[str] = Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""")
description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""")
id: DynamicTableId = Field(..., description="""Array of unique identifiers for the rows of this dynamic table.""")
VectorData: Optional[List[VectorData]] = Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""")
class NWBFileGeneralIntracellularEphysSequentialRecordings(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.
"""
simultaneous_recordings: SequentialRecordingsTableSimultaneousRecordings = Field(..., description="""A reference to one or more rows in the SimultaneousRecordingsTable table.""")
simultaneous_recordings_index: SequentialRecordingsTableSimultaneousRecordingsIndex = Field(..., description="""Index dataset for the simultaneous_recordings column.""")
stimulus_type: Optional[List[str]] = Field(default_factory=list, description="""The type of stimulus used for the sequential recording.""")
colnames: Optional[str] = Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""")
description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""")
id: DynamicTableId = Field(..., description="""Array of unique identifiers for the rows of this dynamic table.""")
VectorData: Optional[List[VectorData]] = Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""")
class NWBFileGeneralIntracellularEphysRepetitions(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.
"""
sequential_recordings: RepetitionsTableSequentialRecordings = Field(..., description="""A reference to one or more rows in the SequentialRecordingsTable table.""")
sequential_recordings_index: RepetitionsTableSequentialRecordingsIndex = Field(..., description="""Index dataset for the sequential_recordings column.""")
colnames: Optional[str] = Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""")
description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""")
id: DynamicTableId = Field(..., description="""Array of unique identifiers for the rows of this dynamic table.""")
VectorData: Optional[List[VectorData]] = Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""")
class NWBFileGeneralIntracellularEphysExperimentalConditions(ExperimentalConditionsTable):
"""
A table for grouping different intracellular recording repetitions together that belong to the same experimental experimental_conditions.
"""
repetitions: ExperimentalConditionsTableRepetitions = Field(..., description="""A reference to one or more rows in the RepetitionsTable table.""")
repetitions_index: ExperimentalConditionsTableRepetitionsIndex = Field(..., description="""Index dataset for the repetitions column.""")
colnames: Optional[str] = Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""")
description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""")
id: DynamicTableId = Field(..., description="""Array of unique identifiers for the rows of this dynamic table.""")
VectorData: Optional[List[VectorData]] = Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""")
class NWBFileGeneralOptogenetics(ConfiguredBaseModel):
"""
Metadata describing optogenetic stimuluation.
"""
OptogeneticStimulusSite: Optional[List[OptogeneticStimulusSite]] = Field(default_factory=list, description="""An optogenetic stimulation site.""")
class NWBFileGeneralOptophysiology(ConfiguredBaseModel):
"""
Metadata related to optophysiology.
"""
ImagingPlane: Optional[List[ImagingPlane]] = Field(default_factory=list, description="""An imaging plane.""")
class NWBFileIntervals(ConfiguredBaseModel): class NWBFileIntervals(ConfiguredBaseModel):
""" """
Experimental intervals, whether that be logically distinct sub-experiments having a particular scientific goal, trials (see trials subgroup) during an experiment, or epochs (see epochs subgroup) deriving from analysis of data. Experimental intervals, whether that be logically distinct sub-experiments having a particular scientific goal, trials (see trials subgroup) during an experiment, or epochs (see epochs subgroup) deriving from analysis of data.
""" """
epochs: Optional[NWBFileIntervalsEpochs] = Field(None, description="""Divisions in time marking experimental stages or sub-divisions of a single recording session.""") name: str = Field("intervals", const=True)
trials: Optional[NWBFileIntervalsTrials] = Field(None, description="""Repeated experimental events that have a logical grouping.""") epochs: Optional[TimeIntervals] = Field(None, description="""Divisions in time marking experimental stages or sub-divisions of a single recording session.""")
invalid_times: Optional[NWBFileIntervalsInvalidTimes] = Field(None, description="""Time intervals that should be removed from analysis.""") trials: Optional[TimeIntervals] = Field(None, description="""Repeated experimental events that have a logical grouping.""")
TimeIntervals: Optional[List[TimeIntervals]] = Field(default_factory=list, description="""Optional additional table(s) for describing other experimental time intervals.""") invalid_times: Optional[TimeIntervals] = Field(None, description="""Time intervals that should be removed from analysis.""")
time_intervals: Optional[List[TimeIntervals]] = Field(default_factory=list, description="""Optional additional table(s) for describing other experimental time intervals.""")
class NWBFileIntervalsEpochs(TimeIntervals):
"""
Divisions in time marking experimental stages or sub-divisions of a single recording session.
"""
start_time: Optional[List[float]] = Field(default_factory=list, description="""Start time of epoch, in seconds.""")
stop_time: Optional[List[float]] = Field(default_factory=list, description="""Stop time of epoch, in seconds.""")
tags: Optional[List[str]] = Field(default_factory=list, description="""User-defined tags that identify or categorize events.""")
tags_index: Optional[TimeIntervalsTagsIndex] = Field(None, description="""Index for tags.""")
timeseries: Optional[TimeIntervalsTimeseries] = Field(None, description="""An index into a TimeSeries object.""")
timeseries_index: Optional[TimeIntervalsTimeseriesIndex] = Field(None, description="""Index for timeseries.""")
colnames: Optional[str] = Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""")
description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""")
id: DynamicTableId = Field(..., description="""Array of unique identifiers for the rows of this dynamic table.""")
VectorData: Optional[List[VectorData]] = Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""")
class NWBFileIntervalsTrials(TimeIntervals):
"""
Repeated experimental events that have a logical grouping.
"""
start_time: Optional[List[float]] = Field(default_factory=list, description="""Start time of epoch, in seconds.""")
stop_time: Optional[List[float]] = Field(default_factory=list, description="""Stop time of epoch, in seconds.""")
tags: Optional[List[str]] = Field(default_factory=list, description="""User-defined tags that identify or categorize events.""")
tags_index: Optional[TimeIntervalsTagsIndex] = Field(None, description="""Index for tags.""")
timeseries: Optional[TimeIntervalsTimeseries] = Field(None, description="""An index into a TimeSeries object.""")
timeseries_index: Optional[TimeIntervalsTimeseriesIndex] = Field(None, description="""Index for timeseries.""")
colnames: Optional[str] = Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""")
description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""")
id: DynamicTableId = Field(..., description="""Array of unique identifiers for the rows of this dynamic table.""")
VectorData: Optional[List[VectorData]] = Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""")
class NWBFileIntervalsInvalidTimes(TimeIntervals):
"""
Time intervals that should be removed from analysis.
"""
start_time: Optional[List[float]] = Field(default_factory=list, description="""Start time of epoch, in seconds.""")
stop_time: Optional[List[float]] = Field(default_factory=list, description="""Stop time of epoch, in seconds.""")
tags: Optional[List[str]] = Field(default_factory=list, description="""User-defined tags that identify or categorize events.""")
tags_index: Optional[TimeIntervalsTagsIndex] = Field(None, description="""Index for tags.""")
timeseries: Optional[TimeIntervalsTimeseries] = Field(None, description="""An index into a TimeSeries object.""")
timeseries_index: Optional[TimeIntervalsTimeseriesIndex] = Field(None, description="""Index for timeseries.""")
colnames: Optional[str] = Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""")
description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""")
id: DynamicTableId = Field(..., description="""Array of unique identifiers for the rows of this dynamic table.""")
VectorData: Optional[List[VectorData]] = Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""")
class NWBFileUnits(Units):
"""
Data about sorted spike units.
"""
spike_times_index: Optional[UnitsSpikeTimesIndex] = Field(None, description="""Index into the spike_times dataset.""")
spike_times: Optional[UnitsSpikeTimes] = Field(None, description="""Spike times for each unit in seconds.""")
obs_intervals_index: Optional[UnitsObsIntervalsIndex] = Field(None, description="""Index into the obs_intervals dataset.""")
obs_intervals: Optional[UnitsObsIntervals] = Field(None, description="""Observation intervals for each unit.""")
electrodes_index: Optional[UnitsElectrodesIndex] = Field(None, description="""Index into electrodes.""")
electrodes: Optional[UnitsElectrodes] = Field(None, description="""Electrode that each spike unit came from, specified using a DynamicTableRegion.""")
electrode_group: Optional[List[ElectrodeGroup]] = Field(default_factory=list, description="""Electrode group that each spike unit came from.""")
waveform_mean: Optional[UnitsWaveformMean] = Field(None, description="""Spike waveform mean for each spike unit.""")
waveform_sd: Optional[UnitsWaveformSd] = Field(None, description="""Spike waveform standard deviation for each spike unit.""")
waveforms: Optional[UnitsWaveforms] = Field(None, description="""Individual waveforms for each spike on each electrode. This is a doubly indexed column. The 'waveforms_index' column indexes which waveforms in this column belong to the same spike event for a given unit, where each waveform was recorded from a different electrode. The 'waveforms_index_index' column indexes the 'waveforms_index' column to indicate which spike events belong to a given unit. For example, if the 'waveforms_index_index' column has values [2, 5, 6], then the first 2 elements of the 'waveforms_index' column correspond to the 2 spike events of the first unit, the next 3 elements of the 'waveforms_index' column correspond to the 3 spike events of the second unit, and the next 1 element of the 'waveforms_index' column corresponds to the 1 spike event of the third unit. If the 'waveforms_index' column has values [3, 6, 8, 10, 12, 13], then the first 3 elements of the 'waveforms' column contain the 3 spike waveforms that were recorded from 3 different electrodes for the first spike time of the first unit. See https://nwb-schema.readthedocs.io/en/stable/format_description.html#doubly-ragged-arrays for a graphical representation of this example. When there is only one electrode for each unit (i.e., each spike time is associated with a single waveform), then the 'waveforms_index' column will have values 1, 2, ..., N, where N is the number of spike events. The number of electrodes for each spike event should be the same within a given unit. The 'electrodes' column should be used to indicate which electrodes are associated with each unit, and the order of the waveforms within a given unit x spike event should be in the same order as the electrodes referenced in the 'electrodes' column of this table. The number of samples for each waveform must be the same.""")
waveforms_index: Optional[UnitsWaveformsIndex] = Field(None, description="""Index into the waveforms dataset. One value for every spike event. See 'waveforms' for more detail.""")
waveforms_index_index: Optional[UnitsWaveformsIndexIndex] = Field(None, description="""Index into the waveforms_index dataset. One value for every unit (row in the table). See 'waveforms' for more detail.""")
colnames: Optional[str] = Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""")
description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""")
id: DynamicTableId = Field(..., description="""Array of unique identifiers for the rows of this dynamic table.""")
VectorData: Optional[List[VectorData]] = Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""")
class SubjectAge(ConfiguredBaseModel): class SubjectAge(ConfiguredBaseModel):
""" """
Age of subject. Can be supplied instead of 'date_of_birth'. Age of subject. Can be supplied instead of 'date_of_birth'.
""" """
name: str = Field("age", const=True)
reference: Optional[str] = Field(None, description="""Age is with reference to this event. Can be 'birth' or 'gestational'. If reference is omitted, 'birth' is implied.""") reference: Optional[str] = Field(None, description="""Age is with reference to this event. Can be 'birth' or 'gestational'. If reference is omitted, 'birth' is implied.""")
# Update forward refs # Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/postponed_annotations/ # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
NWBFileFileCreateDate.update_forward_refs() NWBFileStimulus.model_rebuild()
NWBFileAcquisition.update_forward_refs() NWBFileGeneral.model_rebuild()
NWBFileAnalysis.update_forward_refs() NWBFileGeneralSourceScript.model_rebuild()
NWBFileScratch.update_forward_refs() NWBFileGeneralExtracellularEphys.model_rebuild()
NWBFileProcessing.update_forward_refs() NWBFileGeneralIntracellularEphys.model_rebuild()
NWBFileStimulus.update_forward_refs() NWBFileIntervals.model_rebuild()
NWBFileStimulusPresentation.update_forward_refs() SubjectAge.model_rebuild()
NWBFileStimulusTemplates.update_forward_refs()
NWBFileGeneral.update_forward_refs()
NWBFileGeneralExperimenter.update_forward_refs()
NWBFileGeneralKeywords.update_forward_refs()
NWBFileGeneralRelatedPublications.update_forward_refs()
NWBFileGeneralSourceScript.update_forward_refs()
NWBFileGeneralDevices.update_forward_refs()
NWBFileGeneralSubject.update_forward_refs()
NWBFileGeneralExtracellularEphys.update_forward_refs()
NWBFileGeneralExtracellularEphysElectrodes.update_forward_refs()
NWBFileGeneralIntracellularEphys.update_forward_refs()
NWBFileGeneralIntracellularEphysSweepTable.update_forward_refs()
NWBFileGeneralIntracellularEphysIntracellularRecordings.update_forward_refs()
NWBFileGeneralIntracellularEphysSimultaneousRecordings.update_forward_refs()
NWBFileGeneralIntracellularEphysSequentialRecordings.update_forward_refs()
NWBFileGeneralIntracellularEphysRepetitions.update_forward_refs()
NWBFileGeneralIntracellularEphysExperimentalConditions.update_forward_refs()
NWBFileGeneralOptogenetics.update_forward_refs()
NWBFileGeneralOptophysiology.update_forward_refs()
NWBFileIntervals.update_forward_refs()
NWBFileIntervalsEpochs.update_forward_refs()
NWBFileIntervalsTrials.update_forward_refs()
NWBFileIntervalsInvalidTimes.update_forward_refs()
NWBFileUnits.update_forward_refs()
SubjectAge.update_forward_refs()

View file

@ -11,42 +11,38 @@ else:
from typing_extensions import Literal from typing_extensions import Literal
from .core_nwb_icephys_include import (
IntracellularRecordingsTableResponses,
VoltageClampSeriesResistanceCompBandwidth,
RepetitionsTableSequentialRecordingsIndex,
ExperimentalConditionsTableRepetitionsIndex,
SequentialRecordingsTableSimultaneousRecordingsIndex,
IntracellularResponsesTableResponse,
VoltageClampSeriesWholeCellCapacitanceComp,
CurrentClampStimulusSeriesData,
IntracellularRecordingsTableElectrodes,
RepetitionsTableSequentialRecordings,
VoltageClampSeriesCapacitanceSlow,
IntracellularStimuliTableStimulus,
VoltageClampSeriesWholeCellSeriesResistanceComp,
VoltageClampSeriesData,
ExperimentalConditionsTableRepetitions,
PatchClampSeriesData,
VoltageClampSeriesResistanceCompPrediction,
IntracellularRecordingsTableStimuli,
CurrentClampSeriesData,
SimultaneousRecordingsTableRecordingsIndex,
SequentialRecordingsTableSimultaneousRecordings,
VoltageClampStimulusSeriesData,
VoltageClampSeriesResistanceCompCorrection,
SweepTableSeriesIndex,
VoltageClampSeriesCapacitanceFast,
SimultaneousRecordingsTableRecordings
)
from .core_nwb_base import ( from .core_nwb_base import (
TimeSeries, TimeSeries,
NWBContainer, NWBContainer
DynamicTable )
from .core_nwb_icephys_include import (
VoltageClampSeriesCapacitanceSlow,
ExperimentalConditionsTableRepetitions,
VoltageClampStimulusSeriesData,
ExperimentalConditionsTableRepetitionsIndex,
VoltageClampSeriesResistanceCompPrediction,
VoltageClampSeriesWholeCellSeriesResistanceComp,
SequentialRecordingsTableSimultaneousRecordings,
VoltageClampSeriesCapacitanceFast,
RepetitionsTableSequentialRecordingsIndex,
IntracellularStimuliTableStimulus,
VoltageClampSeriesResistanceCompCorrection,
SequentialRecordingsTableSimultaneousRecordingsIndex,
SimultaneousRecordingsTableRecordings,
IntracellularResponsesTableResponse,
VoltageClampSeriesResistanceCompBandwidth,
CurrentClampSeriesData,
SimultaneousRecordingsTableRecordingsIndex,
VoltageClampSeriesData,
RepetitionsTableSequentialRecordings,
VoltageClampSeriesWholeCellCapacitanceComp,
CurrentClampStimulusSeriesData,
SweepTableSeriesIndex
) )
from .hdmf_common_table import ( from .hdmf_common_table import (
DynamicTable,
AlignedDynamicTable AlignedDynamicTable
) )
@ -54,13 +50,9 @@ from .hdmf_common_table import (
metamodel_version = "None" metamodel_version = "None"
version = "None" version = "None"
class WeakRefShimBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel,
__slots__ = '__weakref__'
class ConfiguredBaseModel(WeakRefShimBaseModel,
validate_assignment = True, validate_assignment = True,
validate_all = True, validate_default = True,
underscore_attrs_are_private = True,
extra = 'forbid', extra = 'forbid',
arbitrary_types_allowed = True, arbitrary_types_allowed = True,
use_enum_values = True): use_enum_values = True):
@ -71,16 +63,17 @@ class PatchClampSeries(TimeSeries):
""" """
An abstract base class for patch-clamp data - stimulus or response, current or voltage. An abstract base class for patch-clamp data - stimulus or response, current or voltage.
""" """
name: str = Field(...)
stimulus_description: Optional[str] = Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""") stimulus_description: Optional[str] = Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""")
sweep_number: Optional[int] = Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") sweep_number: Optional[int] = Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""")
data: PatchClampSeriesData = Field(..., description="""Recorded voltage or current.""") data: List[float] = Field(default_factory=list, description="""Recorded voltage or current.""")
gain: Optional[float] = Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""") gain: Optional[float] = Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""")
description: Optional[str] = Field(None, description="""Description of the time series.""") description: Optional[str] = Field(None, description="""Description of the time series.""")
comments: Optional[str] = Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") comments: Optional[str] = Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""")
starting_time: Optional[TimeSeriesStartingTime] = Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") starting_time: Optional[TimeSeriesStartingTime] = Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""")
timestamps: Optional[TimeSeriesTimestamps] = Field(None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") timestamps: Optional[List[float]] = Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""")
control: Optional[TimeSeriesControl] = Field(None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") control: Optional[List[int]] = Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""")
control_description: Optional[TimeSeriesControlDescription] = Field(None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") control_description: Optional[List[str]] = Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""")
sync: Optional[TimeSeriesSync] = Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") sync: Optional[TimeSeriesSync] = Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""")
@ -88,6 +81,7 @@ class CurrentClampSeries(PatchClampSeries):
""" """
Voltage data from an intracellular current-clamp recording. A corresponding CurrentClampStimulusSeries (stored separately as a stimulus) is used to store the current injected. Voltage data from an intracellular current-clamp recording. A corresponding CurrentClampStimulusSeries (stored separately as a stimulus) is used to store the current injected.
""" """
name: str = Field(...)
data: CurrentClampSeriesData = Field(..., description="""Recorded voltage.""") data: CurrentClampSeriesData = Field(..., description="""Recorded voltage.""")
bias_current: Optional[float] = Field(None, description="""Bias current, in amps.""") bias_current: Optional[float] = Field(None, description="""Bias current, in amps.""")
bridge_balance: Optional[float] = Field(None, description="""Bridge balance, in ohms.""") bridge_balance: Optional[float] = Field(None, description="""Bridge balance, in ohms.""")
@ -98,9 +92,9 @@ class CurrentClampSeries(PatchClampSeries):
description: Optional[str] = Field(None, description="""Description of the time series.""") description: Optional[str] = Field(None, description="""Description of the time series.""")
comments: Optional[str] = Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") comments: Optional[str] = Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""")
starting_time: Optional[TimeSeriesStartingTime] = Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") starting_time: Optional[TimeSeriesStartingTime] = Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""")
timestamps: Optional[TimeSeriesTimestamps] = Field(None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") timestamps: Optional[List[float]] = Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""")
control: Optional[TimeSeriesControl] = Field(None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") control: Optional[List[int]] = Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""")
control_description: Optional[TimeSeriesControlDescription] = Field(None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") control_description: Optional[List[str]] = Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""")
sync: Optional[TimeSeriesSync] = Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") sync: Optional[TimeSeriesSync] = Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""")
@ -108,6 +102,7 @@ class IZeroClampSeries(CurrentClampSeries):
""" """
Voltage data from an intracellular recording when all current and amplifier settings are off (i.e., CurrentClampSeries fields will be zero). There is no CurrentClampStimulusSeries associated with an IZero series because the amplifier is disconnected and no stimulus can reach the cell. Voltage data from an intracellular recording when all current and amplifier settings are off (i.e., CurrentClampSeries fields will be zero). There is no CurrentClampStimulusSeries associated with an IZero series because the amplifier is disconnected and no stimulus can reach the cell.
""" """
name: str = Field(...)
stimulus_description: Optional[str] = Field(None, description="""An IZeroClampSeries has no stimulus, so this attribute is automatically set to \"N/A\"""") stimulus_description: Optional[str] = Field(None, description="""An IZeroClampSeries has no stimulus, so this attribute is automatically set to \"N/A\"""")
bias_current: float = Field(..., description="""Bias current, in amps, fixed to 0.0.""") bias_current: float = Field(..., description="""Bias current, in amps, fixed to 0.0.""")
bridge_balance: float = Field(..., description="""Bridge balance, in ohms, fixed to 0.0.""") bridge_balance: float = Field(..., description="""Bridge balance, in ohms, fixed to 0.0.""")
@ -118,9 +113,9 @@ class IZeroClampSeries(CurrentClampSeries):
description: Optional[str] = Field(None, description="""Description of the time series.""") description: Optional[str] = Field(None, description="""Description of the time series.""")
comments: Optional[str] = Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") comments: Optional[str] = Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""")
starting_time: Optional[TimeSeriesStartingTime] = Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") starting_time: Optional[TimeSeriesStartingTime] = Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""")
timestamps: Optional[TimeSeriesTimestamps] = Field(None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") timestamps: Optional[List[float]] = Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""")
control: Optional[TimeSeriesControl] = Field(None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") control: Optional[List[int]] = Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""")
control_description: Optional[TimeSeriesControlDescription] = Field(None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") control_description: Optional[List[str]] = Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""")
sync: Optional[TimeSeriesSync] = Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") sync: Optional[TimeSeriesSync] = Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""")
@ -128,6 +123,7 @@ class CurrentClampStimulusSeries(PatchClampSeries):
""" """
Stimulus current applied during current clamp recording. Stimulus current applied during current clamp recording.
""" """
name: str = Field(...)
data: CurrentClampStimulusSeriesData = Field(..., description="""Stimulus current applied.""") data: CurrentClampStimulusSeriesData = Field(..., description="""Stimulus current applied.""")
stimulus_description: Optional[str] = Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""") stimulus_description: Optional[str] = Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""")
sweep_number: Optional[int] = Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") sweep_number: Optional[int] = Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""")
@ -135,9 +131,9 @@ class CurrentClampStimulusSeries(PatchClampSeries):
description: Optional[str] = Field(None, description="""Description of the time series.""") description: Optional[str] = Field(None, description="""Description of the time series.""")
comments: Optional[str] = Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") comments: Optional[str] = Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""")
starting_time: Optional[TimeSeriesStartingTime] = Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") starting_time: Optional[TimeSeriesStartingTime] = Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""")
timestamps: Optional[TimeSeriesTimestamps] = Field(None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") timestamps: Optional[List[float]] = Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""")
control: Optional[TimeSeriesControl] = Field(None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") control: Optional[List[int]] = Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""")
control_description: Optional[TimeSeriesControlDescription] = Field(None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") control_description: Optional[List[str]] = Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""")
sync: Optional[TimeSeriesSync] = Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") sync: Optional[TimeSeriesSync] = Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""")
@ -145,6 +141,7 @@ class VoltageClampSeries(PatchClampSeries):
""" """
Current data from an intracellular voltage-clamp recording. A corresponding VoltageClampStimulusSeries (stored separately as a stimulus) is used to store the voltage injected. Current data from an intracellular voltage-clamp recording. A corresponding VoltageClampStimulusSeries (stored separately as a stimulus) is used to store the voltage injected.
""" """
name: str = Field(...)
data: VoltageClampSeriesData = Field(..., description="""Recorded current.""") data: VoltageClampSeriesData = Field(..., description="""Recorded current.""")
capacitance_fast: Optional[VoltageClampSeriesCapacitanceFast] = Field(None, description="""Fast capacitance, in farads.""") capacitance_fast: Optional[VoltageClampSeriesCapacitanceFast] = Field(None, description="""Fast capacitance, in farads.""")
capacitance_slow: Optional[VoltageClampSeriesCapacitanceSlow] = Field(None, description="""Slow capacitance, in farads.""") capacitance_slow: Optional[VoltageClampSeriesCapacitanceSlow] = Field(None, description="""Slow capacitance, in farads.""")
@ -159,9 +156,9 @@ class VoltageClampSeries(PatchClampSeries):
description: Optional[str] = Field(None, description="""Description of the time series.""") description: Optional[str] = Field(None, description="""Description of the time series.""")
comments: Optional[str] = Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") comments: Optional[str] = Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""")
starting_time: Optional[TimeSeriesStartingTime] = Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") starting_time: Optional[TimeSeriesStartingTime] = Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""")
timestamps: Optional[TimeSeriesTimestamps] = Field(None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") timestamps: Optional[List[float]] = Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""")
control: Optional[TimeSeriesControl] = Field(None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") control: Optional[List[int]] = Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""")
control_description: Optional[TimeSeriesControlDescription] = Field(None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") control_description: Optional[List[str]] = Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""")
sync: Optional[TimeSeriesSync] = Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") sync: Optional[TimeSeriesSync] = Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""")
@ -169,6 +166,7 @@ class VoltageClampStimulusSeries(PatchClampSeries):
""" """
Stimulus voltage applied during a voltage clamp recording. Stimulus voltage applied during a voltage clamp recording.
""" """
name: str = Field(...)
data: VoltageClampStimulusSeriesData = Field(..., description="""Stimulus voltage applied.""") data: VoltageClampStimulusSeriesData = Field(..., description="""Stimulus voltage applied.""")
stimulus_description: Optional[str] = Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""") stimulus_description: Optional[str] = Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""")
sweep_number: Optional[int] = Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") sweep_number: Optional[int] = Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""")
@ -176,9 +174,9 @@ class VoltageClampStimulusSeries(PatchClampSeries):
description: Optional[str] = Field(None, description="""Description of the time series.""") description: Optional[str] = Field(None, description="""Description of the time series.""")
comments: Optional[str] = Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") comments: Optional[str] = Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""")
starting_time: Optional[TimeSeriesStartingTime] = Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") starting_time: Optional[TimeSeriesStartingTime] = Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""")
timestamps: Optional[TimeSeriesTimestamps] = Field(None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") timestamps: Optional[List[float]] = Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""")
control: Optional[TimeSeriesControl] = Field(None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") control: Optional[List[int]] = Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""")
control_description: Optional[TimeSeriesControlDescription] = Field(None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") control_description: Optional[List[str]] = Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""")
sync: Optional[TimeSeriesSync] = Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") sync: Optional[TimeSeriesSync] = Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""")
@ -186,6 +184,7 @@ class IntracellularElectrode(NWBContainer):
""" """
An intracellular electrode and its metadata. An intracellular electrode and its metadata.
""" """
name: str = Field(...)
cell_id: Optional[str] = Field(None, description="""unique ID of the cell""") cell_id: Optional[str] = Field(None, description="""unique ID of the cell""")
description: str = Field(..., description="""Description of electrode (e.g., whole-cell, sharp, etc.).""") description: str = Field(..., description="""Description of electrode (e.g., whole-cell, sharp, etc.).""")
filtering: Optional[str] = Field(None, description="""Electrode specific filtering.""") filtering: Optional[str] = Field(None, description="""Electrode specific filtering.""")
@ -200,12 +199,13 @@ class SweepTable(DynamicTable):
""" """
[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. [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.
""" """
name: str = Field(...)
sweep_number: Optional[List[int]] = Field(default_factory=list, description="""Sweep number of the PatchClampSeries in that row.""") sweep_number: Optional[List[int]] = Field(default_factory=list, description="""Sweep number of the PatchClampSeries in that row.""")
series: Optional[List[PatchClampSeries]] = Field(default_factory=list, description="""The PatchClampSeries with the sweep number in that row.""") series: Optional[List[PatchClampSeries]] = Field(default_factory=list, description="""The PatchClampSeries with the sweep number in that row.""")
series_index: SweepTableSeriesIndex = Field(..., description="""Index for series.""") series_index: SweepTableSeriesIndex = Field(..., description="""Index for series.""")
colnames: Optional[str] = Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") colnames: Optional[str] = Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""")
description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""")
id: DynamicTableId = Field(..., description="""Array of unique identifiers for the rows of this dynamic table.""") id: List[int] = Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""")
VectorData: Optional[List[VectorData]] = Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") VectorData: Optional[List[VectorData]] = Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""")
@ -213,10 +213,11 @@ class IntracellularElectrodesTable(DynamicTable):
""" """
Table for storing intracellular electrode related metadata. Table for storing intracellular electrode related metadata.
""" """
name: str = Field(...)
description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""")
electrode: Optional[List[IntracellularElectrode]] = Field(default_factory=list, description="""Column for storing the reference to the intracellular electrode.""") electrode: Optional[List[IntracellularElectrode]] = Field(default_factory=list, description="""Column for storing the reference to the intracellular electrode.""")
colnames: Optional[str] = Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") colnames: Optional[str] = Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""")
id: DynamicTableId = Field(..., description="""Array of unique identifiers for the rows of this dynamic table.""") id: List[int] = Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""")
VectorData: Optional[List[VectorData]] = Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") VectorData: Optional[List[VectorData]] = Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""")
@ -224,10 +225,11 @@ class IntracellularStimuliTable(DynamicTable):
""" """
Table for storing intracellular stimulus related metadata. Table for storing intracellular stimulus related metadata.
""" """
name: str = Field(...)
description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""")
stimulus: IntracellularStimuliTableStimulus = Field(..., description="""Column storing the reference to the recorded stimulus for the recording (rows).""") stimulus: IntracellularStimuliTableStimulus = Field(..., description="""Column storing the reference to the recorded stimulus for the recording (rows).""")
colnames: Optional[str] = Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") colnames: Optional[str] = Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""")
id: DynamicTableId = Field(..., description="""Array of unique identifiers for the rows of this dynamic table.""") id: List[int] = Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""")
VectorData: Optional[List[VectorData]] = Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") VectorData: Optional[List[VectorData]] = Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""")
@ -235,10 +237,11 @@ class IntracellularResponsesTable(DynamicTable):
""" """
Table for storing intracellular response related metadata. Table for storing intracellular response related metadata.
""" """
name: str = Field(...)
description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""")
response: IntracellularResponsesTableResponse = Field(..., description="""Column storing the reference to the recorded response for the recording (rows)""") response: IntracellularResponsesTableResponse = Field(..., description="""Column storing the reference to the recorded response for the recording (rows)""")
colnames: Optional[str] = Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") colnames: Optional[str] = Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""")
id: DynamicTableId = Field(..., description="""Array of unique identifiers for the rows of this dynamic table.""") id: List[int] = Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""")
VectorData: Optional[List[VectorData]] = Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") VectorData: Optional[List[VectorData]] = Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""")
@ -246,14 +249,15 @@ class IntracellularRecordingsTable(AlignedDynamicTable):
""" """
A table to group together a stimulus and response from a single electrode and a single simultaneous recording. Each row in the table represents a single recording consisting typically of a stimulus and a corresponding response. In some cases, however, only a stimulus or a response is recorded as part of an experiment. In this case, both the stimulus and response will point to the same TimeSeries while the idx_start and count of the invalid column will be set to -1, thus, indicating that no values have been recorded for the stimulus or response, respectively. Note, a recording MUST contain at least a stimulus or a response. Typically the stimulus and response are PatchClampSeries. However, the use of AD/DA channels that are not associated to an electrode is also common in intracellular electrophysiology, in which case other TimeSeries may be used. A table to group together a stimulus and response from a single electrode and a single simultaneous recording. Each row in the table represents a single recording consisting typically of a stimulus and a corresponding response. In some cases, however, only a stimulus or a response is recorded as part of an experiment. In this case, both the stimulus and response will point to the same TimeSeries while the idx_start and count of the invalid column will be set to -1, thus, indicating that no values have been recorded for the stimulus or response, respectively. Note, a recording MUST contain at least a stimulus or a response. Typically the stimulus and response are PatchClampSeries. However, the use of AD/DA channels that are not associated to an electrode is also common in intracellular electrophysiology, in which case other TimeSeries may be used.
""" """
name: str = Field("intracellular_recordings", const=True)
description: Optional[str] = Field(None, description="""Description of the contents of this table. Inherited from AlignedDynamicTable and overwritten here to fix the value of the attribute.""") description: Optional[str] = Field(None, description="""Description of the contents of this table. Inherited from AlignedDynamicTable and overwritten here to fix the value of the attribute.""")
electrodes: IntracellularRecordingsTableElectrodes = Field(..., description="""Table for storing intracellular electrode related metadata.""") electrodes: IntracellularElectrodesTable = Field(..., description="""Table for storing intracellular electrode related metadata.""")
stimuli: IntracellularRecordingsTableStimuli = Field(..., description="""Table for storing intracellular stimulus related metadata.""") stimuli: IntracellularStimuliTable = Field(..., description="""Table for storing intracellular stimulus related metadata.""")
responses: IntracellularRecordingsTableResponses = Field(..., description="""Table for storing intracellular response related metadata.""") responses: IntracellularResponsesTable = Field(..., description="""Table for storing intracellular response related metadata.""")
categories: Optional[str] = Field(None, description="""The names of the categories in this AlignedDynamicTable. Each category is represented by one DynamicTable stored in the parent group. This attribute should be used to specify an order of categories and the category names must match the names of the corresponding DynamicTable in the group.""") categories: Optional[str] = Field(None, description="""The names of the categories in this AlignedDynamicTable. Each category is represented by one DynamicTable stored in the parent group. This attribute should be used to specify an order of categories and the category names must match the names of the corresponding DynamicTable in the group.""")
DynamicTable: Optional[List[DynamicTable]] = Field(default_factory=list, description="""A DynamicTable representing a particular category for columns in the AlignedDynamicTable parent container. The table MUST be aligned with (i.e., have the same number of rows) as all other DynamicTables stored in the AlignedDynamicTable parent container. The name of the category is given by the name of the DynamicTable and its description by the description attribute of the DynamicTable.""") dynamic_table: Optional[List[DynamicTable]] = Field(default_factory=list, description="""A DynamicTable representing a particular category for columns in the AlignedDynamicTable parent container. The table MUST be aligned with (i.e., have the same number of rows) as all other DynamicTables stored in the AlignedDynamicTable parent container. The name of the category is given by the name of the DynamicTable and its description by the description attribute of the DynamicTable.""")
colnames: Optional[str] = Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") colnames: Optional[str] = Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""")
id: DynamicTableId = Field(..., description="""Array of unique identifiers for the rows of this dynamic table.""") id: List[int] = Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""")
VectorData: Optional[List[VectorData]] = Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") VectorData: Optional[List[VectorData]] = Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""")
@ -261,11 +265,12 @@ class SimultaneousRecordingsTable(DynamicTable):
""" """
A table for grouping different intracellular recordings from the IntracellularRecordingsTable table together that were recorded simultaneously from different electrodes. A table for grouping different intracellular recordings from the IntracellularRecordingsTable table together that were recorded simultaneously from different electrodes.
""" """
name: str = Field("simultaneous_recordings", const=True)
recordings: SimultaneousRecordingsTableRecordings = Field(..., description="""A reference to one or more rows in the IntracellularRecordingsTable table.""") recordings: SimultaneousRecordingsTableRecordings = Field(..., description="""A reference to one or more rows in the IntracellularRecordingsTable table.""")
recordings_index: SimultaneousRecordingsTableRecordingsIndex = Field(..., description="""Index dataset for the recordings column.""") recordings_index: SimultaneousRecordingsTableRecordingsIndex = Field(..., description="""Index dataset for the recordings column.""")
colnames: Optional[str] = Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") colnames: Optional[str] = Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""")
description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""")
id: DynamicTableId = Field(..., description="""Array of unique identifiers for the rows of this dynamic table.""") id: List[int] = Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""")
VectorData: Optional[List[VectorData]] = Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") VectorData: Optional[List[VectorData]] = Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""")
@ -273,12 +278,13 @@ class SequentialRecordingsTable(DynamicTable):
""" """
A table for grouping different sequential recordings from the SimultaneousRecordingsTable table together. This is typically used to group together sequential recordings where a sequence of stimuli of the same type with varying parameters have been presented in a sequence. A table for grouping different sequential recordings from the SimultaneousRecordingsTable table together. This is typically used to group together sequential recordings where a sequence of stimuli of the same type with varying parameters have been presented in a sequence.
""" """
name: str = Field("sequential_recordings", const=True)
simultaneous_recordings: SequentialRecordingsTableSimultaneousRecordings = Field(..., description="""A reference to one or more rows in the SimultaneousRecordingsTable table.""") simultaneous_recordings: SequentialRecordingsTableSimultaneousRecordings = Field(..., description="""A reference to one or more rows in the SimultaneousRecordingsTable table.""")
simultaneous_recordings_index: SequentialRecordingsTableSimultaneousRecordingsIndex = Field(..., description="""Index dataset for the simultaneous_recordings column.""") simultaneous_recordings_index: SequentialRecordingsTableSimultaneousRecordingsIndex = Field(..., description="""Index dataset for the simultaneous_recordings column.""")
stimulus_type: Optional[List[str]] = Field(default_factory=list, description="""The type of stimulus used for the sequential recording.""") stimulus_type: Optional[List[str]] = Field(default_factory=list, description="""The type of stimulus used for the sequential recording.""")
colnames: Optional[str] = Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") colnames: Optional[str] = Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""")
description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""")
id: DynamicTableId = Field(..., description="""Array of unique identifiers for the rows of this dynamic table.""") id: List[int] = Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""")
VectorData: Optional[List[VectorData]] = Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") VectorData: Optional[List[VectorData]] = Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""")
@ -286,11 +292,12 @@ class RepetitionsTable(DynamicTable):
""" """
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. 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.
""" """
name: str = Field("repetitions", const=True)
sequential_recordings: RepetitionsTableSequentialRecordings = Field(..., description="""A reference to one or more rows in the SequentialRecordingsTable table.""") sequential_recordings: RepetitionsTableSequentialRecordings = Field(..., description="""A reference to one or more rows in the SequentialRecordingsTable table.""")
sequential_recordings_index: RepetitionsTableSequentialRecordingsIndex = Field(..., description="""Index dataset for the sequential_recordings column.""") sequential_recordings_index: RepetitionsTableSequentialRecordingsIndex = Field(..., description="""Index dataset for the sequential_recordings column.""")
colnames: Optional[str] = Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") colnames: Optional[str] = Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""")
description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""")
id: DynamicTableId = Field(..., description="""Array of unique identifiers for the rows of this dynamic table.""") id: List[int] = Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""")
VectorData: Optional[List[VectorData]] = Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") VectorData: Optional[List[VectorData]] = Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""")
@ -298,30 +305,32 @@ class ExperimentalConditionsTable(DynamicTable):
""" """
A table for grouping different intracellular recording repetitions together that belong to the same experimental condition. A table for grouping different intracellular recording repetitions together that belong to the same experimental condition.
""" """
name: str = Field("experimental_conditions", const=True)
repetitions: ExperimentalConditionsTableRepetitions = Field(..., description="""A reference to one or more rows in the RepetitionsTable table.""") repetitions: ExperimentalConditionsTableRepetitions = Field(..., description="""A reference to one or more rows in the RepetitionsTable table.""")
repetitions_index: ExperimentalConditionsTableRepetitionsIndex = Field(..., description="""Index dataset for the repetitions column.""") repetitions_index: ExperimentalConditionsTableRepetitionsIndex = Field(..., description="""Index dataset for the repetitions column.""")
colnames: Optional[str] = Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") colnames: Optional[str] = Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""")
description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""")
id: DynamicTableId = Field(..., description="""Array of unique identifiers for the rows of this dynamic table.""") id: List[int] = Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""")
VectorData: Optional[List[VectorData]] = Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") VectorData: Optional[List[VectorData]] = Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""")
# Update forward refs # Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/postponed_annotations/ # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
PatchClampSeries.update_forward_refs() PatchClampSeries.model_rebuild()
CurrentClampSeries.update_forward_refs() CurrentClampSeries.model_rebuild()
IZeroClampSeries.update_forward_refs() IZeroClampSeries.model_rebuild()
CurrentClampStimulusSeries.update_forward_refs() CurrentClampStimulusSeries.model_rebuild()
VoltageClampSeries.update_forward_refs() VoltageClampSeries.model_rebuild()
VoltageClampStimulusSeries.update_forward_refs() VoltageClampStimulusSeries.model_rebuild()
IntracellularElectrode.update_forward_refs() IntracellularElectrode.model_rebuild()
SweepTable.update_forward_refs() SweepTable.model_rebuild()
IntracellularElectrodesTable.update_forward_refs() IntracellularElectrodesTable.model_rebuild()
IntracellularStimuliTable.update_forward_refs() IntracellularStimuliTable.model_rebuild()
IntracellularResponsesTable.update_forward_refs() IntracellularResponsesTable.model_rebuild()
IntracellularRecordingsTable.update_forward_refs() IntracellularRecordingsTable.model_rebuild()
SimultaneousRecordingsTable.update_forward_refs() SimultaneousRecordingsTable.model_rebuild()
SequentialRecordingsTable.update_forward_refs() SequentialRecordingsTable.model_rebuild()
RepetitionsTable.update_forward_refs() RepetitionsTable.model_rebuild()
ExperimentalConditionsTable.update_forward_refs() ExperimentalConditionsTable.model_rebuild()

View file

@ -16,49 +16,35 @@ from .hdmf_common_table import (
VectorIndex VectorIndex
) )
from .core_nwb_base import ( from .core_nwb_icephys import (
TimeSeriesReferenceVectorData SequentialRecordingsTable,
RepetitionsTable,
SimultaneousRecordingsTable,
IntracellularRecordingsTable
) )
from .core_nwb_icephys import ( from .core_nwb_base import (
SimultaneousRecordingsTable, TimeSeriesReferenceVectorData
IntracellularElectrodesTable,
IntracellularResponsesTable,
SequentialRecordingsTable,
IntracellularRecordingsTable,
IntracellularStimuliTable,
RepetitionsTable
) )
metamodel_version = "None" metamodel_version = "None"
version = "None" version = "None"
class WeakRefShimBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel,
__slots__ = '__weakref__'
class ConfiguredBaseModel(WeakRefShimBaseModel,
validate_assignment = True, validate_assignment = True,
validate_all = True, validate_default = True,
underscore_attrs_are_private = True,
extra = 'forbid', extra = 'forbid',
arbitrary_types_allowed = True, arbitrary_types_allowed = True,
use_enum_values = True): use_enum_values = True):
pass pass
class PatchClampSeriesData(ConfiguredBaseModel):
"""
Recorded voltage or current.
"""
unit: Optional[str] = Field(None, description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion' and add 'offset'.""")
data: List[float] = Field(default_factory=list, description="""Recorded voltage or current.""")
class CurrentClampSeriesData(ConfiguredBaseModel): class CurrentClampSeriesData(ConfiguredBaseModel):
""" """
Recorded voltage. Recorded voltage.
""" """
name: str = Field("data", const=True)
unit: Optional[str] = Field(None, description="""Base unit of measurement for working with the data. which is fixed to 'volts'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion' and add 'offset'.""") unit: Optional[str] = Field(None, description="""Base unit of measurement for working with the data. which is fixed to 'volts'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion' and add 'offset'.""")
@ -66,6 +52,7 @@ class CurrentClampStimulusSeriesData(ConfiguredBaseModel):
""" """
Stimulus current applied. Stimulus current applied.
""" """
name: str = Field("data", const=True)
unit: Optional[str] = Field(None, description="""Base unit of measurement for working with the data. which is fixed to 'amperes'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion' and add 'offset'.""") unit: Optional[str] = Field(None, description="""Base unit of measurement for working with the data. which is fixed to 'amperes'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion' and add 'offset'.""")
@ -73,6 +60,7 @@ class VoltageClampSeriesData(ConfiguredBaseModel):
""" """
Recorded current. Recorded current.
""" """
name: str = Field("data", const=True)
unit: Optional[str] = Field(None, description="""Base unit of measurement for working with the data. which is fixed to 'amperes'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion' and add 'offset'.""") unit: Optional[str] = Field(None, description="""Base unit of measurement for working with the data. which is fixed to 'amperes'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion' and add 'offset'.""")
@ -80,6 +68,7 @@ class VoltageClampSeriesCapacitanceFast(ConfiguredBaseModel):
""" """
Fast capacitance, in farads. Fast capacitance, in farads.
""" """
name: str = Field("capacitance_fast", const=True)
unit: Optional[str] = Field(None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""") unit: Optional[str] = Field(None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""")
@ -87,6 +76,7 @@ class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel):
""" """
Slow capacitance, in farads. Slow capacitance, in farads.
""" """
name: str = Field("capacitance_slow", const=True)
unit: Optional[str] = Field(None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""") unit: Optional[str] = Field(None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""")
@ -94,6 +84,7 @@ class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel):
""" """
Resistance compensation bandwidth, in hertz. Resistance compensation bandwidth, in hertz.
""" """
name: str = Field("resistance_comp_bandwidth", const=True)
unit: Optional[str] = Field(None, description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'.""") unit: Optional[str] = Field(None, description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'.""")
@ -101,6 +92,7 @@ class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel):
""" """
Resistance compensation correction, in percent. Resistance compensation correction, in percent.
""" """
name: str = Field("resistance_comp_correction", const=True)
unit: Optional[str] = Field(None, description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'.""") unit: Optional[str] = Field(None, description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'.""")
@ -108,6 +100,7 @@ class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel):
""" """
Resistance compensation prediction, in percent. Resistance compensation prediction, in percent.
""" """
name: str = Field("resistance_comp_prediction", const=True)
unit: Optional[str] = Field(None, description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'.""") unit: Optional[str] = Field(None, description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'.""")
@ -115,6 +108,7 @@ class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel):
""" """
Whole cell capacitance compensation, in farads. Whole cell capacitance compensation, in farads.
""" """
name: str = Field("whole_cell_capacitance_comp", const=True)
unit: Optional[str] = Field(None, description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'.""") unit: Optional[str] = Field(None, description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'.""")
@ -122,6 +116,7 @@ class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel):
""" """
Whole cell series resistance compensation, in ohms. Whole cell series resistance compensation, in ohms.
""" """
name: str = Field("whole_cell_series_resistance_comp", const=True)
unit: Optional[str] = Field(None, description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'.""") unit: Optional[str] = Field(None, description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'.""")
@ -129,6 +124,7 @@ class VoltageClampStimulusSeriesData(ConfiguredBaseModel):
""" """
Stimulus voltage applied. Stimulus voltage applied.
""" """
name: str = Field("data", const=True)
unit: Optional[str] = Field(None, description="""Base unit of measurement for working with the data. which is fixed to 'volts'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion' and add 'offset'.""") unit: Optional[str] = Field(None, description="""Base unit of measurement for working with the data. which is fixed to 'volts'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion' and add 'offset'.""")
@ -136,158 +132,188 @@ class SweepTableSeriesIndex(VectorIndex):
""" """
Index for series. Index for series.
""" """
name: str = Field("series_index", const=True)
target: Optional[VectorData] = Field(None, description="""Reference to the target dataset that this index applies to.""") target: Optional[VectorData] = Field(None, description="""Reference to the target dataset that this index applies to.""")
description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") description: Optional[str] = Field(None, description="""Description of what these vectors represent.""")
array: Optional[NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], ]] = Field(None) array: Optional[Union[
NDArray[Shape["* dim0"], Any],
NDArray[Shape["* dim0, * dim1"], Any],
NDArray[Shape["* dim0, * dim1, * dim2"], Any],
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any]
]] = Field(None)
class IntracellularStimuliTableStimulus(TimeSeriesReferenceVectorData): class IntracellularStimuliTableStimulus(TimeSeriesReferenceVectorData):
""" """
Column storing the reference to the recorded stimulus for the recording (rows). Column storing the reference to the recorded stimulus for the recording (rows).
""" """
name: str = Field("stimulus", const=True)
description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") description: Optional[str] = Field(None, description="""Description of what these vectors represent.""")
array: Optional[NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], ]] = Field(None) array: Optional[Union[
NDArray[Shape["* dim0"], Any],
NDArray[Shape["* dim0, * dim1"], Any],
NDArray[Shape["* dim0, * dim1, * dim2"], Any],
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any]
]] = Field(None)
class IntracellularResponsesTableResponse(TimeSeriesReferenceVectorData): class IntracellularResponsesTableResponse(TimeSeriesReferenceVectorData):
""" """
Column storing the reference to the recorded response for the recording (rows) Column storing the reference to the recorded response for the recording (rows)
""" """
name: str = Field("response", const=True)
description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") description: Optional[str] = Field(None, description="""Description of what these vectors represent.""")
array: Optional[NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], ]] = Field(None) array: Optional[Union[
NDArray[Shape["* dim0"], Any],
NDArray[Shape["* dim0, * dim1"], Any],
class IntracellularRecordingsTableElectrodes(IntracellularElectrodesTable): NDArray[Shape["* dim0, * dim1, * dim2"], Any],
""" NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any]
Table for storing intracellular electrode related metadata. ]] = Field(None)
"""
description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""")
electrode: Optional[List[IntracellularElectrode]] = Field(default_factory=list, description="""Column for storing the reference to the intracellular electrode.""")
colnames: Optional[str] = Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""")
id: DynamicTableId = Field(..., description="""Array of unique identifiers for the rows of this dynamic table.""")
VectorData: Optional[List[VectorData]] = Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""")
class IntracellularRecordingsTableStimuli(IntracellularStimuliTable):
"""
Table for storing intracellular stimulus related metadata.
"""
description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""")
stimulus: IntracellularStimuliTableStimulus = Field(..., description="""Column storing the reference to the recorded stimulus for the recording (rows).""")
colnames: Optional[str] = Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""")
id: DynamicTableId = Field(..., description="""Array of unique identifiers for the rows of this dynamic table.""")
VectorData: Optional[List[VectorData]] = Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""")
class IntracellularRecordingsTableResponses(IntracellularResponsesTable):
"""
Table for storing intracellular response related metadata.
"""
description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""")
response: IntracellularResponsesTableResponse = Field(..., description="""Column storing the reference to the recorded response for the recording (rows)""")
colnames: Optional[str] = Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""")
id: DynamicTableId = Field(..., description="""Array of unique identifiers for the rows of this dynamic table.""")
VectorData: Optional[List[VectorData]] = Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""")
class SimultaneousRecordingsTableRecordings(DynamicTableRegion): class SimultaneousRecordingsTableRecordings(DynamicTableRegion):
""" """
A reference to one or more rows in the IntracellularRecordingsTable table. A reference to one or more rows in the IntracellularRecordingsTable table.
""" """
name: str = Field("recordings", const=True)
table: Optional[IntracellularRecordingsTable] = Field(None, description="""Reference to the IntracellularRecordingsTable table that this table region applies to. This specializes the attribute inherited from DynamicTableRegion to fix the type of table that can be referenced here.""") table: Optional[IntracellularRecordingsTable] = Field(None, description="""Reference to the IntracellularRecordingsTable table that this table region applies to. This specializes the attribute inherited from DynamicTableRegion to fix the type of table that can be referenced here.""")
description: Optional[str] = Field(None, description="""Description of what this table region points to.""") description: Optional[str] = Field(None, description="""Description of what this table region points to.""")
array: Optional[NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], ]] = Field(None) array: Optional[Union[
NDArray[Shape["* dim0"], Any],
NDArray[Shape["* dim0, * dim1"], Any],
NDArray[Shape["* dim0, * dim1, * dim2"], Any],
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any]
]] = Field(None)
class SimultaneousRecordingsTableRecordingsIndex(VectorIndex): class SimultaneousRecordingsTableRecordingsIndex(VectorIndex):
""" """
Index dataset for the recordings column. Index dataset for the recordings column.
""" """
name: str = Field("recordings_index", const=True)
target: Optional[VectorData] = Field(None, description="""Reference to the target dataset that this index applies to.""") target: Optional[VectorData] = Field(None, description="""Reference to the target dataset that this index applies to.""")
description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") description: Optional[str] = Field(None, description="""Description of what these vectors represent.""")
array: Optional[NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], ]] = Field(None) array: Optional[Union[
NDArray[Shape["* dim0"], Any],
NDArray[Shape["* dim0, * dim1"], Any],
NDArray[Shape["* dim0, * dim1, * dim2"], Any],
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any]
]] = Field(None)
class SequentialRecordingsTableSimultaneousRecordings(DynamicTableRegion): class SequentialRecordingsTableSimultaneousRecordings(DynamicTableRegion):
""" """
A reference to one or more rows in the SimultaneousRecordingsTable table. A reference to one or more rows in the SimultaneousRecordingsTable table.
""" """
name: str = Field("simultaneous_recordings", const=True)
table: Optional[SimultaneousRecordingsTable] = Field(None, description="""Reference to the SimultaneousRecordingsTable table that this table region applies to. This specializes the attribute inherited from DynamicTableRegion to fix the type of table that can be referenced here.""") table: Optional[SimultaneousRecordingsTable] = Field(None, description="""Reference to the SimultaneousRecordingsTable table that this table region applies to. This specializes the attribute inherited from DynamicTableRegion to fix the type of table that can be referenced here.""")
description: Optional[str] = Field(None, description="""Description of what this table region points to.""") description: Optional[str] = Field(None, description="""Description of what this table region points to.""")
array: Optional[NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], ]] = Field(None) array: Optional[Union[
NDArray[Shape["* dim0"], Any],
NDArray[Shape["* dim0, * dim1"], Any],
NDArray[Shape["* dim0, * dim1, * dim2"], Any],
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any]
]] = Field(None)
class SequentialRecordingsTableSimultaneousRecordingsIndex(VectorIndex): class SequentialRecordingsTableSimultaneousRecordingsIndex(VectorIndex):
""" """
Index dataset for the simultaneous_recordings column. Index dataset for the simultaneous_recordings column.
""" """
name: str = Field("simultaneous_recordings_index", const=True)
target: Optional[VectorData] = Field(None, description="""Reference to the target dataset that this index applies to.""") target: Optional[VectorData] = Field(None, description="""Reference to the target dataset that this index applies to.""")
description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") description: Optional[str] = Field(None, description="""Description of what these vectors represent.""")
array: Optional[NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], ]] = Field(None) array: Optional[Union[
NDArray[Shape["* dim0"], Any],
NDArray[Shape["* dim0, * dim1"], Any],
NDArray[Shape["* dim0, * dim1, * dim2"], Any],
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any]
]] = Field(None)
class RepetitionsTableSequentialRecordings(DynamicTableRegion): class RepetitionsTableSequentialRecordings(DynamicTableRegion):
""" """
A reference to one or more rows in the SequentialRecordingsTable table. A reference to one or more rows in the SequentialRecordingsTable table.
""" """
name: str = Field("sequential_recordings", const=True)
table: Optional[SequentialRecordingsTable] = Field(None, description="""Reference to the SequentialRecordingsTable table that this table region applies to. This specializes the attribute inherited from DynamicTableRegion to fix the type of table that can be referenced here.""") table: Optional[SequentialRecordingsTable] = Field(None, description="""Reference to the SequentialRecordingsTable table that this table region applies to. This specializes the attribute inherited from DynamicTableRegion to fix the type of table that can be referenced here.""")
description: Optional[str] = Field(None, description="""Description of what this table region points to.""") description: Optional[str] = Field(None, description="""Description of what this table region points to.""")
array: Optional[NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], ]] = Field(None) array: Optional[Union[
NDArray[Shape["* dim0"], Any],
NDArray[Shape["* dim0, * dim1"], Any],
NDArray[Shape["* dim0, * dim1, * dim2"], Any],
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any]
]] = Field(None)
class RepetitionsTableSequentialRecordingsIndex(VectorIndex): class RepetitionsTableSequentialRecordingsIndex(VectorIndex):
""" """
Index dataset for the sequential_recordings column. Index dataset for the sequential_recordings column.
""" """
name: str = Field("sequential_recordings_index", const=True)
target: Optional[VectorData] = Field(None, description="""Reference to the target dataset that this index applies to.""") target: Optional[VectorData] = Field(None, description="""Reference to the target dataset that this index applies to.""")
description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") description: Optional[str] = Field(None, description="""Description of what these vectors represent.""")
array: Optional[NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], ]] = Field(None) array: Optional[Union[
NDArray[Shape["* dim0"], Any],
NDArray[Shape["* dim0, * dim1"], Any],
NDArray[Shape["* dim0, * dim1, * dim2"], Any],
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any]
]] = Field(None)
class ExperimentalConditionsTableRepetitions(DynamicTableRegion): class ExperimentalConditionsTableRepetitions(DynamicTableRegion):
""" """
A reference to one or more rows in the RepetitionsTable table. A reference to one or more rows in the RepetitionsTable table.
""" """
name: str = Field("repetitions", const=True)
table: Optional[RepetitionsTable] = Field(None, description="""Reference to the RepetitionsTable table that this table region applies to. This specializes the attribute inherited from DynamicTableRegion to fix the type of table that can be referenced here.""") table: Optional[RepetitionsTable] = Field(None, description="""Reference to the RepetitionsTable table that this table region applies to. This specializes the attribute inherited from DynamicTableRegion to fix the type of table that can be referenced here.""")
description: Optional[str] = Field(None, description="""Description of what this table region points to.""") description: Optional[str] = Field(None, description="""Description of what this table region points to.""")
array: Optional[NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], ]] = Field(None) array: Optional[Union[
NDArray[Shape["* dim0"], Any],
NDArray[Shape["* dim0, * dim1"], Any],
NDArray[Shape["* dim0, * dim1, * dim2"], Any],
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any]
]] = Field(None)
class ExperimentalConditionsTableRepetitionsIndex(VectorIndex): class ExperimentalConditionsTableRepetitionsIndex(VectorIndex):
""" """
Index dataset for the repetitions column. Index dataset for the repetitions column.
""" """
name: str = Field("repetitions_index", const=True)
target: Optional[VectorData] = Field(None, description="""Reference to the target dataset that this index applies to.""") target: Optional[VectorData] = Field(None, description="""Reference to the target dataset that this index applies to.""")
description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") description: Optional[str] = Field(None, description="""Description of what these vectors represent.""")
array: Optional[NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], ]] = Field(None) array: Optional[Union[
NDArray[Shape["* dim0"], Any],
NDArray[Shape["* dim0, * dim1"], Any],
NDArray[Shape["* dim0, * dim1, * dim2"], Any],
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any]
]] = Field(None)
# Update forward refs # Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/postponed_annotations/ # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
PatchClampSeriesData.update_forward_refs() CurrentClampSeriesData.model_rebuild()
CurrentClampSeriesData.update_forward_refs() CurrentClampStimulusSeriesData.model_rebuild()
CurrentClampStimulusSeriesData.update_forward_refs() VoltageClampSeriesData.model_rebuild()
VoltageClampSeriesData.update_forward_refs() VoltageClampSeriesCapacitanceFast.model_rebuild()
VoltageClampSeriesCapacitanceFast.update_forward_refs() VoltageClampSeriesCapacitanceSlow.model_rebuild()
VoltageClampSeriesCapacitanceSlow.update_forward_refs() VoltageClampSeriesResistanceCompBandwidth.model_rebuild()
VoltageClampSeriesResistanceCompBandwidth.update_forward_refs() VoltageClampSeriesResistanceCompCorrection.model_rebuild()
VoltageClampSeriesResistanceCompCorrection.update_forward_refs() VoltageClampSeriesResistanceCompPrediction.model_rebuild()
VoltageClampSeriesResistanceCompPrediction.update_forward_refs() VoltageClampSeriesWholeCellCapacitanceComp.model_rebuild()
VoltageClampSeriesWholeCellCapacitanceComp.update_forward_refs() VoltageClampSeriesWholeCellSeriesResistanceComp.model_rebuild()
VoltageClampSeriesWholeCellSeriesResistanceComp.update_forward_refs() VoltageClampStimulusSeriesData.model_rebuild()
VoltageClampStimulusSeriesData.update_forward_refs() SweepTableSeriesIndex.model_rebuild()
SweepTableSeriesIndex.update_forward_refs() IntracellularStimuliTableStimulus.model_rebuild()
IntracellularStimuliTableStimulus.update_forward_refs() IntracellularResponsesTableResponse.model_rebuild()
IntracellularResponsesTableResponse.update_forward_refs() SimultaneousRecordingsTableRecordings.model_rebuild()
IntracellularRecordingsTableElectrodes.update_forward_refs() SimultaneousRecordingsTableRecordingsIndex.model_rebuild()
IntracellularRecordingsTableStimuli.update_forward_refs() SequentialRecordingsTableSimultaneousRecordings.model_rebuild()
IntracellularRecordingsTableResponses.update_forward_refs() SequentialRecordingsTableSimultaneousRecordingsIndex.model_rebuild()
SimultaneousRecordingsTableRecordings.update_forward_refs() RepetitionsTableSequentialRecordings.model_rebuild()
SimultaneousRecordingsTableRecordingsIndex.update_forward_refs() RepetitionsTableSequentialRecordingsIndex.model_rebuild()
SequentialRecordingsTableSimultaneousRecordings.update_forward_refs() ExperimentalConditionsTableRepetitions.model_rebuild()
SequentialRecordingsTableSimultaneousRecordingsIndex.update_forward_refs() ExperimentalConditionsTableRepetitionsIndex.model_rebuild()
RepetitionsTableSequentialRecordings.update_forward_refs()
RepetitionsTableSequentialRecordingsIndex.update_forward_refs()
ExperimentalConditionsTableRepetitions.update_forward_refs()
ExperimentalConditionsTableRepetitionsIndex.update_forward_refs()

View file

@ -11,44 +11,38 @@ else:
from typing_extensions import Literal from typing_extensions import Literal
# from .core_nwb_image_include import (
# ImageSeriesData,
# OpticalSeriesFieldOfView,
# RGBAImageArray,
# IndexSeriesData,
# ImageSeriesDimension,
# OpticalSeriesData,
# ImageSeriesExternalFile,
# GrayscaleImageArray,
# RGBImageArray
# )
from .core_nwb_base import ( from .core_nwb_base import (
Image, TimeSeries,
TimeSeries Image
)
from .core_nwb_image_include import (
ImageSeriesData,
RGBAImageArray,
GrayscaleImageArray,
RGBImageArray,
OpticalSeriesFieldOfView,
OpticalSeriesData
) )
metamodel_version = "None" metamodel_version = "None"
version = "None" version = "None"
class WeakRefShimBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel,
__slots__ = '__weakref__'
class ConfiguredBaseModel(WeakRefShimBaseModel,
validate_assignment = True, validate_assignment = True,
validate_all = True, validate_default = True,
underscore_attrs_are_private = True,
extra = 'forbid', extra = 'forbid',
arbitrary_types_allowed = True, arbitrary_types_allowed = True,
use_enum_values = True): use_enum_values = True):
pass pass
class GrayscaleImage(ConfiguredBaseModel): class GrayscaleImage(Image):
""" """
A grayscale image. A grayscale image.
""" """
name: str = Field(...)
array: Optional[NDArray[Shape["* x, * y"], Number]] = Field(None) array: Optional[NDArray[Shape["* x, * y"], Number]] = Field(None)
resolution: Optional[float] = Field(None, description="""Pixel resolution of the image, in pixels per centimeter.""") resolution: Optional[float] = Field(None, description="""Pixel resolution of the image, in pixels per centimeter.""")
description: Optional[str] = Field(None, description="""Description of the image.""") description: Optional[str] = Field(None, description="""Description of the image.""")
@ -58,6 +52,7 @@ class RGBImage(Image):
""" """
A color image. A color image.
""" """
name: str = Field(...)
array: Optional[NDArray[Shape["* x, * y, 3 r_g_b"], Number]] = Field(None) array: Optional[NDArray[Shape["* x, * y, 3 r_g_b"], Number]] = Field(None)
resolution: Optional[float] = Field(None, description="""Pixel resolution of the image, in pixels per centimeter.""") resolution: Optional[float] = Field(None, description="""Pixel resolution of the image, in pixels per centimeter.""")
description: Optional[str] = Field(None, description="""Description of the image.""") description: Optional[str] = Field(None, description="""Description of the image.""")
@ -67,86 +62,92 @@ class RGBAImage(Image):
""" """
A color image with transparency. A color image with transparency.
""" """
name: str = Field(...)
array: Optional[NDArray[Shape["* x, * y, 4 r_g_b_a"], Number]] = Field(None) array: Optional[NDArray[Shape["* x, * y, 4 r_g_b_a"], Number]] = Field(None)
resolution: Optional[float] = Field(None, description="""Pixel resolution of the image, in pixels per centimeter.""") resolution: Optional[float] = Field(None, description="""Pixel resolution of the image, in pixels per centimeter.""")
description: Optional[str] = Field(None, description="""Description of the image.""") description: Optional[str] = Field(None, description="""Description of the image.""")
#
# class ImageSeries(TimeSeries): class ImageSeries(TimeSeries):
# """ """
# General image data that is common between acquisition and stimulus time series. Sometimes the image data is stored in the file in a raw format while other times it will be stored as a series of external image files in the host file system. The data field will either be binary data, if the data is stored in the NWB file, or empty, if the data is stored in an external image stack. [frame][x][y] or [frame][x][y][z]. General image data that is common between acquisition and stimulus time series. Sometimes the image data is stored in the file in a raw format while other times it will be stored as a series of external image files in the host file system. The data field will either be binary data, if the data is stored in the NWB file, or empty, if the data is stored in an external image stack. [frame][x][y] or [frame][x][y][z].
# """ """
# data: ImageSeriesData = Field(..., description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""") name: str = Field(...)
# dimension: Optional[ImageSeriesDimension] = Field(None, description="""Number of pixels on x, y, (and z) axes.""") data: ImageSeriesData = Field(..., description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""")
# external_file: Optional[ImageSeriesExternalFile] = Field(None, description="""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.""") dimension: Optional[List[int]] = Field(default_factory=list, description="""Number of pixels on x, y, (and z) axes.""")
# format: Optional[str] = Field(None, description="""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.""") external_file: Optional[List[str]] = Field(default_factory=list, description="""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.""")
# description: Optional[str] = Field(None, description="""Description of the time series.""") format: Optional[str] = Field(None, description="""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.""")
# comments: Optional[str] = Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") description: Optional[str] = Field(None, description="""Description of the time series.""")
# starting_time: Optional[TimeSeriesStartingTime] = Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") comments: Optional[str] = Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""")
# timestamps: Optional[TimeSeriesTimestamps] = Field(None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") starting_time: Optional[TimeSeriesStartingTime] = Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""")
# control: Optional[TimeSeriesControl] = Field(None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") timestamps: Optional[List[float]] = Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""")
# control_description: Optional[TimeSeriesControlDescription] = Field(None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") control: Optional[List[int]] = Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""")
# sync: Optional[TimeSeriesSync] = Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") control_description: Optional[List[str]] = Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""")
# sync: Optional[TimeSeriesSync] = Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""")
#
# class ImageMaskSeries(ImageSeries):
# """ class ImageMaskSeries(ImageSeries):
# An alpha mask that is applied to a presented visual stimulus. The 'data' array contains an array of mask values that are applied to the displayed image. Mask values are stored as RGBA. Mask can vary with time. The timestamps array indicates the starting time of a mask, and that mask pattern continues until it's explicitly changed. """
# """ An alpha mask that is applied to a presented visual stimulus. The 'data' array contains an array of mask values that are applied to the displayed image. Mask values are stored as RGBA. Mask can vary with time. The timestamps array indicates the starting time of a mask, and that mask pattern continues until it's explicitly changed.
# data: ImageSeriesData = Field(..., description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""") """
# dimension: Optional[ImageSeriesDimension] = Field(None, description="""Number of pixels on x, y, (and z) axes.""") name: str = Field(...)
# external_file: Optional[ImageSeriesExternalFile] = Field(None, description="""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.""") data: ImageSeriesData = Field(..., description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""")
# format: Optional[str] = Field(None, description="""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.""") dimension: Optional[List[int]] = Field(default_factory=list, description="""Number of pixels on x, y, (and z) axes.""")
# description: Optional[str] = Field(None, description="""Description of the time series.""") external_file: Optional[List[str]] = Field(default_factory=list, description="""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.""")
# comments: Optional[str] = Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") format: Optional[str] = Field(None, description="""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.""")
# starting_time: Optional[TimeSeriesStartingTime] = Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") description: Optional[str] = Field(None, description="""Description of the time series.""")
# timestamps: Optional[TimeSeriesTimestamps] = Field(None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") comments: Optional[str] = Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""")
# control: Optional[TimeSeriesControl] = Field(None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") starting_time: Optional[TimeSeriesStartingTime] = Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""")
# control_description: Optional[TimeSeriesControlDescription] = Field(None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") timestamps: Optional[List[float]] = Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""")
# sync: Optional[TimeSeriesSync] = Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") control: Optional[List[int]] = Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""")
# control_description: Optional[List[str]] = Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""")
# sync: Optional[TimeSeriesSync] = Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""")
# class OpticalSeries(ImageSeries):
# """
# Image data that is presented or recorded. A stimulus template movie will be stored only as an image. When the image is presented as stimulus, additional data is required, such as field of view (e.g., how much of the visual field the image covers, or how what is the area of the target being imaged). If the OpticalSeries represents acquired imaging data, orientation is also important. class OpticalSeries(ImageSeries):
# """ """
# distance: Optional[float] = Field(None, description="""Distance from camera/monitor to target/eye.""") Image data that is presented or recorded. A stimulus template movie will be stored only as an image. When the image is presented as stimulus, additional data is required, such as field of view (e.g., how much of the visual field the image covers, or how what is the area of the target being imaged). If the OpticalSeries represents acquired imaging data, orientation is also important.
# field_of_view: Optional[OpticalSeriesFieldOfView] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") """
# data: OpticalSeriesData = Field(..., description="""Images presented to subject, either grayscale or RGB""") name: str = Field(...)
# orientation: Optional[str] = Field(None, description="""Description of image relative to some reference frame (e.g., which way is up). Must also specify frame of reference.""") distance: Optional[float] = Field(None, description="""Distance from camera/monitor to target/eye.""")
# dimension: Optional[ImageSeriesDimension] = Field(None, description="""Number of pixels on x, y, (and z) axes.""") field_of_view: Optional[OpticalSeriesFieldOfView] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""")
# external_file: Optional[ImageSeriesExternalFile] = Field(None, description="""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.""") data: OpticalSeriesData = Field(..., description="""Images presented to subject, either grayscale or RGB""")
# format: Optional[str] = Field(None, description="""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.""") orientation: Optional[str] = Field(None, description="""Description of image relative to some reference frame (e.g., which way is up). Must also specify frame of reference.""")
# description: Optional[str] = Field(None, description="""Description of the time series.""") dimension: Optional[List[int]] = Field(default_factory=list, description="""Number of pixels on x, y, (and z) axes.""")
# comments: Optional[str] = Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") external_file: Optional[List[str]] = Field(default_factory=list, description="""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.""")
# starting_time: Optional[TimeSeriesStartingTime] = Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") format: Optional[str] = Field(None, description="""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.""")
# timestamps: Optional[TimeSeriesTimestamps] = Field(None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") description: Optional[str] = Field(None, description="""Description of the time series.""")
# control: Optional[TimeSeriesControl] = Field(None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") comments: Optional[str] = Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""")
# control_description: Optional[TimeSeriesControlDescription] = Field(None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") starting_time: Optional[TimeSeriesStartingTime] = Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""")
# sync: Optional[TimeSeriesSync] = Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") timestamps: Optional[List[float]] = Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""")
# control: Optional[List[int]] = Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""")
# control_description: Optional[List[str]] = Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""")
# class IndexSeries(TimeSeries): sync: Optional[TimeSeriesSync] = Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""")
# """
# Stores indices to image frames stored in an ImageSeries. The purpose of the IndexSeries is to allow a static image stack to be stored in an Images object, and the images in the stack to be referenced out-of-order. This can be for the display of individual images, or of movie segments (as a movie is simply a series of images). The data field stores the index of the frame in the referenced Images object, and the timestamps array indicates when that image was displayed.
# """ class IndexSeries(TimeSeries):
# data: IndexSeriesData = Field(..., description="""Index of the image (using zero-indexing) in the linked Images object.""") """
# description: Optional[str] = Field(None, description="""Description of the time series.""") Stores indices to image frames stored in an ImageSeries. The purpose of the IndexSeries is to allow a static image stack to be stored in an Images object, and the images in the stack to be referenced out-of-order. This can be for the display of individual images, or of movie segments (as a movie is simply a series of images). The data field stores the index of the frame in the referenced Images object, and the timestamps array indicates when that image was displayed.
# comments: Optional[str] = Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") """
# starting_time: Optional[TimeSeriesStartingTime] = Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") name: str = Field(...)
# timestamps: Optional[TimeSeriesTimestamps] = Field(None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") data: List[int] = Field(default_factory=list, description="""Index of the image (using zero-indexing) in the linked Images object.""")
# control: Optional[TimeSeriesControl] = Field(None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") description: Optional[str] = Field(None, description="""Description of the time series.""")
# control_description: Optional[TimeSeriesControlDescription] = Field(None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") comments: Optional[str] = Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""")
# sync: Optional[TimeSeriesSync] = Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") starting_time: Optional[TimeSeriesStartingTime] = Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""")
# timestamps: Optional[List[float]] = Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""")
# control: Optional[List[int]] = Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""")
# control_description: Optional[List[str]] = Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""")
# # Update forward refs sync: Optional[TimeSeriesSync] = Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""")
# # see https://pydantic-docs.helpmanual.io/usage/postponed_annotations/
# GrayscaleImage.update_forward_refs()
# RGBImage.update_forward_refs()
# RGBAImage.update_forward_refs() # Model rebuild
# ImageSeries.update_forward_refs() # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
# ImageMaskSeries.update_forward_refs() GrayscaleImage.model_rebuild()
# OpticalSeries.update_forward_refs() RGBImage.model_rebuild()
# IndexSeries.update_forward_refs() RGBAImage.model_rebuild()
ImageSeries.model_rebuild()
ImageMaskSeries.model_rebuild()
OpticalSeries.model_rebuild()
IndexSeries.model_rebuild()

View file

@ -19,13 +19,9 @@ from .nwb_language import (
metamodel_version = "None" metamodel_version = "None"
version = "None" version = "None"
class WeakRefShimBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel,
__slots__ = '__weakref__'
class ConfiguredBaseModel(WeakRefShimBaseModel,
validate_assignment = True, validate_assignment = True,
validate_all = True, validate_default = True,
underscore_attrs_are_private = True,
extra = 'forbid', extra = 'forbid',
arbitrary_types_allowed = True, arbitrary_types_allowed = True,
use_enum_values = True): use_enum_values = True):
@ -34,29 +30,33 @@ class ConfiguredBaseModel(WeakRefShimBaseModel,
class GrayscaleImageArray(Arraylike): class GrayscaleImageArray(Arraylike):
x: Optional[float] = Field(None) x: float = Field(...)
y: Optional[float] = Field(None) y: float = Field(...)
class RGBImageArray(Arraylike): class RGBImageArray(Arraylike):
x: Optional[float] = Field(None) x: float = Field(...)
y: Optional[float] = Field(None) y: float = Field(...)
r_g_b: Optional[float] = Field(None) r_g_b: float = Field(...)
class RGBAImageArray(Arraylike): class RGBAImageArray(Arraylike):
x: Optional[float] = Field(None) x: float = Field(...)
y: Optional[float] = Field(None) y: float = Field(...)
r_g_b_a: Optional[float] = Field(None) r_g_b_a: float = Field(...)
class ImageSeriesData(ConfiguredBaseModel): class ImageSeriesData(ConfiguredBaseModel):
""" """
Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array. Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.
""" """
array: Optional[NDArray[Shape["* frame, * x, * y, * z"], Number]] = Field(None) name: str = Field("data", const=True)
array: Optional[Union[
NDArray[Shape["* frame, * x, * y"], Number],
NDArray[Shape["* frame, * x, * y, * z"], Number]
]] = Field(None)
class ImageSeriesDataArray(Arraylike): class ImageSeriesDataArray(Arraylike):
@ -67,26 +67,15 @@ class ImageSeriesDataArray(Arraylike):
z: Optional[float] = Field(None) z: Optional[float] = Field(None)
class ImageSeriesDimension(ConfiguredBaseModel):
"""
Number of pixels on x, y, (and z) axes.
"""
dimension: Optional[List[int]] = Field(default_factory=list, description="""Number of pixels on x, y, (and z) axes.""")
class ImageSeriesExternalFile(ConfiguredBaseModel):
"""
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.
"""
starting_frame: Optional[int] = Field(None, description="""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].""")
external_file: Optional[List[str]] = Field(default_factory=list, description="""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.""")
class OpticalSeriesFieldOfView(ConfiguredBaseModel): class OpticalSeriesFieldOfView(ConfiguredBaseModel):
""" """
Width, height and depth of image, or imaged area, in meters. Width, height and depth of image, or imaged area, in meters.
""" """
array: Optional[NDArray[Shape["2 width_height, 3 width_height_depth"], Float32]] = Field(None) name: str = Field("field_of_view", const=True)
array: Optional[Union[
NDArray[Shape["2 width_height"], Float32],
NDArray[Shape["2 width_height, 3 width_height_depth"], Float32]
]] = Field(None)
class OpticalSeriesFieldOfViewArray(Arraylike): class OpticalSeriesFieldOfViewArray(Arraylike):
@ -99,7 +88,11 @@ class OpticalSeriesData(ConfiguredBaseModel):
""" """
Images presented to subject, either grayscale or RGB Images presented to subject, either grayscale or RGB
""" """
array: Optional[NDArray[Shape["* frame, * x, * y, 3 r_g_b"], Number]] = Field(None) name: str = Field("data", const=True)
array: Optional[Union[
NDArray[Shape["* frame, * x, * y"], Number],
NDArray[Shape["* frame, * x, * y, 3 r_g_b"], Number]
]] = Field(None)
class OpticalSeriesDataArray(Arraylike): class OpticalSeriesDataArray(Arraylike):
@ -110,29 +103,16 @@ class OpticalSeriesDataArray(Arraylike):
r_g_b: Optional[float] = Field(None) r_g_b: Optional[float] = Field(None)
class IndexSeriesData(ConfiguredBaseModel):
"""
Index of the image (using zero-indexing) in the linked Images object.
"""
conversion: Optional[float] = Field(None, description="""This field is unused by IndexSeries.""")
resolution: Optional[float] = Field(None, description="""This field is unused by IndexSeries.""")
offset: Optional[float] = Field(None, description="""This field is unused by IndexSeries.""")
unit: Optional[str] = Field(None, description="""This field is unused by IndexSeries and has the value N/A.""")
data: List[int] = Field(default_factory=list, description="""Index of the image (using zero-indexing) in the linked Images object.""")
# Model rebuild
# Update forward refs # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
# see https://pydantic-docs.helpmanual.io/usage/postponed_annotations/ GrayscaleImageArray.model_rebuild()
GrayscaleImageArray.update_forward_refs() RGBImageArray.model_rebuild()
RGBImageArray.update_forward_refs() RGBAImageArray.model_rebuild()
RGBAImageArray.update_forward_refs() ImageSeriesData.model_rebuild()
ImageSeriesData.update_forward_refs() ImageSeriesDataArray.model_rebuild()
ImageSeriesDataArray.update_forward_refs() OpticalSeriesFieldOfView.model_rebuild()
ImageSeriesDimension.update_forward_refs() OpticalSeriesFieldOfViewArray.model_rebuild()
ImageSeriesExternalFile.update_forward_refs() OpticalSeriesData.model_rebuild()
OpticalSeriesFieldOfView.update_forward_refs() OpticalSeriesDataArray.model_rebuild()
OpticalSeriesFieldOfViewArray.update_forward_refs()
OpticalSeriesData.update_forward_refs()
OpticalSeriesDataArray.update_forward_refs()
IndexSeriesData.update_forward_refs()

View file

@ -11,26 +11,25 @@ else:
from typing_extensions import Literal from typing_extensions import Literal
from .hdmf_common_table import (
DynamicTable
)
from .core_nwb_misc_include import ( from .core_nwb_misc_include import (
AbstractFeatureSeriesFeatures, UnitsElectrodes,
UnitsElectrodesIndex, UnitsElectrodesIndex,
UnitsObsIntervalsIndex, UnitsObsIntervalsIndex,
DecompositionSeriesData,
UnitsSpikeTimes, UnitsSpikeTimes,
UnitsWaveformMean, UnitsSpikeTimesIndex,
UnitsWaveformsIndexIndex,
UnitsWaveforms,
UnitsWaveformsIndex,
AnnotationSeriesData,
UnitsObsIntervals,
AbstractFeatureSeriesFeatureUnits,
DecompositionSeriesBands,
UnitsWaveformSd, UnitsWaveformSd,
UnitsElectrodes, UnitsWaveformMean,
IntervalSeriesData, UnitsWaveforms,
DecompositionSeriesSourceChannels,
AbstractFeatureSeriesData, AbstractFeatureSeriesData,
UnitsSpikeTimesIndex UnitsWaveformsIndexIndex,
UnitsObsIntervals,
UnitsWaveformsIndex,
DecompositionSeriesData,
DecompositionSeriesSourceChannels
) )
from .core_nwb_base import ( from .core_nwb_base import (
@ -41,21 +40,13 @@ from .core_nwb_ecephys import (
ElectrodeGroup ElectrodeGroup
) )
from .hdmf_common_table import (
DynamicTable
)
metamodel_version = "None" metamodel_version = "None"
version = "None" version = "None"
class WeakRefShimBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel,
__slots__ = '__weakref__'
class ConfiguredBaseModel(WeakRefShimBaseModel,
validate_assignment = True, validate_assignment = True,
validate_all = True, validate_default = True,
underscore_attrs_are_private = True,
extra = 'forbid', extra = 'forbid',
arbitrary_types_allowed = True, arbitrary_types_allowed = True,
use_enum_values = True): use_enum_values = True):
@ -66,15 +57,16 @@ class AbstractFeatureSeries(TimeSeries):
""" """
Abstract features, such as quantitative descriptions of sensory stimuli. The TimeSeries::data field is a 2D array, storing those features (e.g., for visual grating stimulus this might be orientation, spatial frequency and contrast). Null stimuli (eg, uniform gray) can be marked as being an independent feature (eg, 1.0 for gray, 0.0 for actual stimulus) or by storing NaNs for feature values, or through use of the TimeSeries::control fields. A set of features is considered to persist until the next set of features is defined. The final set of features stored should be the null set. This is useful when storing the raw stimulus is impractical. Abstract features, such as quantitative descriptions of sensory stimuli. The TimeSeries::data field is a 2D array, storing those features (e.g., for visual grating stimulus this might be orientation, spatial frequency and contrast). Null stimuli (eg, uniform gray) can be marked as being an independent feature (eg, 1.0 for gray, 0.0 for actual stimulus) or by storing NaNs for feature values, or through use of the TimeSeries::control fields. A set of features is considered to persist until the next set of features is defined. The final set of features stored should be the null set. This is useful when storing the raw stimulus is impractical.
""" """
name: str = Field(...)
data: AbstractFeatureSeriesData = Field(..., description="""Values of each feature at each time.""") data: AbstractFeatureSeriesData = Field(..., description="""Values of each feature at each time.""")
feature_units: Optional[AbstractFeatureSeriesFeatureUnits] = Field(None, description="""Units of each feature.""") feature_units: Optional[List[str]] = Field(default_factory=list, description="""Units of each feature.""")
features: AbstractFeatureSeriesFeatures = Field(..., description="""Description of the features represented in TimeSeries::data.""") features: List[str] = Field(default_factory=list, description="""Description of the features represented in TimeSeries::data.""")
description: Optional[str] = Field(None, description="""Description of the time series.""") description: Optional[str] = Field(None, description="""Description of the time series.""")
comments: Optional[str] = Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") comments: Optional[str] = Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""")
starting_time: Optional[TimeSeriesStartingTime] = Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") starting_time: Optional[TimeSeriesStartingTime] = Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""")
timestamps: Optional[TimeSeriesTimestamps] = Field(None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") timestamps: Optional[List[float]] = Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""")
control: Optional[TimeSeriesControl] = Field(None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") control: Optional[List[int]] = Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""")
control_description: Optional[TimeSeriesControlDescription] = Field(None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") control_description: Optional[List[str]] = Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""")
sync: Optional[TimeSeriesSync] = Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") sync: Optional[TimeSeriesSync] = Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""")
@ -82,13 +74,14 @@ class AnnotationSeries(TimeSeries):
""" """
Stores user annotations made during an experiment. The data[] field stores a text array, and timestamps are stored for each annotation (ie, interval=1). This is largely an alias to a standard TimeSeries storing a text array but that is identifiable as storing annotations in a machine-readable way. Stores user annotations made during an experiment. The data[] field stores a text array, and timestamps are stored for each annotation (ie, interval=1). This is largely an alias to a standard TimeSeries storing a text array but that is identifiable as storing annotations in a machine-readable way.
""" """
data: AnnotationSeriesData = Field(..., description="""Annotations made during an experiment.""") name: str = Field(...)
data: List[str] = Field(default_factory=list, description="""Annotations made during an experiment.""")
description: Optional[str] = Field(None, description="""Description of the time series.""") description: Optional[str] = Field(None, description="""Description of the time series.""")
comments: Optional[str] = Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") comments: Optional[str] = Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""")
starting_time: Optional[TimeSeriesStartingTime] = Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") starting_time: Optional[TimeSeriesStartingTime] = Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""")
timestamps: Optional[TimeSeriesTimestamps] = Field(None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") timestamps: Optional[List[float]] = Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""")
control: Optional[TimeSeriesControl] = Field(None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") control: Optional[List[int]] = Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""")
control_description: Optional[TimeSeriesControlDescription] = Field(None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") control_description: Optional[List[str]] = Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""")
sync: Optional[TimeSeriesSync] = Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") sync: Optional[TimeSeriesSync] = Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""")
@ -96,13 +89,14 @@ class IntervalSeries(TimeSeries):
""" """
Stores intervals of data. The timestamps field stores the beginning and end of intervals. The data field stores whether the interval just started (>0 value) or ended (<0 value). Different interval types can be represented in the same series by using multiple key values (eg, 1 for feature A, 2 for feature B, 3 for feature C, etc). The field data stores an 8-bit integer. This is largely an alias of a standard TimeSeries but that is identifiable as representing time intervals in a machine-readable way. Stores intervals of data. The timestamps field stores the beginning and end of intervals. The data field stores whether the interval just started (>0 value) or ended (<0 value). Different interval types can be represented in the same series by using multiple key values (eg, 1 for feature A, 2 for feature B, 3 for feature C, etc). The field data stores an 8-bit integer. This is largely an alias of a standard TimeSeries but that is identifiable as representing time intervals in a machine-readable way.
""" """
data: IntervalSeriesData = Field(..., description="""Use values >0 if interval started, <0 if interval ended.""") name: str = Field(...)
data: List[int] = Field(default_factory=list, description="""Use values >0 if interval started, <0 if interval ended.""")
description: Optional[str] = Field(None, description="""Description of the time series.""") description: Optional[str] = Field(None, description="""Description of the time series.""")
comments: Optional[str] = Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") comments: Optional[str] = Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""")
starting_time: Optional[TimeSeriesStartingTime] = Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") starting_time: Optional[TimeSeriesStartingTime] = Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""")
timestamps: Optional[TimeSeriesTimestamps] = Field(None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") timestamps: Optional[List[float]] = Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""")
control: Optional[TimeSeriesControl] = Field(None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") control: Optional[List[int]] = Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""")
control_description: Optional[TimeSeriesControlDescription] = Field(None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") control_description: Optional[List[str]] = Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""")
sync: Optional[TimeSeriesSync] = Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") sync: Optional[TimeSeriesSync] = Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""")
@ -110,16 +104,17 @@ class DecompositionSeries(TimeSeries):
""" """
Spectral analysis of a time series, e.g. of an LFP or a speech signal. Spectral analysis of a time series, e.g. of an LFP or a speech signal.
""" """
name: str = Field(...)
data: DecompositionSeriesData = Field(..., description="""Data decomposed into frequency bands.""") data: DecompositionSeriesData = Field(..., description="""Data decomposed into frequency bands.""")
metric: str = Field(..., description="""The metric used, e.g. phase, amplitude, power.""") metric: str = Field(..., description="""The metric used, e.g. phase, amplitude, power.""")
source_channels: Optional[DecompositionSeriesSourceChannels] = Field(None, description="""DynamicTableRegion pointer to the channels that this decomposition series was generated from.""") source_channels: Optional[DecompositionSeriesSourceChannels] = Field(None, description="""DynamicTableRegion pointer to the channels that this decomposition series was generated from.""")
bands: DecompositionSeriesBands = Field(..., description="""Table for describing the bands that this series was generated from. There should be one row in this table for each band.""") bands: DynamicTable = Field(..., description="""Table for describing the bands that this series was generated from. There should be one row in this table for each band.""")
description: Optional[str] = Field(None, description="""Description of the time series.""") description: Optional[str] = Field(None, description="""Description of the time series.""")
comments: Optional[str] = Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") comments: Optional[str] = Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""")
starting_time: Optional[TimeSeriesStartingTime] = Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") starting_time: Optional[TimeSeriesStartingTime] = Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""")
timestamps: Optional[TimeSeriesTimestamps] = Field(None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") timestamps: Optional[List[float]] = Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""")
control: Optional[TimeSeriesControl] = Field(None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") control: Optional[List[int]] = Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""")
control_description: Optional[TimeSeriesControlDescription] = Field(None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") control_description: Optional[List[str]] = Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""")
sync: Optional[TimeSeriesSync] = Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") sync: Optional[TimeSeriesSync] = Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""")
@ -127,6 +122,7 @@ class Units(DynamicTable):
""" """
Data about spiking units. Event times of observed units (e.g. cell, synapse, etc.) should be concatenated and stored in spike_times. Data about spiking units. Event times of observed units (e.g. cell, synapse, etc.) should be concatenated and stored in spike_times.
""" """
name: str = Field(...)
spike_times_index: Optional[UnitsSpikeTimesIndex] = Field(None, description="""Index into the spike_times dataset.""") spike_times_index: Optional[UnitsSpikeTimesIndex] = Field(None, description="""Index into the spike_times dataset.""")
spike_times: Optional[UnitsSpikeTimes] = Field(None, description="""Spike times for each unit in seconds.""") spike_times: Optional[UnitsSpikeTimes] = Field(None, description="""Spike times for each unit in seconds.""")
obs_intervals_index: Optional[UnitsObsIntervalsIndex] = Field(None, description="""Index into the obs_intervals dataset.""") obs_intervals_index: Optional[UnitsObsIntervalsIndex] = Field(None, description="""Index into the obs_intervals dataset.""")
@ -141,15 +137,16 @@ class Units(DynamicTable):
waveforms_index_index: Optional[UnitsWaveformsIndexIndex] = Field(None, description="""Index into the waveforms_index dataset. One value for every unit (row in the table). See 'waveforms' for more detail.""") waveforms_index_index: Optional[UnitsWaveformsIndexIndex] = Field(None, description="""Index into the waveforms_index dataset. One value for every unit (row in the table). See 'waveforms' for more detail.""")
colnames: Optional[str] = Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") colnames: Optional[str] = Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""")
description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""")
id: DynamicTableId = Field(..., description="""Array of unique identifiers for the rows of this dynamic table.""") id: List[int] = Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""")
VectorData: Optional[List[VectorData]] = Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") VectorData: Optional[List[VectorData]] = Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""")
# Update forward refs # Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/postponed_annotations/ # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
AbstractFeatureSeries.update_forward_refs() AbstractFeatureSeries.model_rebuild()
AnnotationSeries.update_forward_refs() AnnotationSeries.model_rebuild()
IntervalSeries.update_forward_refs() IntervalSeries.model_rebuild()
DecompositionSeries.update_forward_refs() DecompositionSeries.model_rebuild()
Units.update_forward_refs() Units.model_rebuild()

View file

@ -13,9 +13,8 @@ else:
from .hdmf_common_table import ( from .hdmf_common_table import (
DynamicTableRegion, DynamicTableRegion,
DynamicTable, VectorData,
VectorIndex, VectorIndex
VectorData
) )
from .nwb_language import ( from .nwb_language import (
@ -26,13 +25,9 @@ from .nwb_language import (
metamodel_version = "None" metamodel_version = "None"
version = "None" version = "None"
class WeakRefShimBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel,
__slots__ = '__weakref__'
class ConfiguredBaseModel(WeakRefShimBaseModel,
validate_assignment = True, validate_assignment = True,
validate_all = True, validate_default = True,
underscore_attrs_are_private = True,
extra = 'forbid', extra = 'forbid',
arbitrary_types_allowed = True, arbitrary_types_allowed = True,
use_enum_values = True): use_enum_values = True):
@ -43,8 +38,12 @@ class AbstractFeatureSeriesData(ConfiguredBaseModel):
""" """
Values of each feature at each time. Values of each feature at each time.
""" """
name: str = Field("data", const=True)
unit: Optional[str] = Field(None, description="""Since there can be different units for different features, store the units in 'feature_units'. The default value for this attribute is \"see 'feature_units'\".""") unit: Optional[str] = Field(None, description="""Since there can be different units for different features, store the units in 'feature_units'. The default value for this attribute is \"see 'feature_units'\".""")
array: Optional[NDArray[Shape["* num_times, * num_features"], Number]] = Field(None) array: Optional[Union[
NDArray[Shape["* num_times"], Number],
NDArray[Shape["* num_times, * num_features"], Number]
]] = Field(None)
class AbstractFeatureSeriesDataArray(Arraylike): class AbstractFeatureSeriesDataArray(Arraylike):
@ -53,225 +52,221 @@ class AbstractFeatureSeriesDataArray(Arraylike):
num_features: Optional[float] = Field(None) num_features: Optional[float] = Field(None)
class AbstractFeatureSeriesFeatureUnits(ConfiguredBaseModel):
"""
Units of each feature.
"""
feature_units: Optional[List[str]] = Field(default_factory=list, description="""Units of each feature.""")
class AbstractFeatureSeriesFeatures(ConfiguredBaseModel):
"""
Description of the features represented in TimeSeries::data.
"""
features: List[str] = Field(default_factory=list, description="""Description of the features represented in TimeSeries::data.""")
class AnnotationSeriesData(ConfiguredBaseModel):
"""
Annotations made during an experiment.
"""
resolution: Optional[float] = Field(None, description="""Smallest meaningful difference between values in data. Annotations have no units, so the value is fixed to -1.0.""")
unit: Optional[str] = Field(None, description="""Base unit of measurement for working with the data. Annotations have no units, so the value is fixed to 'n/a'.""")
data: List[str] = Field(default_factory=list, description="""Annotations made during an experiment.""")
class IntervalSeriesData(ConfiguredBaseModel):
"""
Use values >0 if interval started, <0 if interval ended.
"""
resolution: Optional[float] = Field(None, description="""Smallest meaningful difference between values in data. Annotations have no units, so the value is fixed to -1.0.""")
unit: Optional[str] = Field(None, description="""Base unit of measurement for working with the data. Annotations have no units, so the value is fixed to 'n/a'.""")
data: List[int] = Field(default_factory=list, description="""Use values >0 if interval started, <0 if interval ended.""")
class DecompositionSeriesData(ConfiguredBaseModel): class DecompositionSeriesData(ConfiguredBaseModel):
""" """
Data decomposed into frequency bands. Data decomposed into frequency bands.
""" """
name: str = Field("data", const=True)
unit: Optional[str] = Field(None, description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") unit: Optional[str] = Field(None, description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""")
array: Optional[NDArray[Shape["* num_times, * num_channels, * num_bands"], Number]] = Field(None) array: Optional[NDArray[Shape["* num_times, * num_channels, * num_bands"], Number]] = Field(None)
class DecompositionSeriesDataArray(Arraylike): class DecompositionSeriesDataArray(Arraylike):
num_times: Optional[float] = Field(None) num_times: float = Field(...)
num_channels: Optional[float] = Field(None) num_channels: float = Field(...)
num_bands: Optional[float] = Field(None) num_bands: float = Field(...)
class DecompositionSeriesSourceChannels(DynamicTableRegion): class DecompositionSeriesSourceChannels(DynamicTableRegion):
""" """
DynamicTableRegion pointer to the channels that this decomposition series was generated from. DynamicTableRegion pointer to the channels that this decomposition series was generated from.
""" """
name: str = Field("source_channels", const=True)
table: Optional[DynamicTable] = Field(None, description="""Reference to the DynamicTable object that this region applies to.""") table: Optional[DynamicTable] = Field(None, description="""Reference to the DynamicTable object that this region applies to.""")
description: Optional[str] = Field(None, description="""Description of what this table region points to.""") description: Optional[str] = Field(None, description="""Description of what this table region points to.""")
array: Optional[NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], ]] = Field(None) array: Optional[Union[
NDArray[Shape["* dim0"], Any],
NDArray[Shape["* dim0, * dim1"], Any],
class DecompositionSeriesBands(DynamicTable): NDArray[Shape["* dim0, * dim1, * dim2"], Any],
""" NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any]
Table for describing the bands that this series was generated from. There should be one row in this table for each band. ]] = Field(None)
"""
band_name: Optional[List[str]] = Field(default_factory=list, description="""Name of the band, e.g. theta.""")
band_limits: DecompositionSeriesBandsBandLimits = Field(..., description="""Low and high limit of each band in Hz. If it is a Gaussian filter, use 2 SD on either side of the center.""")
band_mean: DecompositionSeriesBandsBandMean = Field(..., description="""The mean Gaussian filters, in Hz.""")
band_stdev: DecompositionSeriesBandsBandStdev = Field(..., description="""The standard deviation of Gaussian filters, in Hz.""")
colnames: Optional[str] = Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""")
description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""")
id: DynamicTableId = Field(..., description="""Array of unique identifiers for the rows of this dynamic table.""")
VectorData: Optional[List[VectorData]] = Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""")
class DecompositionSeriesBandsBandLimits(VectorData):
"""
Low and high limit of each band in Hz. If it is a Gaussian filter, use 2 SD on either side of the center.
"""
description: Optional[str] = Field(None, description="""Description of what these vectors represent.""")
array: Optional[NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], ]] = Field(None)
class DecompositionSeriesBandsBandMean(VectorData):
"""
The mean Gaussian filters, in Hz.
"""
description: Optional[str] = Field(None, description="""Description of what these vectors represent.""")
array: Optional[NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], ]] = Field(None)
class DecompositionSeriesBandsBandStdev(VectorData):
"""
The standard deviation of Gaussian filters, in Hz.
"""
description: Optional[str] = Field(None, description="""Description of what these vectors represent.""")
array: Optional[NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], ]] = Field(None)
class UnitsSpikeTimesIndex(VectorIndex): class UnitsSpikeTimesIndex(VectorIndex):
""" """
Index into the spike_times dataset. Index into the spike_times dataset.
""" """
name: str = Field("spike_times_index", const=True)
target: Optional[VectorData] = Field(None, description="""Reference to the target dataset that this index applies to.""") target: Optional[VectorData] = Field(None, description="""Reference to the target dataset that this index applies to.""")
description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") description: Optional[str] = Field(None, description="""Description of what these vectors represent.""")
array: Optional[NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], ]] = Field(None) array: Optional[Union[
NDArray[Shape["* dim0"], Any],
NDArray[Shape["* dim0, * dim1"], Any],
NDArray[Shape["* dim0, * dim1, * dim2"], Any],
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any]
]] = Field(None)
class UnitsSpikeTimes(VectorData): class UnitsSpikeTimes(VectorData):
""" """
Spike times for each unit in seconds. Spike times for each unit in seconds.
""" """
name: str = Field("spike_times", const=True)
resolution: Optional[float] = Field(None, description="""The smallest possible difference between two spike times. Usually 1 divided by the acquisition sampling rate from which spike times were extracted, but could be larger if the acquisition time series was downsampled or smaller if the acquisition time series was smoothed/interpolated and it is possible for the spike time to be between samples.""") resolution: Optional[float] = Field(None, description="""The smallest possible difference between two spike times. Usually 1 divided by the acquisition sampling rate from which spike times were extracted, but could be larger if the acquisition time series was downsampled or smaller if the acquisition time series was smoothed/interpolated and it is possible for the spike time to be between samples.""")
description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") description: Optional[str] = Field(None, description="""Description of what these vectors represent.""")
array: Optional[NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], ]] = Field(None) array: Optional[Union[
NDArray[Shape["* dim0"], Any],
NDArray[Shape["* dim0, * dim1"], Any],
NDArray[Shape["* dim0, * dim1, * dim2"], Any],
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any]
]] = Field(None)
class UnitsObsIntervalsIndex(VectorIndex): class UnitsObsIntervalsIndex(VectorIndex):
""" """
Index into the obs_intervals dataset. Index into the obs_intervals dataset.
""" """
name: str = Field("obs_intervals_index", const=True)
target: Optional[VectorData] = Field(None, description="""Reference to the target dataset that this index applies to.""") target: Optional[VectorData] = Field(None, description="""Reference to the target dataset that this index applies to.""")
description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") description: Optional[str] = Field(None, description="""Description of what these vectors represent.""")
array: Optional[NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], ]] = Field(None) array: Optional[Union[
NDArray[Shape["* dim0"], Any],
NDArray[Shape["* dim0, * dim1"], Any],
NDArray[Shape["* dim0, * dim1, * dim2"], Any],
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any]
]] = Field(None)
class UnitsObsIntervals(VectorData): class UnitsObsIntervals(VectorData):
""" """
Observation intervals for each unit. Observation intervals for each unit.
""" """
name: str = Field("obs_intervals", const=True)
description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") description: Optional[str] = Field(None, description="""Description of what these vectors represent.""")
array: Optional[NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], ]] = Field(None) array: Optional[Union[
NDArray[Shape["* dim0"], Any],
NDArray[Shape["* dim0, * dim1"], Any],
NDArray[Shape["* dim0, * dim1, * dim2"], Any],
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any]
]] = Field(None)
class UnitsElectrodesIndex(VectorIndex): class UnitsElectrodesIndex(VectorIndex):
""" """
Index into electrodes. Index into electrodes.
""" """
name: str = Field("electrodes_index", const=True)
target: Optional[VectorData] = Field(None, description="""Reference to the target dataset that this index applies to.""") target: Optional[VectorData] = Field(None, description="""Reference to the target dataset that this index applies to.""")
description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") description: Optional[str] = Field(None, description="""Description of what these vectors represent.""")
array: Optional[NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], ]] = Field(None) array: Optional[Union[
NDArray[Shape["* dim0"], Any],
NDArray[Shape["* dim0, * dim1"], Any],
NDArray[Shape["* dim0, * dim1, * dim2"], Any],
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any]
]] = Field(None)
class UnitsElectrodes(DynamicTableRegion): class UnitsElectrodes(DynamicTableRegion):
""" """
Electrode that each spike unit came from, specified using a DynamicTableRegion. Electrode that each spike unit came from, specified using a DynamicTableRegion.
""" """
name: str = Field("electrodes", const=True)
table: Optional[DynamicTable] = Field(None, description="""Reference to the DynamicTable object that this region applies to.""") table: Optional[DynamicTable] = Field(None, description="""Reference to the DynamicTable object that this region applies to.""")
description: Optional[str] = Field(None, description="""Description of what this table region points to.""") description: Optional[str] = Field(None, description="""Description of what this table region points to.""")
array: Optional[NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], ]] = Field(None) array: Optional[Union[
NDArray[Shape["* dim0"], Any],
NDArray[Shape["* dim0, * dim1"], Any],
NDArray[Shape["* dim0, * dim1, * dim2"], Any],
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any]
]] = Field(None)
class UnitsWaveformMean(VectorData): class UnitsWaveformMean(VectorData):
""" """
Spike waveform mean for each spike unit. Spike waveform mean for each spike unit.
""" """
name: str = Field("waveform_mean", const=True)
sampling_rate: Optional[float] = Field(None, description="""Sampling rate, in hertz.""") sampling_rate: Optional[float] = Field(None, description="""Sampling rate, in hertz.""")
unit: Optional[str] = Field(None, description="""Unit of measurement. This value is fixed to 'volts'.""") unit: Optional[str] = Field(None, description="""Unit of measurement. This value is fixed to 'volts'.""")
description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") description: Optional[str] = Field(None, description="""Description of what these vectors represent.""")
array: Optional[NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], ]] = Field(None) array: Optional[Union[
NDArray[Shape["* dim0"], Any],
NDArray[Shape["* dim0, * dim1"], Any],
NDArray[Shape["* dim0, * dim1, * dim2"], Any],
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any]
]] = Field(None)
class UnitsWaveformSd(VectorData): class UnitsWaveformSd(VectorData):
""" """
Spike waveform standard deviation for each spike unit. Spike waveform standard deviation for each spike unit.
""" """
name: str = Field("waveform_sd", const=True)
sampling_rate: Optional[float] = Field(None, description="""Sampling rate, in hertz.""") sampling_rate: Optional[float] = Field(None, description="""Sampling rate, in hertz.""")
unit: Optional[str] = Field(None, description="""Unit of measurement. This value is fixed to 'volts'.""") unit: Optional[str] = Field(None, description="""Unit of measurement. This value is fixed to 'volts'.""")
description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") description: Optional[str] = Field(None, description="""Description of what these vectors represent.""")
array: Optional[NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], ]] = Field(None) array: Optional[Union[
NDArray[Shape["* dim0"], Any],
NDArray[Shape["* dim0, * dim1"], Any],
NDArray[Shape["* dim0, * dim1, * dim2"], Any],
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any]
]] = Field(None)
class UnitsWaveforms(VectorData): class UnitsWaveforms(VectorData):
""" """
Individual waveforms for each spike on each electrode. This is a doubly indexed column. The 'waveforms_index' column indexes which waveforms in this column belong to the same spike event for a given unit, where each waveform was recorded from a different electrode. The 'waveforms_index_index' column indexes the 'waveforms_index' column to indicate which spike events belong to a given unit. For example, if the 'waveforms_index_index' column has values [2, 5, 6], then the first 2 elements of the 'waveforms_index' column correspond to the 2 spike events of the first unit, the next 3 elements of the 'waveforms_index' column correspond to the 3 spike events of the second unit, and the next 1 element of the 'waveforms_index' column corresponds to the 1 spike event of the third unit. If the 'waveforms_index' column has values [3, 6, 8, 10, 12, 13], then the first 3 elements of the 'waveforms' column contain the 3 spike waveforms that were recorded from 3 different electrodes for the first spike time of the first unit. See https://nwb-schema.readthedocs.io/en/stable/format_description.html#doubly-ragged-arrays for a graphical representation of this example. When there is only one electrode for each unit (i.e., each spike time is associated with a single waveform), then the 'waveforms_index' column will have values 1, 2, ..., N, where N is the number of spike events. The number of electrodes for each spike event should be the same within a given unit. The 'electrodes' column should be used to indicate which electrodes are associated with each unit, and the order of the waveforms within a given unit x spike event should be in the same order as the electrodes referenced in the 'electrodes' column of this table. The number of samples for each waveform must be the same. Individual waveforms for each spike on each electrode. This is a doubly indexed column. The 'waveforms_index' column indexes which waveforms in this column belong to the same spike event for a given unit, where each waveform was recorded from a different electrode. The 'waveforms_index_index' column indexes the 'waveforms_index' column to indicate which spike events belong to a given unit. For example, if the 'waveforms_index_index' column has values [2, 5, 6], then the first 2 elements of the 'waveforms_index' column correspond to the 2 spike events of the first unit, the next 3 elements of the 'waveforms_index' column correspond to the 3 spike events of the second unit, and the next 1 element of the 'waveforms_index' column corresponds to the 1 spike event of the third unit. If the 'waveforms_index' column has values [3, 6, 8, 10, 12, 13], then the first 3 elements of the 'waveforms' column contain the 3 spike waveforms that were recorded from 3 different electrodes for the first spike time of the first unit. See https://nwb-schema.readthedocs.io/en/stable/format_description.html#doubly-ragged-arrays for a graphical representation of this example. When there is only one electrode for each unit (i.e., each spike time is associated with a single waveform), then the 'waveforms_index' column will have values 1, 2, ..., N, where N is the number of spike events. The number of electrodes for each spike event should be the same within a given unit. The 'electrodes' column should be used to indicate which electrodes are associated with each unit, and the order of the waveforms within a given unit x spike event should be in the same order as the electrodes referenced in the 'electrodes' column of this table. The number of samples for each waveform must be the same.
""" """
name: str = Field("waveforms", const=True)
sampling_rate: Optional[float] = Field(None, description="""Sampling rate, in hertz.""") sampling_rate: Optional[float] = Field(None, description="""Sampling rate, in hertz.""")
unit: Optional[str] = Field(None, description="""Unit of measurement. This value is fixed to 'volts'.""") unit: Optional[str] = Field(None, description="""Unit of measurement. This value is fixed to 'volts'.""")
description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") description: Optional[str] = Field(None, description="""Description of what these vectors represent.""")
array: Optional[NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], ]] = Field(None) array: Optional[Union[
NDArray[Shape["* dim0"], Any],
NDArray[Shape["* dim0, * dim1"], Any],
NDArray[Shape["* dim0, * dim1, * dim2"], Any],
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any]
]] = Field(None)
class UnitsWaveformsIndex(VectorIndex): class UnitsWaveformsIndex(VectorIndex):
""" """
Index into the waveforms dataset. One value for every spike event. See 'waveforms' for more detail. Index into the waveforms dataset. One value for every spike event. See 'waveforms' for more detail.
""" """
name: str = Field("waveforms_index", const=True)
target: Optional[VectorData] = Field(None, description="""Reference to the target dataset that this index applies to.""") target: Optional[VectorData] = Field(None, description="""Reference to the target dataset that this index applies to.""")
description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") description: Optional[str] = Field(None, description="""Description of what these vectors represent.""")
array: Optional[NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], ]] = Field(None) array: Optional[Union[
NDArray[Shape["* dim0"], Any],
NDArray[Shape["* dim0, * dim1"], Any],
NDArray[Shape["* dim0, * dim1, * dim2"], Any],
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any]
]] = Field(None)
class UnitsWaveformsIndexIndex(VectorIndex): class UnitsWaveformsIndexIndex(VectorIndex):
""" """
Index into the waveforms_index dataset. One value for every unit (row in the table). See 'waveforms' for more detail. Index into the waveforms_index dataset. One value for every unit (row in the table). See 'waveforms' for more detail.
""" """
name: str = Field("waveforms_index_index", const=True)
target: Optional[VectorData] = Field(None, description="""Reference to the target dataset that this index applies to.""") target: Optional[VectorData] = Field(None, description="""Reference to the target dataset that this index applies to.""")
description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") description: Optional[str] = Field(None, description="""Description of what these vectors represent.""")
array: Optional[NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], ]] = Field(None) array: Optional[Union[
NDArray[Shape["* dim0"], Any],
NDArray[Shape["* dim0, * dim1"], Any],
NDArray[Shape["* dim0, * dim1, * dim2"], Any],
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any]
]] = Field(None)
# Update forward refs # Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/postponed_annotations/ # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
AbstractFeatureSeriesData.update_forward_refs() AbstractFeatureSeriesData.model_rebuild()
AbstractFeatureSeriesDataArray.update_forward_refs() AbstractFeatureSeriesDataArray.model_rebuild()
AbstractFeatureSeriesFeatureUnits.update_forward_refs() DecompositionSeriesData.model_rebuild()
AbstractFeatureSeriesFeatures.update_forward_refs() DecompositionSeriesDataArray.model_rebuild()
AnnotationSeriesData.update_forward_refs() DecompositionSeriesSourceChannels.model_rebuild()
IntervalSeriesData.update_forward_refs() UnitsSpikeTimesIndex.model_rebuild()
DecompositionSeriesData.update_forward_refs() UnitsSpikeTimes.model_rebuild()
DecompositionSeriesDataArray.update_forward_refs() UnitsObsIntervalsIndex.model_rebuild()
DecompositionSeriesSourceChannels.update_forward_refs() UnitsObsIntervals.model_rebuild()
DecompositionSeriesBands.update_forward_refs() UnitsElectrodesIndex.model_rebuild()
DecompositionSeriesBandsBandLimits.update_forward_refs() UnitsElectrodes.model_rebuild()
DecompositionSeriesBandsBandMean.update_forward_refs() UnitsWaveformMean.model_rebuild()
DecompositionSeriesBandsBandStdev.update_forward_refs() UnitsWaveformSd.model_rebuild()
UnitsSpikeTimesIndex.update_forward_refs() UnitsWaveforms.model_rebuild()
UnitsSpikeTimes.update_forward_refs() UnitsWaveformsIndex.model_rebuild()
UnitsObsIntervalsIndex.update_forward_refs() UnitsWaveformsIndexIndex.model_rebuild()
UnitsObsIntervals.update_forward_refs()
UnitsElectrodesIndex.update_forward_refs()
UnitsElectrodes.update_forward_refs()
UnitsWaveformMean.update_forward_refs()
UnitsWaveformSd.update_forward_refs()
UnitsWaveforms.update_forward_refs()
UnitsWaveformsIndex.update_forward_refs()
UnitsWaveformsIndexIndex.update_forward_refs()

View file

@ -16,21 +16,13 @@ from .core_nwb_base import (
TimeSeries TimeSeries
) )
from .core_nwb_ogen_include import (
OptogeneticSeriesData
)
metamodel_version = "None" metamodel_version = "None"
version = "None" version = "None"
class WeakRefShimBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel,
__slots__ = '__weakref__'
class ConfiguredBaseModel(WeakRefShimBaseModel,
validate_assignment = True, validate_assignment = True,
validate_all = True, validate_default = True,
underscore_attrs_are_private = True,
extra = 'forbid', extra = 'forbid',
arbitrary_types_allowed = True, arbitrary_types_allowed = True,
use_enum_values = True): use_enum_values = True):
@ -41,13 +33,14 @@ class OptogeneticSeries(TimeSeries):
""" """
An optogenetic stimulus. An optogenetic stimulus.
""" """
data: OptogeneticSeriesData = Field(..., description="""Applied power for optogenetic stimulus, in watts.""") name: str = Field(...)
data: List[float] = Field(default_factory=list, description="""Applied power for optogenetic stimulus, in watts.""")
description: Optional[str] = Field(None, description="""Description of the time series.""") description: Optional[str] = Field(None, description="""Description of the time series.""")
comments: Optional[str] = Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") comments: Optional[str] = Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""")
starting_time: Optional[TimeSeriesStartingTime] = Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") starting_time: Optional[TimeSeriesStartingTime] = Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""")
timestamps: Optional[TimeSeriesTimestamps] = Field(None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") timestamps: Optional[List[float]] = Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""")
control: Optional[TimeSeriesControl] = Field(None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") control: Optional[List[int]] = Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""")
control_description: Optional[TimeSeriesControlDescription] = Field(None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") control_description: Optional[List[str]] = Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""")
sync: Optional[TimeSeriesSync] = Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") sync: Optional[TimeSeriesSync] = Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""")
@ -55,13 +48,15 @@ class OptogeneticStimulusSite(NWBContainer):
""" """
A site of optogenetic stimulation. A site of optogenetic stimulation.
""" """
name: str = Field(...)
description: str = Field(..., description="""Description of stimulation site.""") description: str = Field(..., description="""Description of stimulation site.""")
excitation_lambda: float = Field(..., description="""Excitation wavelength, in nm.""") excitation_lambda: float = Field(..., description="""Excitation wavelength, in nm.""")
location: str = Field(..., description="""Location of the stimulation site. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""") location: str = Field(..., description="""Location of the stimulation site. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""")
# Update forward refs # Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/postponed_annotations/ # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
OptogeneticSeries.update_forward_refs() OptogeneticSeries.model_rebuild()
OptogeneticStimulusSite.update_forward_refs() OptogeneticStimulusSite.model_rebuild()

View file

@ -15,13 +15,9 @@ else:
metamodel_version = "None" metamodel_version = "None"
version = "None" version = "None"
class WeakRefShimBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel,
__slots__ = '__weakref__'
class ConfiguredBaseModel(WeakRefShimBaseModel,
validate_assignment = True, validate_assignment = True,
validate_all = True, validate_default = True,
underscore_attrs_are_private = True,
extra = 'forbid', extra = 'forbid',
arbitrary_types_allowed = True, arbitrary_types_allowed = True,
use_enum_values = True): use_enum_values = True):
@ -37,6 +33,7 @@ class OptogeneticSeriesData(ConfiguredBaseModel):
# Update forward refs # Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/postponed_annotations/ # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
OptogeneticSeriesData.update_forward_refs() OptogeneticSeriesData.model_rebuild()

View file

@ -11,25 +11,22 @@ else:
from typing_extensions import Literal from typing_extensions import Literal
from .core_nwb_ophys_include import (
CorrectedImageStackXyTranslation,
PlaneSegmentationVoxelMaskIndex,
ImagingPlaneOriginCoords,
TwoPhotonSeriesFieldOfView,
RoiResponseSeriesRois,
CorrectedImageStackCorrected,
ImagingPlaneManifold,
PlaneSegmentationImageMask,
PlaneSegmentationReferenceImages,
ImagingPlaneGridSpacing,
RoiResponseSeriesData,
PlaneSegmentationPixelMaskIndex
)
from .core_nwb_base import ( from .core_nwb_base import (
TimeSeries, TimeSeries,
NWBContainer, NWBDataInterface,
NWBDataInterface NWBContainer
)
from .core_nwb_ophys_include import (
RoiResponseSeriesRois,
TwoPhotonSeriesFieldOfView,
ImagingPlaneOriginCoords,
RoiResponseSeriesData,
PlaneSegmentationPixelMaskIndex,
PlaneSegmentationImageMask,
ImagingPlaneGridSpacing,
PlaneSegmentationVoxelMaskIndex,
ImagingPlaneManifold
) )
from .hdmf_common_table import ( from .hdmf_common_table import (
@ -44,13 +41,9 @@ from .core_nwb_image import (
metamodel_version = "None" metamodel_version = "None"
version = "None" version = "None"
class WeakRefShimBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel,
__slots__ = '__weakref__'
class ConfiguredBaseModel(WeakRefShimBaseModel,
validate_assignment = True, validate_assignment = True,
validate_all = True, validate_default = True,
underscore_attrs_are_private = True,
extra = 'forbid', extra = 'forbid',
arbitrary_types_allowed = True, arbitrary_types_allowed = True,
use_enum_values = True): use_enum_values = True):
@ -61,6 +54,7 @@ class OnePhotonSeries(ImageSeries):
""" """
Image stack recorded over time from 1-photon microscope. Image stack recorded over time from 1-photon microscope.
""" """
name: str = Field(...)
pmt_gain: Optional[float] = Field(None, description="""Photomultiplier gain.""") pmt_gain: Optional[float] = Field(None, description="""Photomultiplier gain.""")
scan_line_rate: Optional[float] = Field(None, description="""Lines imaged per second. This is also stored in /general/optophysiology but is kept here as it is useful information for analysis, and so good to be stored w/ the actual data.""") scan_line_rate: Optional[float] = Field(None, description="""Lines imaged per second. This is also stored in /general/optophysiology but is kept here as it is useful information for analysis, and so good to be stored w/ the actual data.""")
exposure_time: Optional[float] = Field(None, description="""Exposure time of the sample; often the inverse of the frequency.""") exposure_time: Optional[float] = Field(None, description="""Exposure time of the sample; often the inverse of the frequency.""")
@ -68,15 +62,15 @@ class OnePhotonSeries(ImageSeries):
power: Optional[float] = Field(None, description="""Power of the excitation in mW, if known.""") power: Optional[float] = Field(None, description="""Power of the excitation in mW, if known.""")
intensity: Optional[float] = Field(None, description="""Intensity of the excitation in mW/mm^2, if known.""") intensity: Optional[float] = Field(None, description="""Intensity of the excitation in mW/mm^2, if known.""")
data: ImageSeriesData = Field(..., description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""") data: ImageSeriesData = Field(..., description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""")
dimension: Optional[ImageSeriesDimension] = Field(None, description="""Number of pixels on x, y, (and z) axes.""") dimension: Optional[List[int]] = Field(default_factory=list, description="""Number of pixels on x, y, (and z) axes.""")
external_file: Optional[ImageSeriesExternalFile] = Field(None, description="""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: Optional[List[str]] = Field(default_factory=list, description="""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.""")
format: Optional[str] = Field(None, description="""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.""") format: Optional[str] = Field(None, description="""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.""")
description: Optional[str] = Field(None, description="""Description of the time series.""") description: Optional[str] = Field(None, description="""Description of the time series.""")
comments: Optional[str] = Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") comments: Optional[str] = Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""")
starting_time: Optional[TimeSeriesStartingTime] = Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") starting_time: Optional[TimeSeriesStartingTime] = Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""")
timestamps: Optional[TimeSeriesTimestamps] = Field(None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") timestamps: Optional[List[float]] = Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""")
control: Optional[TimeSeriesControl] = Field(None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") control: Optional[List[int]] = Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""")
control_description: Optional[TimeSeriesControlDescription] = Field(None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") control_description: Optional[List[str]] = Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""")
sync: Optional[TimeSeriesSync] = Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") sync: Optional[TimeSeriesSync] = Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""")
@ -84,19 +78,20 @@ class TwoPhotonSeries(ImageSeries):
""" """
Image stack recorded over time from 2-photon microscope. Image stack recorded over time from 2-photon microscope.
""" """
name: str = Field(...)
pmt_gain: Optional[float] = Field(None, description="""Photomultiplier gain.""") pmt_gain: Optional[float] = Field(None, description="""Photomultiplier gain.""")
scan_line_rate: Optional[float] = Field(None, description="""Lines imaged per second. This is also stored in /general/optophysiology but is kept here as it is useful information for analysis, and so good to be stored w/ the actual data.""") scan_line_rate: Optional[float] = Field(None, description="""Lines imaged per second. This is also stored in /general/optophysiology but is kept here as it is useful information for analysis, and so good to be stored w/ the actual data.""")
field_of_view: Optional[TwoPhotonSeriesFieldOfView] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") field_of_view: Optional[TwoPhotonSeriesFieldOfView] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""")
data: ImageSeriesData = Field(..., description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""") data: ImageSeriesData = Field(..., description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""")
dimension: Optional[ImageSeriesDimension] = Field(None, description="""Number of pixels on x, y, (and z) axes.""") dimension: Optional[List[int]] = Field(default_factory=list, description="""Number of pixels on x, y, (and z) axes.""")
external_file: Optional[ImageSeriesExternalFile] = Field(None, description="""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: Optional[List[str]] = Field(default_factory=list, description="""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.""")
format: Optional[str] = Field(None, description="""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.""") format: Optional[str] = Field(None, description="""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.""")
description: Optional[str] = Field(None, description="""Description of the time series.""") description: Optional[str] = Field(None, description="""Description of the time series.""")
comments: Optional[str] = Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") comments: Optional[str] = Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""")
starting_time: Optional[TimeSeriesStartingTime] = Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") starting_time: Optional[TimeSeriesStartingTime] = Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""")
timestamps: Optional[TimeSeriesTimestamps] = Field(None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") timestamps: Optional[List[float]] = Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""")
control: Optional[TimeSeriesControl] = Field(None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") control: Optional[List[int]] = Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""")
control_description: Optional[TimeSeriesControlDescription] = Field(None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") control_description: Optional[List[str]] = Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""")
sync: Optional[TimeSeriesSync] = Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") sync: Optional[TimeSeriesSync] = Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""")
@ -104,14 +99,15 @@ class RoiResponseSeries(TimeSeries):
""" """
ROI responses over an imaging plane. The first dimension represents time. The second dimension, if present, represents ROIs. ROI responses over an imaging plane. The first dimension represents time. The second dimension, if present, represents ROIs.
""" """
name: str = Field(...)
data: RoiResponseSeriesData = Field(..., description="""Signals from ROIs.""") data: RoiResponseSeriesData = Field(..., description="""Signals from ROIs.""")
rois: RoiResponseSeriesRois = Field(..., description="""DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries.""") rois: RoiResponseSeriesRois = Field(..., description="""DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries.""")
description: Optional[str] = Field(None, description="""Description of the time series.""") description: Optional[str] = Field(None, description="""Description of the time series.""")
comments: Optional[str] = Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") comments: Optional[str] = Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""")
starting_time: Optional[TimeSeriesStartingTime] = Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") starting_time: Optional[TimeSeriesStartingTime] = Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""")
timestamps: Optional[TimeSeriesTimestamps] = Field(None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") timestamps: Optional[List[float]] = Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""")
control: Optional[TimeSeriesControl] = Field(None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") control: Optional[List[int]] = Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""")
control_description: Optional[TimeSeriesControlDescription] = Field(None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") control_description: Optional[List[str]] = Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""")
sync: Optional[TimeSeriesSync] = Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") sync: Optional[TimeSeriesSync] = Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""")
@ -119,36 +115,40 @@ class DfOverF(NWBDataInterface):
""" """
dF/F information about a region of interest (ROI). Storage hierarchy of dF/F should be the same as for segmentation (i.e., same names for ROIs and for image planes). dF/F information about a region of interest (ROI). Storage hierarchy of dF/F should be the same as for segmentation (i.e., same names for ROIs and for image planes).
""" """
RoiResponseSeries: List[RoiResponseSeries] = Field(default_factory=list, description="""RoiResponseSeries object(s) containing dF/F for a ROI.""") name: str = Field(...)
roi_response_series: List[RoiResponseSeries] = Field(default_factory=list, description="""RoiResponseSeries object(s) containing dF/F for a ROI.""")
class Fluorescence(NWBDataInterface): class Fluorescence(NWBDataInterface):
""" """
Fluorescence information about a region of interest (ROI). Storage hierarchy of fluorescence should be the same as for segmentation (ie, same names for ROIs and for image planes). Fluorescence information about a region of interest (ROI). Storage hierarchy of fluorescence should be the same as for segmentation (ie, same names for ROIs and for image planes).
""" """
RoiResponseSeries: List[RoiResponseSeries] = Field(default_factory=list, description="""RoiResponseSeries object(s) containing fluorescence data for a ROI.""") name: str = Field(...)
roi_response_series: List[RoiResponseSeries] = Field(default_factory=list, description="""RoiResponseSeries object(s) containing fluorescence data for a ROI.""")
class ImageSegmentation(NWBDataInterface): class ImageSegmentation(NWBDataInterface):
""" """
Stores pixels in an image that represent different regions of interest (ROIs) or masks. All segmentation for a given imaging plane is stored together, with storage for multiple imaging planes (masks) supported. Each ROI is stored in its own subgroup, with the ROI group containing both a 2D mask and a list of pixels that make up this mask. Segments can also be used for masking neuropil. If segmentation is allowed to change with time, a new imaging plane (or module) is required and ROI names should remain consistent between them. Stores pixels in an image that represent different regions of interest (ROIs) or masks. All segmentation for a given imaging plane is stored together, with storage for multiple imaging planes (masks) supported. Each ROI is stored in its own subgroup, with the ROI group containing both a 2D mask and a list of pixels that make up this mask. Segments can also be used for masking neuropil. If segmentation is allowed to change with time, a new imaging plane (or module) is required and ROI names should remain consistent between them.
""" """
PlaneSegmentation: List[PlaneSegmentation] = Field(default_factory=list, description="""Results from image segmentation of a specific imaging plane.""") name: str = Field(...)
plane_segmentation: List[PlaneSegmentation] = Field(default_factory=list, description="""Results from image segmentation of a specific imaging plane.""")
class PlaneSegmentation(DynamicTable): class PlaneSegmentation(DynamicTable):
""" """
Results from image segmentation of a specific imaging plane. Results from image segmentation of a specific imaging plane.
""" """
name: str = Field(...)
image_mask: Optional[PlaneSegmentationImageMask] = Field(None, description="""ROI masks for each ROI. Each image mask is the size of the original imaging plane (or volume) and members of the ROI are finite non-zero.""") image_mask: Optional[PlaneSegmentationImageMask] = Field(None, description="""ROI masks for each ROI. Each image mask is the size of the original imaging plane (or volume) and members of the ROI are finite non-zero.""")
pixel_mask_index: Optional[PlaneSegmentationPixelMaskIndex] = Field(None, description="""Index into pixel_mask.""") pixel_mask_index: Optional[PlaneSegmentationPixelMaskIndex] = Field(None, description="""Index into pixel_mask.""")
pixel_mask: Optional[List[Any]] = Field(default_factory=list, description="""Pixel masks for each ROI: a list of indices and weights for the ROI. Pixel masks are concatenated and parsing of this dataset is maintained by the PlaneSegmentation""") pixel_mask: Optional[List[Any]] = Field(default_factory=list, description="""Pixel masks for each ROI: a list of indices and weights for the ROI. Pixel masks are concatenated and parsing of this dataset is maintained by the PlaneSegmentation""")
voxel_mask_index: Optional[PlaneSegmentationVoxelMaskIndex] = Field(None, description="""Index into voxel_mask.""") voxel_mask_index: Optional[PlaneSegmentationVoxelMaskIndex] = Field(None, description="""Index into voxel_mask.""")
voxel_mask: Optional[List[Any]] = Field(default_factory=list, description="""Voxel masks for each ROI: a list of indices and weights for the ROI. Voxel masks are concatenated and parsing of this dataset is maintained by the PlaneSegmentation""") voxel_mask: Optional[List[Any]] = Field(default_factory=list, description="""Voxel masks for each ROI: a list of indices and weights for the ROI. Voxel masks are concatenated and parsing of this dataset is maintained by the PlaneSegmentation""")
reference_images: PlaneSegmentationReferenceImages = Field(..., description="""Image stacks that the segmentation masks apply to.""") reference_images: Optional[List[ImageSeries]] = Field(default_factory=list, description="""Image stacks that the segmentation masks apply to.""")
colnames: Optional[str] = Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") colnames: Optional[str] = Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""")
description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""")
id: DynamicTableId = Field(..., description="""Array of unique identifiers for the rows of this dynamic table.""") id: List[int] = Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""")
VectorData: Optional[List[VectorData]] = Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") VectorData: Optional[List[VectorData]] = Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""")
@ -156,6 +156,7 @@ class ImagingPlane(NWBContainer):
""" """
An imaging plane and its metadata. An imaging plane and its metadata.
""" """
name: str = Field(...)
description: Optional[str] = Field(None, description="""Description of the imaging plane.""") description: Optional[str] = Field(None, description="""Description of the imaging plane.""")
excitation_lambda: float = Field(..., description="""Excitation wavelength, in nm.""") excitation_lambda: float = Field(..., description="""Excitation wavelength, in nm.""")
imaging_rate: Optional[float] = Field(None, description="""Rate that images are acquired, in Hz. If the corresponding TimeSeries is present, the rate should be stored there instead.""") imaging_rate: Optional[float] = Field(None, description="""Rate that images are acquired, in Hz. If the corresponding TimeSeries is present, the rate should be stored there instead.""")
@ -165,13 +166,14 @@ class ImagingPlane(NWBContainer):
origin_coords: Optional[ImagingPlaneOriginCoords] = Field(None, description="""Physical location of the first element of the imaging plane (0, 0) for 2-D data or (0, 0, 0) for 3-D data. See also reference_frame for what the physical location is relative to (e.g., bregma).""") origin_coords: Optional[ImagingPlaneOriginCoords] = Field(None, description="""Physical location of the first element of the imaging plane (0, 0) for 2-D data or (0, 0, 0) for 3-D data. See also reference_frame for what the physical location is relative to (e.g., bregma).""")
grid_spacing: Optional[ImagingPlaneGridSpacing] = Field(None, description="""Space between pixels in (x, y) or voxels in (x, y, z) directions, in the specified unit. Assumes imaging plane is a regular grid. See also reference_frame to interpret the grid.""") grid_spacing: Optional[ImagingPlaneGridSpacing] = Field(None, description="""Space between pixels in (x, y) or voxels in (x, y, z) directions, in the specified unit. Assumes imaging plane is a regular grid. See also reference_frame to interpret the grid.""")
reference_frame: Optional[str] = Field(None, description="""Describes reference frame of origin_coords and grid_spacing. For example, this can be a text description of the anatomical location and orientation of the grid defined by origin_coords and grid_spacing or the vectors needed to transform or rotate the grid to a common anatomical axis (e.g., AP/DV/ML). This field is necessary to interpret origin_coords and grid_spacing. If origin_coords and grid_spacing are not present, then this field is not required. For example, if the microscope takes 10 x 10 x 2 images, where the first value of the data matrix (index (0, 0, 0)) corresponds to (-1.2, -0.6, -2) mm relative to bregma, the spacing between pixels is 0.2 mm in x, 0.2 mm in y and 0.5 mm in z, and larger numbers in x means more anterior, larger numbers in y means more rightward, and larger numbers in z means more ventral, then enter the following -- origin_coords = (-1.2, -0.6, -2) grid_spacing = (0.2, 0.2, 0.5) reference_frame = \"Origin coordinates are relative to bregma. First dimension corresponds to anterior-posterior axis (larger index = more anterior). Second dimension corresponds to medial-lateral axis (larger index = more rightward). Third dimension corresponds to dorsal-ventral axis (larger index = more ventral).\"""") reference_frame: Optional[str] = Field(None, description="""Describes reference frame of origin_coords and grid_spacing. For example, this can be a text description of the anatomical location and orientation of the grid defined by origin_coords and grid_spacing or the vectors needed to transform or rotate the grid to a common anatomical axis (e.g., AP/DV/ML). This field is necessary to interpret origin_coords and grid_spacing. If origin_coords and grid_spacing are not present, then this field is not required. For example, if the microscope takes 10 x 10 x 2 images, where the first value of the data matrix (index (0, 0, 0)) corresponds to (-1.2, -0.6, -2) mm relative to bregma, the spacing between pixels is 0.2 mm in x, 0.2 mm in y and 0.5 mm in z, and larger numbers in x means more anterior, larger numbers in y means more rightward, and larger numbers in z means more ventral, then enter the following -- origin_coords = (-1.2, -0.6, -2) grid_spacing = (0.2, 0.2, 0.5) reference_frame = \"Origin coordinates are relative to bregma. First dimension corresponds to anterior-posterior axis (larger index = more anterior). Second dimension corresponds to medial-lateral axis (larger index = more rightward). Third dimension corresponds to dorsal-ventral axis (larger index = more ventral).\"""")
OpticalChannel: List[OpticalChannel] = Field(default_factory=list, description="""An optical channel used to record from an imaging plane.""") optical_channel: List[OpticalChannel] = Field(default_factory=list, description="""An optical channel used to record from an imaging plane.""")
class OpticalChannel(NWBContainer): class OpticalChannel(NWBContainer):
""" """
An optical channel used to record from an imaging plane. An optical channel used to record from an imaging plane.
""" """
name: str = Field(...)
description: str = Field(..., description="""Description or other notes about the channel.""") description: str = Field(..., description="""Description or other notes about the channel.""")
emission_lambda: float = Field(..., description="""Emission wavelength for channel, in nm.""") emission_lambda: float = Field(..., description="""Emission wavelength for channel, in nm.""")
@ -180,28 +182,31 @@ class MotionCorrection(NWBDataInterface):
""" """
An image stack where all frames are shifted (registered) to a common coordinate system, to account for movement and drift between frames. Note: each frame at each point in time is assumed to be 2-D (has only x & y dimensions). An image stack where all frames are shifted (registered) to a common coordinate system, to account for movement and drift between frames. Note: each frame at each point in time is assumed to be 2-D (has only x & y dimensions).
""" """
CorrectedImageStack: List[CorrectedImageStack] = Field(default_factory=list, description="""Reuslts from motion correction of an image stack.""") name: str = Field(...)
corrected_image_stack: List[CorrectedImageStack] = Field(default_factory=list, description="""Reuslts from motion correction of an image stack.""")
class CorrectedImageStack(NWBDataInterface): class CorrectedImageStack(NWBDataInterface):
""" """
Reuslts from motion correction of an image stack. Reuslts from motion correction of an image stack.
""" """
corrected: CorrectedImageStackCorrected = Field(..., description="""Image stack with frames shifted to the common coordinates.""") name: str = Field(...)
xy_translation: CorrectedImageStackXyTranslation = Field(..., description="""Stores the x,y delta necessary to align each frame to the common coordinates, for example, to align each frame to a reference image.""") corrected: ImageSeries = Field(..., description="""Image stack with frames shifted to the common coordinates.""")
xy_translation: TimeSeries = Field(..., description="""Stores the x,y delta necessary to align each frame to the common coordinates, for example, to align each frame to a reference image.""")
# Update forward refs # Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/postponed_annotations/ # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
OnePhotonSeries.update_forward_refs() OnePhotonSeries.model_rebuild()
TwoPhotonSeries.update_forward_refs() TwoPhotonSeries.model_rebuild()
RoiResponseSeries.update_forward_refs() RoiResponseSeries.model_rebuild()
DfOverF.update_forward_refs() DfOverF.model_rebuild()
Fluorescence.update_forward_refs() Fluorescence.model_rebuild()
ImageSegmentation.update_forward_refs() ImageSegmentation.model_rebuild()
PlaneSegmentation.update_forward_refs() PlaneSegmentation.model_rebuild()
ImagingPlane.update_forward_refs() ImagingPlane.model_rebuild()
OpticalChannel.update_forward_refs() OpticalChannel.model_rebuild()
MotionCorrection.update_forward_refs() MotionCorrection.model_rebuild()
CorrectedImageStack.update_forward_refs() CorrectedImageStack.model_rebuild()

View file

@ -13,33 +13,21 @@ else:
from .hdmf_common_table import ( from .hdmf_common_table import (
DynamicTableRegion, DynamicTableRegion,
VectorIndex, VectorData,
VectorData VectorIndex
)
from .core_nwb_image import (
ImageSeries
) )
from .nwb_language import ( from .nwb_language import (
Arraylike Arraylike
) )
from .core_nwb_base import (
TimeSeries
)
metamodel_version = "None" metamodel_version = "None"
version = "None" version = "None"
class WeakRefShimBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel,
__slots__ = '__weakref__'
class ConfiguredBaseModel(WeakRefShimBaseModel,
validate_assignment = True, validate_assignment = True,
validate_all = True, validate_default = True,
underscore_attrs_are_private = True,
extra = 'forbid', extra = 'forbid',
arbitrary_types_allowed = True, arbitrary_types_allowed = True,
use_enum_values = True): use_enum_values = True):
@ -50,7 +38,11 @@ class TwoPhotonSeriesFieldOfView(ConfiguredBaseModel):
""" """
Width, height and depth of image, or imaged area, in meters. Width, height and depth of image, or imaged area, in meters.
""" """
array: Optional[NDArray[Shape["2 width|height, 3 width|height|depth"], Float32]] = Field(None) name: str = Field("field_of_view", const=True)
array: Optional[Union[
NDArray[Shape["2 width|height"], Float32],
NDArray[Shape["2 width|height, 3 width|height|depth"], Float32]
]] = Field(None)
class TwoPhotonSeriesFieldOfViewArray(Arraylike): class TwoPhotonSeriesFieldOfViewArray(Arraylike):
@ -63,7 +55,11 @@ class RoiResponseSeriesData(ConfiguredBaseModel):
""" """
Signals from ROIs. Signals from ROIs.
""" """
array: Optional[NDArray[Shape["* num_times, * num_ROIs"], Number]] = Field(None) name: str = Field("data", const=True)
array: Optional[Union[
NDArray[Shape["* num_times"], Number],
NDArray[Shape["* num_times, * num_ROIs"], Number]
]] = Field(None)
class RoiResponseSeriesDataArray(Arraylike): class RoiResponseSeriesDataArray(Arraylike):
@ -76,51 +72,72 @@ class RoiResponseSeriesRois(DynamicTableRegion):
""" """
DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries. DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries.
""" """
name: str = Field("rois", const=True)
table: Optional[DynamicTable] = Field(None, description="""Reference to the DynamicTable object that this region applies to.""") table: Optional[DynamicTable] = Field(None, description="""Reference to the DynamicTable object that this region applies to.""")
description: Optional[str] = Field(None, description="""Description of what this table region points to.""") description: Optional[str] = Field(None, description="""Description of what this table region points to.""")
array: Optional[NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], ]] = Field(None) array: Optional[Union[
NDArray[Shape["* dim0"], Any],
NDArray[Shape["* dim0, * dim1"], Any],
NDArray[Shape["* dim0, * dim1, * dim2"], Any],
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any]
]] = Field(None)
class PlaneSegmentationImageMask(VectorData): class PlaneSegmentationImageMask(VectorData):
""" """
ROI masks for each ROI. Each image mask is the size of the original imaging plane (or volume) and members of the ROI are finite non-zero. ROI masks for each ROI. Each image mask is the size of the original imaging plane (or volume) and members of the ROI are finite non-zero.
""" """
name: str = Field("image_mask", const=True)
description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") description: Optional[str] = Field(None, description="""Description of what these vectors represent.""")
array: Optional[NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], ]] = Field(None) array: Optional[Union[
NDArray[Shape["* dim0"], Any],
NDArray[Shape["* dim0, * dim1"], Any],
NDArray[Shape["* dim0, * dim1, * dim2"], Any],
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any]
]] = Field(None)
class PlaneSegmentationPixelMaskIndex(VectorIndex): class PlaneSegmentationPixelMaskIndex(VectorIndex):
""" """
Index into pixel_mask. Index into pixel_mask.
""" """
name: str = Field("pixel_mask_index", const=True)
target: Optional[VectorData] = Field(None, description="""Reference to the target dataset that this index applies to.""") target: Optional[VectorData] = Field(None, description="""Reference to the target dataset that this index applies to.""")
description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") description: Optional[str] = Field(None, description="""Description of what these vectors represent.""")
array: Optional[NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], ]] = Field(None) array: Optional[Union[
NDArray[Shape["* dim0"], Any],
NDArray[Shape["* dim0, * dim1"], Any],
NDArray[Shape["* dim0, * dim1, * dim2"], Any],
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any]
]] = Field(None)
class PlaneSegmentationVoxelMaskIndex(VectorIndex): class PlaneSegmentationVoxelMaskIndex(VectorIndex):
""" """
Index into voxel_mask. Index into voxel_mask.
""" """
name: str = Field("voxel_mask_index", const=True)
target: Optional[VectorData] = Field(None, description="""Reference to the target dataset that this index applies to.""") target: Optional[VectorData] = Field(None, description="""Reference to the target dataset that this index applies to.""")
description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") description: Optional[str] = Field(None, description="""Description of what these vectors represent.""")
array: Optional[NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], ]] = Field(None) array: Optional[Union[
NDArray[Shape["* dim0"], Any],
NDArray[Shape["* dim0, * dim1"], Any],
class PlaneSegmentationReferenceImages(ConfiguredBaseModel): NDArray[Shape["* dim0, * dim1, * dim2"], Any],
""" NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any]
Image stacks that the segmentation masks apply to. ]] = Field(None)
"""
ImageSeries: Optional[List[ImageSeries]] = Field(default_factory=list, description="""One or more image stacks that the masks apply to (can be one-element stack).""")
class ImagingPlaneManifold(ConfiguredBaseModel): class ImagingPlaneManifold(ConfiguredBaseModel):
""" """
DEPRECATED Physical position of each pixel. 'xyz' represents the position of the pixel relative to the defined coordinate space. Deprecated in favor of origin_coords and grid_spacing. DEPRECATED Physical position of each pixel. 'xyz' represents the position of the pixel relative to the defined coordinate space. Deprecated in favor of origin_coords and grid_spacing.
""" """
name: str = Field("manifold", const=True)
conversion: Optional[float] = Field(None, description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as pixels from x = -500 to 499, y = -500 to 499 that correspond to a 2 m x 2 m range, then the 'conversion' multiplier to get from raw data acquisition pixel units to meters is 2/1000.""") conversion: Optional[float] = Field(None, description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as pixels from x = -500 to 499, y = -500 to 499 that correspond to a 2 m x 2 m range, then the 'conversion' multiplier to get from raw data acquisition pixel units to meters is 2/1000.""")
unit: Optional[str] = Field(None, description="""Base unit of measurement for working with the data. The default value is 'meters'.""") unit: Optional[str] = Field(None, description="""Base unit of measurement for working with the data. The default value is 'meters'.""")
array: Optional[NDArray[Shape["* height, * width, 3 x_y_z, * depth"], Float32]] = Field(None) array: Optional[Union[
NDArray[Shape["* height, * width, 3 x_y_z"], Float32],
NDArray[Shape["* height, * width, 3 x_y_z, * depth"], Float32]
]] = Field(None)
class ImagingPlaneManifoldArray(Arraylike): class ImagingPlaneManifoldArray(Arraylike):
@ -135,8 +152,12 @@ class ImagingPlaneOriginCoords(ConfiguredBaseModel):
""" """
Physical location of the first element of the imaging plane (0, 0) for 2-D data or (0, 0, 0) for 3-D data. See also reference_frame for what the physical location is relative to (e.g., bregma). Physical location of the first element of the imaging plane (0, 0) for 2-D data or (0, 0, 0) for 3-D data. See also reference_frame for what the physical location is relative to (e.g., bregma).
""" """
name: str = Field("origin_coords", const=True)
unit: Optional[str] = Field(None, description="""Measurement units for origin_coords. The default value is 'meters'.""") unit: Optional[str] = Field(None, description="""Measurement units for origin_coords. The default value is 'meters'.""")
array: Optional[NDArray[Shape["2 x_y, 3 x_y_z"], Float32]] = Field(None) array: Optional[Union[
NDArray[Shape["2 x_y"], Float32],
NDArray[Shape["2 x_y, 3 x_y_z"], Float32]
]] = Field(None)
class ImagingPlaneOriginCoordsArray(Arraylike): class ImagingPlaneOriginCoordsArray(Arraylike):
@ -149,8 +170,12 @@ class ImagingPlaneGridSpacing(ConfiguredBaseModel):
""" """
Space between pixels in (x, y) or voxels in (x, y, z) directions, in the specified unit. Assumes imaging plane is a regular grid. See also reference_frame to interpret the grid. Space between pixels in (x, y) or voxels in (x, y, z) directions, in the specified unit. Assumes imaging plane is a regular grid. See also reference_frame to interpret the grid.
""" """
name: str = Field("grid_spacing", const=True)
unit: Optional[str] = Field(None, description="""Measurement units for grid_spacing. The default value is 'meters'.""") unit: Optional[str] = Field(None, description="""Measurement units for grid_spacing. The default value is 'meters'.""")
array: Optional[NDArray[Shape["2 x_y, 3 x_y_z"], Float32]] = Field(None) array: Optional[Union[
NDArray[Shape["2 x_y"], Float32],
NDArray[Shape["2 x_y, 3 x_y_z"], Float32]
]] = Field(None)
class ImagingPlaneGridSpacingArray(Arraylike): class ImagingPlaneGridSpacingArray(Arraylike):
@ -159,54 +184,21 @@ class ImagingPlaneGridSpacingArray(Arraylike):
x_y_z: Optional[float] = Field(None) x_y_z: Optional[float] = Field(None)
class CorrectedImageStackCorrected(ImageSeries):
"""
Image stack with frames shifted to the common coordinates.
"""
data: ImageSeriesData = Field(..., description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""")
dimension: Optional[ImageSeriesDimension] = Field(None, description="""Number of pixels on x, y, (and z) axes.""")
external_file: Optional[ImageSeriesExternalFile] = Field(None, description="""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.""")
format: Optional[str] = Field(None, description="""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.""")
description: Optional[str] = Field(None, description="""Description of the time series.""")
comments: Optional[str] = Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""")
starting_time: Optional[TimeSeriesStartingTime] = Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""")
timestamps: Optional[TimeSeriesTimestamps] = Field(None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""")
control: Optional[TimeSeriesControl] = Field(None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""")
control_description: Optional[TimeSeriesControlDescription] = Field(None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""")
sync: Optional[TimeSeriesSync] = Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""")
class CorrectedImageStackXyTranslation(TimeSeries): # Model rebuild
""" # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
Stores the x,y delta necessary to align each frame to the common coordinates, for example, to align each frame to a reference image. TwoPhotonSeriesFieldOfView.model_rebuild()
""" TwoPhotonSeriesFieldOfViewArray.model_rebuild()
description: Optional[str] = Field(None, description="""Description of the time series.""") RoiResponseSeriesData.model_rebuild()
comments: Optional[str] = Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") RoiResponseSeriesDataArray.model_rebuild()
data: TimeSeriesData = Field(..., description="""Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first dimension should always represent time. This can also be used to store binary data (e.g., image frames). This can also be a link to data stored in an external file.""") RoiResponseSeriesRois.model_rebuild()
starting_time: Optional[TimeSeriesStartingTime] = Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") PlaneSegmentationImageMask.model_rebuild()
timestamps: Optional[TimeSeriesTimestamps] = Field(None, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") PlaneSegmentationPixelMaskIndex.model_rebuild()
control: Optional[TimeSeriesControl] = Field(None, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") PlaneSegmentationVoxelMaskIndex.model_rebuild()
control_description: Optional[TimeSeriesControlDescription] = Field(None, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") ImagingPlaneManifold.model_rebuild()
sync: Optional[TimeSeriesSync] = Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") ImagingPlaneManifoldArray.model_rebuild()
ImagingPlaneOriginCoords.model_rebuild()
ImagingPlaneOriginCoordsArray.model_rebuild()
ImagingPlaneGridSpacing.model_rebuild()
# Update forward refs ImagingPlaneGridSpacingArray.model_rebuild()
# see https://pydantic-docs.helpmanual.io/usage/postponed_annotations/
TwoPhotonSeriesFieldOfView.update_forward_refs()
TwoPhotonSeriesFieldOfViewArray.update_forward_refs()
RoiResponseSeriesData.update_forward_refs()
RoiResponseSeriesDataArray.update_forward_refs()
RoiResponseSeriesRois.update_forward_refs()
PlaneSegmentationImageMask.update_forward_refs()
PlaneSegmentationPixelMaskIndex.update_forward_refs()
PlaneSegmentationVoxelMaskIndex.update_forward_refs()
PlaneSegmentationReferenceImages.update_forward_refs()
ImagingPlaneManifold.update_forward_refs()
ImagingPlaneManifoldArray.update_forward_refs()
ImagingPlaneOriginCoords.update_forward_refs()
ImagingPlaneOriginCoordsArray.update_forward_refs()
ImagingPlaneGridSpacing.update_forward_refs()
ImagingPlaneGridSpacingArray.update_forward_refs()
CorrectedImageStackCorrected.update_forward_refs()
CorrectedImageStackXyTranslation.update_forward_refs()

View file

@ -12,14 +12,13 @@ else:
from .core_nwb_retinotopy_include import ( from .core_nwb_retinotopy_include import (
ImagingRetinotopyAxisDescriptions,
ImagingRetinotopyFocalDepthImage,
ImagingRetinotopyAxis2PowerMap,
ImagingRetinotopyVasculatureImage,
ImagingRetinotopyAxis2PhaseMap,
ImagingRetinotopyAxis1PhaseMap,
ImagingRetinotopyAxis1PowerMap, ImagingRetinotopyAxis1PowerMap,
ImagingRetinotopySignMap ImagingRetinotopyAxis1PhaseMap,
ImagingRetinotopyVasculatureImage,
ImagingRetinotopySignMap,
ImagingRetinotopyAxis2PowerMap,
ImagingRetinotopyAxis2PhaseMap,
ImagingRetinotopyFocalDepthImage
) )
from .core_nwb_base import ( from .core_nwb_base import (
@ -30,13 +29,9 @@ from .core_nwb_base import (
metamodel_version = "None" metamodel_version = "None"
version = "None" version = "None"
class WeakRefShimBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel,
__slots__ = '__weakref__'
class ConfiguredBaseModel(WeakRefShimBaseModel,
validate_assignment = True, validate_assignment = True,
validate_all = True, validate_default = True,
underscore_attrs_are_private = True,
extra = 'forbid', extra = 'forbid',
arbitrary_types_allowed = True, arbitrary_types_allowed = True,
use_enum_values = True): use_enum_values = True):
@ -47,17 +42,19 @@ class ImagingRetinotopy(NWBDataInterface):
""" """
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). 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).
""" """
name: str = Field(...)
axis_1_phase_map: ImagingRetinotopyAxis1PhaseMap = Field(..., description="""Phase response to stimulus on the first measured axis.""") axis_1_phase_map: ImagingRetinotopyAxis1PhaseMap = Field(..., description="""Phase response to stimulus on the first measured axis.""")
axis_1_power_map: Optional[ImagingRetinotopyAxis1PowerMap] = Field(None, description="""Power response on the first measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power.""") axis_1_power_map: Optional[ImagingRetinotopyAxis1PowerMap] = Field(None, description="""Power response on the first measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power.""")
axis_2_phase_map: ImagingRetinotopyAxis2PhaseMap = Field(..., description="""Phase response to stimulus on the second measured axis.""") axis_2_phase_map: ImagingRetinotopyAxis2PhaseMap = Field(..., description="""Phase response to stimulus on the second measured axis.""")
axis_2_power_map: Optional[ImagingRetinotopyAxis2PowerMap] = Field(None, description="""Power response on the second measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power.""") axis_2_power_map: Optional[ImagingRetinotopyAxis2PowerMap] = Field(None, description="""Power response on the second measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power.""")
axis_descriptions: ImagingRetinotopyAxisDescriptions = Field(..., description="""Two-element array describing the contents of the two response axis fields. Description should be something like ['altitude', 'azimuth'] or '['radius', 'theta'].""") axis_descriptions: List[str] = Field(default_factory=list, description="""Two-element array describing the contents of the two response axis fields. Description should be something like ['altitude', 'azimuth'] or '['radius', 'theta'].""")
focal_depth_image: Optional[ImagingRetinotopyFocalDepthImage] = Field(None, description="""Gray-scale image taken with same settings/parameters (e.g., focal depth, wavelength) as data collection. Array format: [rows][columns].""") focal_depth_image: Optional[ImagingRetinotopyFocalDepthImage] = Field(None, description="""Gray-scale image taken with same settings/parameters (e.g., focal depth, wavelength) as data collection. Array format: [rows][columns].""")
sign_map: Optional[ImagingRetinotopySignMap] = Field(None, description="""Sine of the angle between the direction of the gradient in axis_1 and axis_2.""") sign_map: Optional[ImagingRetinotopySignMap] = Field(None, description="""Sine of the angle between the direction of the gradient in axis_1 and axis_2.""")
vasculature_image: ImagingRetinotopyVasculatureImage = Field(..., description="""Gray-scale anatomical image of cortical surface. Array structure: [rows][columns]""") vasculature_image: ImagingRetinotopyVasculatureImage = Field(..., description="""Gray-scale anatomical image of cortical surface. Array structure: [rows][columns]""")
# Update forward refs # Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/postponed_annotations/ # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
ImagingRetinotopy.update_forward_refs() ImagingRetinotopy.model_rebuild()

View file

@ -19,13 +19,9 @@ from .nwb_language import (
metamodel_version = "None" metamodel_version = "None"
version = "None" version = "None"
class WeakRefShimBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel,
__slots__ = '__weakref__'
class ConfiguredBaseModel(WeakRefShimBaseModel,
validate_assignment = True, validate_assignment = True,
validate_all = True, validate_default = True,
underscore_attrs_are_private = True,
extra = 'forbid', extra = 'forbid',
arbitrary_types_allowed = True, arbitrary_types_allowed = True,
use_enum_values = True): use_enum_values = True):
@ -36,6 +32,7 @@ class ImagingRetinotopyAxis1PhaseMap(ConfiguredBaseModel):
""" """
Phase response to stimulus on the first measured axis. Phase response to stimulus on the first measured axis.
""" """
name: str = Field("axis_1_phase_map", const=True)
dimension: Optional[int] = Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") dimension: Optional[int] = Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""")
field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""")
unit: Optional[str] = Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") unit: Optional[str] = Field(None, description="""Unit that axis data is stored in (e.g., degrees).""")
@ -44,14 +41,15 @@ class ImagingRetinotopyAxis1PhaseMap(ConfiguredBaseModel):
class ImagingRetinotopyAxis1PhaseMapArray(Arraylike): class ImagingRetinotopyAxis1PhaseMapArray(Arraylike):
num_rows: Optional[float] = Field(None) num_rows: float = Field(...)
num_cols: Optional[float] = Field(None) num_cols: float = Field(...)
class ImagingRetinotopyAxis1PowerMap(ConfiguredBaseModel): class ImagingRetinotopyAxis1PowerMap(ConfiguredBaseModel):
""" """
Power response on the first measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power. Power response on the first measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power.
""" """
name: str = Field("axis_1_power_map", const=True)
dimension: Optional[int] = Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") dimension: Optional[int] = Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""")
field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""")
unit: Optional[str] = Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") unit: Optional[str] = Field(None, description="""Unit that axis data is stored in (e.g., degrees).""")
@ -60,14 +58,15 @@ class ImagingRetinotopyAxis1PowerMap(ConfiguredBaseModel):
class ImagingRetinotopyAxis1PowerMapArray(Arraylike): class ImagingRetinotopyAxis1PowerMapArray(Arraylike):
num_rows: Optional[float] = Field(None) num_rows: float = Field(...)
num_cols: Optional[float] = Field(None) num_cols: float = Field(...)
class ImagingRetinotopyAxis2PhaseMap(ConfiguredBaseModel): class ImagingRetinotopyAxis2PhaseMap(ConfiguredBaseModel):
""" """
Phase response to stimulus on the second measured axis. Phase response to stimulus on the second measured axis.
""" """
name: str = Field("axis_2_phase_map", const=True)
dimension: Optional[int] = Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") dimension: Optional[int] = Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""")
field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""")
unit: Optional[str] = Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") unit: Optional[str] = Field(None, description="""Unit that axis data is stored in (e.g., degrees).""")
@ -76,14 +75,15 @@ class ImagingRetinotopyAxis2PhaseMap(ConfiguredBaseModel):
class ImagingRetinotopyAxis2PhaseMapArray(Arraylike): class ImagingRetinotopyAxis2PhaseMapArray(Arraylike):
num_rows: Optional[float] = Field(None) num_rows: float = Field(...)
num_cols: Optional[float] = Field(None) num_cols: float = Field(...)
class ImagingRetinotopyAxis2PowerMap(ConfiguredBaseModel): class ImagingRetinotopyAxis2PowerMap(ConfiguredBaseModel):
""" """
Power response on the second measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power. Power response on the second measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power.
""" """
name: str = Field("axis_2_power_map", const=True)
dimension: Optional[int] = Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") dimension: Optional[int] = Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""")
field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""")
unit: Optional[str] = Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") unit: Optional[str] = Field(None, description="""Unit that axis data is stored in (e.g., degrees).""")
@ -92,21 +92,15 @@ class ImagingRetinotopyAxis2PowerMap(ConfiguredBaseModel):
class ImagingRetinotopyAxis2PowerMapArray(Arraylike): class ImagingRetinotopyAxis2PowerMapArray(Arraylike):
num_rows: Optional[float] = Field(None) num_rows: float = Field(...)
num_cols: Optional[float] = Field(None) num_cols: float = Field(...)
class ImagingRetinotopyAxisDescriptions(ConfiguredBaseModel):
"""
Two-element array describing the contents of the two response axis fields. Description should be something like ['altitude', 'azimuth'] or '['radius', 'theta'].
"""
axis_descriptions: List[str] = Field(default_factory=list, description="""Two-element array describing the contents of the two response axis fields. Description should be something like ['altitude', 'azimuth'] or '['radius', 'theta'].""")
class ImagingRetinotopyFocalDepthImage(ConfiguredBaseModel): class ImagingRetinotopyFocalDepthImage(ConfiguredBaseModel):
""" """
Gray-scale image taken with same settings/parameters (e.g., focal depth, wavelength) as data collection. Array format: [rows][columns]. Gray-scale image taken with same settings/parameters (e.g., focal depth, wavelength) as data collection. Array format: [rows][columns].
""" """
name: str = Field("focal_depth_image", const=True)
bits_per_pixel: Optional[int] = Field(None, description="""Number of bits used to represent each value. This is necessary to determine maximum (white) pixel value.""") bits_per_pixel: Optional[int] = Field(None, description="""Number of bits used to represent each value. This is necessary to determine maximum (white) pixel value.""")
dimension: Optional[int] = Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") dimension: Optional[int] = Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""")
field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""")
@ -117,14 +111,15 @@ class ImagingRetinotopyFocalDepthImage(ConfiguredBaseModel):
class ImagingRetinotopyFocalDepthImageArray(Arraylike): class ImagingRetinotopyFocalDepthImageArray(Arraylike):
num_rows: Optional[int] = Field(None) num_rows: int = Field(...)
num_cols: Optional[int] = Field(None) num_cols: int = Field(...)
class ImagingRetinotopySignMap(ConfiguredBaseModel): class ImagingRetinotopySignMap(ConfiguredBaseModel):
""" """
Sine of the angle between the direction of the gradient in axis_1 and axis_2. Sine of the angle between the direction of the gradient in axis_1 and axis_2.
""" """
name: str = Field("sign_map", const=True)
dimension: Optional[int] = Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") dimension: Optional[int] = Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""")
field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""")
array: Optional[NDArray[Shape["* num_rows, * num_cols"], Float32]] = Field(None) array: Optional[NDArray[Shape["* num_rows, * num_cols"], Float32]] = Field(None)
@ -132,14 +127,15 @@ class ImagingRetinotopySignMap(ConfiguredBaseModel):
class ImagingRetinotopySignMapArray(Arraylike): class ImagingRetinotopySignMapArray(Arraylike):
num_rows: Optional[float] = Field(None) num_rows: float = Field(...)
num_cols: Optional[float] = Field(None) num_cols: float = Field(...)
class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel): class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel):
""" """
Gray-scale anatomical image of cortical surface. Array structure: [rows][columns] Gray-scale anatomical image of cortical surface. Array structure: [rows][columns]
""" """
name: str = Field("vasculature_image", const=True)
bits_per_pixel: Optional[int] = Field(None, description="""Number of bits used to represent each value. This is necessary to determine maximum (white) pixel value""") bits_per_pixel: Optional[int] = Field(None, description="""Number of bits used to represent each value. This is necessary to determine maximum (white) pixel value""")
dimension: Optional[int] = Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") dimension: Optional[int] = Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""")
field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""") field_of_view: Optional[float] = Field(None, description="""Size of viewing area, in meters.""")
@ -149,25 +145,25 @@ class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel):
class ImagingRetinotopyVasculatureImageArray(Arraylike): class ImagingRetinotopyVasculatureImageArray(Arraylike):
num_rows: Optional[int] = Field(None) num_rows: int = Field(...)
num_cols: Optional[int] = Field(None) num_cols: int = Field(...)
# Update forward refs # Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/postponed_annotations/ # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
ImagingRetinotopyAxis1PhaseMap.update_forward_refs() ImagingRetinotopyAxis1PhaseMap.model_rebuild()
ImagingRetinotopyAxis1PhaseMapArray.update_forward_refs() ImagingRetinotopyAxis1PhaseMapArray.model_rebuild()
ImagingRetinotopyAxis1PowerMap.update_forward_refs() ImagingRetinotopyAxis1PowerMap.model_rebuild()
ImagingRetinotopyAxis1PowerMapArray.update_forward_refs() ImagingRetinotopyAxis1PowerMapArray.model_rebuild()
ImagingRetinotopyAxis2PhaseMap.update_forward_refs() ImagingRetinotopyAxis2PhaseMap.model_rebuild()
ImagingRetinotopyAxis2PhaseMapArray.update_forward_refs() ImagingRetinotopyAxis2PhaseMapArray.model_rebuild()
ImagingRetinotopyAxis2PowerMap.update_forward_refs() ImagingRetinotopyAxis2PowerMap.model_rebuild()
ImagingRetinotopyAxis2PowerMapArray.update_forward_refs() ImagingRetinotopyAxis2PowerMapArray.model_rebuild()
ImagingRetinotopyAxisDescriptions.update_forward_refs() ImagingRetinotopyFocalDepthImage.model_rebuild()
ImagingRetinotopyFocalDepthImage.update_forward_refs() ImagingRetinotopyFocalDepthImageArray.model_rebuild()
ImagingRetinotopyFocalDepthImageArray.update_forward_refs() ImagingRetinotopySignMap.model_rebuild()
ImagingRetinotopySignMap.update_forward_refs() ImagingRetinotopySignMapArray.model_rebuild()
ImagingRetinotopySignMapArray.update_forward_refs() ImagingRetinotopyVasculatureImage.model_rebuild()
ImagingRetinotopyVasculatureImage.update_forward_refs() ImagingRetinotopyVasculatureImageArray.model_rebuild()
ImagingRetinotopyVasculatureImageArray.update_forward_refs()

View file

@ -15,13 +15,9 @@ else:
metamodel_version = "None" metamodel_version = "None"
version = "1.8.0" version = "1.8.0"
class WeakRefShimBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel,
__slots__ = '__weakref__'
class ConfiguredBaseModel(WeakRefShimBaseModel,
validate_assignment = True, validate_assignment = True,
validate_all = True, validate_default = True,
underscore_attrs_are_private = True,
extra = 'forbid', extra = 'forbid',
arbitrary_types_allowed = True, arbitrary_types_allowed = True,
use_enum_values = True): use_enum_values = True):
@ -29,5 +25,6 @@ class ConfiguredBaseModel(WeakRefShimBaseModel,
# Update forward refs # Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/postponed_annotations/ # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model

View file

@ -15,13 +15,9 @@ else:
metamodel_version = "None" metamodel_version = "None"
version = "None" version = "None"
class WeakRefShimBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel,
__slots__ = '__weakref__'
class ConfiguredBaseModel(WeakRefShimBaseModel,
validate_assignment = True, validate_assignment = True,
validate_all = True, validate_default = True,
underscore_attrs_are_private = True,
extra = 'forbid', extra = 'forbid',
arbitrary_types_allowed = True, arbitrary_types_allowed = True,
use_enum_values = True): use_enum_values = True):
@ -32,27 +28,29 @@ class Data(ConfiguredBaseModel):
""" """
An abstract data type for a dataset. An abstract data type for a dataset.
""" """
None name: str = Field(...)
class Container(ConfiguredBaseModel): class Container(ConfiguredBaseModel):
""" """
An abstract data type for a group storing collections of data and metadata. Base type for all data and metadata containers. An abstract data type for a group storing collections of data and metadata. Base type for all data and metadata containers.
""" """
None name: str = Field(...)
class SimpleMultiContainer(Container): class SimpleMultiContainer(Container):
""" """
A simple Container for holding onto multiple containers. A simple Container for holding onto multiple containers.
""" """
name: str = Field(...)
Data: Optional[List[Data]] = Field(default_factory=list, description="""Data objects held within this SimpleMultiContainer.""") Data: Optional[List[Data]] = Field(default_factory=list, description="""Data objects held within this SimpleMultiContainer.""")
Container: Optional[List[Container]] = Field(default_factory=list, description="""Container objects held within this SimpleMultiContainer.""") container: Optional[List[Container]] = Field(default_factory=list, description="""Container objects held within this SimpleMultiContainer.""")
# Update forward refs # Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/postponed_annotations/ # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
Data.update_forward_refs() Data.model_rebuild()
Container.update_forward_refs() Container.model_rebuild()
SimpleMultiContainer.update_forward_refs() SimpleMultiContainer.model_rebuild()

View file

@ -1,33 +0,0 @@
from __future__ import annotations
from datetime import datetime, date
from enum import Enum
from typing import List, Dict, Optional, Any, Union
from pydantic import BaseModel as BaseModel, Field
from nptyping import NDArray, Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64
import sys
if sys.version_info >= (3, 8):
from typing import Literal
else:
from typing_extensions import Literal
metamodel_version = "None"
version = "None"
class WeakRefShimBaseModel(BaseModel):
__slots__ = '__weakref__'
class ConfiguredBaseModel(WeakRefShimBaseModel,
validate_assignment = True,
validate_all = True,
underscore_attrs_are_private = True,
extra = 'forbid',
arbitrary_types_allowed = True,
use_enum_values = True):
pass
# Update forward refs
# see https://pydantic-docs.helpmanual.io/usage/postponed_annotations/

View file

@ -11,12 +11,6 @@ else:
from typing_extensions import Literal from typing_extensions import Literal
from .hdmf_common_sparse_include import (
CSRMatrixData,
CSRMatrixIndices,
CSRMatrixIndptr
)
from .hdmf_common_base import ( from .hdmf_common_base import (
Container Container
) )
@ -25,13 +19,9 @@ from .hdmf_common_base import (
metamodel_version = "None" metamodel_version = "None"
version = "None" version = "None"
class WeakRefShimBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel,
__slots__ = '__weakref__'
class ConfiguredBaseModel(WeakRefShimBaseModel,
validate_assignment = True, validate_assignment = True,
validate_all = True, validate_default = True,
underscore_attrs_are_private = True,
extra = 'forbid', extra = 'forbid',
arbitrary_types_allowed = True, arbitrary_types_allowed = True,
use_enum_values = True): use_enum_values = True):
@ -42,13 +32,15 @@ class CSRMatrix(Container):
""" """
A compressed sparse row matrix. Data are stored in the standard CSR format, where column indices for row i are stored in indices[indptr[i]:indptr[i+1]] and their corresponding values are stored in data[indptr[i]:indptr[i+1]]. A compressed sparse row matrix. Data are stored in the standard CSR format, where column indices for row i are stored in indices[indptr[i]:indptr[i+1]] and their corresponding values are stored in data[indptr[i]:indptr[i+1]].
""" """
name: str = Field(...)
shape: Optional[int] = Field(None, description="""The shape (number of rows, number of columns) of this sparse matrix.""") shape: Optional[int] = Field(None, description="""The shape (number of rows, number of columns) of this sparse matrix.""")
indices: CSRMatrixIndices = Field(..., description="""The column indices.""") indices: List[int] = Field(default_factory=list, description="""The column indices.""")
indptr: CSRMatrixIndptr = Field(..., description="""The row index pointer.""") indptr: List[int] = Field(default_factory=list, description="""The row index pointer.""")
data: CSRMatrixData = Field(..., description="""The non-zero values in the matrix.""") data: List[Any] = Field(default_factory=list, description="""The non-zero values in the matrix.""")
# Update forward refs # Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/postponed_annotations/ # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
CSRMatrix.update_forward_refs() CSRMatrix.model_rebuild()

View file

@ -1,57 +0,0 @@
from __future__ import annotations
from datetime import datetime, date
from enum import Enum
from typing import List, Dict, Optional, Any, Union
from pydantic import BaseModel as BaseModel, Field
from nptyping import NDArray, Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64
import sys
if sys.version_info >= (3, 8):
from typing import Literal
else:
from typing_extensions import Literal
metamodel_version = "None"
version = "None"
class WeakRefShimBaseModel(BaseModel):
__slots__ = '__weakref__'
class ConfiguredBaseModel(WeakRefShimBaseModel,
validate_assignment = True,
validate_all = True,
underscore_attrs_are_private = True,
extra = 'forbid',
arbitrary_types_allowed = True,
use_enum_values = True):
pass
class CSRMatrixIndices(ConfiguredBaseModel):
"""
The column indices.
"""
indices: List[int] = Field(default_factory=list, description="""The column indices.""")
class CSRMatrixIndptr(ConfiguredBaseModel):
"""
The row index pointer.
"""
indptr: List[int] = Field(default_factory=list, description="""The row index pointer.""")
class CSRMatrixData(ConfiguredBaseModel):
"""
The non-zero values in the matrix.
"""
data: List[Any] = Field(default_factory=list, description="""The non-zero values in the matrix.""")
# Update forward refs
# see https://pydantic-docs.helpmanual.io/usage/postponed_annotations/
CSRMatrixIndices.update_forward_refs()
CSRMatrixIndptr.update_forward_refs()
CSRMatrixData.update_forward_refs()

View file

@ -11,28 +11,23 @@ else:
from typing_extensions import Literal from typing_extensions import Literal
# from .hdmf_common_table_include import (
# VectorDataArray,
# ElementIdentifiersArray,
# DynamicTableId
# )
from .hdmf_common_base import ( from .hdmf_common_base import (
Container, Data,
Data Container
)
from .hdmf_common_table_include import (
VectorDataArray,
ElementIdentifiersArray
) )
metamodel_version = "None" metamodel_version = "None"
version = "None" version = "None"
class WeakRefShimBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel,
__slots__ = '__weakref__'
class ConfiguredBaseModel(WeakRefShimBaseModel,
validate_assignment = True, validate_assignment = True,
validate_all = True, validate_default = True,
underscore_attrs_are_private = True,
extra = 'forbid', extra = 'forbid',
arbitrary_types_allowed = True, arbitrary_types_allowed = True,
use_enum_values = True): use_enum_values = True):
@ -43,63 +38,85 @@ class VectorData(Data):
""" """
An n-dimensional dataset representing a column of a DynamicTable. If used without an accompanying VectorIndex, first dimension is along the rows of the DynamicTable and each step along the first dimension is a cell of the larger table. VectorData can also be used to represent a ragged array if paired with a VectorIndex. This allows for storing arrays of varying length in a single cell of the DynamicTable by indexing into this VectorData. The first vector is at VectorData[0:VectorIndex[0]]. The second vector is at VectorData[VectorIndex[0]:VectorIndex[1]], and so on. An n-dimensional dataset representing a column of a DynamicTable. If used without an accompanying VectorIndex, first dimension is along the rows of the DynamicTable and each step along the first dimension is a cell of the larger table. VectorData can also be used to represent a ragged array if paired with a VectorIndex. This allows for storing arrays of varying length in a single cell of the DynamicTable by indexing into this VectorData. The first vector is at VectorData[0:VectorIndex[0]]. The second vector is at VectorData[VectorIndex[0]:VectorIndex[1]], and so on.
""" """
name: str = Field(...)
description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") description: Optional[str] = Field(None, description="""Description of what these vectors represent.""")
array: Optional[NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any]] = Field(None) array: Optional[Union[
NDArray[Shape["* dim0"], Any],
NDArray[Shape["* dim0, * dim1"], Any],
NDArray[Shape["* dim0, * dim1, * dim2"], Any],
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any]
]] = Field(None)
class VectorIndex(VectorData): class VectorIndex(VectorData):
""" """
Used with VectorData to encode a ragged array. An array of indices into the first dimension of the target VectorData, and forming a map between the rows of a DynamicTable and the indices of the VectorData. The name of the VectorIndex is expected to be the name of the target VectorData object followed by \"_index\". Used with VectorData to encode a ragged array. An array of indices into the first dimension of the target VectorData, and forming a map between the rows of a DynamicTable and the indices of the VectorData. The name of the VectorIndex is expected to be the name of the target VectorData object followed by \"_index\".
""" """
name: str = Field(...)
target: Optional[VectorData] = Field(None, description="""Reference to the target dataset that this index applies to.""") target: Optional[VectorData] = Field(None, description="""Reference to the target dataset that this index applies to.""")
description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") description: Optional[str] = Field(None, description="""Description of what these vectors represent.""")
array: Optional[NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any]] = Field(None) array: Optional[Union[
NDArray[Shape["* dim0"], Any],
NDArray[Shape["* dim0, * dim1"], Any],
NDArray[Shape["* dim0, * dim1, * dim2"], Any],
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any]
]] = Field(None)
class ElementIdentifiers(Data): class ElementIdentifiers(Data):
""" """
A list of unique identifiers for values within a dataset, e.g. rows of a DynamicTable. A list of unique identifiers for values within a dataset, e.g. rows of a DynamicTable.
""" """
name: str = Field(...)
array: Optional[NDArray[Shape["* num_elements"], Int]] = Field(None) array: Optional[NDArray[Shape["* num_elements"], Int]] = Field(None)
# class DynamicTableRegion(VectorData): class DynamicTableRegion(VectorData):
# """ """
# DynamicTableRegion provides a link from one table to an index or region of another. The `table` attribute is a link to another `DynamicTable`, indicating which table is referenced, and the data is int(s) indicating the row(s) (0-indexed) of the target array. `DynamicTableRegion`s can be used to associate rows with repeated meta-data without data duplication. They can also be used to create hierarchical relationships between multiple `DynamicTable`s. `DynamicTableRegion` objects may be paired with a `VectorIndex` object to create ragged references, so a single cell of a `DynamicTable` can reference many rows of another `DynamicTable`. DynamicTableRegion provides a link from one table to an index or region of another. The `table` attribute is a link to another `DynamicTable`, indicating which table is referenced, and the data is int(s) indicating the row(s) (0-indexed) of the target array. `DynamicTableRegion`s can be used to associate rows with repeated meta-data without data duplication. They can also be used to create hierarchical relationships between multiple `DynamicTable`s. `DynamicTableRegion` objects may be paired with a `VectorIndex` object to create ragged references, so a single cell of a `DynamicTable` can reference many rows of another `DynamicTable`.
# """ """
# table: Optional[DynamicTable] = Field(None, description="""Reference to the DynamicTable object that this region applies to.""") name: str = Field(...)
# description: Optional[str] = Field(None, description="""Description of what this table region points to.""") table: Optional[DynamicTable] = Field(None, description="""Reference to the DynamicTable object that this region applies to.""")
# array: Optional[NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any]] = Field(None) description: Optional[str] = Field(None, description="""Description of what this table region points to.""")
# array: Optional[Union[
NDArray[Shape["* dim0"], Any],
NDArray[Shape["* dim0, * dim1"], Any],
NDArray[Shape["* dim0, * dim1, * dim2"], Any],
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any]
]] = Field(None)
# class DynamicTable(Container): class DynamicTable(Container):
# """ """
# A group containing multiple datasets that are aligned on the first dimension (Currently, this requirement if left up to APIs to check and enforce). These datasets represent different columns in the table. Apart from a column that contains unique identifiers for each row, there are no other required datasets. Users are free to add any number of custom VectorData objects (columns) here. DynamicTable also supports ragged array columns, where each element can be of a different size. To add a ragged array column, use a VectorIndex type to index the corresponding VectorData type. See documentation for VectorData and VectorIndex for more details. Unlike a compound data type, which is analogous to storing an array-of-structs, a DynamicTable can be thought of as a struct-of-arrays. This provides an alternative structure to choose from when optimizing storage for anticipated access patterns. Additionally, this type provides a way of creating a table without having to define a compound type up front. Although this convenience may be attractive, users should think carefully about how data will be accessed. DynamicTable is more appropriate for column-centric access, whereas a dataset with a compound type would be more appropriate for row-centric access. Finally, data size should also be taken into account. For small tables, performance loss may be an acceptable trade-off for the flexibility of a DynamicTable. A group containing multiple datasets that are aligned on the first dimension (Currently, this requirement if left up to APIs to check and enforce). These datasets represent different columns in the table. Apart from a column that contains unique identifiers for each row, there are no other required datasets. Users are free to add any number of custom VectorData objects (columns) here. DynamicTable also supports ragged array columns, where each element can be of a different size. To add a ragged array column, use a VectorIndex type to index the corresponding VectorData type. See documentation for VectorData and VectorIndex for more details. Unlike a compound data type, which is analogous to storing an array-of-structs, a DynamicTable can be thought of as a struct-of-arrays. This provides an alternative structure to choose from when optimizing storage for anticipated access patterns. Additionally, this type provides a way of creating a table without having to define a compound type up front. Although this convenience may be attractive, users should think carefully about how data will be accessed. DynamicTable is more appropriate for column-centric access, whereas a dataset with a compound type would be more appropriate for row-centric access. Finally, data size should also be taken into account. For small tables, performance loss may be an acceptable trade-off for the flexibility of a DynamicTable.
# """ """
# colnames: Optional[str] = Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") name: str = Field(...)
# description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") colnames: Optional[str] = Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""")
# id: DynamicTableId = Field(..., description="""Array of unique identifiers for the rows of this dynamic table.""") description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""")
# VectorData: Optional[List[VectorData]] = Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") id: List[int] = Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""")
# VectorData: Optional[List[VectorData]] = Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""")
# class AlignedDynamicTable(DynamicTable): class AlignedDynamicTable(DynamicTable):
# """ """
# DynamicTable container that supports storing a collection of sub-tables. Each sub-table is a DynamicTable itself that is aligned with the main table by row index. I.e., all DynamicTables stored in this group MUST have the same number of rows. This type effectively defines a 2-level table in which the main data is stored in the main table implemented by this type and additional columns of the table are grouped into categories, with each category being represented by a separate DynamicTable stored within the group. DynamicTable container that supports storing a collection of sub-tables. Each sub-table is a DynamicTable itself that is aligned with the main table by row index. I.e., all DynamicTables stored in this group MUST have the same number of rows. This type effectively defines a 2-level table in which the main data is stored in the main table implemented by this type and additional columns of the table are grouped into categories, with each category being represented by a separate DynamicTable stored within the group.
# """ """
# categories: Optional[str] = Field(None, description="""The names of the categories in this AlignedDynamicTable. Each category is represented by one DynamicTable stored in the parent group. This attribute should be used to specify an order of categories and the category names must match the names of the corresponding DynamicTable in the group.""") name: str = Field(...)
# DynamicTable: Optional[List[DynamicTable]] = Field(default_factory=list, description="""A DynamicTable representing a particular category for columns in the AlignedDynamicTable parent container. The table MUST be aligned with (i.e., have the same number of rows) as all other DynamicTables stored in the AlignedDynamicTable parent container. The name of the category is given by the name of the DynamicTable and its description by the description attribute of the DynamicTable.""") categories: Optional[str] = Field(None, description="""The names of the categories in this AlignedDynamicTable. Each category is represented by one DynamicTable stored in the parent group. This attribute should be used to specify an order of categories and the category names must match the names of the corresponding DynamicTable in the group.""")
# colnames: Optional[str] = Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") dynamic_table: Optional[List[DynamicTable]] = Field(default_factory=list, description="""A DynamicTable representing a particular category for columns in the AlignedDynamicTable parent container. The table MUST be aligned with (i.e., have the same number of rows) as all other DynamicTables stored in the AlignedDynamicTable parent container. The name of the category is given by the name of the DynamicTable and its description by the description attribute of the DynamicTable.""")
# description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""") colnames: Optional[str] = Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""")
# id: DynamicTableId = Field(..., description="""Array of unique identifiers for the rows of this dynamic table.""") description: Optional[str] = Field(None, description="""Description of what is in this dynamic table.""")
# VectorData: Optional[List[VectorData]] = Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") id: List[int] = Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""")
# VectorData: Optional[List[VectorData]] = Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""")
# Update forward refs # Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/postponed_annotations/ # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
VectorData.update_forward_refs() VectorData.model_rebuild()
VectorIndex.update_forward_refs() VectorIndex.model_rebuild()
ElementIdentifiers.update_forward_refs() ElementIdentifiers.model_rebuild()
DynamicTableRegion.update_forward_refs() DynamicTableRegion.model_rebuild()
# DynamicTable.update_forward_refs() DynamicTable.model_rebuild()
# AlignedDynamicTable.update_forward_refs() AlignedDynamicTable.model_rebuild()

View file

@ -11,10 +11,6 @@ else:
from typing_extensions import Literal from typing_extensions import Literal
# from .hdmf_common_table import (
# ElementIdentifiers
# )
from .nwb_language import ( from .nwb_language import (
Arraylike Arraylike
) )
@ -23,13 +19,9 @@ from .nwb_language import (
metamodel_version = "None" metamodel_version = "None"
version = "None" version = "None"
class WeakRefShimBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel,
__slots__ = '__weakref__'
class ConfiguredBaseModel(WeakRefShimBaseModel,
validate_assignment = True, validate_assignment = True,
validate_all = True, validate_default = True,
underscore_attrs_are_private = True,
extra = 'forbid', extra = 'forbid',
arbitrary_types_allowed = True, arbitrary_types_allowed = True,
use_enum_values = True): use_enum_values = True):
@ -49,17 +41,9 @@ class ElementIdentifiersArray(Arraylike):
num_elements: int = Field(...) num_elements: int = Field(...)
# class DynamicTableId(ElementIdentifiers):
# """
# Array of unique identifiers for the rows of this dynamic table.
# """
# id: List[int] = Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""")
# array: Optional[NDArray[Shape["* num_elements"], Int]] = Field(None)
#
# Model rebuild
# Update forward refs # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
# see https://pydantic-docs.helpmanual.io/usage/postponed_annotations/ VectorDataArray.model_rebuild()
VectorDataArray.update_forward_refs() ElementIdentifiersArray.model_rebuild()
ElementIdentifiersArray.update_forward_refs()
DynamicTableId.update_forward_refs()

View file

@ -15,13 +15,9 @@ else:
metamodel_version = "None" metamodel_version = "None"
version = "0.5.0" version = "0.5.0"
class WeakRefShimBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel,
__slots__ = '__weakref__'
class ConfiguredBaseModel(WeakRefShimBaseModel,
validate_assignment = True, validate_assignment = True,
validate_all = True, validate_default = True,
underscore_attrs_are_private = True,
extra = 'forbid', extra = 'forbid',
arbitrary_types_allowed = True, arbitrary_types_allowed = True,
use_enum_values = True): use_enum_values = True):
@ -29,5 +25,6 @@ class ConfiguredBaseModel(WeakRefShimBaseModel,
# Update forward refs # Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/postponed_annotations/ # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model

View file

@ -19,13 +19,9 @@ from .hdmf_common_table import (
metamodel_version = "None" metamodel_version = "None"
version = "None" version = "None"
class WeakRefShimBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel,
__slots__ = '__weakref__'
class ConfiguredBaseModel(WeakRefShimBaseModel,
validate_assignment = True, validate_assignment = True,
validate_all = True, validate_default = True,
underscore_attrs_are_private = True,
extra = 'forbid', extra = 'forbid',
arbitrary_types_allowed = True, arbitrary_types_allowed = True,
use_enum_values = True): use_enum_values = True):
@ -36,12 +32,19 @@ class EnumData(VectorData):
""" """
Data that come from a fixed set of values. A data value of i corresponds to the i-th value in the VectorData referenced by the 'elements' attribute. Data that come from a fixed set of values. A data value of i corresponds to the i-th value in the VectorData referenced by the 'elements' attribute.
""" """
name: str = Field(...)
elements: Optional[VectorData] = Field(None, description="""Reference to the VectorData object that contains the enumerable elements""") elements: Optional[VectorData] = Field(None, description="""Reference to the VectorData object that contains the enumerable elements""")
description: Optional[str] = Field(None, description="""Description of what these vectors represent.""") description: Optional[str] = Field(None, description="""Description of what these vectors represent.""")
array: Optional[NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], ]] = Field(None) array: Optional[Union[
NDArray[Shape["* dim0"], Any],
NDArray[Shape["* dim0, * dim1"], Any],
NDArray[Shape["* dim0, * dim1, * dim2"], Any],
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any]
]] = Field(None)
# Update forward refs # Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/postponed_annotations/ # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
EnumData.update_forward_refs() EnumData.model_rebuild()

View file

@ -1,33 +0,0 @@
from __future__ import annotations
from datetime import datetime, date
from enum import Enum
from typing import List, Dict, Optional, Any, Union
from pydantic import BaseModel as BaseModel, Field
from nptyping import NDArray, Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64
import sys
if sys.version_info >= (3, 8):
from typing import Literal
else:
from typing_extensions import Literal
metamodel_version = "None"
version = "None"
class WeakRefShimBaseModel(BaseModel):
__slots__ = '__weakref__'
class ConfiguredBaseModel(WeakRefShimBaseModel,
validate_assignment = True,
validate_all = True,
underscore_attrs_are_private = True,
extra = 'forbid',
arbitrary_types_allowed = True,
use_enum_values = True):
pass
# Update forward refs
# see https://pydantic-docs.helpmanual.io/usage/postponed_annotations/

View file

@ -15,26 +15,13 @@ from .hdmf_common_base import (
Container Container
) )
from .hdmf_experimental_resources_include import (
HERDObjectKeys,
HERDObjects,
HERDEntities,
HERDKeys,
HERDFiles,
HERDEntityKeys
)
metamodel_version = "None" metamodel_version = "None"
version = "None" version = "None"
class WeakRefShimBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel,
__slots__ = '__weakref__'
class ConfiguredBaseModel(WeakRefShimBaseModel,
validate_assignment = True, validate_assignment = True,
validate_all = True, validate_default = True,
underscore_attrs_are_private = True,
extra = 'forbid', extra = 'forbid',
arbitrary_types_allowed = True, arbitrary_types_allowed = True,
use_enum_values = True): use_enum_values = True):
@ -45,15 +32,17 @@ class HERD(Container):
""" """
HDMF External Resources Data Structure. A set of six tables for tracking external resource references in a file or across multiple files. HDMF External Resources Data Structure. A set of six tables for tracking external resource references in a file or across multiple files.
""" """
keys: HERDKeys = Field(<built-in method keys of dict object at 0x10ab5b600>, description="""A table for storing user terms that are used to refer to external resources.""") name: str = Field(...)
files: HERDFiles = Field(..., description="""A table for storing object ids of files used in external resources.""") keys: List[Any] = Field(default_factory=list, description="""A table for storing user terms that are used to refer to external resources.""")
entities: HERDEntities = Field(..., description="""A table for mapping user terms (i.e., keys) to resource entities.""") files: List[Any] = Field(default_factory=list, description="""A table for storing object ids of files used in external resources.""")
objects: HERDObjects = Field(..., description="""A table for identifying which objects in a file contain references to external resources.""") entities: List[Any] = Field(default_factory=list, description="""A table for mapping user terms (i.e., keys) to resource entities.""")
object_keys: HERDObjectKeys = Field(..., description="""A table for identifying which objects use which keys.""") objects: List[Any] = Field(default_factory=list, description="""A table for identifying which objects in a file contain references to external resources.""")
entity_keys: HERDEntityKeys = Field(..., description="""A table for identifying which keys use which entity.""") object_keys: List[Any] = Field(default_factory=list, description="""A table for identifying which objects use which keys.""")
entity_keys: List[Any] = Field(default_factory=list, description="""A table for identifying which keys use which entity.""")
# Update forward refs # Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/postponed_annotations/ # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
HERD.update_forward_refs() HERD.model_rebuild()

View file

@ -1,85 +0,0 @@
from __future__ import annotations
from datetime import datetime, date
from enum import Enum
from typing import List, Dict, Optional, Any, Union
from pydantic import BaseModel as BaseModel, Field
from nptyping import NDArray, Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64
import sys
if sys.version_info >= (3, 8):
from typing import Literal
else:
from typing_extensions import Literal
from .hdmf_common_base import (
Data
)
metamodel_version = "None"
version = "None"
class WeakRefShimBaseModel(BaseModel):
__slots__ = '__weakref__'
class ConfiguredBaseModel(WeakRefShimBaseModel,
validate_assignment = True,
validate_all = True,
underscore_attrs_are_private = True,
extra = 'forbid',
arbitrary_types_allowed = True,
use_enum_values = True):
pass
class HERDKeys(Data):
"""
A table for storing user terms that are used to refer to external resources.
"""
keys: List[Any] = Field(default_factory=list, description="""A table for storing user terms that are used to refer to external resources.""")
class HERDFiles(Data):
"""
A table for storing object ids of files used in external resources.
"""
files: List[Any] = Field(default_factory=list, description="""A table for storing object ids of files used in external resources.""")
class HERDEntities(Data):
"""
A table for mapping user terms (i.e., keys) to resource entities.
"""
entities: List[Any] = Field(default_factory=list, description="""A table for mapping user terms (i.e., keys) to resource entities.""")
class HERDObjects(Data):
"""
A table for identifying which objects in a file contain references to external resources.
"""
objects: List[Any] = Field(default_factory=list, description="""A table for identifying which objects in a file contain references to external resources.""")
class HERDObjectKeys(Data):
"""
A table for identifying which objects use which keys.
"""
object_keys: List[Any] = Field(default_factory=list, description="""A table for identifying which objects use which keys.""")
class HERDEntityKeys(Data):
"""
A table for identifying which keys use which entity.
"""
entity_keys: List[Any] = Field(default_factory=list, description="""A table for identifying which keys use which entity.""")
# Update forward refs
# see https://pydantic-docs.helpmanual.io/usage/postponed_annotations/
HERDKeys.update_forward_refs()
HERDFiles.update_forward_refs()
HERDEntities.update_forward_refs()
HERDObjects.update_forward_refs()
HERDObjectKeys.update_forward_refs()
HERDEntityKeys.update_forward_refs()

View file

@ -15,13 +15,9 @@ else:
metamodel_version = "None" metamodel_version = "None"
version = "None" version = "None"
class WeakRefShimBaseModel(BaseModel): class ConfiguredBaseModel(BaseModel,
__slots__ = '__weakref__'
class ConfiguredBaseModel(WeakRefShimBaseModel,
validate_assignment = True, validate_assignment = True,
validate_all = True, validate_default = True,
underscore_attrs_are_private = True,
extra = 'forbid', extra = 'forbid',
arbitrary_types_allowed = True, arbitrary_types_allowed = True,
use_enum_values = True): use_enum_values = True):
@ -36,6 +32,7 @@ class Arraylike(ConfiguredBaseModel):
# Update forward refs # Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/postponed_annotations/ # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
Arraylike.update_forward_refs() Arraylike.model_rebuild()

View file

@ -121,7 +121,7 @@ class GitRepo:
# Check that the remote matches # Check that the remote matches
if self.remote.strip('.git') != self.namespace.repository: if self.remote.strip('.git') != self.namespace.repository:
warnings.warn('Repository exists, but has the wrong remote URL') warnings.warn(f'Repository exists, but has the wrong remote URL.\nExpected: {self.namespace.repository}\nGot:{self.remote.strip(".git")}')
return False return False
# otherwise we're good # otherwise we're good

View file

@ -46,6 +46,12 @@ classes:
should always represent time. This can also be used to store binary data (e.g., should always represent time. This can also be used to store binary data (e.g.,
image frames). This can also be a link to data stored in an external file. image frames). This can also be a link to data stored in an external file.
attributes: attributes:
name:
name: name
ifabsent: string(data)
range: string
required: true
equals_string: data
conversion: conversion:
name: conversion name: conversion
description: Scalar to multiply each element in data to convert it to the description: Scalar to multiply each element in data to convert it to the
@ -120,6 +126,12 @@ classes:
spaced, the timestamp of the first sample can be specified and all subsequent spaced, the timestamp of the first sample can be specified and all subsequent
ones calculated from the sampling rate attribute. ones calculated from the sampling rate attribute.
attributes: attributes:
name:
name: name
ifabsent: string(starting_time)
range: string
required: true
equals_string: starting_time
rate: rate:
name: rate name: rate
description: Sampling rate, in Hz. description: Sampling rate, in Hz.
@ -128,54 +140,6 @@ classes:
name: unit name: unit
description: Unit of measurement for time, which is fixed to 'seconds'. description: Unit of measurement for time, which is fixed to 'seconds'.
range: text range: text
TimeSeries__timestamps:
name: TimeSeries__timestamps
description: Timestamps for samples stored in data, in seconds, relative to the
common experiment master-clock stored in NWBFile.timestamps_reference_time.
attributes:
interval:
name: interval
description: Value is '1'
range: int32
unit:
name: unit
description: Unit of measurement for timestamps, which is fixed to 'seconds'.
range: text
timestamps:
name: timestamps
description: Timestamps for samples stored in data, in seconds, relative to
the common experiment master-clock stored in NWBFile.timestamps_reference_time.
multivalued: true
range: float64
required: false
TimeSeries__control:
name: TimeSeries__control
description: Numerical labels that apply to each time point in data for the purpose
of querying and slicing data by these values. If present, the length of this
array should be the same size as the first dimension of data.
attributes:
control:
name: control
description: Numerical labels that apply to each time point in data for the
purpose of querying and slicing data by these values. If present, the length
of this array should be the same size as the first dimension of data.
multivalued: true
range: uint8
required: false
TimeSeries__control_description:
name: TimeSeries__control_description
description: Description of each control value. Must be present if control is
present. If present, control_description[0] should describe time points where
control == 0.
attributes:
control_description:
name: control_description
description: Description of each control value. Must be present if control
is present. If present, control_description[0] should describe time points
where control == 0.
multivalued: true
range: text
required: false
TimeSeries__sync: TimeSeries__sync:
name: TimeSeries__sync name: TimeSeries__sync
description: Lab-specific time and sync information as provided directly from description: Lab-specific time and sync information as provided directly from
@ -184,9 +148,23 @@ classes:
This group will usually only be populated in TimeSeries that are stored external This group will usually only be populated in TimeSeries that are stored external
to the NWB file, in files storing raw data. Once timestamp data is calculated, to the NWB file, in files storing raw data. Once timestamp data is calculated,
the contents of 'sync' are mostly for archival purposes. the contents of 'sync' are mostly for archival purposes.
attributes:
name:
name: name
ifabsent: string(sync)
range: string
required: true
equals_string: sync
Images__order_of_images: Images__order_of_images:
name: Images__order_of_images name: Images__order_of_images
description: Ordered dataset of references to Image objects stored in the parent description: Ordered dataset of references to Image objects stored in the parent
group. Each Image object in the Images group should be stored once and only group. Each Image object in the Images group should be stored once and only
once, so the dataset should have the same length as the number of images. once, so the dataset should have the same length as the number of images.
is_a: ImageReferences is_a: ImageReferences
attributes:
name:
name: name
ifabsent: string(order_of_images)
range: string
required: true
equals_string: order_of_images

View file

@ -12,12 +12,24 @@ classes:
name: NWBData name: NWBData
description: An abstract data type for a dataset. description: An abstract data type for a dataset.
is_a: Data is_a: Data
attributes:
name:
name: name
range: string
required: true
tree_root: true
TimeSeriesReferenceVectorData: TimeSeriesReferenceVectorData:
name: TimeSeriesReferenceVectorData name: TimeSeriesReferenceVectorData
description: Column storing references to a TimeSeries (rows). For each TimeSeries description: Column storing references to a TimeSeries (rows). For each TimeSeries
this VectorData column stores the start_index and count to indicate the range this VectorData column stores the start_index and count to indicate the range
in time to be selected as well as an object reference to the TimeSeries. in time to be selected as well as an object reference to the TimeSeries.
is_a: VectorData is_a: VectorData
attributes:
name:
name: name
range: string
required: true
tree_root: true
Image: Image:
name: Image name: Image
description: An abstract data type for an image. Shape can be 2-D (x, y), or 3-D description: An abstract data type for an image. Shape can be 2-D (x, y), or 3-D
@ -25,6 +37,10 @@ classes:
b)) or (x, y, (r, g, b, a)). b)) or (x, y, (r, g, b, a)).
is_a: NWBData is_a: NWBData
attributes: attributes:
name:
name: name
range: string
required: true
resolution: resolution:
name: resolution name: resolution
description: Pixel resolution of the image, in pixels per centimeter. description: Pixel resolution of the image, in pixels per centimeter.
@ -36,29 +52,51 @@ classes:
array: array:
name: array name: array
range: Image__Array range: Image__Array
tree_root: true
ImageReferences: ImageReferences:
name: ImageReferences name: ImageReferences
description: Ordered dataset of references to Image objects. description: Ordered dataset of references to Image objects.
is_a: NWBData is_a: NWBData
attributes: attributes:
name:
name: name
range: string
required: true
array: array:
name: array name: array
range: ImageReferences__Array range: ImageReferences__Array
tree_root: true
NWBContainer: NWBContainer:
name: NWBContainer name: NWBContainer
description: An abstract data type for a generic container storing collections description: An abstract data type for a generic container storing collections
of data and metadata. Base type for all data and metadata containers. of data and metadata. Base type for all data and metadata containers.
is_a: Container is_a: Container
attributes:
name:
name: name
range: string
required: true
tree_root: true
NWBDataInterface: NWBDataInterface:
name: NWBDataInterface name: NWBDataInterface
description: An abstract data type for a generic container storing collections description: An abstract data type for a generic container storing collections
of data, as opposed to metadata. of data, as opposed to metadata.
is_a: NWBContainer is_a: NWBContainer
attributes:
name:
name: name
range: string
required: true
tree_root: true
TimeSeries: TimeSeries:
name: TimeSeries name: TimeSeries
description: General purpose time series. description: General purpose time series.
is_a: NWBDataInterface is_a: NWBDataInterface
attributes: attributes:
name:
name: name
range: string
required: true
description: description:
name: description name: description
description: Description of the time series. description: Description of the time series.
@ -90,24 +128,24 @@ classes:
name: timestamps name: timestamps
description: Timestamps for samples stored in data, in seconds, relative to description: Timestamps for samples stored in data, in seconds, relative to
the common experiment master-clock stored in NWBFile.timestamps_reference_time. the common experiment master-clock stored in NWBFile.timestamps_reference_time.
multivalued: false multivalued: true
range: TimeSeries__timestamps range: float64
required: false required: false
control: control:
name: control name: control
description: Numerical labels that apply to each time point in data for the description: Numerical labels that apply to each time point in data for the
purpose of querying and slicing data by these values. If present, the length purpose of querying and slicing data by these values. If present, the length
of this array should be the same size as the first dimension of data. of this array should be the same size as the first dimension of data.
multivalued: false multivalued: true
range: TimeSeries__control range: uint8
required: false required: false
control_description: control_description:
name: control_description name: control_description
description: Description of each control value. Must be present if control description: Description of each control value. Must be present if control
is present. If present, control_description[0] should describe time points is present. If present, control_description[0] should describe time points
where control == 0. where control == 0.
multivalued: false multivalued: true
range: TimeSeries__control_description range: text
required: false required: false
sync: sync:
name: sync name: sync
@ -120,27 +158,33 @@ classes:
multivalued: false multivalued: false
range: TimeSeries__sync range: TimeSeries__sync
required: false required: false
tree_root: true
ProcessingModule: ProcessingModule:
name: ProcessingModule name: ProcessingModule
description: A collection of processed data. description: A collection of processed data.
is_a: NWBContainer is_a: NWBContainer
attributes: attributes:
name:
name: name
range: string
required: true
description: description:
name: description name: description
description: Description of this collection of processed data. description: Description of this collection of processed data.
range: text range: text
NWBDataInterface: nwb_data_interface:
name: NWBDataInterface name: nwb_data_interface
description: Data objects stored in this collection. description: Data objects stored in this collection.
multivalued: true multivalued: true
range: NWBDataInterface range: NWBDataInterface
required: false required: false
DynamicTable: dynamic_table:
name: DynamicTable name: dynamic_table
description: Tables stored in this collection. description: Tables stored in this collection.
multivalued: true multivalued: true
range: DynamicTable range: DynamicTable
required: false required: false
tree_root: true
Images: Images:
name: Images name: Images
description: A collection of images with an optional way to specify the order description: A collection of images with an optional way to specify the order
@ -148,6 +192,10 @@ classes:
if the images are referenced by index, e.g., from an IndexSeries. if the images are referenced by index, e.g., from an IndexSeries.
is_a: NWBDataInterface is_a: NWBDataInterface
attributes: attributes:
name:
name: name
range: string
required: true
description: description:
name: description name: description
description: Description of this collection of images. description: Description of this collection of images.
@ -167,3 +215,4 @@ classes:
multivalued: false multivalued: false
range: Images__order_of_images range: Images__order_of_images
required: false required: false
tree_root: true

View file

@ -13,6 +13,12 @@ classes:
description: 1-D or 2-D array storing position or direction relative to some reference description: 1-D or 2-D array storing position or direction relative to some reference
frame. frame.
attributes: attributes:
name:
name: name
ifabsent: string(data)
range: string
required: true
equals_string: data
unit: unit:
name: unit name: unit
description: Base unit of measurement for working with the data. The default description: Base unit of measurement for working with the data. The default

View file

@ -21,6 +21,10 @@ classes:
SpatialSeries values.' SpatialSeries values.'
is_a: TimeSeries is_a: TimeSeries
attributes: attributes:
name:
name: name
range: string
required: true
data: data:
name: data name: data
description: 1-D or 2-D array storing position or direction relative to some description: 1-D or 2-D array storing position or direction relative to some
@ -34,6 +38,7 @@ classes:
multivalued: false multivalued: false
range: text range: text
required: false required: false
tree_root: true
BehavioralEpochs: BehavioralEpochs:
name: BehavioralEpochs name: BehavioralEpochs
description: TimeSeries for storing behavioral epochs. The objective of this description: TimeSeries for storing behavioral epochs. The objective of this
@ -50,58 +55,83 @@ classes:
events. BehavioralTimeSeries is for continuous data. events. BehavioralTimeSeries is for continuous data.
is_a: NWBDataInterface is_a: NWBDataInterface
attributes: attributes:
IntervalSeries: name:
name: IntervalSeries name: name
range: string
required: true
interval_series:
name: interval_series
description: IntervalSeries object containing start and stop times of epochs. description: IntervalSeries object containing start and stop times of epochs.
multivalued: true multivalued: true
range: IntervalSeries range: IntervalSeries
required: false required: false
tree_root: true
BehavioralEvents: BehavioralEvents:
name: BehavioralEvents name: BehavioralEvents
description: TimeSeries for storing behavioral events. See description of <a href="#BehavioralEpochs">BehavioralEpochs</a> description: TimeSeries for storing behavioral events. See description of <a href="#BehavioralEpochs">BehavioralEpochs</a>
for more details. for more details.
is_a: NWBDataInterface is_a: NWBDataInterface
attributes: attributes:
TimeSeries: name:
name: TimeSeries name: name
range: string
required: true
time_series:
name: time_series
description: TimeSeries object containing behavioral events. description: TimeSeries object containing behavioral events.
multivalued: true multivalued: true
range: TimeSeries range: TimeSeries
required: false required: false
tree_root: true
BehavioralTimeSeries: BehavioralTimeSeries:
name: BehavioralTimeSeries name: BehavioralTimeSeries
description: TimeSeries for storing Behavoioral time series data. See description description: TimeSeries for storing Behavoioral time series data. See description
of <a href="#BehavioralEpochs">BehavioralEpochs</a> for more details. of <a href="#BehavioralEpochs">BehavioralEpochs</a> for more details.
is_a: NWBDataInterface is_a: NWBDataInterface
attributes: attributes:
TimeSeries: name:
name: TimeSeries name: name
range: string
required: true
time_series:
name: time_series
description: TimeSeries object containing continuous behavioral data. description: TimeSeries object containing continuous behavioral data.
multivalued: true multivalued: true
range: TimeSeries range: TimeSeries
required: false required: false
tree_root: true
PupilTracking: PupilTracking:
name: PupilTracking name: PupilTracking
description: Eye-tracking data, representing pupil size. description: Eye-tracking data, representing pupil size.
is_a: NWBDataInterface is_a: NWBDataInterface
attributes: attributes:
TimeSeries: name:
name: TimeSeries name: name
range: string
required: true
time_series:
name: time_series
description: TimeSeries object containing time series data on pupil size. description: TimeSeries object containing time series data on pupil size.
multivalued: true multivalued: true
range: TimeSeries range: TimeSeries
required: true required: true
tree_root: true
EyeTracking: EyeTracking:
name: EyeTracking name: EyeTracking
description: Eye-tracking data, representing direction of gaze. description: Eye-tracking data, representing direction of gaze.
is_a: NWBDataInterface is_a: NWBDataInterface
attributes: attributes:
SpatialSeries: name:
name: SpatialSeries name: name
range: string
required: true
spatial_series:
name: spatial_series
description: SpatialSeries object containing data measuring direction of gaze. description: SpatialSeries object containing data measuring direction of gaze.
multivalued: true multivalued: true
range: SpatialSeries range: SpatialSeries
required: false required: false
tree_root: true
CompassDirection: CompassDirection:
name: CompassDirection name: CompassDirection
description: With a CompassDirection interface, a module publishes a SpatialSeries description: With a CompassDirection interface, a module publishes a SpatialSeries
@ -111,20 +141,30 @@ classes:
be radians or degrees. be radians or degrees.
is_a: NWBDataInterface is_a: NWBDataInterface
attributes: attributes:
SpatialSeries: name:
name: SpatialSeries name: name
range: string
required: true
spatial_series:
name: spatial_series
description: SpatialSeries object containing direction of gaze travel. description: SpatialSeries object containing direction of gaze travel.
multivalued: true multivalued: true
range: SpatialSeries range: SpatialSeries
required: false required: false
tree_root: true
Position: Position:
name: Position name: Position
description: Position data, whether along the x, x/y or x/y/z axis. description: Position data, whether along the x, x/y or x/y/z axis.
is_a: NWBDataInterface is_a: NWBDataInterface
attributes: attributes:
SpatialSeries: name:
name: SpatialSeries name: name
range: string
required: true
spatial_series:
name: spatial_series
description: SpatialSeries object containing position data. description: SpatialSeries object containing position data.
multivalued: true multivalued: true
range: SpatialSeries range: SpatialSeries
required: true required: true
tree_root: true

View file

@ -1,8 +0,0 @@
name: core.nwb.device.include
id: core.nwb.device.include
imports:
- core.nwb.base
- nwb.language
- core.nwb.device.include
- core.nwb.device
default_prefix: core.nwb.device.include/

View file

@ -3,7 +3,6 @@ id: core.nwb.device
imports: imports:
- core.nwb.base - core.nwb.base
- nwb.language - nwb.language
- core.nwb.device.include
- core.nwb.device - core.nwb.device
default_prefix: core.nwb.device/ default_prefix: core.nwb.device/
classes: classes:
@ -13,6 +12,10 @@ classes:
electrode, microscope. electrode, microscope.
is_a: NWBContainer is_a: NWBContainer
attributes: attributes:
name:
name: name
range: string
required: true
description: description:
name: description name: description
description: Description of the device (e.g., model, firmware version, processing description: Description of the device (e.g., model, firmware version, processing
@ -22,3 +25,4 @@ classes:
name: manufacturer name: manufacturer
description: The name of the manufacturer of the device. description: The name of the manufacturer of the device.
range: text range: text
tree_root: true

View file

@ -13,6 +13,12 @@ classes:
name: ElectricalSeries__data name: ElectricalSeries__data
description: Recorded voltage data. description: Recorded voltage data.
attributes: attributes:
name:
name: name
ifabsent: string(data)
range: string
required: true
equals_string: data
unit: unit:
name: unit name: unit
description: Base unit of measurement for working with the data. This value description: Base unit of measurement for working with the data. This value
@ -44,41 +50,23 @@ classes:
description: DynamicTableRegion pointer to the electrodes that this time series description: DynamicTableRegion pointer to the electrodes that this time series
was generated from. was generated from.
is_a: DynamicTableRegion is_a: DynamicTableRegion
ElectricalSeries__channel_conversion:
name: ElectricalSeries__channel_conversion
description: Channel-specific conversion factor. Multiply the data in the 'data'
dataset by these values along the channel axis (as indicated by axis attribute)
AND by the global conversion factor in the 'conversion' attribute of 'data'
to get the data values in Volts, i.e, data in Volts = data * data.conversion
* channel_conversion. This approach allows for both global and per-channel data
conversion factors needed to support the storage of electrical recordings as
native values generated by data acquisition systems. If this dataset is not
present, then there is no channel-specific conversion factor, i.e. it is 1 for
all channels.
attributes: attributes:
axis: name:
name: axis name: name
description: The zero-indexed axis of the 'data' dataset that the channel-specific ifabsent: string(electrodes)
conversion factor corresponds to. This value is fixed to 1. range: string
range: int32 required: true
channel_conversion: equals_string: electrodes
name: channel_conversion
description: Channel-specific conversion factor. Multiply the data in the
'data' dataset by these values along the channel axis (as indicated by axis
attribute) AND by the global conversion factor in the 'conversion' attribute
of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion
* channel_conversion. This approach allows for both global and per-channel
data conversion factors needed to support the storage of electrical recordings
as native values generated by data acquisition systems. If this dataset
is not present, then there is no channel-specific conversion factor, i.e.
it is 1 for all channels.
multivalued: true
range: float32
required: false
SpikeEventSeries__data: SpikeEventSeries__data:
name: SpikeEventSeries__data name: SpikeEventSeries__data
description: Spike waveforms. description: Spike waveforms.
attributes: attributes:
name:
name: name
ifabsent: string(data)
range: string
required: true
equals_string: data
unit: unit:
name: unit name: unit
description: Unit of measurement for waveforms, which is fixed to 'volts'. description: Unit of measurement for waveforms, which is fixed to 'volts'.
@ -102,45 +90,16 @@ classes:
name: num_channels name: num_channels
range: numeric range: numeric
required: false required: false
SpikeEventSeries__timestamps:
name: SpikeEventSeries__timestamps
description: Timestamps for samples stored in data, in seconds, relative to the
common experiment master-clock stored in NWBFile.timestamps_reference_time.
Timestamps are required for the events. Unlike for TimeSeries, timestamps are
required for SpikeEventSeries and are thus re-specified here.
attributes:
interval:
name: interval
description: Value is '1'
range: int32
unit:
name: unit
description: Unit of measurement for timestamps, which is fixed to 'seconds'.
range: text
timestamps:
name: timestamps
description: Timestamps for samples stored in data, in seconds, relative to
the common experiment master-clock stored in NWBFile.timestamps_reference_time.
Timestamps are required for the events. Unlike for TimeSeries, timestamps
are required for SpikeEventSeries and are thus re-specified here.
multivalued: true
range: float64
required: true
FeatureExtraction__description:
name: FeatureExtraction__description
description: Description of features (eg, ''PC1'') for each of the extracted features.
attributes:
description:
name: description
description: Description of features (eg, ''PC1'') for each of the extracted
features.
multivalued: true
range: text
required: true
FeatureExtraction__features: FeatureExtraction__features:
name: FeatureExtraction__features name: FeatureExtraction__features
description: Multi-dimensional array of features extracted from each event. description: Multi-dimensional array of features extracted from each event.
attributes: attributes:
name:
name: name
ifabsent: string(features)
range: string
required: true
equals_string: features
array: array:
name: array name: array
range: FeatureExtraction__features__Array range: FeatureExtraction__features__Array
@ -151,60 +110,27 @@ classes:
num_events: num_events:
name: num_events name: num_events
range: float32 range: float32
required: false required: true
num_channels: num_channels:
name: num_channels name: num_channels
range: float32 range: float32
required: false required: true
num_features: num_features:
name: num_features name: num_features
range: float32 range: float32
required: false
FeatureExtraction__times:
name: FeatureExtraction__times
description: Times of events that features correspond to (can be a link).
attributes:
times:
name: times
description: Times of events that features correspond to (can be a link).
multivalued: true
range: float64
required: true required: true
FeatureExtraction__electrodes: FeatureExtraction__electrodes:
name: FeatureExtraction__electrodes name: FeatureExtraction__electrodes
description: DynamicTableRegion pointer to the electrodes that this time series description: DynamicTableRegion pointer to the electrodes that this time series
was generated from. was generated from.
is_a: DynamicTableRegion is_a: DynamicTableRegion
EventDetection__source_idx:
name: EventDetection__source_idx
description: Indices (zero-based) into source ElectricalSeries::data array corresponding
to time of event. ''description'' should define what is meant by time of event
(e.g., .25 ms before action potential peak, zero-crossing time, etc). The index
points to each event from the raw data.
attributes: attributes:
source_idx: name:
name: source_idx name: name
description: Indices (zero-based) into source ElectricalSeries::data array ifabsent: string(electrodes)
corresponding to time of event. ''description'' should define what is meant range: string
by time of event (e.g., .25 ms before action potential peak, zero-crossing
time, etc). The index points to each event from the raw data.
multivalued: true
range: int32
required: true
EventDetection__times:
name: EventDetection__times
description: Timestamps of events, in seconds.
attributes:
unit:
name: unit
description: Unit of measurement for event times, which is fixed to 'seconds'.
range: text
times:
name: times
description: Timestamps of events, in seconds.
multivalued: true
range: float64
required: true required: true
equals_string: electrodes
ClusterWaveforms__waveform_mean: ClusterWaveforms__waveform_mean:
name: ClusterWaveforms__waveform_mean name: ClusterWaveforms__waveform_mean
description: The mean waveform for each cluster, using the same indices for each description: The mean waveform for each cluster, using the same indices for each
@ -212,6 +138,12 @@ classes:
is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should
be empty (e.g., zero- filled) be empty (e.g., zero- filled)
attributes: attributes:
name:
name: name
ifabsent: string(waveform_mean)
range: string
required: true
equals_string: waveform_mean
array: array:
name: array name: array
range: ClusterWaveforms__waveform_mean__Array range: ClusterWaveforms__waveform_mean__Array
@ -222,16 +154,22 @@ classes:
num_clusters: num_clusters:
name: num_clusters name: num_clusters
range: float32 range: float32
required: false required: true
num_samples: num_samples:
name: num_samples name: num_samples
range: float32 range: float32
required: false required: true
ClusterWaveforms__waveform_sd: ClusterWaveforms__waveform_sd:
name: ClusterWaveforms__waveform_sd name: ClusterWaveforms__waveform_sd
description: Stdev of waveforms for each cluster, using the same indices as in description: Stdev of waveforms for each cluster, using the same indices as in
mean mean
attributes: attributes:
name:
name: name
ifabsent: string(waveform_sd)
range: string
required: true
equals_string: waveform_sd
array: array:
name: array name: array
range: ClusterWaveforms__waveform_sd__Array range: ClusterWaveforms__waveform_sd__Array
@ -242,42 +180,8 @@ classes:
num_clusters: num_clusters:
name: num_clusters name: num_clusters
range: float32 range: float32
required: false required: true
num_samples: num_samples:
name: num_samples name: num_samples
range: float32 range: float32
required: false
Clustering__num:
name: Clustering__num
description: Cluster number of each event
attributes:
num:
name: num
description: Cluster number of each event
multivalued: true
range: int32
required: true
Clustering__peak_over_rms:
name: Clustering__peak_over_rms
description: Maximum ratio of waveform peak to RMS on any channel in the cluster
(provides a basic clustering metric).
attributes:
peak_over_rms:
name: peak_over_rms
description: Maximum ratio of waveform peak to RMS on any channel in the cluster
(provides a basic clustering metric).
multivalued: true
range: float32
required: true
Clustering__times:
name: Clustering__times
description: Times of clustered events, in seconds. This may be a link to times
field in associated FeatureExtraction module.
attributes:
times:
name: times
description: Times of clustered events, in seconds. This may be a link to
times field in associated FeatureExtraction module.
multivalued: true
range: float64
required: true required: true

View file

@ -17,6 +17,10 @@ classes:
channels. channels.
is_a: TimeSeries is_a: TimeSeries
attributes: attributes:
name:
name: name
range: string
required: true
filtering: filtering:
name: filtering name: filtering
description: Filtering applied to all channels of the data. For example, if description: Filtering applied to all channels of the data. For example, if
@ -51,9 +55,10 @@ classes:
as native values generated by data acquisition systems. If this dataset as native values generated by data acquisition systems. If this dataset
is not present, then there is no channel-specific conversion factor, i.e. is not present, then there is no channel-specific conversion factor, i.e.
it is 1 for all channels. it is 1 for all channels.
multivalued: false multivalued: true
range: ElectricalSeries__channel_conversion range: float32
required: false required: false
tree_root: true
SpikeEventSeries: SpikeEventSeries:
name: SpikeEventSeries name: SpikeEventSeries
description: 'Stores snapshots/snippets of recorded spike events (i.e., threshold description: 'Stores snapshots/snippets of recorded spike events (i.e., threshold
@ -66,6 +71,10 @@ classes:
[num samples] for single electrode).' [num samples] for single electrode).'
is_a: ElectricalSeries is_a: ElectricalSeries
attributes: attributes:
name:
name: name
range: string
required: true
data: data:
name: data name: data
description: Spike waveforms. description: Spike waveforms.
@ -78,21 +87,26 @@ classes:
the common experiment master-clock stored in NWBFile.timestamps_reference_time. the common experiment master-clock stored in NWBFile.timestamps_reference_time.
Timestamps are required for the events. Unlike for TimeSeries, timestamps Timestamps are required for the events. Unlike for TimeSeries, timestamps
are required for SpikeEventSeries and are thus re-specified here. are required for SpikeEventSeries and are thus re-specified here.
multivalued: false multivalued: true
range: SpikeEventSeries__timestamps range: float64
required: true required: true
tree_root: true
FeatureExtraction: FeatureExtraction:
name: FeatureExtraction name: FeatureExtraction
description: Features, such as PC1 and PC2, that are extracted from signals stored description: Features, such as PC1 and PC2, that are extracted from signals stored
in a SpikeEventSeries or other source. in a SpikeEventSeries or other source.
is_a: NWBDataInterface is_a: NWBDataInterface
attributes: attributes:
name:
name: name
range: string
required: true
description: description:
name: description name: description
description: Description of features (eg, ''PC1'') for each of the extracted description: Description of features (eg, ''PC1'') for each of the extracted
features. features.
multivalued: false multivalued: true
range: FeatureExtraction__description range: text
required: true required: true
features: features:
name: features name: features
@ -103,8 +117,8 @@ classes:
times: times:
name: times name: times
description: Times of events that features correspond to (can be a link). description: Times of events that features correspond to (can be a link).
multivalued: false multivalued: true
range: FeatureExtraction__times range: float64
required: true required: true
electrodes: electrodes:
name: electrodes name: electrodes
@ -113,11 +127,16 @@ classes:
multivalued: false multivalued: false
range: FeatureExtraction__electrodes range: FeatureExtraction__electrodes
required: true required: true
tree_root: true
EventDetection: EventDetection:
name: EventDetection name: EventDetection
description: Detected spike events from voltage trace(s). description: Detected spike events from voltage trace(s).
is_a: NWBDataInterface is_a: NWBDataInterface
attributes: attributes:
name:
name: name
range: string
required: true
detection_method: detection_method:
name: detection_method name: detection_method
description: Description of how events were detected, such as voltage threshold, description: Description of how events were detected, such as voltage threshold,
@ -131,15 +150,16 @@ classes:
corresponding to time of event. ''description'' should define what is meant corresponding to time of event. ''description'' should define what is meant
by time of event (e.g., .25 ms before action potential peak, zero-crossing by time of event (e.g., .25 ms before action potential peak, zero-crossing
time, etc). The index points to each event from the raw data. time, etc). The index points to each event from the raw data.
multivalued: false multivalued: true
range: EventDetection__source_idx range: int32
required: true required: true
times: times:
name: times name: times
description: Timestamps of events, in seconds. description: Timestamps of events, in seconds.
multivalued: false multivalued: true
range: EventDetection__times range: float64
required: true required: true
tree_root: true
EventWaveform: EventWaveform:
name: EventWaveform name: EventWaveform
description: Represents either the waveforms of detected events, as extracted description: Represents either the waveforms of detected events, as extracted
@ -147,12 +167,17 @@ classes:
during experiment acquisition. during experiment acquisition.
is_a: NWBDataInterface is_a: NWBDataInterface
attributes: attributes:
SpikeEventSeries: name:
name: SpikeEventSeries name: name
range: string
required: true
spike_event_series:
name: spike_event_series
description: SpikeEventSeries object(s) containing detected spike event waveforms. description: SpikeEventSeries object(s) containing detected spike event waveforms.
multivalued: true multivalued: true
range: SpikeEventSeries range: SpikeEventSeries
required: false required: false
tree_root: true
FilteredEphys: FilteredEphys:
name: FilteredEphys name: FilteredEphys
description: Electrophysiology data from one or more channels that has been subjected description: Electrophysiology data from one or more channels that has been subjected
@ -168,13 +193,18 @@ classes:
the ElectricalSeries 'filtering' attribute. the ElectricalSeries 'filtering' attribute.
is_a: NWBDataInterface is_a: NWBDataInterface
attributes: attributes:
ElectricalSeries: name:
name: ElectricalSeries name: name
range: string
required: true
electrical_series:
name: electrical_series
description: ElectricalSeries object(s) containing filtered electrophysiology description: ElectricalSeries object(s) containing filtered electrophysiology
data. data.
multivalued: true multivalued: true
range: ElectricalSeries range: ElectricalSeries
required: true required: true
tree_root: true
LFP: LFP:
name: LFP name: LFP
description: LFP data from one or more channels. The electrode map in each published description: LFP data from one or more channels. The electrode map in each published
@ -182,18 +212,27 @@ classes:
properties should be noted in the ElectricalSeries 'filtering' attribute. properties should be noted in the ElectricalSeries 'filtering' attribute.
is_a: NWBDataInterface is_a: NWBDataInterface
attributes: attributes:
ElectricalSeries: name:
name: ElectricalSeries name: name
range: string
required: true
electrical_series:
name: electrical_series
description: ElectricalSeries object(s) containing LFP data for one or more description: ElectricalSeries object(s) containing LFP data for one or more
channels. channels.
multivalued: true multivalued: true
range: ElectricalSeries range: ElectricalSeries
required: true required: true
tree_root: true
ElectrodeGroup: ElectrodeGroup:
name: ElectrodeGroup name: ElectrodeGroup
description: A physical grouping of electrodes, e.g. a shank of an array. description: A physical grouping of electrodes, e.g. a shank of an array.
is_a: NWBContainer is_a: NWBContainer
attributes: attributes:
name:
name: name
range: string
required: true
description: description:
name: description name: description
description: Description of this electrode group. description: Description of this electrode group.
@ -210,6 +249,7 @@ classes:
multivalued: false multivalued: false
range: AnyType range: AnyType
required: false required: false
tree_root: true
ClusterWaveforms: ClusterWaveforms:
name: ClusterWaveforms name: ClusterWaveforms
description: DEPRECATED The mean waveform shape, including standard deviation, description: DEPRECATED The mean waveform shape, including standard deviation,
@ -220,6 +260,10 @@ classes:
or an extension of this one. or an extension of this one.
is_a: NWBDataInterface is_a: NWBDataInterface
attributes: attributes:
name:
name: name
range: string
required: true
waveform_filtering: waveform_filtering:
name: waveform_filtering name: waveform_filtering
description: Filtering applied to data before generating mean/sd description: Filtering applied to data before generating mean/sd
@ -242,12 +286,17 @@ classes:
multivalued: false multivalued: false
range: ClusterWaveforms__waveform_sd range: ClusterWaveforms__waveform_sd
required: true required: true
tree_root: true
Clustering: Clustering:
name: Clustering name: Clustering
description: DEPRECATED Clustered spike data, whether from automatic clustering description: DEPRECATED Clustered spike data, whether from automatic clustering
tools (e.g., klustakwik) or as a result of manual sorting. tools (e.g., klustakwik) or as a result of manual sorting.
is_a: NWBDataInterface is_a: NWBDataInterface
attributes: attributes:
name:
name: name
range: string
required: true
description: description:
name: description name: description
description: Description of clusters or clustering, (e.g. cluster 0 is noise, description: Description of clusters or clustering, (e.g. cluster 0 is noise,
@ -258,20 +307,21 @@ classes:
num: num:
name: num name: num
description: Cluster number of each event description: Cluster number of each event
multivalued: false multivalued: true
range: Clustering__num range: int32
required: true required: true
peak_over_rms: peak_over_rms:
name: peak_over_rms name: peak_over_rms
description: Maximum ratio of waveform peak to RMS on any channel in the cluster description: Maximum ratio of waveform peak to RMS on any channel in the cluster
(provides a basic clustering metric). (provides a basic clustering metric).
multivalued: false multivalued: true
range: Clustering__peak_over_rms range: float32
required: true required: true
times: times:
name: times name: times
description: Times of clustered events, in seconds. This may be a link to description: Times of clustered events, in seconds. This may be a link to
times field in associated FeatureExtraction module. times field in associated FeatureExtraction module.
multivalued: false multivalued: true
range: Clustering__times range: float64
required: true required: true
tree_root: true

View file

@ -12,11 +12,32 @@ classes:
name: TimeIntervals__tags_index name: TimeIntervals__tags_index
description: Index for tags. description: Index for tags.
is_a: VectorIndex is_a: VectorIndex
attributes:
name:
name: name
ifabsent: string(tags_index)
range: string
required: true
equals_string: tags_index
TimeIntervals__timeseries: TimeIntervals__timeseries:
name: TimeIntervals__timeseries name: TimeIntervals__timeseries
description: An index into a TimeSeries object. description: An index into a TimeSeries object.
is_a: TimeSeriesReferenceVectorData is_a: TimeSeriesReferenceVectorData
attributes:
name:
name: name
ifabsent: string(timeseries)
range: string
required: true
equals_string: timeseries
TimeIntervals__timeseries_index: TimeIntervals__timeseries_index:
name: TimeIntervals__timeseries_index name: TimeIntervals__timeseries_index
description: Index for timeseries. description: Index for timeseries.
is_a: VectorIndex is_a: VectorIndex
attributes:
name:
name: name
ifabsent: string(timeseries_index)
range: string
required: true
equals_string: timeseries_index

View file

@ -14,6 +14,10 @@ classes:
epoch applies to. epoch applies to.
is_a: DynamicTable is_a: DynamicTable
attributes: attributes:
name:
name: name
range: string
required: true
start_time: start_time:
name: start_time name: start_time
description: Start time of epoch, in seconds. description: Start time of epoch, in seconds.
@ -47,3 +51,4 @@ classes:
multivalued: false multivalued: false
range: TimeIntervals__timeseries_index range: TimeIntervals__timeseries_index
required: false required: false
tree_root: true

View file

@ -15,116 +15,6 @@ imports:
- core.nwb.file - core.nwb.file
default_prefix: core.nwb.file.include/ default_prefix: core.nwb.file.include/
classes: classes:
NWBFile__file_create_date:
name: NWBFile__file_create_date
description: 'A record of the date the file was created and of subsequent modifications.
The date is stored in UTC with local timezone offset as ISO 8601 extended formatted
strings: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in "Z" with
no timezone offset. Date accuracy is up to milliseconds. The file can be created
after the experiment was run, so this may differ from the experiment start time.
Each modification to the nwb file adds a new entry to the array.'
attributes:
file_create_date:
name: file_create_date
description: 'A record of the date the file was created and of subsequent
modifications. The date is stored in UTC with local timezone offset as ISO
8601 extended formatted strings: 2018-09-28T14:43:54.123+02:00. Dates stored
in UTC end in "Z" with no timezone offset. Date accuracy is up to milliseconds.
The file can be created after the experiment was run, so this may differ
from the experiment start time. Each modification to the nwb file adds a
new entry to the array.'
multivalued: true
range: isodatetime
required: true
NWBFile__acquisition:
name: NWBFile__acquisition
description: Data streams recorded from the system, including ephys, ophys, tracking,
etc. This group should be read-only after the experiment is completed and timestamps
are corrected to a common timebase. The data stored here may be links to raw
data stored in external NWB files. This will allow keeping bulky raw data out
of the file while preserving the option of keeping some/all in the file. Acquired
data includes tracking and experimental data streams (i.e., everything measured
from the system). If bulky data is stored in the /acquisition group, the data
can exist in a separate NWB file that is linked to by the file being used for
processing and analysis.
attributes:
NWBDataInterface:
name: NWBDataInterface
description: Acquired, raw data.
multivalued: true
range: NWBDataInterface
required: false
DynamicTable:
name: DynamicTable
description: Tabular data that is relevant to acquisition
multivalued: true
range: DynamicTable
required: false
NWBFile__analysis:
name: NWBFile__analysis
description: Lab-specific and custom scientific analysis of data. There is no
defined format for the content of this group - the format is up to the individual
user/lab. To facilitate sharing analysis data between labs, the contents here
should be stored in standard types (e.g., neurodata_types) and appropriately
documented. The file can store lab-specific and custom data analysis without
restriction on its form or schema, reducing data formatting restrictions on
end users. Such data should be placed in the analysis group. The analysis data
should be documented so that it could be shared with other labs.
attributes:
NWBContainer:
name: NWBContainer
description: Custom analysis results.
multivalued: true
range: NWBContainer
required: false
DynamicTable:
name: DynamicTable
description: Tabular data that is relevant to data stored in analysis
multivalued: true
range: DynamicTable
required: false
NWBFile__scratch:
name: NWBFile__scratch
description: A place to store one-off analysis results. Data placed here is not
intended for sharing. By placing data here, users acknowledge that there is
no guarantee that their data meets any standard.
attributes:
ScratchData:
name: ScratchData
description: Any one-off datasets
multivalued: true
range: ScratchData
required: false
NWBContainer:
name: NWBContainer
description: Any one-off containers
multivalued: true
range: NWBContainer
required: false
DynamicTable:
name: DynamicTable
description: Any one-off tables
multivalued: true
range: DynamicTable
required: false
NWBFile__processing:
name: NWBFile__processing
description: The home for ProcessingModules. These modules perform intermediate
analysis of data that is necessary to perform before scientific analysis. Examples
include spike clustering, extracting position from tracking data, stitching
together image slices. ProcessingModules can be large and express many data
sets from relatively complex analysis (e.g., spike detection and clustering)
or small, representing extraction of position information from tracking video,
or even binary lick/no-lick decisions. Common software tools (e.g., klustakwik,
MClust) are expected to read/write data here. 'Processing' refers to intermediate
analysis of the acquired data to make it more amenable to scientific analysis.
attributes:
ProcessingModule:
name: ProcessingModule
description: Intermediate analysis of acquired data.
multivalued: true
range: ProcessingModule
required: false
NWBFile__stimulus: NWBFile__stimulus:
name: NWBFile__stimulus name: NWBFile__stimulus
description: Data pushed into the system (eg, video stimulus, sound, voltage, description: Data pushed into the system (eg, video stimulus, sound, voltage,
@ -140,50 +30,28 @@ classes:
times. These templates can exist in the present file or can be linked to a remote times. These templates can exist in the present file or can be linked to a remote
library file. library file.
attributes: attributes:
name:
name: name
ifabsent: string(stimulus)
range: string
required: true
equals_string: stimulus
presentation: presentation:
name: presentation name: presentation
description: Stimuli presented during the experiment. description: Stimuli presented during the experiment.
multivalued: false multivalued: true
range: NWBFile__stimulus__presentation any_of:
required: true - range: TimeSeries
templates: templates:
name: templates name: templates
description: Template stimuli. Timestamps in templates are based on stimulus description: Template stimuli. Timestamps in templates are based on stimulus
design and are relative to the beginning of the stimulus. When templates design and are relative to the beginning of the stimulus. When templates
are used, the stimulus instances must convert presentation times to the are used, the stimulus instances must convert presentation times to the
experiment`s time reference frame. experiment`s time reference frame.
multivalued: false
range: NWBFile__stimulus__templates
required: true
NWBFile__stimulus__presentation:
name: NWBFile__stimulus__presentation
description: Stimuli presented during the experiment.
attributes:
TimeSeries:
name: TimeSeries
description: TimeSeries objects containing data of presented stimuli.
multivalued: true multivalued: true
range: TimeSeries any_of:
required: false - range: TimeSeries
NWBFile__stimulus__templates: - range: Images
name: NWBFile__stimulus__templates
description: Template stimuli. Timestamps in templates are based on stimulus design
and are relative to the beginning of the stimulus. When templates are used,
the stimulus instances must convert presentation times to the experiment`s time
reference frame.
attributes:
TimeSeries:
name: TimeSeries
description: TimeSeries objects containing template data of presented stimuli.
multivalued: true
range: TimeSeries
required: false
Images:
name: Images
description: Images objects containing images of presented stimuli.
multivalued: true
range: Images
required: false
NWBFile__general: NWBFile__general:
name: NWBFile__general name: NWBFile__general
description: Experimental metadata, including protocol, notes and description description: Experimental metadata, including protocol, notes and description
@ -201,6 +69,12 @@ classes:
when data is present. Unused groups (e.g., intracellular_ephys in an optophysiology when data is present. Unused groups (e.g., intracellular_ephys in an optophysiology
experiment) should not be created unless there is data to store within them. experiment) should not be created unless there is data to store within them.
attributes: attributes:
name:
name: name
ifabsent: string(general)
range: string
required: true
equals_string: general
data_collection: data_collection:
name: data_collection name: data_collection
description: Notes about data collection and analysis. description: Notes about data collection and analysis.
@ -217,8 +91,8 @@ classes:
name: experimenter name: experimenter
description: Name of person(s) who performed the experiment. Can also specify description: Name of person(s) who performed the experiment. Can also specify
roles of different people involved. roles of different people involved.
multivalued: false multivalued: true
range: NWBFile__general__experimenter range: text
required: false required: false
institution: institution:
name: institution name: institution
@ -229,8 +103,8 @@ classes:
keywords: keywords:
name: keywords name: keywords
description: Terms to search over. description: Terms to search over.
multivalued: false multivalued: true
range: NWBFile__general__keywords range: text
required: false required: false
lab: lab:
name: lab name: lab
@ -261,8 +135,8 @@ classes:
related_publications: related_publications:
name: related_publications name: related_publications
description: Publication information. PMID, DOI, URL, etc. description: Publication information. PMID, DOI, URL, etc.
multivalued: false multivalued: true
range: NWBFile__general__related_publications range: text
required: false required: false
session_id: session_id:
name: session_id name: session_id
@ -304,8 +178,8 @@ classes:
multivalued: false multivalued: false
range: text range: text
required: false required: false
LabMetaData: lab_meta_data:
name: LabMetaData name: lab_meta_data
description: Place-holder than can be extended so that lab-specific meta-data description: Place-holder than can be extended so that lab-specific meta-data
can be placed in /general. can be placed in /general.
multivalued: true multivalued: true
@ -315,15 +189,15 @@ classes:
name: devices name: devices
description: Description of hardware devices used during experiment, e.g., description: Description of hardware devices used during experiment, e.g.,
monitors, ADC boards, microscopes, etc. monitors, ADC boards, microscopes, etc.
multivalued: false multivalued: true
range: NWBFile__general__devices any_of:
required: false - range: Device
subject: subject:
name: subject name: subject
description: Information about the animal or person from which the data was description: Information about the animal or person from which the data was
measured. measured.
multivalued: false multivalued: false
range: NWBFile__general__subject range: Subject
required: false required: false
extracellular_ephys: extracellular_ephys:
name: extracellular_ephys name: extracellular_ephys
@ -340,77 +214,42 @@ classes:
optogenetics: optogenetics:
name: optogenetics name: optogenetics
description: Metadata describing optogenetic stimuluation. description: Metadata describing optogenetic stimuluation.
multivalued: false multivalued: true
range: NWBFile__general__optogenetics any_of:
required: false - range: OptogeneticStimulusSite
optophysiology: optophysiology:
name: optophysiology name: optophysiology
description: Metadata related to optophysiology. description: Metadata related to optophysiology.
multivalued: false
range: NWBFile__general__optophysiology
required: false
NWBFile__general__experimenter:
name: NWBFile__general__experimenter
description: Name of person(s) who performed the experiment. Can also specify
roles of different people involved.
attributes:
experimenter:
name: experimenter
description: Name of person(s) who performed the experiment. Can also specify
roles of different people involved.
multivalued: true multivalued: true
range: text any_of:
required: false - range: ImagingPlane
NWBFile__general__keywords:
name: NWBFile__general__keywords
description: Terms to search over.
attributes:
keywords:
name: keywords
description: Terms to search over.
multivalued: true
range: text
required: false
NWBFile__general__related_publications:
name: NWBFile__general__related_publications
description: Publication information. PMID, DOI, URL, etc.
attributes:
related_publications:
name: related_publications
description: Publication information. PMID, DOI, URL, etc.
multivalued: true
range: text
required: false
NWBFile__general__source_script: NWBFile__general__source_script:
name: NWBFile__general__source_script name: NWBFile__general__source_script
description: Script file or link to public source code used to create this NWB description: Script file or link to public source code used to create this NWB
file. file.
attributes: attributes:
name:
name: name
ifabsent: string(source_script)
range: string
required: true
equals_string: source_script
file_name: file_name:
name: file_name name: file_name
description: Name of script file. description: Name of script file.
range: text range: text
NWBFile__general__devices:
name: NWBFile__general__devices
description: Description of hardware devices used during experiment, e.g., monitors,
ADC boards, microscopes, etc.
attributes:
Device:
name: Device
description: Data acquisition devices.
multivalued: true
range: Device
required: false
NWBFile__general__subject:
name: NWBFile__general__subject
description: Information about the animal or person from which the data was measured.
is_a: Subject
NWBFile__general__extracellular_ephys: NWBFile__general__extracellular_ephys:
name: NWBFile__general__extracellular_ephys name: NWBFile__general__extracellular_ephys
description: Metadata related to extracellular electrophysiology. description: Metadata related to extracellular electrophysiology.
attributes: attributes:
ElectrodeGroup: name:
name: ElectrodeGroup name: name
ifabsent: string(extracellular_ephys)
range: string
required: true
equals_string: extracellular_ephys
electrode_group:
name: electrode_group
description: Physical group of electrodes. description: Physical group of electrodes.
multivalued: true multivalued: true
range: ElectrodeGroup range: ElectrodeGroup
@ -419,82 +258,18 @@ classes:
name: electrodes name: electrodes
description: A table of all electrodes (i.e. channels) used for recording. description: A table of all electrodes (i.e. channels) used for recording.
multivalued: false multivalued: false
range: NWBFile__general__extracellular_ephys__electrodes range: DynamicTable
required: false required: false
NWBFile__general__extracellular_ephys__electrodes:
name: NWBFile__general__extracellular_ephys__electrodes
description: A table of all electrodes (i.e. channels) used for recording.
is_a: DynamicTable
attributes:
x:
name: x
description: x coordinate of the channel location in the brain (+x is posterior).
multivalued: true
range: float32
y:
name: y
description: y coordinate of the channel location in the brain (+y is inferior).
multivalued: true
range: float32
z:
name: z
description: z coordinate of the channel location in the brain (+z is right).
multivalued: true
range: float32
imp:
name: imp
description: Impedance of the channel, in ohms.
multivalued: true
range: float32
location:
name: location
description: Location of the electrode (channel). Specify the area, layer,
comments on estimation of area/layer, stereotaxic coordinates if in vivo,
etc. Use standard atlas names for anatomical regions when possible.
multivalued: true
range: text
filtering:
name: filtering
description: Description of hardware filtering, including the filter name
and frequency cutoffs.
multivalued: true
range: text
group:
name: group
description: Reference to the ElectrodeGroup this electrode is a part of.
multivalued: true
range: ElectrodeGroup
group_name:
name: group_name
description: Name of the ElectrodeGroup this electrode is a part of.
multivalued: true
range: text
rel_x:
name: rel_x
description: x coordinate in electrode group
multivalued: true
range: float32
rel_y:
name: rel_y
description: y coordinate in electrode group
multivalued: true
range: float32
rel_z:
name: rel_z
description: z coordinate in electrode group
multivalued: true
range: float32
reference:
name: reference
description: Description of the reference electrode and/or reference scheme
used for this electrode, e.g., "stainless steel skull screw" or "online
common average referencing".
multivalued: true
range: text
NWBFile__general__intracellular_ephys: NWBFile__general__intracellular_ephys:
name: NWBFile__general__intracellular_ephys name: NWBFile__general__intracellular_ephys
description: Metadata related to intracellular electrophysiology. description: Metadata related to intracellular electrophysiology.
attributes: attributes:
name:
name: name
ifabsent: string(intracellular_ephys)
range: string
required: true
equals_string: intracellular_ephys
filtering: filtering:
name: filtering name: filtering
description: '[DEPRECATED] Use IntracellularElectrode.filtering instead. Description description: '[DEPRECATED] Use IntracellularElectrode.filtering instead. Description
@ -504,8 +279,8 @@ classes:
multivalued: false multivalued: false
range: text range: text
required: false required: false
IntracellularElectrode: intracellular_electrode:
name: IntracellularElectrode name: intracellular_electrode
description: An intracellular electrode. description: An intracellular electrode.
multivalued: true multivalued: true
range: IntracellularElectrode range: IntracellularElectrode
@ -517,7 +292,7 @@ classes:
tables. Additional SequentialRecordingsTable, RepetitionsTable and ExperimentalConditions tables. Additional SequentialRecordingsTable, RepetitionsTable and ExperimentalConditions
tables provide enhanced support for experiment metadata.' tables provide enhanced support for experiment metadata.'
multivalued: false multivalued: false
range: NWBFile__general__intracellular_ephys__sweep_table range: SweepTable
required: false required: false
intracellular_recordings: intracellular_recordings:
name: intracellular_recordings name: intracellular_recordings
@ -534,7 +309,7 @@ classes:
to an electrode is also common in intracellular electrophysiology, in which to an electrode is also common in intracellular electrophysiology, in which
case other TimeSeries may be used. case other TimeSeries may be used.
multivalued: false multivalued: false
range: NWBFile__general__intracellular_ephys__intracellular_recordings range: IntracellularRecordingsTable
required: false required: false
simultaneous_recordings: simultaneous_recordings:
name: simultaneous_recordings name: simultaneous_recordings
@ -542,7 +317,7 @@ classes:
the IntracellularRecordingsTable table together that were recorded simultaneously the IntracellularRecordingsTable table together that were recorded simultaneously
from different electrodes from different electrodes
multivalued: false multivalued: false
range: NWBFile__general__intracellular_ephys__simultaneous_recordings range: SimultaneousRecordingsTable
required: false required: false
sequential_recordings: sequential_recordings:
name: sequential_recordings name: sequential_recordings
@ -551,7 +326,7 @@ classes:
together sequential recordings where the a sequence of stimuli of the same together sequential recordings where the a sequence of stimuli of the same
type with varying parameters have been presented in a sequence. type with varying parameters have been presented in a sequence.
multivalued: false multivalued: false
range: NWBFile__general__intracellular_ephys__sequential_recordings range: SequentialRecordingsTable
required: false required: false
repetitions: repetitions:
name: repetitions name: repetitions
@ -560,80 +335,14 @@ classes:
type of stimulus, the RepetitionsTable table is typically used to group type of stimulus, the RepetitionsTable table is typically used to group
sets of stimuli applied in sequence. sets of stimuli applied in sequence.
multivalued: false multivalued: false
range: NWBFile__general__intracellular_ephys__repetitions range: RepetitionsTable
required: false required: false
experimental_conditions: experimental_conditions:
name: experimental_conditions name: experimental_conditions
description: A table for grouping different intracellular recording repetitions description: A table for grouping different intracellular recording repetitions
together that belong to the same experimental experimental_conditions. together that belong to the same experimental experimental_conditions.
multivalued: false multivalued: false
range: NWBFile__general__intracellular_ephys__experimental_conditions range: ExperimentalConditionsTable
required: false
NWBFile__general__intracellular_ephys__sweep_table:
name: NWBFile__general__intracellular_ephys__sweep_table
description: '[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.'
is_a: SweepTable
NWBFile__general__intracellular_ephys__intracellular_recordings:
name: NWBFile__general__intracellular_ephys__intracellular_recordings
description: A table to group together a stimulus and response from a single electrode
and a single simultaneous recording. Each row in the table represents a single
recording consisting typically of a stimulus and a corresponding response. In
some cases, however, only a stimulus or a response are recorded as as part of
an experiment. In this case both, the stimulus and response will point to the
same TimeSeries while the idx_start and count of the invalid column will be
set to -1, thus, indicating that no values have been recorded for the stimulus
or response, respectively. Note, a recording MUST contain at least a stimulus
or a response. Typically the stimulus and response are PatchClampSeries. However,
the use of AD/DA channels that are not associated to an electrode is also common
in intracellular electrophysiology, in which case other TimeSeries may be used.
is_a: IntracellularRecordingsTable
NWBFile__general__intracellular_ephys__simultaneous_recordings:
name: NWBFile__general__intracellular_ephys__simultaneous_recordings
description: A table for grouping different intracellular recordings from the
IntracellularRecordingsTable table together that were recorded simultaneously
from different electrodes
is_a: SimultaneousRecordingsTable
NWBFile__general__intracellular_ephys__sequential_recordings:
name: NWBFile__general__intracellular_ephys__sequential_recordings
description: 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.
is_a: SequentialRecordingsTable
NWBFile__general__intracellular_ephys__repetitions:
name: NWBFile__general__intracellular_ephys__repetitions
description: 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.
is_a: RepetitionsTable
NWBFile__general__intracellular_ephys__experimental_conditions:
name: NWBFile__general__intracellular_ephys__experimental_conditions
description: A table for grouping different intracellular recording repetitions
together that belong to the same experimental experimental_conditions.
is_a: ExperimentalConditionsTable
NWBFile__general__optogenetics:
name: NWBFile__general__optogenetics
description: Metadata describing optogenetic stimuluation.
attributes:
OptogeneticStimulusSite:
name: OptogeneticStimulusSite
description: An optogenetic stimulation site.
multivalued: true
range: OptogeneticStimulusSite
required: false
NWBFile__general__optophysiology:
name: NWBFile__general__optophysiology
description: Metadata related to optophysiology.
attributes:
ImagingPlane:
name: ImagingPlane
description: An imaging plane.
multivalued: true
range: ImagingPlane
required: false required: false
NWBFile__intervals: NWBFile__intervals:
name: NWBFile__intervals name: NWBFile__intervals
@ -641,53 +350,48 @@ classes:
having a particular scientific goal, trials (see trials subgroup) during an having a particular scientific goal, trials (see trials subgroup) during an
experiment, or epochs (see epochs subgroup) deriving from analysis of data. experiment, or epochs (see epochs subgroup) deriving from analysis of data.
attributes: attributes:
name:
name: name
ifabsent: string(intervals)
range: string
required: true
equals_string: intervals
epochs: epochs:
name: epochs name: epochs
description: Divisions in time marking experimental stages or sub-divisions description: Divisions in time marking experimental stages or sub-divisions
of a single recording session. of a single recording session.
multivalued: false multivalued: false
range: NWBFile__intervals__epochs range: TimeIntervals
required: false required: false
trials: trials:
name: trials name: trials
description: Repeated experimental events that have a logical grouping. description: Repeated experimental events that have a logical grouping.
multivalued: false multivalued: false
range: NWBFile__intervals__trials range: TimeIntervals
required: false required: false
invalid_times: invalid_times:
name: invalid_times name: invalid_times
description: Time intervals that should be removed from analysis. description: Time intervals that should be removed from analysis.
multivalued: false multivalued: false
range: NWBFile__intervals__invalid_times range: TimeIntervals
required: false required: false
TimeIntervals: time_intervals:
name: TimeIntervals name: time_intervals
description: Optional additional table(s) for describing other experimental description: Optional additional table(s) for describing other experimental
time intervals. time intervals.
multivalued: true multivalued: true
range: TimeIntervals range: TimeIntervals
required: false required: false
NWBFile__intervals__epochs:
name: NWBFile__intervals__epochs
description: Divisions in time marking experimental stages or sub-divisions of
a single recording session.
is_a: TimeIntervals
NWBFile__intervals__trials:
name: NWBFile__intervals__trials
description: Repeated experimental events that have a logical grouping.
is_a: TimeIntervals
NWBFile__intervals__invalid_times:
name: NWBFile__intervals__invalid_times
description: Time intervals that should be removed from analysis.
is_a: TimeIntervals
NWBFile__units:
name: NWBFile__units
description: Data about sorted spike units.
is_a: Units
Subject__age: Subject__age:
name: Subject__age name: Subject__age
description: Age of subject. Can be supplied instead of 'date_of_birth'. description: Age of subject. Can be supplied instead of 'date_of_birth'.
attributes: attributes:
name:
name: name
ifabsent: string(age)
range: string
required: true
equals_string: age
reference: reference:
name: reference name: reference
description: Age is with reference to this event. Can be 'birth' or 'gestational'. description: Age is with reference to this event. Can be 'birth' or 'gestational'.

View file

@ -20,16 +20,27 @@ classes:
description: Any one-off datasets description: Any one-off datasets
is_a: NWBData is_a: NWBData
attributes: attributes:
name:
name: name
range: string
required: true
notes: notes:
name: notes name: notes
description: Any notes the user has about the dataset being stored description: Any notes the user has about the dataset being stored
range: text range: text
tree_root: true
NWBFile: NWBFile:
name: NWBFile name: NWBFile
description: An NWB file storing cellular-based neurophysiology data from a single description: An NWB file storing cellular-based neurophysiology data from a single
experimental session. experimental session.
is_a: NWBContainer is_a: NWBContainer
attributes: attributes:
name:
name: name
ifabsent: string(root)
range: string
required: true
equals_string: root
nwb_version: nwb_version:
name: nwb_version name: nwb_version
description: File version string. Use semantic versioning, e.g. 1.2.1. This description: File version string. Use semantic versioning, e.g. 1.2.1. This
@ -44,8 +55,8 @@ classes:
The file can be created after the experiment was run, so this may differ The file can be created after the experiment was run, so this may differ
from the experiment start time. Each modification to the nwb file adds a from the experiment start time. Each modification to the nwb file adds a
new entry to the array.' new entry to the array.'
multivalued: false multivalued: true
range: NWBFile__file_create_date range: isodatetime
required: true required: true
identifier: identifier:
name: identifier name: identifier
@ -92,9 +103,10 @@ classes:
(i.e., everything measured from the system). If bulky data is stored in (i.e., everything measured from the system). If bulky data is stored in
the /acquisition group, the data can exist in a separate NWB file that is the /acquisition group, the data can exist in a separate NWB file that is
linked to by the file being used for processing and analysis. linked to by the file being used for processing and analysis.
multivalued: false multivalued: true
range: NWBFile__acquisition any_of:
required: true - range: NWBDataInterface
- range: DynamicTable
analysis: analysis:
name: analysis name: analysis
description: Lab-specific and custom scientific analysis of data. There is description: Lab-specific and custom scientific analysis of data. There is
@ -106,17 +118,19 @@ classes:
restrictions on end users. Such data should be placed in the analysis group. restrictions on end users. Such data should be placed in the analysis group.
The analysis data should be documented so that it could be shared with other The analysis data should be documented so that it could be shared with other
labs. labs.
multivalued: false multivalued: true
range: NWBFile__analysis any_of:
required: true - range: NWBContainer
- range: DynamicTable
scratch: scratch:
name: scratch name: scratch
description: A place to store one-off analysis results. Data placed here is description: A place to store one-off analysis results. Data placed here is
not intended for sharing. By placing data here, users acknowledge that there not intended for sharing. By placing data here, users acknowledge that there
is no guarantee that their data meets any standard. is no guarantee that their data meets any standard.
multivalued: false multivalued: true
range: NWBFile__scratch any_of:
required: false - range: NWBContainer
- range: DynamicTable
processing: processing:
name: processing name: processing
description: The home for ProcessingModules. These modules perform intermediate description: The home for ProcessingModules. These modules perform intermediate
@ -129,9 +143,9 @@ classes:
(e.g., klustakwik, MClust) are expected to read/write data here. 'Processing' (e.g., klustakwik, MClust) are expected to read/write data here. 'Processing'
refers to intermediate analysis of the acquired data to make it more amenable refers to intermediate analysis of the acquired data to make it more amenable
to scientific analysis. to scientific analysis.
multivalued: false multivalued: true
range: NWBFile__processing any_of:
required: true - range: ProcessingModule
stimulus: stimulus:
name: stimulus name: stimulus
description: Data pushed into the system (eg, video stimulus, sound, voltage, description: Data pushed into the system (eg, video stimulus, sound, voltage,
@ -182,17 +196,28 @@ classes:
name: units name: units
description: Data about sorted spike units. description: Data about sorted spike units.
multivalued: false multivalued: false
range: NWBFile__units range: Units
required: false required: false
tree_root: true
LabMetaData: LabMetaData:
name: LabMetaData name: LabMetaData
description: Lab-specific meta-data. description: Lab-specific meta-data.
is_a: NWBContainer is_a: NWBContainer
attributes:
name:
name: name
range: string
required: true
tree_root: true
Subject: Subject:
name: Subject name: Subject
description: Information about the animal or person from which the data was measured. description: Information about the animal or person from which the data was measured.
is_a: NWBContainer is_a: NWBContainer
attributes: attributes:
name:
name: name
range: string
required: true
age: age:
name: age name: age
description: Age of subject. Can be supplied instead of 'date_of_birth'. description: Age of subject. Can be supplied instead of 'date_of_birth'.
@ -249,3 +274,4 @@ classes:
multivalued: false multivalued: false
range: text range: text
required: false required: false
tree_root: true

View file

@ -9,26 +9,16 @@ imports:
- core.nwb.icephys - core.nwb.icephys
default_prefix: core.nwb.icephys.include/ default_prefix: core.nwb.icephys.include/
classes: classes:
PatchClampSeries__data:
name: PatchClampSeries__data
description: Recorded voltage or current.
attributes:
unit:
name: unit
description: Base unit of measurement for working with the data. Actual stored
values are not necessarily stored in these units. To access the data in
these units, multiply 'data' by 'conversion' and add 'offset'.
range: text
data:
name: data
description: Recorded voltage or current.
multivalued: true
range: numeric
required: true
CurrentClampSeries__data: CurrentClampSeries__data:
name: CurrentClampSeries__data name: CurrentClampSeries__data
description: Recorded voltage. description: Recorded voltage.
attributes: attributes:
name:
name: name
ifabsent: string(data)
range: string
required: true
equals_string: data
unit: unit:
name: unit name: unit
description: Base unit of measurement for working with the data. which is description: Base unit of measurement for working with the data. which is
@ -40,6 +30,12 @@ classes:
name: CurrentClampStimulusSeries__data name: CurrentClampStimulusSeries__data
description: Stimulus current applied. description: Stimulus current applied.
attributes: attributes:
name:
name: name
ifabsent: string(data)
range: string
required: true
equals_string: data
unit: unit:
name: unit name: unit
description: Base unit of measurement for working with the data. which is description: Base unit of measurement for working with the data. which is
@ -51,6 +47,12 @@ classes:
name: VoltageClampSeries__data name: VoltageClampSeries__data
description: Recorded current. description: Recorded current.
attributes: attributes:
name:
name: name
ifabsent: string(data)
range: string
required: true
equals_string: data
unit: unit:
name: unit name: unit
description: Base unit of measurement for working with the data. which is description: Base unit of measurement for working with the data. which is
@ -62,6 +64,12 @@ classes:
name: VoltageClampSeries__capacitance_fast name: VoltageClampSeries__capacitance_fast
description: Fast capacitance, in farads. description: Fast capacitance, in farads.
attributes: attributes:
name:
name: name
ifabsent: string(capacitance_fast)
range: string
required: true
equals_string: capacitance_fast
unit: unit:
name: unit name: unit
description: Unit of measurement for capacitance_fast, which is fixed to 'farads'. description: Unit of measurement for capacitance_fast, which is fixed to 'farads'.
@ -70,6 +78,12 @@ classes:
name: VoltageClampSeries__capacitance_slow name: VoltageClampSeries__capacitance_slow
description: Slow capacitance, in farads. description: Slow capacitance, in farads.
attributes: attributes:
name:
name: name
ifabsent: string(capacitance_slow)
range: string
required: true
equals_string: capacitance_slow
unit: unit:
name: unit name: unit
description: Unit of measurement for capacitance_fast, which is fixed to 'farads'. description: Unit of measurement for capacitance_fast, which is fixed to 'farads'.
@ -78,6 +92,12 @@ classes:
name: VoltageClampSeries__resistance_comp_bandwidth name: VoltageClampSeries__resistance_comp_bandwidth
description: Resistance compensation bandwidth, in hertz. description: Resistance compensation bandwidth, in hertz.
attributes: attributes:
name:
name: name
ifabsent: string(resistance_comp_bandwidth)
range: string
required: true
equals_string: resistance_comp_bandwidth
unit: unit:
name: unit name: unit
description: Unit of measurement for resistance_comp_bandwidth, which is fixed description: Unit of measurement for resistance_comp_bandwidth, which is fixed
@ -87,6 +107,12 @@ classes:
name: VoltageClampSeries__resistance_comp_correction name: VoltageClampSeries__resistance_comp_correction
description: Resistance compensation correction, in percent. description: Resistance compensation correction, in percent.
attributes: attributes:
name:
name: name
ifabsent: string(resistance_comp_correction)
range: string
required: true
equals_string: resistance_comp_correction
unit: unit:
name: unit name: unit
description: Unit of measurement for resistance_comp_correction, which is description: Unit of measurement for resistance_comp_correction, which is
@ -96,6 +122,12 @@ classes:
name: VoltageClampSeries__resistance_comp_prediction name: VoltageClampSeries__resistance_comp_prediction
description: Resistance compensation prediction, in percent. description: Resistance compensation prediction, in percent.
attributes: attributes:
name:
name: name
ifabsent: string(resistance_comp_prediction)
range: string
required: true
equals_string: resistance_comp_prediction
unit: unit:
name: unit name: unit
description: Unit of measurement for resistance_comp_prediction, which is description: Unit of measurement for resistance_comp_prediction, which is
@ -105,6 +137,12 @@ classes:
name: VoltageClampSeries__whole_cell_capacitance_comp name: VoltageClampSeries__whole_cell_capacitance_comp
description: Whole cell capacitance compensation, in farads. description: Whole cell capacitance compensation, in farads.
attributes: attributes:
name:
name: name
ifabsent: string(whole_cell_capacitance_comp)
range: string
required: true
equals_string: whole_cell_capacitance_comp
unit: unit:
name: unit name: unit
description: Unit of measurement for whole_cell_capacitance_comp, which is description: Unit of measurement for whole_cell_capacitance_comp, which is
@ -114,6 +152,12 @@ classes:
name: VoltageClampSeries__whole_cell_series_resistance_comp name: VoltageClampSeries__whole_cell_series_resistance_comp
description: Whole cell series resistance compensation, in ohms. description: Whole cell series resistance compensation, in ohms.
attributes: attributes:
name:
name: name
ifabsent: string(whole_cell_series_resistance_comp)
range: string
required: true
equals_string: whole_cell_series_resistance_comp
unit: unit:
name: unit name: unit
description: Unit of measurement for whole_cell_series_resistance_comp, which description: Unit of measurement for whole_cell_series_resistance_comp, which
@ -123,6 +167,12 @@ classes:
name: VoltageClampStimulusSeries__data name: VoltageClampStimulusSeries__data
description: Stimulus voltage applied. description: Stimulus voltage applied.
attributes: attributes:
name:
name: name
ifabsent: string(data)
range: string
required: true
equals_string: data
unit: unit:
name: unit name: unit
description: Base unit of measurement for working with the data. which is description: Base unit of measurement for working with the data. which is
@ -134,34 +184,49 @@ classes:
name: SweepTable__series_index name: SweepTable__series_index
description: Index for series. description: Index for series.
is_a: VectorIndex is_a: VectorIndex
attributes:
name:
name: name
ifabsent: string(series_index)
range: string
required: true
equals_string: series_index
IntracellularStimuliTable__stimulus: IntracellularStimuliTable__stimulus:
name: IntracellularStimuliTable__stimulus name: IntracellularStimuliTable__stimulus
description: Column storing the reference to the recorded stimulus for the recording description: Column storing the reference to the recorded stimulus for the recording
(rows). (rows).
is_a: TimeSeriesReferenceVectorData is_a: TimeSeriesReferenceVectorData
attributes:
name:
name: name
ifabsent: string(stimulus)
range: string
required: true
equals_string: stimulus
IntracellularResponsesTable__response: IntracellularResponsesTable__response:
name: IntracellularResponsesTable__response name: IntracellularResponsesTable__response
description: Column storing the reference to the recorded response for the recording description: Column storing the reference to the recorded response for the recording
(rows) (rows)
is_a: TimeSeriesReferenceVectorData is_a: TimeSeriesReferenceVectorData
IntracellularRecordingsTable__electrodes: attributes:
name: IntracellularRecordingsTable__electrodes name:
description: Table for storing intracellular electrode related metadata. name: name
is_a: IntracellularElectrodesTable ifabsent: string(response)
IntracellularRecordingsTable__stimuli: range: string
name: IntracellularRecordingsTable__stimuli required: true
description: Table for storing intracellular stimulus related metadata. equals_string: response
is_a: IntracellularStimuliTable
IntracellularRecordingsTable__responses:
name: IntracellularRecordingsTable__responses
description: Table for storing intracellular response related metadata.
is_a: IntracellularResponsesTable
SimultaneousRecordingsTable__recordings: SimultaneousRecordingsTable__recordings:
name: SimultaneousRecordingsTable__recordings name: SimultaneousRecordingsTable__recordings
description: A reference to one or more rows in the IntracellularRecordingsTable description: A reference to one or more rows in the IntracellularRecordingsTable
table. table.
is_a: DynamicTableRegion is_a: DynamicTableRegion
attributes: attributes:
name:
name: name
ifabsent: string(recordings)
range: string
required: true
equals_string: recordings
table: table:
name: table name: table
description: Reference to the IntracellularRecordingsTable table that this description: Reference to the IntracellularRecordingsTable table that this
@ -172,12 +237,25 @@ classes:
name: SimultaneousRecordingsTable__recordings_index name: SimultaneousRecordingsTable__recordings_index
description: Index dataset for the recordings column. description: Index dataset for the recordings column.
is_a: VectorIndex is_a: VectorIndex
attributes:
name:
name: name
ifabsent: string(recordings_index)
range: string
required: true
equals_string: recordings_index
SequentialRecordingsTable__simultaneous_recordings: SequentialRecordingsTable__simultaneous_recordings:
name: SequentialRecordingsTable__simultaneous_recordings name: SequentialRecordingsTable__simultaneous_recordings
description: A reference to one or more rows in the SimultaneousRecordingsTable description: A reference to one or more rows in the SimultaneousRecordingsTable
table. table.
is_a: DynamicTableRegion is_a: DynamicTableRegion
attributes: attributes:
name:
name: name
ifabsent: string(simultaneous_recordings)
range: string
required: true
equals_string: simultaneous_recordings
table: table:
name: table name: table
description: Reference to the SimultaneousRecordingsTable table that this description: Reference to the SimultaneousRecordingsTable table that this
@ -188,12 +266,25 @@ classes:
name: SequentialRecordingsTable__simultaneous_recordings_index name: SequentialRecordingsTable__simultaneous_recordings_index
description: Index dataset for the simultaneous_recordings column. description: Index dataset for the simultaneous_recordings column.
is_a: VectorIndex is_a: VectorIndex
attributes:
name:
name: name
ifabsent: string(simultaneous_recordings_index)
range: string
required: true
equals_string: simultaneous_recordings_index
RepetitionsTable__sequential_recordings: RepetitionsTable__sequential_recordings:
name: RepetitionsTable__sequential_recordings name: RepetitionsTable__sequential_recordings
description: A reference to one or more rows in the SequentialRecordingsTable description: A reference to one or more rows in the SequentialRecordingsTable
table. table.
is_a: DynamicTableRegion is_a: DynamicTableRegion
attributes: attributes:
name:
name: name
ifabsent: string(sequential_recordings)
range: string
required: true
equals_string: sequential_recordings
table: table:
name: table name: table
description: Reference to the SequentialRecordingsTable table that this table description: Reference to the SequentialRecordingsTable table that this table
@ -204,11 +295,24 @@ classes:
name: RepetitionsTable__sequential_recordings_index name: RepetitionsTable__sequential_recordings_index
description: Index dataset for the sequential_recordings column. description: Index dataset for the sequential_recordings column.
is_a: VectorIndex is_a: VectorIndex
attributes:
name:
name: name
ifabsent: string(sequential_recordings_index)
range: string
required: true
equals_string: sequential_recordings_index
ExperimentalConditionsTable__repetitions: ExperimentalConditionsTable__repetitions:
name: ExperimentalConditionsTable__repetitions name: ExperimentalConditionsTable__repetitions
description: A reference to one or more rows in the RepetitionsTable table. description: A reference to one or more rows in the RepetitionsTable table.
is_a: DynamicTableRegion is_a: DynamicTableRegion
attributes: attributes:
name:
name: name
ifabsent: string(repetitions)
range: string
required: true
equals_string: repetitions
table: table:
name: table name: table
description: Reference to the RepetitionsTable table that this table region description: Reference to the RepetitionsTable table that this table region
@ -219,3 +323,10 @@ classes:
name: ExperimentalConditionsTable__repetitions_index name: ExperimentalConditionsTable__repetitions_index
description: Index dataset for the repetitions column. description: Index dataset for the repetitions column.
is_a: VectorIndex is_a: VectorIndex
attributes:
name:
name: name
ifabsent: string(repetitions_index)
range: string
required: true
equals_string: repetitions_index

View file

@ -15,6 +15,10 @@ classes:
current or voltage. current or voltage.
is_a: TimeSeries is_a: TimeSeries
attributes: attributes:
name:
name: name
range: string
required: true
stimulus_description: stimulus_description:
name: stimulus_description name: stimulus_description
description: Protocol/stimulus name for this patch-clamp dataset. description: Protocol/stimulus name for this patch-clamp dataset.
@ -26,8 +30,8 @@ classes:
data: data:
name: data name: data
description: Recorded voltage or current. description: Recorded voltage or current.
multivalued: false multivalued: true
range: PatchClampSeries__data range: numeric
required: true required: true
gain: gain:
name: gain name: gain
@ -36,6 +40,7 @@ classes:
multivalued: false multivalued: false
range: float32 range: float32
required: false required: false
tree_root: true
CurrentClampSeries: CurrentClampSeries:
name: CurrentClampSeries name: CurrentClampSeries
description: Voltage data from an intracellular current-clamp recording. A corresponding description: Voltage data from an intracellular current-clamp recording. A corresponding
@ -43,6 +48,10 @@ classes:
the current injected. the current injected.
is_a: PatchClampSeries is_a: PatchClampSeries
attributes: attributes:
name:
name: name
range: string
required: true
data: data:
name: data name: data
description: Recorded voltage. description: Recorded voltage.
@ -67,6 +76,7 @@ classes:
multivalued: false multivalued: false
range: float32 range: float32
required: false required: false
tree_root: true
IZeroClampSeries: IZeroClampSeries:
name: IZeroClampSeries name: IZeroClampSeries
description: Voltage data from an intracellular recording when all current and description: Voltage data from an intracellular recording when all current and
@ -75,6 +85,10 @@ classes:
amplifier is disconnected and no stimulus can reach the cell. amplifier is disconnected and no stimulus can reach the cell.
is_a: CurrentClampSeries is_a: CurrentClampSeries
attributes: attributes:
name:
name: name
range: string
required: true
stimulus_description: stimulus_description:
name: stimulus_description name: stimulus_description
description: An IZeroClampSeries has no stimulus, so this attribute is automatically description: An IZeroClampSeries has no stimulus, so this attribute is automatically
@ -98,17 +112,23 @@ classes:
multivalued: false multivalued: false
range: float32 range: float32
required: true required: true
tree_root: true
CurrentClampStimulusSeries: CurrentClampStimulusSeries:
name: CurrentClampStimulusSeries name: CurrentClampStimulusSeries
description: Stimulus current applied during current clamp recording. description: Stimulus current applied during current clamp recording.
is_a: PatchClampSeries is_a: PatchClampSeries
attributes: attributes:
name:
name: name
range: string
required: true
data: data:
name: data name: data
description: Stimulus current applied. description: Stimulus current applied.
multivalued: false multivalued: false
range: CurrentClampStimulusSeries__data range: CurrentClampStimulusSeries__data
required: true required: true
tree_root: true
VoltageClampSeries: VoltageClampSeries:
name: VoltageClampSeries name: VoltageClampSeries
description: Current data from an intracellular voltage-clamp recording. A corresponding description: Current data from an intracellular voltage-clamp recording. A corresponding
@ -116,6 +136,10 @@ classes:
the voltage injected. the voltage injected.
is_a: PatchClampSeries is_a: PatchClampSeries
attributes: attributes:
name:
name: name
range: string
required: true
data: data:
name: data name: data
description: Recorded current. description: Recorded current.
@ -164,22 +188,32 @@ classes:
multivalued: false multivalued: false
range: VoltageClampSeries__whole_cell_series_resistance_comp range: VoltageClampSeries__whole_cell_series_resistance_comp
required: false required: false
tree_root: true
VoltageClampStimulusSeries: VoltageClampStimulusSeries:
name: VoltageClampStimulusSeries name: VoltageClampStimulusSeries
description: Stimulus voltage applied during a voltage clamp recording. description: Stimulus voltage applied during a voltage clamp recording.
is_a: PatchClampSeries is_a: PatchClampSeries
attributes: attributes:
name:
name: name
range: string
required: true
data: data:
name: data name: data
description: Stimulus voltage applied. description: Stimulus voltage applied.
multivalued: false multivalued: false
range: VoltageClampStimulusSeries__data range: VoltageClampStimulusSeries__data
required: true required: true
tree_root: true
IntracellularElectrode: IntracellularElectrode:
name: IntracellularElectrode name: IntracellularElectrode
description: An intracellular electrode and its metadata. description: An intracellular electrode and its metadata.
is_a: NWBContainer is_a: NWBContainer
attributes: attributes:
name:
name: name
range: string
required: true
cell_id: cell_id:
name: cell_id name: cell_id
description: unique ID of the cell description: unique ID of the cell
@ -230,6 +264,7 @@ classes:
multivalued: false multivalued: false
range: text range: text
required: false required: false
tree_root: true
SweepTable: SweepTable:
name: SweepTable name: SweepTable
description: '[DEPRECATED] Table used to group different PatchClampSeries. SweepTable description: '[DEPRECATED] Table used to group different PatchClampSeries. SweepTable
@ -238,6 +273,10 @@ classes:
tables provide enhanced support for experiment metadata.' tables provide enhanced support for experiment metadata.'
is_a: DynamicTable is_a: DynamicTable
attributes: attributes:
name:
name: name
range: string
required: true
sweep_number: sweep_number:
name: sweep_number name: sweep_number
description: Sweep number of the PatchClampSeries in that row. description: Sweep number of the PatchClampSeries in that row.
@ -254,11 +293,16 @@ classes:
multivalued: false multivalued: false
range: SweepTable__series_index range: SweepTable__series_index
required: true required: true
tree_root: true
IntracellularElectrodesTable: IntracellularElectrodesTable:
name: IntracellularElectrodesTable name: IntracellularElectrodesTable
description: Table for storing intracellular electrode related metadata. description: Table for storing intracellular electrode related metadata.
is_a: DynamicTable is_a: DynamicTable
attributes: attributes:
name:
name: name
range: string
required: true
description: description:
name: description name: description
description: Description of what is in this dynamic table. description: Description of what is in this dynamic table.
@ -268,11 +312,16 @@ classes:
description: Column for storing the reference to the intracellular electrode. description: Column for storing the reference to the intracellular electrode.
multivalued: true multivalued: true
range: IntracellularElectrode range: IntracellularElectrode
tree_root: true
IntracellularStimuliTable: IntracellularStimuliTable:
name: IntracellularStimuliTable name: IntracellularStimuliTable
description: Table for storing intracellular stimulus related metadata. description: Table for storing intracellular stimulus related metadata.
is_a: DynamicTable is_a: DynamicTable
attributes: attributes:
name:
name: name
range: string
required: true
description: description:
name: description name: description
description: Description of what is in this dynamic table. description: Description of what is in this dynamic table.
@ -284,11 +333,16 @@ classes:
multivalued: false multivalued: false
range: IntracellularStimuliTable__stimulus range: IntracellularStimuliTable__stimulus
required: true required: true
tree_root: true
IntracellularResponsesTable: IntracellularResponsesTable:
name: IntracellularResponsesTable name: IntracellularResponsesTable
description: Table for storing intracellular response related metadata. description: Table for storing intracellular response related metadata.
is_a: DynamicTable is_a: DynamicTable
attributes: attributes:
name:
name: name
range: string
required: true
description: description:
name: description name: description
description: Description of what is in this dynamic table. description: Description of what is in this dynamic table.
@ -300,6 +354,7 @@ classes:
multivalued: false multivalued: false
range: IntracellularResponsesTable__response range: IntracellularResponsesTable__response
required: true required: true
tree_root: true
IntracellularRecordingsTable: IntracellularRecordingsTable:
name: IntracellularRecordingsTable name: IntracellularRecordingsTable
description: A table to group together a stimulus and response from a single electrode description: A table to group together a stimulus and response from a single electrode
@ -315,6 +370,12 @@ classes:
electrophysiology, in which case other TimeSeries may be used. electrophysiology, in which case other TimeSeries may be used.
is_a: AlignedDynamicTable is_a: AlignedDynamicTable
attributes: attributes:
name:
name: name
ifabsent: string(intracellular_recordings)
range: string
required: true
equals_string: intracellular_recordings
description: description:
name: description name: description
description: Description of the contents of this table. Inherited from AlignedDynamicTable description: Description of the contents of this table. Inherited from AlignedDynamicTable
@ -324,20 +385,21 @@ classes:
name: electrodes name: electrodes
description: Table for storing intracellular electrode related metadata. description: Table for storing intracellular electrode related metadata.
multivalued: false multivalued: false
range: IntracellularRecordingsTable__electrodes range: IntracellularElectrodesTable
required: true required: true
stimuli: stimuli:
name: stimuli name: stimuli
description: Table for storing intracellular stimulus related metadata. description: Table for storing intracellular stimulus related metadata.
multivalued: false multivalued: false
range: IntracellularRecordingsTable__stimuli range: IntracellularStimuliTable
required: true required: true
responses: responses:
name: responses name: responses
description: Table for storing intracellular response related metadata. description: Table for storing intracellular response related metadata.
multivalued: false multivalued: false
range: IntracellularRecordingsTable__responses range: IntracellularResponsesTable
required: true required: true
tree_root: true
SimultaneousRecordingsTable: SimultaneousRecordingsTable:
name: SimultaneousRecordingsTable name: SimultaneousRecordingsTable
description: A table for grouping different intracellular recordings from the description: A table for grouping different intracellular recordings from the
@ -345,6 +407,12 @@ classes:
from different electrodes. from different electrodes.
is_a: DynamicTable is_a: DynamicTable
attributes: attributes:
name:
name: name
ifabsent: string(simultaneous_recordings)
range: string
required: true
equals_string: simultaneous_recordings
recordings: recordings:
name: recordings name: recordings
description: A reference to one or more rows in the IntracellularRecordingsTable description: A reference to one or more rows in the IntracellularRecordingsTable
@ -358,6 +426,7 @@ classes:
multivalued: false multivalued: false
range: SimultaneousRecordingsTable__recordings_index range: SimultaneousRecordingsTable__recordings_index
required: true required: true
tree_root: true
SequentialRecordingsTable: SequentialRecordingsTable:
name: SequentialRecordingsTable name: SequentialRecordingsTable
description: A table for grouping different sequential recordings from the SimultaneousRecordingsTable description: A table for grouping different sequential recordings from the SimultaneousRecordingsTable
@ -366,6 +435,12 @@ classes:
presented in a sequence. presented in a sequence.
is_a: DynamicTable is_a: DynamicTable
attributes: attributes:
name:
name: name
ifabsent: string(sequential_recordings)
range: string
required: true
equals_string: sequential_recordings
simultaneous_recordings: simultaneous_recordings:
name: simultaneous_recordings name: simultaneous_recordings
description: A reference to one or more rows in the SimultaneousRecordingsTable description: A reference to one or more rows in the SimultaneousRecordingsTable
@ -384,6 +459,7 @@ classes:
description: The type of stimulus used for the sequential recording. description: The type of stimulus used for the sequential recording.
multivalued: true multivalued: true
range: text range: text
tree_root: true
RepetitionsTable: RepetitionsTable:
name: RepetitionsTable name: RepetitionsTable
description: A table for grouping different sequential intracellular recordings description: A table for grouping different sequential intracellular recordings
@ -392,6 +468,12 @@ classes:
of stimuli applied in sequence. of stimuli applied in sequence.
is_a: DynamicTable is_a: DynamicTable
attributes: attributes:
name:
name: name
ifabsent: string(repetitions)
range: string
required: true
equals_string: repetitions
sequential_recordings: sequential_recordings:
name: sequential_recordings name: sequential_recordings
description: A reference to one or more rows in the SequentialRecordingsTable description: A reference to one or more rows in the SequentialRecordingsTable
@ -405,12 +487,19 @@ classes:
multivalued: false multivalued: false
range: RepetitionsTable__sequential_recordings_index range: RepetitionsTable__sequential_recordings_index
required: true required: true
tree_root: true
ExperimentalConditionsTable: ExperimentalConditionsTable:
name: ExperimentalConditionsTable name: ExperimentalConditionsTable
description: A table for grouping different intracellular recording repetitions description: A table for grouping different intracellular recording repetitions
together that belong to the same experimental condition. together that belong to the same experimental condition.
is_a: DynamicTable is_a: DynamicTable
attributes: attributes:
name:
name: name
ifabsent: string(experimental_conditions)
range: string
required: true
equals_string: experimental_conditions
repetitions: repetitions:
name: repetitions name: repetitions
description: A reference to one or more rows in the RepetitionsTable table. description: A reference to one or more rows in the RepetitionsTable table.
@ -423,3 +512,4 @@ classes:
multivalued: false multivalued: false
range: ExperimentalConditionsTable__repetitions_index range: ExperimentalConditionsTable__repetitions_index
required: true required: true
tree_root: true

View file

@ -15,11 +15,11 @@ classes:
x: x:
name: x name: x
range: numeric range: numeric
required: false required: true
y: y:
name: y name: y
range: numeric range: numeric
required: false required: true
RGBImage__Array: RGBImage__Array:
name: RGBImage__Array name: RGBImage__Array
is_a: Arraylike is_a: Arraylike
@ -27,15 +27,15 @@ classes:
x: x:
name: x name: x
range: numeric range: numeric
required: false required: true
y: y:
name: y name: y
range: numeric range: numeric
required: false required: true
r, g, b: r, g, b:
name: r, g, b name: r, g, b
range: numeric range: numeric
required: false required: true
minimum_cardinality: 3 minimum_cardinality: 3
maximum_cardinality: 3 maximum_cardinality: 3
RGBAImage__Array: RGBAImage__Array:
@ -45,15 +45,15 @@ classes:
x: x:
name: x name: x
range: numeric range: numeric
required: false required: true
y: y:
name: y name: y
range: numeric range: numeric
required: false required: true
r, g, b, a: r, g, b, a:
name: r, g, b, a name: r, g, b, a
range: numeric range: numeric
required: false required: true
minimum_cardinality: 4 minimum_cardinality: 4
maximum_cardinality: 4 maximum_cardinality: 4
ImageSeries__data: ImageSeries__data:
@ -61,6 +61,12 @@ classes:
description: Binary data representing images across frames. If data are stored description: Binary data representing images across frames. If data are stored
in an external file, this should be an empty 3D array. in an external file, this should be an empty 3D array.
attributes: attributes:
name:
name: name
ifabsent: string(data)
range: string
required: true
equals_string: data
array: array:
name: array name: array
range: ImageSeries__data__Array range: ImageSeries__data__Array
@ -84,52 +90,16 @@ classes:
name: z name: z
range: numeric range: numeric
required: false required: false
ImageSeries__dimension:
name: ImageSeries__dimension
description: Number of pixels on x, y, (and z) axes.
attributes:
dimension:
name: dimension
description: Number of pixels on x, y, (and z) axes.
multivalued: true
range: int32
required: false
ImageSeries__external_file:
name: ImageSeries__external_file
description: 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.
attributes:
starting_frame:
name: starting_frame
description: 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].
range: int32
external_file:
name: external_file
description: 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.
multivalued: true
range: text
required: false
OpticalSeries__field_of_view: OpticalSeries__field_of_view:
name: OpticalSeries__field_of_view name: OpticalSeries__field_of_view
description: Width, height and depth of image, or imaged area, in meters. description: Width, height and depth of image, or imaged area, in meters.
attributes: attributes:
name:
name: name
ifabsent: string(field_of_view)
range: string
required: true
equals_string: field_of_view
array: array:
name: array name: array
range: OpticalSeries__field_of_view__Array range: OpticalSeries__field_of_view__Array
@ -153,6 +123,12 @@ classes:
name: OpticalSeries__data name: OpticalSeries__data
description: Images presented to subject, either grayscale or RGB description: Images presented to subject, either grayscale or RGB
attributes: attributes:
name:
name: name
ifabsent: string(data)
range: string
required: true
equals_string: data
array: array:
name: array name: array
range: OpticalSeries__data__Array range: OpticalSeries__data__Array
@ -178,30 +154,3 @@ classes:
required: false required: false
minimum_cardinality: 3 minimum_cardinality: 3
maximum_cardinality: 3 maximum_cardinality: 3
IndexSeries__data:
name: IndexSeries__data
description: Index of the image (using zero-indexing) in the linked Images object.
attributes:
conversion:
name: conversion
description: This field is unused by IndexSeries.
range: float32
resolution:
name: resolution
description: This field is unused by IndexSeries.
range: float32
offset:
name: offset
description: This field is unused by IndexSeries.
range: float32
unit:
name: unit
description: This field is unused by IndexSeries and has the value N/A.
range: text
data:
name: data
description: Index of the image (using zero-indexing) in the linked Images
object.
multivalued: true
range: uint32
required: true

View file

@ -13,25 +13,40 @@ classes:
description: A grayscale image. description: A grayscale image.
is_a: Image is_a: Image
attributes: attributes:
name:
name: name
range: string
required: true
array: array:
name: array name: array
range: GrayscaleImage__Array range: GrayscaleImage__Array
tree_root: true
RGBImage: RGBImage:
name: RGBImage name: RGBImage
description: A color image. description: A color image.
is_a: Image is_a: Image
attributes: attributes:
name:
name: name
range: string
required: true
array: array:
name: array name: array
range: RGBImage__Array range: RGBImage__Array
tree_root: true
RGBAImage: RGBAImage:
name: RGBAImage name: RGBAImage
description: A color image with transparency. description: A color image with transparency.
is_a: Image is_a: Image
attributes: attributes:
name:
name: name
range: string
required: true
array: array:
name: array name: array
range: RGBAImage__Array range: RGBAImage__Array
tree_root: true
ImageSeries: ImageSeries:
name: ImageSeries name: ImageSeries
description: General image data that is common between acquisition and stimulus description: General image data that is common between acquisition and stimulus
@ -42,6 +57,10 @@ classes:
stack. [frame][x][y] or [frame][x][y][z]. stack. [frame][x][y] or [frame][x][y][z].
is_a: TimeSeries is_a: TimeSeries
attributes: attributes:
name:
name: name
range: string
required: true
data: data:
name: data name: data
description: Binary data representing images across frames. If data are stored description: Binary data representing images across frames. If data are stored
@ -52,8 +71,8 @@ classes:
dimension: dimension:
name: dimension name: dimension
description: Number of pixels on x, y, (and z) axes. description: Number of pixels on x, y, (and z) axes.
multivalued: false multivalued: true
range: ImageSeries__dimension range: int32
required: false required: false
external_file: external_file:
name: external_file name: external_file
@ -62,8 +81,8 @@ classes:
in the file system as one or more image file(s). This field should NOT be 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 used if the image is stored in another NWB file and that file is linked
to this file. to this file.
multivalued: false multivalued: true
range: ImageSeries__external_file range: text
required: false required: false
format: format:
name: format name: format
@ -74,6 +93,7 @@ classes:
multivalued: false multivalued: false
range: text range: text
required: false required: false
tree_root: true
ImageMaskSeries: ImageMaskSeries:
name: ImageMaskSeries name: ImageMaskSeries
description: An alpha mask that is applied to a presented visual stimulus. The description: An alpha mask that is applied to a presented visual stimulus. The
@ -82,6 +102,12 @@ classes:
array indicates the starting time of a mask, and that mask pattern continues array indicates the starting time of a mask, and that mask pattern continues
until it's explicitly changed. until it's explicitly changed.
is_a: ImageSeries is_a: ImageSeries
attributes:
name:
name: name
range: string
required: true
tree_root: true
OpticalSeries: OpticalSeries:
name: OpticalSeries name: OpticalSeries
description: Image data that is presented or recorded. A stimulus template movie description: Image data that is presented or recorded. A stimulus template movie
@ -91,6 +117,10 @@ classes:
OpticalSeries represents acquired imaging data, orientation is also important. OpticalSeries represents acquired imaging data, orientation is also important.
is_a: ImageSeries is_a: ImageSeries
attributes: attributes:
name:
name: name
range: string
required: true
distance: distance:
name: distance name: distance
description: Distance from camera/monitor to target/eye. description: Distance from camera/monitor to target/eye.
@ -116,6 +146,7 @@ classes:
multivalued: false multivalued: false
range: text range: text
required: false required: false
tree_root: true
IndexSeries: IndexSeries:
name: IndexSeries name: IndexSeries
description: Stores indices to image frames stored in an ImageSeries. The purpose description: Stores indices to image frames stored in an ImageSeries. The purpose
@ -127,10 +158,15 @@ classes:
was displayed. was displayed.
is_a: TimeSeries is_a: TimeSeries
attributes: attributes:
name:
name: name
range: string
required: true
data: data:
name: data name: data
description: Index of the image (using zero-indexing) in the linked Images description: Index of the image (using zero-indexing) in the linked Images
object. object.
multivalued: false multivalued: true
range: IndexSeries__data range: uint32
required: true required: true
tree_root: true

View file

@ -13,6 +13,12 @@ classes:
name: AbstractFeatureSeries__data name: AbstractFeatureSeries__data
description: Values of each feature at each time. description: Values of each feature at each time.
attributes: attributes:
name:
name: name
ifabsent: string(data)
range: string
required: true
equals_string: data
unit: unit:
name: unit name: unit
description: Since there can be different units for different features, store description: Since there can be different units for different features, store
@ -34,70 +40,16 @@ classes:
name: num_features name: num_features
range: numeric range: numeric
required: false required: false
AbstractFeatureSeries__feature_units:
name: AbstractFeatureSeries__feature_units
description: Units of each feature.
attributes:
feature_units:
name: feature_units
description: Units of each feature.
multivalued: true
range: text
required: false
AbstractFeatureSeries__features:
name: AbstractFeatureSeries__features
description: Description of the features represented in TimeSeries::data.
attributes:
features:
name: features
description: Description of the features represented in TimeSeries::data.
multivalued: true
range: text
required: true
AnnotationSeries__data:
name: AnnotationSeries__data
description: Annotations made during an experiment.
attributes:
resolution:
name: resolution
description: Smallest meaningful difference between values in data. Annotations
have no units, so the value is fixed to -1.0.
range: float32
unit:
name: unit
description: Base unit of measurement for working with the data. Annotations
have no units, so the value is fixed to 'n/a'.
range: text
data:
name: data
description: Annotations made during an experiment.
multivalued: true
range: text
required: true
IntervalSeries__data:
name: IntervalSeries__data
description: Use values >0 if interval started, <0 if interval ended.
attributes:
resolution:
name: resolution
description: Smallest meaningful difference between values in data. Annotations
have no units, so the value is fixed to -1.0.
range: float32
unit:
name: unit
description: Base unit of measurement for working with the data. Annotations
have no units, so the value is fixed to 'n/a'.
range: text
data:
name: data
description: Use values >0 if interval started, <0 if interval ended.
multivalued: true
range: int8
required: true
DecompositionSeries__data: DecompositionSeries__data:
name: DecompositionSeries__data name: DecompositionSeries__data
description: Data decomposed into frequency bands. description: Data decomposed into frequency bands.
attributes: attributes:
name:
name: name
ifabsent: string(data)
range: string
required: true
equals_string: data
unit: unit:
name: unit name: unit
description: Base unit of measurement for working with the data. Actual stored description: Base unit of measurement for working with the data. Actual stored
@ -114,72 +66,49 @@ classes:
num_times: num_times:
name: num_times name: num_times
range: numeric range: numeric
required: false required: true
num_channels: num_channels:
name: num_channels name: num_channels
range: numeric range: numeric
required: false required: true
num_bands: num_bands:
name: num_bands name: num_bands
range: numeric range: numeric
required: false required: true
DecompositionSeries__source_channels: DecompositionSeries__source_channels:
name: DecompositionSeries__source_channels name: DecompositionSeries__source_channels
description: DynamicTableRegion pointer to the channels that this decomposition description: DynamicTableRegion pointer to the channels that this decomposition
series was generated from. series was generated from.
is_a: DynamicTableRegion is_a: DynamicTableRegion
DecompositionSeries__bands:
name: DecompositionSeries__bands
description: Table for describing the bands that this series was generated from.
There should be one row in this table for each band.
is_a: DynamicTable
attributes: attributes:
band_name: name:
name: band_name name: name
description: Name of the band, e.g. theta. ifabsent: string(source_channels)
multivalued: true range: string
range: text
band_limits:
name: band_limits
description: Low and high limit of each band in Hz. If it is a Gaussian filter,
use 2 SD on either side of the center.
multivalued: false
range: DecompositionSeries__bands__band_limits
required: true required: true
band_mean: equals_string: source_channels
name: band_mean
description: The mean Gaussian filters, in Hz.
multivalued: false
range: DecompositionSeries__bands__band_mean
required: true
band_stdev:
name: band_stdev
description: The standard deviation of Gaussian filters, in Hz.
multivalued: false
range: DecompositionSeries__bands__band_stdev
required: true
DecompositionSeries__bands__band_limits:
name: DecompositionSeries__bands__band_limits
description: Low and high limit of each band in Hz. If it is a Gaussian filter,
use 2 SD on either side of the center.
is_a: VectorData
DecompositionSeries__bands__band_mean:
name: DecompositionSeries__bands__band_mean
description: The mean Gaussian filters, in Hz.
is_a: VectorData
DecompositionSeries__bands__band_stdev:
name: DecompositionSeries__bands__band_stdev
description: The standard deviation of Gaussian filters, in Hz.
is_a: VectorData
Units__spike_times_index: Units__spike_times_index:
name: Units__spike_times_index name: Units__spike_times_index
description: Index into the spike_times dataset. description: Index into the spike_times dataset.
is_a: VectorIndex is_a: VectorIndex
attributes:
name:
name: name
ifabsent: string(spike_times_index)
range: string
required: true
equals_string: spike_times_index
Units__spike_times: Units__spike_times:
name: Units__spike_times name: Units__spike_times
description: Spike times for each unit in seconds. description: Spike times for each unit in seconds.
is_a: VectorData is_a: VectorData
attributes: attributes:
name:
name: name
ifabsent: string(spike_times)
range: string
required: true
equals_string: spike_times
resolution: resolution:
name: resolution name: resolution
description: The smallest possible difference between two spike times. Usually description: The smallest possible difference between two spike times. Usually
@ -192,23 +121,57 @@ classes:
name: Units__obs_intervals_index name: Units__obs_intervals_index
description: Index into the obs_intervals dataset. description: Index into the obs_intervals dataset.
is_a: VectorIndex is_a: VectorIndex
attributes:
name:
name: name
ifabsent: string(obs_intervals_index)
range: string
required: true
equals_string: obs_intervals_index
Units__obs_intervals: Units__obs_intervals:
name: Units__obs_intervals name: Units__obs_intervals
description: Observation intervals for each unit. description: Observation intervals for each unit.
is_a: VectorData is_a: VectorData
attributes:
name:
name: name
ifabsent: string(obs_intervals)
range: string
required: true
equals_string: obs_intervals
Units__electrodes_index: Units__electrodes_index:
name: Units__electrodes_index name: Units__electrodes_index
description: Index into electrodes. description: Index into electrodes.
is_a: VectorIndex is_a: VectorIndex
attributes:
name:
name: name
ifabsent: string(electrodes_index)
range: string
required: true
equals_string: electrodes_index
Units__electrodes: Units__electrodes:
name: Units__electrodes name: Units__electrodes
description: Electrode that each spike unit came from, specified using a DynamicTableRegion. description: Electrode that each spike unit came from, specified using a DynamicTableRegion.
is_a: DynamicTableRegion is_a: DynamicTableRegion
attributes:
name:
name: name
ifabsent: string(electrodes)
range: string
required: true
equals_string: electrodes
Units__waveform_mean: Units__waveform_mean:
name: Units__waveform_mean name: Units__waveform_mean
description: Spike waveform mean for each spike unit. description: Spike waveform mean for each spike unit.
is_a: VectorData is_a: VectorData
attributes: attributes:
name:
name: name
ifabsent: string(waveform_mean)
range: string
required: true
equals_string: waveform_mean
sampling_rate: sampling_rate:
name: sampling_rate name: sampling_rate
description: Sampling rate, in hertz. description: Sampling rate, in hertz.
@ -222,6 +185,12 @@ classes:
description: Spike waveform standard deviation for each spike unit. description: Spike waveform standard deviation for each spike unit.
is_a: VectorData is_a: VectorData
attributes: attributes:
name:
name: name
ifabsent: string(waveform_sd)
range: string
required: true
equals_string: waveform_sd
sampling_rate: sampling_rate:
name: sampling_rate name: sampling_rate
description: Sampling rate, in hertz. description: Sampling rate, in hertz.
@ -257,6 +226,12 @@ classes:
each waveform must be the same. each waveform must be the same.
is_a: VectorData is_a: VectorData
attributes: attributes:
name:
name: name
ifabsent: string(waveforms)
range: string
required: true
equals_string: waveforms
sampling_rate: sampling_rate:
name: sampling_rate name: sampling_rate
description: Sampling rate, in hertz. description: Sampling rate, in hertz.
@ -270,8 +245,22 @@ classes:
description: Index into the waveforms dataset. One value for every spike event. description: Index into the waveforms dataset. One value for every spike event.
See 'waveforms' for more detail. See 'waveforms' for more detail.
is_a: VectorIndex is_a: VectorIndex
attributes:
name:
name: name
ifabsent: string(waveforms_index)
range: string
required: true
equals_string: waveforms_index
Units__waveforms_index_index: Units__waveforms_index_index:
name: Units__waveforms_index_index name: Units__waveforms_index_index
description: Index into the waveforms_index dataset. One value for every unit description: Index into the waveforms_index dataset. One value for every unit
(row in the table). See 'waveforms' for more detail. (row in the table). See 'waveforms' for more detail.
is_a: VectorIndex is_a: VectorIndex
attributes:
name:
name: name
ifabsent: string(waveforms_index_index)
range: string
required: true
equals_string: waveforms_index_index

View file

@ -22,6 +22,10 @@ classes:
is impractical. is impractical.
is_a: TimeSeries is_a: TimeSeries
attributes: attributes:
name:
name: name
range: string
required: true
data: data:
name: data name: data
description: Values of each feature at each time. description: Values of each feature at each time.
@ -31,15 +35,16 @@ classes:
feature_units: feature_units:
name: feature_units name: feature_units
description: Units of each feature. description: Units of each feature.
multivalued: false multivalued: true
range: AbstractFeatureSeries__feature_units range: text
required: false required: false
features: features:
name: features name: features
description: Description of the features represented in TimeSeries::data. description: Description of the features represented in TimeSeries::data.
multivalued: false multivalued: true
range: AbstractFeatureSeries__features range: text
required: true required: true
tree_root: true
AnnotationSeries: AnnotationSeries:
name: AnnotationSeries name: AnnotationSeries
description: Stores user annotations made during an experiment. The data[] field description: Stores user annotations made during an experiment. The data[] field
@ -48,12 +53,17 @@ classes:
is identifiable as storing annotations in a machine-readable way. is identifiable as storing annotations in a machine-readable way.
is_a: TimeSeries is_a: TimeSeries
attributes: attributes:
name:
name: name
range: string
required: true
data: data:
name: data name: data
description: Annotations made during an experiment. description: Annotations made during an experiment.
multivalued: false multivalued: true
range: AnnotationSeries__data range: text
required: true required: true
tree_root: true
IntervalSeries: IntervalSeries:
name: IntervalSeries name: IntervalSeries
description: Stores intervals of data. The timestamps field stores the beginning description: Stores intervals of data. The timestamps field stores the beginning
@ -65,17 +75,26 @@ classes:
time intervals in a machine-readable way. time intervals in a machine-readable way.
is_a: TimeSeries is_a: TimeSeries
attributes: attributes:
name:
name: name
range: string
required: true
data: data:
name: data name: data
description: Use values >0 if interval started, <0 if interval ended. description: Use values >0 if interval started, <0 if interval ended.
multivalued: false multivalued: true
range: IntervalSeries__data range: int8
required: true required: true
tree_root: true
DecompositionSeries: DecompositionSeries:
name: DecompositionSeries name: DecompositionSeries
description: Spectral analysis of a time series, e.g. of an LFP or a speech signal. description: Spectral analysis of a time series, e.g. of an LFP or a speech signal.
is_a: TimeSeries is_a: TimeSeries
attributes: attributes:
name:
name: name
range: string
required: true
data: data:
name: data name: data
description: Data decomposed into frequency bands. description: Data decomposed into frequency bands.
@ -100,14 +119,19 @@ classes:
description: Table for describing the bands that this series was generated description: Table for describing the bands that this series was generated
from. There should be one row in this table for each band. from. There should be one row in this table for each band.
multivalued: false multivalued: false
range: DecompositionSeries__bands range: DynamicTable
required: true required: true
tree_root: true
Units: Units:
name: Units name: Units
description: Data about spiking units. Event times of observed units (e.g. cell, description: Data about spiking units. Event times of observed units (e.g. cell,
synapse, etc.) should be concatenated and stored in spike_times. synapse, etc.) should be concatenated and stored in spike_times.
is_a: DynamicTable is_a: DynamicTable
attributes: attributes:
name:
name: name
range: string
required: true
spike_times_index: spike_times_index:
name: spike_times_index name: spike_times_index
description: Index into the spike_times dataset. description: Index into the spike_times dataset.
@ -203,3 +227,4 @@ classes:
multivalued: false multivalued: false
range: Units__waveforms_index_index range: Units__waveforms_index_index
required: false required: false
tree_root: true

View file

@ -1,24 +0,0 @@
name: core.nwb.ogen.include
id: core.nwb.ogen.include
imports:
- core.nwb.base
- core.nwb.device
- nwb.language
- core.nwb.ogen.include
- core.nwb.ogen
default_prefix: core.nwb.ogen.include/
classes:
OptogeneticSeries__data:
name: OptogeneticSeries__data
description: Applied power for optogenetic stimulus, in watts.
attributes:
unit:
name: unit
description: Unit of measurement for data, which is fixed to 'watts'.
range: text
data:
name: data
description: Applied power for optogenetic stimulus, in watts.
multivalued: true
range: numeric
required: true

View file

@ -4,7 +4,6 @@ imports:
- core.nwb.base - core.nwb.base
- core.nwb.device - core.nwb.device
- nwb.language - nwb.language
- core.nwb.ogen.include
- core.nwb.ogen - core.nwb.ogen
default_prefix: core.nwb.ogen/ default_prefix: core.nwb.ogen/
classes: classes:
@ -13,17 +12,26 @@ classes:
description: An optogenetic stimulus. description: An optogenetic stimulus.
is_a: TimeSeries is_a: TimeSeries
attributes: attributes:
name:
name: name
range: string
required: true
data: data:
name: data name: data
description: Applied power for optogenetic stimulus, in watts. description: Applied power for optogenetic stimulus, in watts.
multivalued: false multivalued: true
range: OptogeneticSeries__data range: numeric
required: true required: true
tree_root: true
OptogeneticStimulusSite: OptogeneticStimulusSite:
name: OptogeneticStimulusSite name: OptogeneticStimulusSite
description: A site of optogenetic stimulation. description: A site of optogenetic stimulation.
is_a: NWBContainer is_a: NWBContainer
attributes: attributes:
name:
name: name
range: string
required: true
description: description:
name: description name: description
description: Description of stimulation site. description: Description of stimulation site.
@ -44,3 +52,4 @@ classes:
multivalued: false multivalued: false
range: text range: text
required: true required: true
tree_root: true

View file

@ -14,6 +14,12 @@ classes:
name: TwoPhotonSeries__field_of_view name: TwoPhotonSeries__field_of_view
description: Width, height and depth of image, or imaged area, in meters. description: Width, height and depth of image, or imaged area, in meters.
attributes: attributes:
name:
name: name
ifabsent: string(field_of_view)
range: string
required: true
equals_string: field_of_view
array: array:
name: array name: array
range: TwoPhotonSeries__field_of_view__Array range: TwoPhotonSeries__field_of_view__Array
@ -37,6 +43,12 @@ classes:
name: RoiResponseSeries__data name: RoiResponseSeries__data
description: Signals from ROIs. description: Signals from ROIs.
attributes: attributes:
name:
name: name
ifabsent: string(data)
range: string
required: true
equals_string: data
array: array:
name: array name: array
range: RoiResponseSeries__data__Array range: RoiResponseSeries__data__Array
@ -57,36 +69,59 @@ classes:
description: DynamicTableRegion referencing into an ROITable containing information description: DynamicTableRegion referencing into an ROITable containing information
on the ROIs stored in this timeseries. on the ROIs stored in this timeseries.
is_a: DynamicTableRegion is_a: DynamicTableRegion
attributes:
name:
name: name
ifabsent: string(rois)
range: string
required: true
equals_string: rois
PlaneSegmentation__image_mask: PlaneSegmentation__image_mask:
name: PlaneSegmentation__image_mask name: PlaneSegmentation__image_mask
description: ROI masks for each ROI. Each image mask is the size of the original description: ROI masks for each ROI. Each image mask is the size of the original
imaging plane (or volume) and members of the ROI are finite non-zero. imaging plane (or volume) and members of the ROI are finite non-zero.
is_a: VectorData is_a: VectorData
attributes:
name:
name: name
ifabsent: string(image_mask)
range: string
required: true
equals_string: image_mask
PlaneSegmentation__pixel_mask_index: PlaneSegmentation__pixel_mask_index:
name: PlaneSegmentation__pixel_mask_index name: PlaneSegmentation__pixel_mask_index
description: Index into pixel_mask. description: Index into pixel_mask.
is_a: VectorIndex is_a: VectorIndex
attributes:
name:
name: name
ifabsent: string(pixel_mask_index)
range: string
required: true
equals_string: pixel_mask_index
PlaneSegmentation__voxel_mask_index: PlaneSegmentation__voxel_mask_index:
name: PlaneSegmentation__voxel_mask_index name: PlaneSegmentation__voxel_mask_index
description: Index into voxel_mask. description: Index into voxel_mask.
is_a: VectorIndex is_a: VectorIndex
PlaneSegmentation__reference_images:
name: PlaneSegmentation__reference_images
description: Image stacks that the segmentation masks apply to.
attributes: attributes:
ImageSeries: name:
name: ImageSeries name: name
description: One or more image stacks that the masks apply to (can be one-element ifabsent: string(voxel_mask_index)
stack). range: string
multivalued: true required: true
range: ImageSeries equals_string: voxel_mask_index
required: false
ImagingPlane__manifold: ImagingPlane__manifold:
name: ImagingPlane__manifold name: ImagingPlane__manifold
description: DEPRECATED Physical position of each pixel. 'xyz' represents the description: DEPRECATED Physical position of each pixel. 'xyz' represents the
position of the pixel relative to the defined coordinate space. Deprecated in position of the pixel relative to the defined coordinate space. Deprecated in
favor of origin_coords and grid_spacing. favor of origin_coords and grid_spacing.
attributes: attributes:
name:
name: name
ifabsent: string(manifold)
range: string
required: true
equals_string: manifold
conversion: conversion:
name: conversion name: conversion
description: Scalar to multiply each element in data to convert it to the description: Scalar to multiply each element in data to convert it to the
@ -134,6 +169,12 @@ classes:
for 2-D data or (0, 0, 0) for 3-D data. See also reference_frame for what the for 2-D data or (0, 0, 0) for 3-D data. See also reference_frame for what the
physical location is relative to (e.g., bregma). physical location is relative to (e.g., bregma).
attributes: attributes:
name:
name: name
ifabsent: string(origin_coords)
range: string
required: true
equals_string: origin_coords
unit: unit:
name: unit name: unit
description: Measurement units for origin_coords. The default value is 'meters'. description: Measurement units for origin_coords. The default value is 'meters'.
@ -163,6 +204,12 @@ classes:
in the specified unit. Assumes imaging plane is a regular grid. See also reference_frame in the specified unit. Assumes imaging plane is a regular grid. See also reference_frame
to interpret the grid. to interpret the grid.
attributes: attributes:
name:
name: name
ifabsent: string(grid_spacing)
range: string
required: true
equals_string: grid_spacing
unit: unit:
name: unit name: unit
description: Measurement units for grid_spacing. The default value is 'meters'. description: Measurement units for grid_spacing. The default value is 'meters'.
@ -186,12 +233,3 @@ classes:
required: false required: false
minimum_cardinality: 3 minimum_cardinality: 3
maximum_cardinality: 3 maximum_cardinality: 3
CorrectedImageStack__corrected:
name: CorrectedImageStack__corrected
description: Image stack with frames shifted to the common coordinates.
is_a: ImageSeries
CorrectedImageStack__xy_translation:
name: CorrectedImageStack__xy_translation
description: Stores the x,y delta necessary to align each frame to the common
coordinates, for example, to align each frame to a reference image.
is_a: TimeSeries

View file

@ -15,6 +15,10 @@ classes:
description: Image stack recorded over time from 1-photon microscope. description: Image stack recorded over time from 1-photon microscope.
is_a: ImageSeries is_a: ImageSeries
attributes: attributes:
name:
name: name
range: string
required: true
pmt_gain: pmt_gain:
name: pmt_gain name: pmt_gain
description: Photomultiplier gain. description: Photomultiplier gain.
@ -41,11 +45,16 @@ classes:
name: intensity name: intensity
description: Intensity of the excitation in mW/mm^2, if known. description: Intensity of the excitation in mW/mm^2, if known.
range: float32 range: float32
tree_root: true
TwoPhotonSeries: TwoPhotonSeries:
name: TwoPhotonSeries name: TwoPhotonSeries
description: Image stack recorded over time from 2-photon microscope. description: Image stack recorded over time from 2-photon microscope.
is_a: ImageSeries is_a: ImageSeries
attributes: attributes:
name:
name: name
range: string
required: true
pmt_gain: pmt_gain:
name: pmt_gain name: pmt_gain
description: Photomultiplier gain. description: Photomultiplier gain.
@ -62,12 +71,17 @@ classes:
multivalued: false multivalued: false
range: TwoPhotonSeries__field_of_view range: TwoPhotonSeries__field_of_view
required: false required: false
tree_root: true
RoiResponseSeries: RoiResponseSeries:
name: RoiResponseSeries name: RoiResponseSeries
description: ROI responses over an imaging plane. The first dimension represents description: ROI responses over an imaging plane. The first dimension represents
time. The second dimension, if present, represents ROIs. time. The second dimension, if present, represents ROIs.
is_a: TimeSeries is_a: TimeSeries
attributes: attributes:
name:
name: name
range: string
required: true
data: data:
name: data name: data
description: Signals from ROIs. description: Signals from ROIs.
@ -81,6 +95,7 @@ classes:
multivalued: false multivalued: false
range: RoiResponseSeries__rois range: RoiResponseSeries__rois
required: true required: true
tree_root: true
DfOverF: DfOverF:
name: DfOverF name: DfOverF
description: dF/F information about a region of interest (ROI). Storage hierarchy description: dF/F information about a region of interest (ROI). Storage hierarchy
@ -88,12 +103,17 @@ classes:
for image planes). for image planes).
is_a: NWBDataInterface is_a: NWBDataInterface
attributes: attributes:
RoiResponseSeries: name:
name: RoiResponseSeries name: name
range: string
required: true
roi_response_series:
name: roi_response_series
description: RoiResponseSeries object(s) containing dF/F for a ROI. description: RoiResponseSeries object(s) containing dF/F for a ROI.
multivalued: true multivalued: true
range: RoiResponseSeries range: RoiResponseSeries
required: true required: true
tree_root: true
Fluorescence: Fluorescence:
name: Fluorescence name: Fluorescence
description: Fluorescence information about a region of interest (ROI). Storage description: Fluorescence information about a region of interest (ROI). Storage
@ -101,13 +121,18 @@ classes:
for ROIs and for image planes). for ROIs and for image planes).
is_a: NWBDataInterface is_a: NWBDataInterface
attributes: attributes:
RoiResponseSeries: name:
name: RoiResponseSeries name: name
range: string
required: true
roi_response_series:
name: roi_response_series
description: RoiResponseSeries object(s) containing fluorescence data for description: RoiResponseSeries object(s) containing fluorescence data for
a ROI. a ROI.
multivalued: true multivalued: true
range: RoiResponseSeries range: RoiResponseSeries
required: true required: true
tree_root: true
ImageSegmentation: ImageSegmentation:
name: ImageSegmentation name: ImageSegmentation
description: Stores pixels in an image that represent different regions of interest description: Stores pixels in an image that represent different regions of interest
@ -119,17 +144,26 @@ classes:
is required and ROI names should remain consistent between them. is required and ROI names should remain consistent between them.
is_a: NWBDataInterface is_a: NWBDataInterface
attributes: attributes:
PlaneSegmentation: name:
name: PlaneSegmentation name: name
range: string
required: true
plane_segmentation:
name: plane_segmentation
description: Results from image segmentation of a specific imaging plane. description: Results from image segmentation of a specific imaging plane.
multivalued: true multivalued: true
range: PlaneSegmentation range: PlaneSegmentation
required: true required: true
tree_root: true
PlaneSegmentation: PlaneSegmentation:
name: PlaneSegmentation name: PlaneSegmentation
description: Results from image segmentation of a specific imaging plane. description: Results from image segmentation of a specific imaging plane.
is_a: DynamicTable is_a: DynamicTable
attributes: attributes:
name:
name: name
range: string
required: true
image_mask: image_mask:
name: image_mask name: image_mask
description: ROI masks for each ROI. Each image mask is the size of the original description: ROI masks for each ROI. Each image mask is the size of the original
@ -166,14 +200,19 @@ classes:
reference_images: reference_images:
name: reference_images name: reference_images
description: Image stacks that the segmentation masks apply to. description: Image stacks that the segmentation masks apply to.
multivalued: false multivalued: true
range: PlaneSegmentation__reference_images any_of:
required: true - range: ImageSeries
tree_root: true
ImagingPlane: ImagingPlane:
name: ImagingPlane name: ImagingPlane
description: An imaging plane and its metadata. description: An imaging plane and its metadata.
is_a: NWBContainer is_a: NWBContainer
attributes: attributes:
name:
name: name
range: string
required: true
description: description:
name: description name: description
description: Description of the imaging plane. description: Description of the imaging plane.
@ -253,17 +292,22 @@ classes:
multivalued: false multivalued: false
range: text range: text
required: false required: false
OpticalChannel: optical_channel:
name: OpticalChannel name: optical_channel
description: An optical channel used to record from an imaging plane. description: An optical channel used to record from an imaging plane.
multivalued: true multivalued: true
range: OpticalChannel range: OpticalChannel
required: true required: true
tree_root: true
OpticalChannel: OpticalChannel:
name: OpticalChannel name: OpticalChannel
description: An optical channel used to record from an imaging plane. description: An optical channel used to record from an imaging plane.
is_a: NWBContainer is_a: NWBContainer
attributes: attributes:
name:
name: name
range: string
required: true
description: description:
name: description name: description
description: Description or other notes about the channel. description: Description or other notes about the channel.
@ -276,6 +320,7 @@ classes:
multivalued: false multivalued: false
range: float32 range: float32
required: true required: true
tree_root: true
MotionCorrection: MotionCorrection:
name: MotionCorrection name: MotionCorrection
description: 'An image stack where all frames are shifted (registered) to a common description: 'An image stack where all frames are shifted (registered) to a common
@ -283,27 +328,37 @@ classes:
frame at each point in time is assumed to be 2-D (has only x & y dimensions).' frame at each point in time is assumed to be 2-D (has only x & y dimensions).'
is_a: NWBDataInterface is_a: NWBDataInterface
attributes: attributes:
CorrectedImageStack: name:
name: CorrectedImageStack name: name
range: string
required: true
corrected_image_stack:
name: corrected_image_stack
description: Reuslts from motion correction of an image stack. description: Reuslts from motion correction of an image stack.
multivalued: true multivalued: true
range: CorrectedImageStack range: CorrectedImageStack
required: true required: true
tree_root: true
CorrectedImageStack: CorrectedImageStack:
name: CorrectedImageStack name: CorrectedImageStack
description: Reuslts from motion correction of an image stack. description: Reuslts from motion correction of an image stack.
is_a: NWBDataInterface is_a: NWBDataInterface
attributes: attributes:
name:
name: name
range: string
required: true
corrected: corrected:
name: corrected name: corrected
description: Image stack with frames shifted to the common coordinates. description: Image stack with frames shifted to the common coordinates.
multivalued: false multivalued: false
range: CorrectedImageStack__corrected range: ImageSeries
required: true required: true
xy_translation: xy_translation:
name: xy_translation name: xy_translation
description: Stores the x,y delta necessary to align each frame to the common description: Stores the x,y delta necessary to align each frame to the common
coordinates, for example, to align each frame to a reference image. coordinates, for example, to align each frame to a reference image.
multivalued: false multivalued: false
range: CorrectedImageStack__xy_translation range: TimeSeries
required: true required: true
tree_root: true

View file

@ -11,6 +11,12 @@ classes:
name: ImagingRetinotopy__axis_1_phase_map name: ImagingRetinotopy__axis_1_phase_map
description: Phase response to stimulus on the first measured axis. description: Phase response to stimulus on the first measured axis.
attributes: attributes:
name:
name: name
ifabsent: string(axis_1_phase_map)
range: string
required: true
equals_string: axis_1_phase_map
dimension: dimension:
name: dimension name: dimension
description: 'Number of rows and columns in the image. NOTE: row, column representation description: 'Number of rows and columns in the image. NOTE: row, column representation
@ -34,16 +40,22 @@ classes:
num_rows: num_rows:
name: num_rows name: num_rows
range: float32 range: float32
required: false required: true
num_cols: num_cols:
name: num_cols name: num_cols
range: float32 range: float32
required: false required: true
ImagingRetinotopy__axis_1_power_map: ImagingRetinotopy__axis_1_power_map:
name: ImagingRetinotopy__axis_1_power_map name: ImagingRetinotopy__axis_1_power_map
description: Power response on the first measured axis. Response is scaled so description: Power response on the first measured axis. Response is scaled so
0.0 is no power in the response and 1.0 is maximum relative power. 0.0 is no power in the response and 1.0 is maximum relative power.
attributes: attributes:
name:
name: name
ifabsent: string(axis_1_power_map)
range: string
required: true
equals_string: axis_1_power_map
dimension: dimension:
name: dimension name: dimension
description: 'Number of rows and columns in the image. NOTE: row, column representation description: 'Number of rows and columns in the image. NOTE: row, column representation
@ -67,15 +79,21 @@ classes:
num_rows: num_rows:
name: num_rows name: num_rows
range: float32 range: float32
required: false required: true
num_cols: num_cols:
name: num_cols name: num_cols
range: float32 range: float32
required: false required: true
ImagingRetinotopy__axis_2_phase_map: ImagingRetinotopy__axis_2_phase_map:
name: ImagingRetinotopy__axis_2_phase_map name: ImagingRetinotopy__axis_2_phase_map
description: Phase response to stimulus on the second measured axis. description: Phase response to stimulus on the second measured axis.
attributes: attributes:
name:
name: name
ifabsent: string(axis_2_phase_map)
range: string
required: true
equals_string: axis_2_phase_map
dimension: dimension:
name: dimension name: dimension
description: 'Number of rows and columns in the image. NOTE: row, column representation description: 'Number of rows and columns in the image. NOTE: row, column representation
@ -99,16 +117,22 @@ classes:
num_rows: num_rows:
name: num_rows name: num_rows
range: float32 range: float32
required: false required: true
num_cols: num_cols:
name: num_cols name: num_cols
range: float32 range: float32
required: false required: true
ImagingRetinotopy__axis_2_power_map: ImagingRetinotopy__axis_2_power_map:
name: ImagingRetinotopy__axis_2_power_map name: ImagingRetinotopy__axis_2_power_map
description: Power response on the second measured axis. Response is scaled so description: Power response on the second measured axis. Response is scaled so
0.0 is no power in the response and 1.0 is maximum relative power. 0.0 is no power in the response and 1.0 is maximum relative power.
attributes: attributes:
name:
name: name
ifabsent: string(axis_2_power_map)
range: string
required: true
equals_string: axis_2_power_map
dimension: dimension:
name: dimension name: dimension
description: 'Number of rows and columns in the image. NOTE: row, column representation description: 'Number of rows and columns in the image. NOTE: row, column representation
@ -132,30 +156,22 @@ classes:
num_rows: num_rows:
name: num_rows name: num_rows
range: float32 range: float32
required: false required: true
num_cols: num_cols:
name: num_cols name: num_cols
range: float32 range: float32
required: false
ImagingRetinotopy__axis_descriptions:
name: ImagingRetinotopy__axis_descriptions
description: Two-element array describing the contents of the two response axis
fields. Description should be something like ['altitude', 'azimuth'] or '['radius',
'theta'].
attributes:
axis_descriptions:
name: axis_descriptions
description: Two-element array describing the contents of the two response
axis fields. Description should be something like ['altitude', 'azimuth']
or '['radius', 'theta'].
multivalued: true
range: text
required: true required: true
ImagingRetinotopy__focal_depth_image: ImagingRetinotopy__focal_depth_image:
name: ImagingRetinotopy__focal_depth_image name: ImagingRetinotopy__focal_depth_image
description: 'Gray-scale image taken with same settings/parameters (e.g., focal description: 'Gray-scale image taken with same settings/parameters (e.g., focal
depth, wavelength) as data collection. Array format: [rows][columns].' depth, wavelength) as data collection. Array format: [rows][columns].'
attributes: attributes:
name:
name: name
ifabsent: string(focal_depth_image)
range: string
required: true
equals_string: focal_depth_image
bits_per_pixel: bits_per_pixel:
name: bits_per_pixel name: bits_per_pixel
description: Number of bits used to represent each value. This is necessary description: Number of bits used to represent each value. This is necessary
@ -188,16 +204,22 @@ classes:
num_rows: num_rows:
name: num_rows name: num_rows
range: uint16 range: uint16
required: false required: true
num_cols: num_cols:
name: num_cols name: num_cols
range: uint16 range: uint16
required: false required: true
ImagingRetinotopy__sign_map: ImagingRetinotopy__sign_map:
name: ImagingRetinotopy__sign_map name: ImagingRetinotopy__sign_map
description: Sine of the angle between the direction of the gradient in axis_1 description: Sine of the angle between the direction of the gradient in axis_1
and axis_2. and axis_2.
attributes: attributes:
name:
name: name
ifabsent: string(sign_map)
range: string
required: true
equals_string: sign_map
dimension: dimension:
name: dimension name: dimension
description: 'Number of rows and columns in the image. NOTE: row, column representation description: 'Number of rows and columns in the image. NOTE: row, column representation
@ -217,16 +239,22 @@ classes:
num_rows: num_rows:
name: num_rows name: num_rows
range: float32 range: float32
required: false required: true
num_cols: num_cols:
name: num_cols name: num_cols
range: float32 range: float32
required: false required: true
ImagingRetinotopy__vasculature_image: ImagingRetinotopy__vasculature_image:
name: ImagingRetinotopy__vasculature_image name: ImagingRetinotopy__vasculature_image
description: 'Gray-scale anatomical image of cortical surface. Array structure: description: 'Gray-scale anatomical image of cortical surface. Array structure:
[rows][columns]' [rows][columns]'
attributes: attributes:
name:
name: name
ifabsent: string(vasculature_image)
range: string
required: true
equals_string: vasculature_image
bits_per_pixel: bits_per_pixel:
name: bits_per_pixel name: bits_per_pixel
description: Number of bits used to represent each value. This is necessary description: Number of bits used to represent each value. This is necessary
@ -255,8 +283,8 @@ classes:
num_rows: num_rows:
name: num_rows name: num_rows
range: uint16 range: uint16
required: false required: true
num_cols: num_cols:
name: num_cols name: num_cols
range: uint16 range: uint16
required: false required: true

View file

@ -20,6 +20,10 @@ classes:
appear backward (i.e., y before x).' appear backward (i.e., y before x).'
is_a: NWBDataInterface is_a: NWBDataInterface
attributes: attributes:
name:
name: name
range: string
required: true
axis_1_phase_map: axis_1_phase_map:
name: axis_1_phase_map name: axis_1_phase_map
description: Phase response to stimulus on the first measured axis. description: Phase response to stimulus on the first measured axis.
@ -51,8 +55,8 @@ classes:
description: Two-element array describing the contents of the two response description: Two-element array describing the contents of the two response
axis fields. Description should be something like ['altitude', 'azimuth'] axis fields. Description should be something like ['altitude', 'azimuth']
or '['radius', 'theta']. or '['radius', 'theta'].
multivalued: false multivalued: true
range: ImagingRetinotopy__axis_descriptions range: text
required: true required: true
focal_depth_image: focal_depth_image:
name: focal_depth_image name: focal_depth_image
@ -75,3 +79,4 @@ classes:
multivalued: false multivalued: false
range: ImagingRetinotopy__vasculature_image range: ImagingRetinotopy__vasculature_image
required: true required: true
tree_root: true

View file

@ -1,7 +0,0 @@
name: hdmf-common.base.include
id: hdmf-common.base.include
imports:
- nwb.language
- hdmf-common.base.include
- hdmf-common.base
default_prefix: hdmf-common.base.include/

View file

@ -2,31 +2,47 @@ name: hdmf-common.base
id: hdmf-common.base id: hdmf-common.base
imports: imports:
- nwb.language - nwb.language
- hdmf-common.base.include
- hdmf-common.base - hdmf-common.base
default_prefix: hdmf-common.base/ default_prefix: hdmf-common.base/
classes: classes:
Data: Data:
name: Data name: Data
description: An abstract data type for a dataset. description: An abstract data type for a dataset.
attributes:
name:
name: name
range: string
required: true
tree_root: true
Container: Container:
name: Container name: Container
description: An abstract data type for a group storing collections of data and description: An abstract data type for a group storing collections of data and
metadata. Base type for all data and metadata containers. metadata. Base type for all data and metadata containers.
attributes:
name:
name: name
range: string
required: true
tree_root: true
SimpleMultiContainer: SimpleMultiContainer:
name: SimpleMultiContainer name: SimpleMultiContainer
description: A simple Container for holding onto multiple containers. description: A simple Container for holding onto multiple containers.
is_a: Container is_a: Container
attributes: attributes:
name:
name: name
range: string
required: true
Data: Data:
name: Data name: Data
description: Data objects held within this SimpleMultiContainer. description: Data objects held within this SimpleMultiContainer.
multivalued: true multivalued: true
range: Data range: Data
required: false required: false
Container: container:
name: Container name: container
description: Container objects held within this SimpleMultiContainer. description: Container objects held within this SimpleMultiContainer.
multivalued: true multivalued: true
range: Container range: Container
required: false required: false
tree_root: true

View file

@ -1,39 +0,0 @@
name: hdmf-common.sparse.include
id: hdmf-common.sparse.include
imports:
- hdmf-common.base
- nwb.language
- hdmf-common.sparse.include
- hdmf-common.sparse
default_prefix: hdmf-common.sparse.include/
classes:
CSRMatrix__indices:
name: CSRMatrix__indices
description: The column indices.
attributes:
indices:
name: indices
description: The column indices.
multivalued: true
range: uint
required: true
CSRMatrix__indptr:
name: CSRMatrix__indptr
description: The row index pointer.
attributes:
indptr:
name: indptr
description: The row index pointer.
multivalued: true
range: uint
required: true
CSRMatrix__data:
name: CSRMatrix__data
description: The non-zero values in the matrix.
attributes:
data:
name: data
description: The non-zero values in the matrix.
multivalued: true
range: AnyType
required: true

View file

@ -3,7 +3,6 @@ id: hdmf-common.sparse
imports: imports:
- hdmf-common.base - hdmf-common.base
- nwb.language - nwb.language
- hdmf-common.sparse.include
- hdmf-common.sparse - hdmf-common.sparse
default_prefix: hdmf-common.sparse/ default_prefix: hdmf-common.sparse/
classes: classes:
@ -14,6 +13,10 @@ classes:
and their corresponding values are stored in data[indptr[i]:indptr[i+1]]. and their corresponding values are stored in data[indptr[i]:indptr[i+1]].
is_a: Container is_a: Container
attributes: attributes:
name:
name: name
range: string
required: true
shape: shape:
name: shape name: shape
description: The shape (number of rows, number of columns) of this sparse description: The shape (number of rows, number of columns) of this sparse
@ -22,18 +25,19 @@ classes:
indices: indices:
name: indices name: indices
description: The column indices. description: The column indices.
multivalued: false multivalued: true
range: CSRMatrix__indices range: uint
required: true required: true
indptr: indptr:
name: indptr name: indptr
description: The row index pointer. description: The row index pointer.
multivalued: false multivalued: true
range: CSRMatrix__indptr range: uint
required: true required: true
data: data:
name: data name: data
description: The non-zero values in the matrix. description: The non-zero values in the matrix.
multivalued: false multivalued: true
range: CSRMatrix__data range: AnyType
required: true required: true
tree_root: true

View file

@ -35,14 +35,3 @@ classes:
name: num_elements name: num_elements
range: int range: int
required: true required: true
DynamicTable__id:
name: DynamicTable__id
description: Array of unique identifiers for the rows of this dynamic table.
is_a: ElementIdentifiers
attributes:
id:
name: id
description: Array of unique identifiers for the rows of this dynamic table.
multivalued: true
range: int
required: true

View file

@ -19,6 +19,10 @@ classes:
and so on. and so on.
is_a: Data is_a: Data
attributes: attributes:
name:
name: name
range: string
required: true
description: description:
name: description name: description
description: Description of what these vectors represent. description: Description of what these vectors represent.
@ -26,6 +30,7 @@ classes:
array: array:
name: array name: array
range: VectorData__Array range: VectorData__Array
tree_root: true
VectorIndex: VectorIndex:
name: VectorIndex name: VectorIndex
description: Used with VectorData to encode a ragged array. An array of indices description: Used with VectorData to encode a ragged array. An array of indices
@ -35,19 +40,29 @@ classes:
by "_index". by "_index".
is_a: VectorData is_a: VectorData
attributes: attributes:
name:
name: name
range: string
required: true
target: target:
name: target name: target
description: Reference to the target dataset that this index applies to. description: Reference to the target dataset that this index applies to.
range: VectorData range: VectorData
tree_root: true
ElementIdentifiers: ElementIdentifiers:
name: ElementIdentifiers name: ElementIdentifiers
description: A list of unique identifiers for values within a dataset, e.g. rows description: A list of unique identifiers for values within a dataset, e.g. rows
of a DynamicTable. of a DynamicTable.
is_a: Data is_a: Data
attributes: attributes:
name:
name: name
range: string
required: true
array: array:
name: array name: array
range: ElementIdentifiers__Array range: ElementIdentifiers__Array
tree_root: true
DynamicTableRegion: DynamicTableRegion:
name: DynamicTableRegion name: DynamicTableRegion
description: DynamicTableRegion provides a link from one table to an index or description: DynamicTableRegion provides a link from one table to an index or
@ -61,6 +76,10 @@ classes:
of another `DynamicTable`. of another `DynamicTable`.
is_a: VectorData is_a: VectorData
attributes: attributes:
name:
name: name
range: string
required: true
table: table:
name: table name: table
description: Reference to the DynamicTable object that this region applies description: Reference to the DynamicTable object that this region applies
@ -70,6 +89,7 @@ classes:
name: description name: description
description: Description of what this table region points to. description: Description of what this table region points to.
range: text range: text
tree_root: true
DynamicTable: DynamicTable:
name: DynamicTable name: DynamicTable
description: A group containing multiple datasets that are aligned on the first description: A group containing multiple datasets that are aligned on the first
@ -92,6 +112,10 @@ classes:
may be an acceptable trade-off for the flexibility of a DynamicTable. may be an acceptable trade-off for the flexibility of a DynamicTable.
is_a: Container is_a: Container
attributes: attributes:
name:
name: name
range: string
required: true
colnames: colnames:
name: colnames name: colnames
description: The names of the columns in this table. This should be used to description: The names of the columns in this table. This should be used to
@ -104,8 +128,8 @@ classes:
id: id:
name: id name: id
description: Array of unique identifiers for the rows of this dynamic table. description: Array of unique identifiers for the rows of this dynamic table.
multivalued: false multivalued: true
range: DynamicTable__id range: int
required: true required: true
VectorData: VectorData:
name: VectorData name: VectorData
@ -113,6 +137,7 @@ classes:
multivalued: true multivalued: true
range: VectorData range: VectorData
required: false required: false
tree_root: true
AlignedDynamicTable: AlignedDynamicTable:
name: AlignedDynamicTable name: AlignedDynamicTable
description: DynamicTable container that supports storing a collection of sub-tables. description: DynamicTable container that supports storing a collection of sub-tables.
@ -124,6 +149,10 @@ classes:
by a separate DynamicTable stored within the group. by a separate DynamicTable stored within the group.
is_a: DynamicTable is_a: DynamicTable
attributes: attributes:
name:
name: name
range: string
required: true
categories: categories:
name: categories name: categories
description: The names of the categories in this AlignedDynamicTable. Each description: The names of the categories in this AlignedDynamicTable. Each
@ -132,8 +161,8 @@ classes:
category names must match the names of the corresponding DynamicTable in category names must match the names of the corresponding DynamicTable in
the group. the group.
range: text range: text
DynamicTable: dynamic_table:
name: DynamicTable name: dynamic_table
description: A DynamicTable representing a particular category for columns description: A DynamicTable representing a particular category for columns
in the AlignedDynamicTable parent container. The table MUST be aligned with in the AlignedDynamicTable parent container. The table MUST be aligned with
(i.e., have the same number of rows) as all other DynamicTables stored in (i.e., have the same number of rows) as all other DynamicTables stored in
@ -143,3 +172,4 @@ classes:
multivalued: true multivalued: true
range: DynamicTable range: DynamicTable
required: false required: false
tree_root: true

View file

@ -1,8 +0,0 @@
name: hdmf-experimental.experimental.include
id: hdmf-experimental.experimental.include
imports:
- hdmf-common.table
- nwb.language
- hdmf-experimental.experimental.include
- hdmf-experimental.experimental
default_prefix: hdmf-experimental.experimental.include/

View file

@ -3,7 +3,6 @@ id: hdmf-experimental.experimental
imports: imports:
- hdmf-common.table - hdmf-common.table
- nwb.language - nwb.language
- hdmf-experimental.experimental.include
- hdmf-experimental.experimental - hdmf-experimental.experimental
default_prefix: hdmf-experimental.experimental/ default_prefix: hdmf-experimental.experimental/
classes: classes:
@ -13,8 +12,13 @@ classes:
to the i-th value in the VectorData referenced by the 'elements' attribute. to the i-th value in the VectorData referenced by the 'elements' attribute.
is_a: VectorData is_a: VectorData
attributes: attributes:
name:
name: name
range: string
required: true
elements: elements:
name: elements name: elements
description: Reference to the VectorData object that contains the enumerable description: Reference to the VectorData object that contains the enumerable
elements elements
range: VectorData range: VectorData
tree_root: true

View file

@ -1,79 +0,0 @@
name: hdmf-experimental.resources.include
id: hdmf-experimental.resources.include
imports:
- hdmf-common.base
- nwb.language
- hdmf-experimental.resources.include
- hdmf-experimental.resources
default_prefix: hdmf-experimental.resources.include/
classes:
HERD__keys:
name: HERD__keys
description: A table for storing user terms that are used to refer to external
resources.
is_a: Data
attributes:
keys:
name: keys
description: A table for storing user terms that are used to refer to external
resources.
multivalued: true
range: AnyType
required: true
HERD__files:
name: HERD__files
description: A table for storing object ids of files used in external resources.
is_a: Data
attributes:
files:
name: files
description: A table for storing object ids of files used in external resources.
multivalued: true
range: AnyType
required: true
HERD__entities:
name: HERD__entities
description: A table for mapping user terms (i.e., keys) to resource entities.
is_a: Data
attributes:
entities:
name: entities
description: A table for mapping user terms (i.e., keys) to resource entities.
multivalued: true
range: AnyType
required: true
HERD__objects:
name: HERD__objects
description: A table for identifying which objects in a file contain references
to external resources.
is_a: Data
attributes:
objects:
name: objects
description: A table for identifying which objects in a file contain references
to external resources.
multivalued: true
range: AnyType
required: true
HERD__object_keys:
name: HERD__object_keys
description: A table for identifying which objects use which keys.
is_a: Data
attributes:
object_keys:
name: object_keys
description: A table for identifying which objects use which keys.
multivalued: true
range: AnyType
required: true
HERD__entity_keys:
name: HERD__entity_keys
description: A table for identifying which keys use which entity.
is_a: Data
attributes:
entity_keys:
name: entity_keys
description: A table for identifying which keys use which entity.
multivalued: true
range: AnyType
required: true

View file

@ -3,7 +3,6 @@ id: hdmf-experimental.resources
imports: imports:
- hdmf-common.base - hdmf-common.base
- nwb.language - nwb.language
- hdmf-experimental.resources.include
- hdmf-experimental.resources - hdmf-experimental.resources
default_prefix: hdmf-experimental.resources/ default_prefix: hdmf-experimental.resources/
classes: classes:
@ -13,41 +12,46 @@ classes:
external resource references in a file or across multiple files. external resource references in a file or across multiple files.
is_a: Container is_a: Container
attributes: attributes:
name:
name: name
range: string
required: true
keys: keys:
name: keys name: keys
description: A table for storing user terms that are used to refer to external description: A table for storing user terms that are used to refer to external
resources. resources.
multivalued: false multivalued: true
range: HERD__keys range: AnyType
required: true required: true
files: files:
name: files name: files
description: A table for storing object ids of files used in external resources. description: A table for storing object ids of files used in external resources.
multivalued: false multivalued: true
range: HERD__files range: AnyType
required: true required: true
entities: entities:
name: entities name: entities
description: A table for mapping user terms (i.e., keys) to resource entities. description: A table for mapping user terms (i.e., keys) to resource entities.
multivalued: false multivalued: true
range: HERD__entities range: AnyType
required: true required: true
objects: objects:
name: objects name: objects
description: A table for identifying which objects in a file contain references description: A table for identifying which objects in a file contain references
to external resources. to external resources.
multivalued: false multivalued: true
range: HERD__objects range: AnyType
required: true required: true
object_keys: object_keys:
name: object_keys name: object_keys
description: A table for identifying which objects use which keys. description: A table for identifying which objects use which keys.
multivalued: false multivalued: true
range: HERD__object_keys range: AnyType
required: true required: true
entity_keys: entity_keys:
name: entity_keys name: entity_keys
description: A table for identifying which keys use which entity. description: A table for identifying which keys use which entity.
multivalued: false multivalued: true
range: HERD__entity_keys range: AnyType
required: true required: true
tree_root: true

View file

@ -85,7 +85,7 @@ types:
typeof: boolean typeof: boolean
isodatetime: isodatetime:
name: isodatetime name: isodatetime
typeof: date typeof: datetime
enums: enums:
FlatDType: FlatDType:
name: FlatDType name: FlatDType

4
pytest.ini Normal file
View file

@ -0,0 +1,4 @@
[pytest]
testpaths =
tests

View file

@ -19,7 +19,7 @@ def generate_core_pydantic(yaml_path:Path, output_path:Path):
generator = NWBPydanticGenerator( generator = NWBPydanticGenerator(
str(schema), str(schema),
pydantic_version='1', pydantic_version='2',
emit_metadata=True, emit_metadata=True,
gen_classvars=True, gen_classvars=True,
gen_slots=True gen_slots=True

22
tests/test_adapter.py Normal file
View file

@ -0,0 +1,22 @@
import pytest
from .fixtures import nwb_core_fixture
from nwb_schema_language import Dataset, Group, Schema
@pytest.mark.parametrize(
['walk_class', 'known_number'],
[
(Dataset, 211),
(Group, 144),
((Dataset, Group), 355),
(Schema, 19)
]
)
def test_walk_types(nwb_core_fixture, walk_class, known_number):
classes = nwb_core_fixture.walk_types(nwb_core_fixture, walk_class)
class_list = list(classes)
assert len(class_list) == known_number
# pdb.set_trace()

View file

@ -0,0 +1,4 @@
import pytest
def test_nothing():
pass

View file

@ -0,0 +1,4 @@
import pytest
from .fixtures import nwb_core_fixture

View file

@ -1,19 +1,5 @@
import pytest import pytest
from rich import print
import pdb
from .fixtures import nwb_core_fixture from .fixtures import nwb_core_fixture
from nwb_schema_language import Attribute
def test_walk_adapter(nwb_core_fixture):
base = nwb_core_fixture.schemas[0]
assert base.path.name == "nwb.base.yaml"
# type_incs = [inc for inc in base.walk(base)]
type_incs = [inc for inc in base.walk_fields(base, 'neurodata_type_inc')]
attributes = [a for a in base.walk_types(base, Attribute)]
# pdb.set_trace()
@pytest.mark.parametrize( @pytest.mark.parametrize(
['class_name','schema_file','namespace_name'], ['class_name','schema_file','namespace_name'],
@ -31,6 +17,4 @@ def test_find_type_source(nwb_core_fixture, class_name, schema_file, namespace_n
def test_populate_imports(nwb_core_fixture): def test_populate_imports(nwb_core_fixture):
nwb_core_fixture.populate_imports() nwb_core_fixture.populate_imports()
pdb.set_trace()

View file

@ -0,0 +1,14 @@
import pytest
from .fixtures import nwb_core_fixture
from nwb_schema_language import Dataset, Group, Schema
@pytest.mark.parametrize(
['schema_name'],
[
['core.nwb.file']
]
)
def test_schema_build(nwb_core_fixture, schema_name):
schema = [sch for sch in nwb_core_fixture.schemas if sch.name == schema_name][0]
res = schema.build()

View file

@ -1 +0,0 @@
import pytest

View file

@ -33,6 +33,8 @@ def test_generate_pydantic(tmp_output_dir):
(tmp_output_dir / 'models').mkdir(exist_ok=True) (tmp_output_dir / 'models').mkdir(exist_ok=True)
for schema in (tmp_output_dir / 'schema').glob('*.yaml'): for schema in (tmp_output_dir / 'schema').glob('*.yaml'):
if not schema.exists():
continue
# python friendly name # python friendly name
python_name = schema.stem.replace('.', '_').replace('-','_') python_name = schema.stem.replace('.', '_').replace('-','_')