This commit is contained in:
sneakers-the-rat 2024-07-29 16:28:48 -07:00
parent 04b08f10fc
commit 73ae5be91c
Signed by untrusted user who does not match committer: jonny
GPG key ID: 6DCB96EF1E4D232D
178 changed files with 10265 additions and 3312 deletions

View file

@ -119,7 +119,7 @@ class Adapter(BaseModel):
Convenience wrapper around :meth:`.walk_field_values`
"""
return next(self.walk_field_values(self, 'neurodata_type_def', name))
return next(self.walk_field_values(self, "neurodata_type_def", name))
def get_model_with_field(self, field: str) -> Generator[Union[Group, Dataset], None, None]:
"""

View file

@ -1,12 +1,11 @@
"""
Adapter for NWB datasets to linkml Classes
"""
from abc import abstractmethod
from typing import ClassVar, Optional, Type
from linkml_runtime.linkml_model.meta import (
SlotDefinition, ArrayExpression
)
from linkml_runtime.linkml_model.meta import ArrayExpression, SlotDefinition
from nwb_linkml.adapters.adapter import BuildResult
from nwb_linkml.adapters.array import ArrayAdapter
@ -276,7 +275,7 @@ class MapListlike(DatasetMap):
"""
dtype = ClassAdapter.handle_dtype(cls.dtype)
return (
not cls.neurodata_type_inc != 'VectorData'
cls.neurodata_type_inc != "VectorData"
and is_1d(cls)
and dtype != "AnyType"
and dtype not in flat_to_linkml
@ -383,7 +382,7 @@ class MapArraylike(DatasetMap):
dtype = ClassAdapter.handle_dtype(cls.dtype)
return (
cls.name
and (all([cls.dims, cls.shape]) or cls.neurodata_type_inc == 'VectorData')
and (all([cls.dims, cls.shape]) or cls.neurodata_type_inc == "VectorData")
and not has_attrs(cls)
and not is_compound(cls)
and dtype in flat_to_linkml
@ -398,7 +397,9 @@ class MapArraylike(DatasetMap):
"""
if cls.neurodata_type_inc == "VectorData" and not (cls.dims and cls.shape):
expressions = {
"array": ArrayExpression(minimum_number_dimensions=1, maximum_number_dimensions=False)
"array": ArrayExpression(
minimum_number_dimensions=1, maximum_number_dimensions=False
)
}
else:
array_adapter = ArrayAdapter(cls.dims, cls.shape)
@ -545,6 +546,7 @@ class MapClassRange(DatasetMap):
Datasets that are a simple named reference to another type without any
additional modification to that type.
"""
@classmethod
def check(c, cls: Dataset) -> bool:
"""
@ -572,7 +574,7 @@ class MapClassRange(DatasetMap):
name=cls.name,
description=cls.doc,
range=f"{cls.neurodata_type_inc}",
annotations=[{'named': True}],
annotations=[{"named": True}],
**QUANTITY_MAP[cls.quantity],
)
res = BuildResult(slots=[this_slot])
@ -583,6 +585,7 @@ class MapClassRange(DatasetMap):
# DynamicTable special cases
# --------------------------------------------------
class MapVectorClassRange(DatasetMap):
"""
Map a ``VectorData`` class that is a reference to another class as simply
@ -591,6 +594,10 @@ class MapVectorClassRange(DatasetMap):
@classmethod
def check(c, cls: Dataset) -> bool:
"""
Check that we are a VectorData object without any additional attributes
with a dtype that refers to another class
"""
dtype = ClassAdapter.handle_dtype(cls.dtype)
return (
cls.neurodata_type_inc == "VectorData"
@ -605,6 +612,9 @@ class MapVectorClassRange(DatasetMap):
def apply(
c, cls: Dataset, res: Optional[BuildResult] = None, name: Optional[str] = None
) -> BuildResult:
"""
Create a slot that replaces the base class just as a list[ClassRef]
"""
this_slot = SlotDefinition(
name=cls.name,
description=cls.doc,

View file

@ -156,6 +156,7 @@ class AfterGenerateSlot:
"""
Container class for slot-modification methods
"""
@staticmethod
def skip_meta(slot: SlotResult, skip_meta: tuple[str]) -> SlotResult:
for key in skip_meta:
@ -195,7 +196,7 @@ class AfterGenerateSlot:
When a slot has a ``named`` annotation, wrap it in :class:`.Named`
"""
if 'named' in slot.source.annotations and slot.source.annotations['named'].value:
if "named" in slot.source.annotations and slot.source.annotations["named"].value:
slot.attribute.range = f"Named[{slot.attribute.range}]"
named_injects = [ModelTypeString, _get_name, NamedString]
if slot.injected_classes is None:
@ -208,6 +209,7 @@ class AfterGenerateSlot:
slot.imports = NamedImports
return slot
def compile_python(
text_or_fn: str, package_path: Path = None, module_name: str = "test"
) -> ModuleType:

View file

@ -0,0 +1,3 @@
"""
Classes to inject into generated pydantic modules
"""

View file

@ -2,12 +2,17 @@
Special types for mimicking HDMF special case behavior
"""
from typing import Optional
from pydantic import BaseModel, ConfigDict, model_validator
from typing import Any
from pydantic import BaseModel, ConfigDict
class DynamicTableMixin(BaseModel):
model_config = ConfigDict(extra='allow')
"""
Mixin to make DynamicTable subclasses behave like tables/dataframes
"""
model_config = ConfigDict(extra="allow")
# @model_validator(mode='after')
# def ensure_equal_length(cls, model: 'DynamicTableMixin') -> 'DynamicTableMixin':
@ -23,15 +28,12 @@ class DynamicTableMixin(BaseModel):
# """
# raise NotImplementedError('TODO')
def __getitem__(self, item):
raise NotImplementedError('TODO')
def __getitem__(self, item: str) -> Any:
raise NotImplementedError("TODO")
def __setitem__(self, key, value):
raise NotImplementedError('TODO')
class VectorDataMixin(BaseModel):
index: Optional[BaseModel] = None
def __setitem__(self, key: str, value: Any) -> None:
raise NotImplementedError("TODO")
# class VectorDataMixin(BaseModel):
# index: Optional[BaseModel] = None

View file

@ -6,25 +6,28 @@ Used to customize behavior of pydantic classes either to match pynwb behavior or
reduce the verbosity of the generated models with convenience classes.
"""
from pydantic import BaseModel, ValidationInfo, BeforeValidator
from typing import Annotated, TypeVar, Type
from typing import Annotated, Type, TypeVar, Union
from linkml.generators.pydanticgen.template import Imports, Import, ObjectImport
from linkml.generators.pydanticgen.template import Import, Imports, ObjectImport
from pydantic import BaseModel, BeforeValidator, ValidationInfo
ModelType = TypeVar("ModelType", bound=Type[BaseModel])
# inspect.getsource() doesn't work for typevars because everything in the typing module
# doesn't behave like a normal python object
ModelTypeString = """ModelType = TypeVar("ModelType", bound=Type[BaseModel])"""
def _get_name(item: BaseModel | dict, info: ValidationInfo):
def _get_name(item: ModelType | dict, info: ValidationInfo) -> Union[ModelType, dict]:
"""Get the name of the slot that refers to this object"""
assert isinstance(item, (BaseModel, dict))
name = info.field_name
if isinstance(item, BaseModel):
item.name = name
else:
item['name'] = name
item["name"] = name
return item
Named = Annotated[ModelType, BeforeValidator(_get_name)]
"""
Generic annotated type that sets the ``name`` field of a model
@ -44,7 +47,19 @@ Examples:
"""
NamedString = """Named = Annotated[ModelType, BeforeValidator(_get_name)]"""
NamedImports = Imports(imports=[
Import(module="typing", objects=[ObjectImport(name="Annotated"),ObjectImport(name="Type"), ObjectImport(name="TypeVar"), ]),
Import(module="pydantic", objects=[ObjectImport(name="ValidationInfo"), ObjectImport(name="BeforeValidator")])
])
NamedImports = Imports(
imports=[
Import(
module="typing",
objects=[
ObjectImport(name="Annotated"),
ObjectImport(name="Type"),
ObjectImport(name="TypeVar"),
],
),
Import(
module="pydantic",
objects=[ObjectImport(name="ValidationInfo"), ObjectImport(name="BeforeValidator")],
),
]
)

View file

@ -1 +1 @@
from .pydantic.core.v2_7_0.namespace import *
from .pydantic.core.v2_7_0.namespace import *

View file

@ -23,7 +23,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -79,7 +81,9 @@ class NWBData(Data):
An abstract data type for a dataset.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
name: str = Field(...)
@ -89,7 +93,9 @@ 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)).
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
name: str = Field(...)
resolution: Optional[np.float32] = Field(
@ -110,7 +116,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
name: str = Field(...)
@ -120,7 +128,9 @@ class NWBDataInterface(NWBContainer):
An abstract data type for a generic container storing collections of data, as opposed to metadata.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
name: str = Field(...)
@ -130,7 +140,9 @@ class TimeSeries(NWBDataInterface):
General purpose time series.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
name: str = Field(...)
description: Optional[str] = Field(None, description="""Description of the time series.""")
@ -159,7 +171,9 @@ class TimeSeries(NWBDataInterface):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -175,7 +189,8 @@ class TimeSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
conversion: Optional[np.float32] = Field(
None,
@ -208,10 +223,14 @@ class TimeSeriesStartingTime(ConfiguredBaseModel):
name: Literal["starting_time"] = Field(
"starting_time",
json_schema_extra={"linkml_meta": {"equals_string": "starting_time", "ifabsent": "string(starting_time)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "starting_time", "ifabsent": "string(starting_time)"}
},
)
rate: Optional[np.float32] = 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'."""
)
value: np.float64 = Field(...)
@ -223,7 +242,8 @@ class TimeSeriesSync(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base"})
name: Literal["sync"] = Field(
"sync", json_schema_extra={"linkml_meta": {"equals_string": "sync", "ifabsent": "string(sync)"}}
"sync",
json_schema_extra={"linkml_meta": {"equals_string": "sync", "ifabsent": "string(sync)"}},
)
@ -232,10 +252,15 @@ class ProcessingModule(NWBContainer):
A collection of processed data.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
children: Optional[List[Union[DynamicTable, NWBDataInterface]]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]}}
None,
json_schema_extra={
"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]}
},
)
name: str = Field(...)
@ -245,10 +270,14 @@ class Images(NWBDataInterface):
A collection of images.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
name: str = Field("Images", json_schema_extra={"linkml_meta": {"ifabsent": "string(Images)"}})
description: Optional[str] = Field(None, description="""Description of this collection of images.""")
description: Optional[str] = Field(
None, description="""Description of this collection of images."""
)
image: List[Image] = Field(..., description="""Images stored in this collection.""")

View file

@ -44,7 +44,12 @@ from ...core.v2_2_0.core_nwb_base import (
ProcessingModule,
Images,
)
from ...hdmf_common.v1_1_0.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData
from ...hdmf_common.v1_1_0.hdmf_common_sparse import (
CSRMatrix,
CSRMatrixIndices,
CSRMatrixIndptr,
CSRMatrixData,
)
from ...hdmf_common.v1_1_0.hdmf_common_table import (
Data,
Index,
@ -70,7 +75,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -126,11 +133,14 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
name: str = Field(...)
data: SpatialSeriesData = Field(
..., description="""1-D or 2-D array storing position or direction relative to some reference frame."""
...,
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."""
@ -157,7 +167,9 @@ class SpatialSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -173,14 +185,18 @@ class SpatialSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
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'.""",
)
array: Optional[
Union[NDArray[Shape["* num_times"], np.number], NDArray[Shape["* num_times, * num_features"], np.number]]
Union[
NDArray[Shape["* num_times"], np.number],
NDArray[Shape["* num_times, * num_features"], np.number],
]
] = Field(None)
@ -189,7 +205,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
children: Optional[List[IntervalSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "IntervalSeries"}]}}
@ -202,7 +220,9 @@ class BehavioralEvents(NWBDataInterface):
TimeSeries for storing behavioral events. See description of <a href=\"#BehavioralEpochs\">BehavioralEpochs</a> for more details.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
children: Optional[List[TimeSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}}
@ -215,7 +235,9 @@ class BehavioralTimeSeries(NWBDataInterface):
TimeSeries for storing Behavoioral time series data. See description of <a href=\"#BehavioralEpochs\">BehavioralEpochs</a> for more details.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
children: Optional[List[TimeSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}}
@ -228,7 +250,9 @@ class PupilTracking(NWBDataInterface):
Eye-tracking data, representing pupil size.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
children: Optional[List[TimeSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}}
@ -241,7 +265,9 @@ class EyeTracking(NWBDataInterface):
Eye-tracking data, representing direction of gaze.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
children: Optional[List[SpatialSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}}
@ -254,7 +280,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
children: Optional[List[SpatialSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}}
@ -267,7 +295,9 @@ class Position(NWBDataInterface):
Position data, whether along the x, x/y or x/y/z axis.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
children: Optional[List[SpatialSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}}

View file

@ -22,7 +22,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -62,14 +64,18 @@ class Device(NWBContainer):
Metadata about a data acquisition device, e.g., recording system, electrode, microscope.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.device", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.device", "tree_root": True}
)
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.""",
)
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."""
)
# Model rebuild

View file

@ -7,7 +7,15 @@ import sys
import numpy as np
from ...hdmf_common.v1_1_0.hdmf_common_table import DynamicTableRegion
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator
from pydantic import (
BaseModel,
ConfigDict,
Field,
RootModel,
field_validator,
ValidationInfo,
BeforeValidator,
)
from ...core.v2_2_0.core_nwb_base import (
TimeSeries,
TimeSeriesStartingTime,
@ -30,7 +38,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -75,7 +85,12 @@ linkml_meta = LinkMLMeta(
},
"default_prefix": "core.nwb.ecephys/",
"id": "core.nwb.ecephys",
"imports": ["core.nwb.base", "../../hdmf_common/v1_1_0/namespace", "core.nwb.device", "core.nwb.language"],
"imports": [
"core.nwb.base",
"../../hdmf_common/v1_1_0/namespace",
"core.nwb.device",
"core.nwb.language",
],
"name": "core.nwb.ecephys",
}
)
@ -86,7 +101,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
name: str = Field(...)
data: Union[
@ -97,7 +114,9 @@ class ElectricalSeries(TimeSeries):
electrodes: Named[DynamicTableRegion] = Field(
...,
description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field(
None,
@ -126,7 +145,9 @@ class ElectricalSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -139,7 +160,9 @@ 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).
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
name: str = Field(...)
data: Union[
@ -154,7 +177,9 @@ class SpikeEventSeries(ElectricalSeries):
electrodes: Named[DynamicTableRegion] = Field(
...,
description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field(
None,
@ -178,7 +203,9 @@ class SpikeEventSeries(ElectricalSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -191,9 +218,14 @@ class FeatureExtraction(NWBDataInterface):
Features, such as PC1 and PC2, that are extracted from signals stored in a SpikeEventSeries or other source.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
name: str = Field("FeatureExtraction", json_schema_extra={"linkml_meta": {"ifabsent": "string(FeatureExtraction)"}})
name: str = Field(
"FeatureExtraction",
json_schema_extra={"linkml_meta": {"ifabsent": "string(FeatureExtraction)"}},
)
description: NDArray[Shape["* num_features"], str] = Field(
...,
description="""Description of features (eg, ''PC1'') for each of the extracted features.""",
@ -204,7 +236,13 @@ class FeatureExtraction(NWBDataInterface):
description="""Multi-dimensional array of features extracted from each event.""",
json_schema_extra={
"linkml_meta": {
"array": {"dimensions": [{"alias": "num_events"}, {"alias": "num_channels"}, {"alias": "num_features"}]}
"array": {
"dimensions": [
{"alias": "num_events"},
{"alias": "num_channels"},
{"alias": "num_features"},
]
}
}
},
)
@ -216,7 +254,9 @@ class FeatureExtraction(NWBDataInterface):
electrodes: Named[DynamicTableRegion] = Field(
...,
description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
@ -225,9 +265,13 @@ class EventDetection(NWBDataInterface):
Detected spike events from voltage trace(s).
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
name: str = Field("EventDetection", json_schema_extra={"linkml_meta": {"ifabsent": "string(EventDetection)"}})
name: str = Field(
"EventDetection", json_schema_extra={"linkml_meta": {"ifabsent": "string(EventDetection)"}}
)
detection_method: str = Field(
...,
description="""Description of how events were detected, such as voltage threshold, or dV/dT threshold, as well as relevant values.""",
@ -249,7 +293,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
children: Optional[List[SpikeEventSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpikeEventSeries"}]}}
@ -262,7 +308,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
children: Optional[List[ElectricalSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "ElectricalSeries"}]}}
@ -275,7 +323,9 @@ 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 description or comments field.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
children: Optional[List[ElectricalSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "ElectricalSeries"}]}}
@ -288,7 +338,9 @@ class ElectrodeGroup(NWBContainer):
A physical grouping of electrodes, e.g. a shank of an array.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
name: str = Field(...)
description: Optional[str] = Field(None, description="""Description of this electrode group.""")
@ -309,7 +361,10 @@ class ElectrodeGroupPosition(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys"})
name: Literal["position"] = Field(
"position", json_schema_extra={"linkml_meta": {"equals_string": "position", "ifabsent": "string(position)"}}
"position",
json_schema_extra={
"linkml_meta": {"equals_string": "position", "ifabsent": "string(position)"}
},
)
x: Optional[np.float32] = Field(None, description="""x coordinate""")
y: Optional[np.float32] = Field(None, description="""y coordinate""")
@ -321,22 +376,33 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
name: str = Field("ClusterWaveforms", json_schema_extra={"linkml_meta": {"ifabsent": "string(ClusterWaveforms)"}})
waveform_filtering: str = Field(..., description="""Filtering applied to data before generating mean/sd""")
name: str = Field(
"ClusterWaveforms",
json_schema_extra={"linkml_meta": {"ifabsent": "string(ClusterWaveforms)"}},
)
waveform_filtering: str = Field(
..., description="""Filtering applied to data before generating mean/sd"""
)
waveform_mean: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = 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)""",
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]}}
"linkml_meta": {
"array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]}
}
},
)
waveform_sd: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = Field(
...,
description="""Stdev of waveforms for each cluster, using the same indices as in mean""",
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]}}
"linkml_meta": {
"array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]}
}
},
)
@ -346,9 +412,13 @@ class Clustering(NWBDataInterface):
DEPRECATED Clustered spike data, whether from automatic clustering tools (e.g., klustakwik) or as a result of manual sorting.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
name: str = Field("Clustering", json_schema_extra={"linkml_meta": {"ifabsent": "string(Clustering)"}})
name: str = Field(
"Clustering", json_schema_extra={"linkml_meta": {"ifabsent": "string(Clustering)"}}
)
description: str = Field(
...,
description="""Description of clusters or clustering, (e.g. cluster 0 is noise, clusters curated using Klusters, etc)""",

View file

@ -6,7 +6,15 @@ import re
import sys
import numpy as np
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator
from pydantic import (
BaseModel,
ConfigDict,
Field,
RootModel,
field_validator,
ValidationInfo,
BeforeValidator,
)
from numpydantic import NDArray, Shape
from ...hdmf_common.v1_1_0.hdmf_common_table import DynamicTable, VectorIndex, VectorData
from ...core.v2_2_0.core_nwb_base import TimeSeries
@ -24,7 +32,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -80,52 +90,70 @@ class TimeIntervals(DynamicTable):
A container for aggregating epoch data and the TimeSeries that each epoch applies to.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.epoch", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.epoch", "tree_root": True}
)
name: str = Field(...)
start_time: NDArray[Any, np.float32] = Field(
...,
description="""Start time of epoch, in seconds.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
stop_time: NDArray[Any, np.float32] = Field(
...,
description="""Stop time of epoch, in seconds.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
tags: Optional[NDArray[Any, str]] = Field(
None,
description="""User-defined tags that identify or categorize events.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
tags_index: Named[Optional[VectorIndex]] = Field(
None,
description="""Index for tags.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
timeseries: Optional[TimeIntervalsTimeseries] = Field(
None, description="""An index into a TimeSeries object."""
)
timeseries: Optional[TimeIntervalsTimeseries] = Field(None, description="""An index into a TimeSeries object.""")
timeseries_index: Named[Optional[VectorIndex]] = Field(
None,
description="""Index for timeseries.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
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: NDArray[Shape["* num_rows"], int] = Field(
...,
description="""Array of unique identifiers for the rows of this dynamic table.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}},
)
vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""")
vector_data: Optional[List[VectorData]] = Field(
None, description="""Vector columns of this dynamic table."""
)
vector_index: Optional[List[VectorIndex]] = Field(
None, description="""Indices for the vector columns of this dynamic table."""
)
@ -140,17 +168,24 @@ class TimeIntervalsTimeseries(VectorData):
name: Literal["timeseries"] = Field(
"timeseries",
json_schema_extra={"linkml_meta": {"equals_string": "timeseries", "ifabsent": "string(timeseries)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "timeseries", "ifabsent": "string(timeseries)"}
},
)
idx_start: Optional[np.int32] = Field(
None,
description="""Start index into the TimeSeries 'data' and 'timestamp' datasets of the referenced TimeSeries. The first dimension of those arrays is always time.""",
)
count: Optional[np.int32] = Field(
None, description="""Number of data samples available in this time series, during this epoch."""
None,
description="""Number of data samples available in this time series, during this epoch.""",
)
timeseries: Optional[TimeSeries] = Field(
None, description="""the TimeSeries that this index applies to."""
)
description: Optional[str] = Field(
None, description="""Description of what these vectors represent."""
)
timeseries: Optional[TimeSeries] = Field(None, description="""the TimeSeries that this index applies to.""")
description: Optional[str] = Field(None, description="""Description of what these vectors represent.""")
# Model rebuild

View file

@ -44,7 +44,12 @@ from ...core.v2_2_0.core_nwb_base import (
ProcessingModule,
Images,
)
from ...hdmf_common.v1_1_0.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData
from ...hdmf_common.v1_1_0.hdmf_common_sparse import (
CSRMatrix,
CSRMatrixIndices,
CSRMatrixIndptr,
CSRMatrixData,
)
from ...hdmf_common.v1_1_0.hdmf_common_table import (
Data,
Index,
@ -117,7 +122,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -184,10 +191,13 @@ class NWBFile(NWBContainer):
An NWB:N file storing cellular-based neurophysiology data from a single experimental session.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.file", "tree_root": True}
)
name: Literal["root"] = Field(
"root", json_schema_extra={"linkml_meta": {"equals_string": "root", "ifabsent": "string(root)"}}
"root",
json_schema_extra={"linkml_meta": {"equals_string": "root", "ifabsent": "string(root)"}},
)
nwb_version: Optional[str] = Field(
None,
@ -196,7 +206,9 @@ class NWBFile(NWBContainer):
file_create_date: NDArray[Shape["* num_modifications"], np.datetime64] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_modifications"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_modifications"}]}}
},
)
identifier: str = Field(
...,
@ -216,17 +228,23 @@ class NWBFile(NWBContainer):
acquisition: Optional[List[Union[DynamicTable, NWBDataInterface]]] = Field(
None,
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.""",
json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]}},
json_schema_extra={
"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]}
},
)
analysis: Optional[List[Union[DynamicTable, NWBContainer]]] = Field(
None,
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.""",
json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]}},
json_schema_extra={
"linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]}
},
)
scratch: Optional[List[Union[DynamicTable, NWBContainer]]] = 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.""",
json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]}},
json_schema_extra={
"linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]}
},
)
processing: Optional[List[ProcessingModule]] = Field(
None,
@ -266,7 +284,10 @@ class NWBFileStimulus(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file"})
name: Literal["stimulus"] = Field(
"stimulus", json_schema_extra={"linkml_meta": {"equals_string": "stimulus", "ifabsent": "string(stimulus)"}}
"stimulus",
json_schema_extra={
"linkml_meta": {"equals_string": "stimulus", "ifabsent": "string(stimulus)"}
},
)
presentation: Optional[List[TimeSeries]] = Field(
None,
@ -288,16 +309,27 @@ class NWBFileGeneral(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file"})
name: Literal["general"] = Field(
"general", json_schema_extra={"linkml_meta": {"equals_string": "general", "ifabsent": "string(general)"}}
"general",
json_schema_extra={
"linkml_meta": {"equals_string": "general", "ifabsent": "string(general)"}
},
)
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."""
)
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.""")
experimenter: Optional[NDArray[Shape["* num_experimenters"], str]] = Field(
None,
description="""Name of person(s) who performed the experiment. Can also specify roles of different people involved.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_experimenters"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_experimenters"}]}}
},
)
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[NDArray[Shape["* num_keywords"], str]] = Field(
None,
description="""Terms to search over.""",
@ -310,12 +342,15 @@ class NWBFileGeneral(ConfiguredBaseModel):
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."""
None,
description="""Experimental protocol, if applicable. e.g., include IACUC protocol number.""",
)
related_publications: Optional[NDArray[Shape["* num_publications"], str]] = Field(
None,
description="""Publication information. PMID, DOI, URL, etc.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_publications"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_publications"}]}}
},
)
session_id: Optional[str] = Field(None, description="""Lab-specific ID for the session.""")
slices: Optional[str] = Field(
@ -323,7 +358,8 @@ class NWBFileGeneral(ConfiguredBaseModel):
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."""
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."""
@ -346,7 +382,8 @@ class NWBFileGeneral(ConfiguredBaseModel):
json_schema_extra={"linkml_meta": {"any_of": [{"range": "Device"}]}},
)
subject: Optional[Subject] = Field(
None, description="""Information about the animal or person from which the data was measured."""
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."""
@ -375,7 +412,9 @@ class NWBFileGeneralSourceScript(ConfiguredBaseModel):
name: Literal["source_script"] = Field(
"source_script",
json_schema_extra={"linkml_meta": {"equals_string": "source_script", "ifabsent": "string(source_script)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "source_script", "ifabsent": "string(source_script)"}
},
)
file_name: Optional[str] = Field(None, description="""Name of script file.""")
value: str = Field(...)
@ -389,23 +428,33 @@ class Subject(NWBContainer):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file"})
name: Literal["subject"] = Field(
"subject", json_schema_extra={"linkml_meta": {"equals_string": "subject", "ifabsent": "string(subject)"}}
"subject",
json_schema_extra={
"linkml_meta": {"equals_string": "subject", "ifabsent": "string(subject)"}
},
)
age: Optional[str] = Field(
None, description="""Age of subject. Can be supplied instead of 'date_of_birth'."""
)
age: Optional[str] = Field(None, description="""Age of subject. Can be supplied instead of 'date_of_birth'.""")
date_of_birth: Optional[np.datetime64] = 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)."""
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.""")
species: Optional[str] = Field(None, description="""Species of subject.""")
subject_id: Optional[str] = Field(
None, description="""ID of animal/person used/participating in experiment (lab convention)."""
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."""
None,
description="""Weight at time of experiment, at time of surgery and at other important times.""",
)
@ -419,10 +468,15 @@ class NWBFileGeneralExtracellularEphys(ConfiguredBaseModel):
name: Literal["extracellular_ephys"] = Field(
"extracellular_ephys",
json_schema_extra={
"linkml_meta": {"equals_string": "extracellular_ephys", "ifabsent": "string(extracellular_ephys)"}
"linkml_meta": {
"equals_string": "extracellular_ephys",
"ifabsent": "string(extracellular_ephys)",
}
},
)
electrode_group: Optional[List[ElectrodeGroup]] = Field(None, description="""Physical group of electrodes.""")
electrode_group: Optional[List[ElectrodeGroup]] = Field(
None, description="""Physical group of electrodes."""
)
electrodes: Optional[NWBFileGeneralExtracellularEphysElectrodes] = Field(
None, description="""A table of all electrodes (i.e. channels) used for recording."""
)
@ -437,48 +491,62 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable):
name: Literal["electrodes"] = Field(
"electrodes",
json_schema_extra={"linkml_meta": {"equals_string": "electrodes", "ifabsent": "string(electrodes)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "electrodes", "ifabsent": "string(electrodes)"}
},
)
x: NDArray[Any, np.float32] = Field(
...,
description="""x coordinate of the channel location in the brain (+x is posterior).""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
y: NDArray[Any, np.float32] = Field(
...,
description="""y coordinate of the channel location in the brain (+y is inferior).""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
z: NDArray[Any, np.float32] = Field(
...,
description="""z coordinate of the channel location in the brain (+z is right).""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
imp: NDArray[Any, np.float32] = Field(
...,
description="""Impedance of the channel.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
location: NDArray[Any, str] = Field(
...,
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.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
filtering: NDArray[Any, np.float32] = Field(
...,
description="""Description of hardware filtering.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
group: List[ElectrodeGroup] = Field(
@ -488,48 +556,62 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable):
...,
description="""Name of the ElectrodeGroup this electrode is a part of.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
rel_x: Optional[NDArray[Any, np.float32]] = Field(
None,
description="""x coordinate in electrode group""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
rel_y: Optional[NDArray[Any, np.float32]] = Field(
None,
description="""y coordinate in electrode group""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
rel_z: Optional[NDArray[Any, np.float32]] = Field(
None,
description="""z coordinate in electrode group""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
reference: Optional[NDArray[Any, str]] = Field(
None,
description="""Description of the reference used for this electrode.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
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: NDArray[Shape["* num_rows"], int] = Field(
...,
description="""Array of unique identifiers for the rows of this dynamic table.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}},
)
vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""")
vector_data: Optional[List[VectorData]] = Field(
None, description="""Vector columns of this dynamic table."""
)
vector_index: Optional[List[VectorIndex]] = Field(
None, description="""Indices for the vector columns of this dynamic table."""
)
@ -545,7 +627,10 @@ class NWBFileGeneralIntracellularEphys(ConfiguredBaseModel):
name: Literal["intracellular_ephys"] = Field(
"intracellular_ephys",
json_schema_extra={
"linkml_meta": {"equals_string": "intracellular_ephys", "ifabsent": "string(intracellular_ephys)"}
"linkml_meta": {
"equals_string": "intracellular_ephys",
"ifabsent": "string(intracellular_ephys)",
}
},
)
filtering: Optional[str] = Field(

View file

@ -5,7 +5,12 @@ from enum import Enum
import re
import sys
import numpy as np
from ...hdmf_common.v1_1_0.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData
from ...hdmf_common.v1_1_0.hdmf_common_sparse import (
CSRMatrix,
CSRMatrixIndices,
CSRMatrixIndptr,
CSRMatrixData,
)
from ...hdmf_common.v1_1_0.hdmf_common_table import (
Data,
Index,
@ -30,7 +35,15 @@ from ...core.v2_2_0.core_nwb_base import (
Images,
)
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator
from pydantic import (
BaseModel,
ConfigDict,
Field,
RootModel,
field_validator,
ValidationInfo,
BeforeValidator,
)
from numpydantic import NDArray, Shape
metamodel_version = "None"
@ -46,7 +59,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -91,7 +106,12 @@ linkml_meta = LinkMLMeta(
},
"default_prefix": "core.nwb.icephys/",
"id": "core.nwb.icephys",
"imports": ["core.nwb.base", "core.nwb.device", "../../hdmf_common/v1_1_0/namespace", "core.nwb.language"],
"imports": [
"core.nwb.base",
"core.nwb.device",
"../../hdmf_common/v1_1_0/namespace",
"core.nwb.language",
],
"name": "core.nwb.icephys",
}
)
@ -102,7 +122,9 @@ class PatchClampSeries(TimeSeries):
An abstract base class for patch-clamp data - stimulus or response, current or voltage.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
stimulus_description: Optional[str] = Field(
@ -113,7 +135,8 @@ class PatchClampSeries(TimeSeries):
)
data: PatchClampSeriesData = Field(..., description="""Recorded voltage or current.""")
gain: Optional[np.float32] = Field(
None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp)."""
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.""")
comments: Optional[str] = Field(
@ -137,7 +160,9 @@ class PatchClampSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -153,7 +178,8 @@ class PatchClampSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
unit: Optional[str] = Field(
None,
@ -169,13 +195,17 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
data: CurrentClampSeriesData = Field(..., description="""Recorded voltage.""")
bias_current: Optional[np.float32] = Field(None, description="""Bias current, in amps.""")
bridge_balance: Optional[np.float32] = Field(None, description="""Bridge balance, in ohms.""")
capacitance_compensation: Optional[np.float32] = Field(None, description="""Capacitance compensation, in farads.""")
capacitance_compensation: Optional[np.float32] = Field(
None, description="""Capacitance compensation, in farads."""
)
stimulus_description: Optional[str] = Field(
None, description="""Protocol/stimulus name for this patch-clamp dataset."""
)
@ -183,7 +213,8 @@ class CurrentClampSeries(PatchClampSeries):
None, description="""Sweep number, allows to group different PatchClampSeries together."""
)
gain: Optional[np.float32] = Field(
None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp)."""
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.""")
comments: Optional[str] = Field(
@ -207,7 +238,9 @@ class CurrentClampSeries(PatchClampSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -223,7 +256,8 @@ class CurrentClampSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
unit: Optional[str] = Field(
None,
@ -237,11 +271,15 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
bias_current: np.float32 = Field(..., description="""Bias current, in amps, fixed to 0.0.""")
bridge_balance: np.float32 = Field(..., description="""Bridge balance, in ohms, fixed to 0.0.""")
bridge_balance: np.float32 = Field(
..., description="""Bridge balance, in ohms, fixed to 0.0."""
)
capacitance_compensation: np.float32 = Field(
..., description="""Capacitance compensation, in farads, fixed to 0.0."""
)
@ -253,7 +291,8 @@ class IZeroClampSeries(CurrentClampSeries):
None, description="""Sweep number, allows to group different PatchClampSeries together."""
)
gain: Optional[np.float32] = Field(
None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp)."""
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.""")
comments: Optional[str] = Field(
@ -277,7 +316,9 @@ class IZeroClampSeries(CurrentClampSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -290,7 +331,9 @@ class CurrentClampStimulusSeries(PatchClampSeries):
Stimulus current applied during current clamp recording.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
data: CurrentClampStimulusSeriesData = Field(..., description="""Stimulus current applied.""")
@ -301,7 +344,8 @@ class CurrentClampStimulusSeries(PatchClampSeries):
None, description="""Sweep number, allows to group different PatchClampSeries together."""
)
gain: Optional[np.float32] = Field(
None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp)."""
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.""")
comments: Optional[str] = Field(
@ -325,7 +369,9 @@ class CurrentClampStimulusSeries(PatchClampSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -341,7 +387,8 @@ class CurrentClampStimulusSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
unit: Optional[str] = Field(
None,
@ -355,7 +402,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
data: VoltageClampSeriesData = Field(..., description="""Recorded current.""")
@ -377,8 +426,8 @@ class VoltageClampSeries(PatchClampSeries):
whole_cell_capacitance_comp: Optional[VoltageClampSeriesWholeCellCapacitanceComp] = Field(
None, description="""Whole cell capacitance compensation, in farads."""
)
whole_cell_series_resistance_comp: Optional[VoltageClampSeriesWholeCellSeriesResistanceComp] = Field(
None, description="""Whole cell series resistance compensation, in ohms."""
whole_cell_series_resistance_comp: Optional[VoltageClampSeriesWholeCellSeriesResistanceComp] = (
Field(None, description="""Whole cell series resistance compensation, in ohms.""")
)
stimulus_description: Optional[str] = Field(
None, description="""Protocol/stimulus name for this patch-clamp dataset."""
@ -387,7 +436,8 @@ class VoltageClampSeries(PatchClampSeries):
None, description="""Sweep number, allows to group different PatchClampSeries together."""
)
gain: Optional[np.float32] = Field(
None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp)."""
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.""")
comments: Optional[str] = Field(
@ -411,7 +461,9 @@ class VoltageClampSeries(PatchClampSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -427,7 +479,8 @@ class VoltageClampSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
unit: Optional[str] = Field(
None,
@ -446,11 +499,15 @@ class VoltageClampSeriesCapacitanceFast(ConfiguredBaseModel):
name: Literal["capacitance_fast"] = Field(
"capacitance_fast",
json_schema_extra={
"linkml_meta": {"equals_string": "capacitance_fast", "ifabsent": "string(capacitance_fast)"}
"linkml_meta": {
"equals_string": "capacitance_fast",
"ifabsent": "string(capacitance_fast)",
}
},
)
unit: Optional[str] = Field(
None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'."""
None,
description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""",
)
value: np.float32 = Field(...)
@ -465,11 +522,15 @@ class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel):
name: Literal["capacitance_slow"] = Field(
"capacitance_slow",
json_schema_extra={
"linkml_meta": {"equals_string": "capacitance_slow", "ifabsent": "string(capacitance_slow)"}
"linkml_meta": {
"equals_string": "capacitance_slow",
"ifabsent": "string(capacitance_slow)",
}
},
)
unit: Optional[str] = Field(
None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'."""
None,
description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""",
)
value: np.float32 = Field(...)
@ -491,7 +552,8 @@ class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel):
},
)
unit: Optional[str] = Field(
None, description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'."""
None,
description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'.""",
)
value: np.float32 = Field(...)
@ -513,7 +575,8 @@ class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel):
},
)
unit: Optional[str] = Field(
None, description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'."""
None,
description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'.""",
)
value: np.float32 = Field(...)
@ -535,7 +598,8 @@ class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel):
},
)
unit: Optional[str] = Field(
None, description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'."""
None,
description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'.""",
)
value: np.float32 = Field(...)
@ -557,7 +621,8 @@ class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel):
},
)
unit: Optional[str] = Field(
None, description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'."""
None,
description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'.""",
)
value: np.float32 = Field(...)
@ -579,7 +644,8 @@ class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel):
},
)
unit: Optional[str] = Field(
None, description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'."""
None,
description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'.""",
)
value: np.float32 = Field(...)
@ -589,7 +655,9 @@ class VoltageClampStimulusSeries(PatchClampSeries):
Stimulus voltage applied during a voltage clamp recording.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
data: VoltageClampStimulusSeriesData = Field(..., description="""Stimulus voltage applied.""")
@ -600,7 +668,8 @@ class VoltageClampStimulusSeries(PatchClampSeries):
None, description="""Sweep number, allows to group different PatchClampSeries together."""
)
gain: Optional[np.float32] = Field(
None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp)."""
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.""")
comments: Optional[str] = Field(
@ -624,7 +693,9 @@ class VoltageClampStimulusSeries(PatchClampSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -640,7 +711,8 @@ class VoltageClampStimulusSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
unit: Optional[str] = Field(
None,
@ -654,19 +726,27 @@ class IntracellularElectrode(NWBContainer):
An intracellular electrode and its metadata.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
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.""")
initial_access_resistance: Optional[str] = Field(None, description="""Initial access resistance.""")
initial_access_resistance: Optional[str] = Field(
None, description="""Initial access resistance."""
)
location: Optional[str] = Field(
None,
description="""Location of the electrode. 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.""",
)
resistance: Optional[str] = Field(None, description="""Electrode resistance, in ohms.""")
seal: Optional[str] = Field(None, description="""Information about seal used for recording.""")
slice: Optional[str] = Field(None, description="""Information about slice used for recording.""")
slice: Optional[str] = Field(
None, description="""Information about slice used for recording."""
)
class SweepTable(DynamicTable):
@ -674,14 +754,18 @@ class SweepTable(DynamicTable):
The table which groups different PatchClampSeries together.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
sweep_number: NDArray[Any, np.uint32] = Field(
...,
description="""Sweep number of the PatchClampSeries in that row.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
series: List[PatchClampSeries] = Field(
@ -690,19 +774,25 @@ class SweepTable(DynamicTable):
series_index: Named[VectorIndex] = Field(
...,
description="""Index for series.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
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: NDArray[Shape["* num_rows"], int] = Field(
...,
description="""Array of unique identifiers for the rows of this dynamic table.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}},
)
vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""")
vector_data: Optional[List[VectorData]] = Field(
None, description="""Vector columns of this dynamic table."""
)
vector_index: Optional[List[VectorIndex]] = Field(
None, description="""Indices for the vector columns of this dynamic table."""
)

View file

@ -19,7 +19,12 @@ from ...core.v2_2_0.core_nwb_base import (
ProcessingModule,
Images,
)
from ...hdmf_common.v1_1_0.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData
from ...hdmf_common.v1_1_0.hdmf_common_sparse import (
CSRMatrix,
CSRMatrixIndices,
CSRMatrixIndptr,
CSRMatrixData,
)
from ...hdmf_common.v1_1_0.hdmf_common_table import (
Data,
Index,
@ -45,7 +50,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -101,7 +108,9 @@ class GrayscaleImage(Image):
A grayscale image.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.image", "tree_root": True}
)
name: str = Field(...)
resolution: Optional[np.float32] = Field(
@ -122,7 +131,9 @@ class RGBImage(Image):
A color image.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.image", "tree_root": True}
)
name: str = Field(...)
resolution: Optional[np.float32] = Field(
@ -143,7 +154,9 @@ class RGBAImage(Image):
A color image with transparency.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.image", "tree_root": True}
)
name: str = Field(...)
resolution: Optional[np.float32] = Field(
@ -164,11 +177,16 @@ 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].
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.image", "tree_root": True}
)
name: str = Field(...)
data: Optional[
Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]]
Union[
NDArray[Shape["* frame, * x, * y"], np.number],
NDArray[Shape["* frame, * x, * y, * z"], np.number],
]
] = Field(None, description="""Binary data representing images across frames.""")
dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field(
None,
@ -205,7 +223,9 @@ class ImageSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -222,7 +242,9 @@ class ImageSeriesExternalFile(ConfiguredBaseModel):
name: Literal["external_file"] = Field(
"external_file",
json_schema_extra={"linkml_meta": {"equals_string": "external_file", "ifabsent": "string(external_file)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "external_file", "ifabsent": "string(external_file)"}
},
)
starting_frame: Optional[np.int32] = Field(
None,
@ -238,11 +260,16 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.image", "tree_root": True}
)
name: str = Field(...)
data: Optional[
Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]]
Union[
NDArray[Shape["* frame, * x, * y"], np.number],
NDArray[Shape["* frame, * x, * y, * z"], np.number],
]
] = Field(None, description="""Binary data representing images across frames.""")
dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field(
None,
@ -279,7 +306,9 @@ class ImageMaskSeries(ImageSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -292,19 +321,29 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.image", "tree_root": True}
)
name: str = Field(...)
distance: Optional[np.float32] = Field(None, description="""Distance from camera/monitor to target/eye.""")
distance: Optional[np.float32] = Field(
None, description="""Distance from camera/monitor to target/eye."""
)
field_of_view: Optional[
Union[NDArray[Shape["2 width_height"], np.float32], NDArray[Shape["3 width_height_depth"], np.float32]]
Union[
NDArray[Shape["2 width_height"], np.float32],
NDArray[Shape["3 width_height_depth"], np.float32],
]
] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""")
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.""",
)
data: Optional[
Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]]
Union[
NDArray[Shape["* frame, * x, * y"], np.number],
NDArray[Shape["* frame, * x, * y, * z"], np.number],
]
] = Field(None, description="""Binary data representing images across frames.""")
dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field(
None,
@ -341,7 +380,9 @@ class OpticalSeries(ImageSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -354,7 +395,9 @@ class IndexSeries(TimeSeries):
Stores indices to image frames stored in an ImageSeries. The purpose of the ImageIndexSeries is to allow a static image stack to be stored somewhere, 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 ImageSeries, and the timestamps array indicates when that image was displayed.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.image", "tree_root": True}
)
name: str = Field(...)
data: NDArray[Shape["* num_times"], np.int32] = Field(
@ -384,7 +427,9 @@ class IndexSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,

View file

@ -7,10 +7,23 @@ import sys
import numpy as np
from ...core.v2_2_0.core_nwb_base import TimeSeries, TimeSeriesStartingTime, TimeSeriesSync
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator
from pydantic import (
BaseModel,
ConfigDict,
Field,
RootModel,
field_validator,
ValidationInfo,
BeforeValidator,
)
from ...core.v2_2_0.core_nwb_ecephys import ElectrodeGroup
from numpydantic import NDArray, Shape
from ...hdmf_common.v1_1_0.hdmf_common_table import DynamicTable, VectorData, VectorIndex, DynamicTableRegion
from ...hdmf_common.v1_1_0.hdmf_common_table import (
DynamicTable,
VectorData,
VectorIndex,
DynamicTableRegion,
)
metamodel_version = "None"
version = "2.2.0"
@ -25,7 +38,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -70,7 +85,12 @@ linkml_meta = LinkMLMeta(
},
"default_prefix": "core.nwb.misc/",
"id": "core.nwb.misc",
"imports": ["core.nwb.base", "../../hdmf_common/v1_1_0/namespace", "core.nwb.ecephys", "core.nwb.language"],
"imports": [
"core.nwb.base",
"../../hdmf_common/v1_1_0/namespace",
"core.nwb.ecephys",
"core.nwb.language",
],
"name": "core.nwb.misc",
}
)
@ -81,10 +101,14 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.misc", "tree_root": True}
)
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[NDArray[Shape["* num_features"], str]] = Field(
None,
description="""Units of each feature.""",
@ -117,7 +141,9 @@ class AbstractFeatureSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -133,14 +159,18 @@ class AbstractFeatureSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
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[
Union[NDArray[Shape["* num_times"], np.number], NDArray[Shape["* num_times, * num_features"], np.number]]
Union[
NDArray[Shape["* num_times"], np.number],
NDArray[Shape["* num_times, * num_features"], np.number],
]
] = Field(None)
@ -149,7 +179,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.misc", "tree_root": True}
)
name: str = Field(...)
data: NDArray[Shape["* num_times"], str] = Field(
@ -179,7 +211,9 @@ class AnnotationSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -192,7 +226,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.misc", "tree_root": True}
)
name: str = Field(...)
data: NDArray[Shape["* num_times"], np.int8] = Field(
@ -222,7 +258,9 @@ class IntervalSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -235,10 +273,14 @@ class DecompositionSeries(TimeSeries):
Spectral analysis of a time series, e.g. of an LFP or a speech signal.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.misc", "tree_root": True}
)
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.""")
bands: DecompositionSeriesBands = Field(
...,
@ -266,7 +308,9 @@ class DecompositionSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -282,7 +326,8 @@ class DecompositionSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
unit: Optional[str] = Field(
None,
@ -292,7 +337,13 @@ class DecompositionSeriesData(ConfiguredBaseModel):
None,
json_schema_extra={
"linkml_meta": {
"array": {"dimensions": [{"alias": "num_times"}, {"alias": "num_channels"}, {"alias": "num_bands"}]}
"array": {
"dimensions": [
{"alias": "num_times"},
{"alias": "num_channels"},
{"alias": "num_bands"},
]
}
}
},
)
@ -306,13 +357,16 @@ class DecompositionSeriesBands(DynamicTable):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"})
name: Literal["bands"] = Field(
"bands", json_schema_extra={"linkml_meta": {"equals_string": "bands", "ifabsent": "string(bands)"}}
"bands",
json_schema_extra={"linkml_meta": {"equals_string": "bands", "ifabsent": "string(bands)"}},
)
band_name: NDArray[Any, str] = Field(
...,
description="""Name of the band, e.g. theta.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
band_limits: NDArray[Shape["* num_bands, 2 low_high"], np.float32] = Field(
@ -320,7 +374,12 @@ class DecompositionSeriesBands(DynamicTable):
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.""",
json_schema_extra={
"linkml_meta": {
"array": {"dimensions": [{"alias": "num_bands"}, {"alias": "low_high", "exact_cardinality": 2}]}
"array": {
"dimensions": [
{"alias": "num_bands"},
{"alias": "low_high", "exact_cardinality": 2},
]
}
}
},
)
@ -338,13 +397,17 @@ class DecompositionSeriesBands(DynamicTable):
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: NDArray[Shape["* num_rows"], int] = Field(
...,
description="""Array of unique identifiers for the rows of this dynamic table.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}},
)
vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""")
vector_data: Optional[List[VectorData]] = Field(
None, description="""Vector columns of this dynamic table."""
)
vector_index: Optional[List[VectorIndex]] = Field(
None, description="""Indices for the vector columns of this dynamic table."""
)
@ -355,38 +418,55 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.misc", "tree_root": True}
)
name: str = Field("Units", json_schema_extra={"linkml_meta": {"ifabsent": "string(Units)"}})
spike_times_index: Named[Optional[VectorIndex]] = Field(
None,
description="""Index into the spike_times dataset.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
spike_times: Optional[UnitsSpikeTimes] = Field(
None, description="""Spike times for each unit."""
)
spike_times: Optional[UnitsSpikeTimes] = Field(None, description="""Spike times for each unit.""")
obs_intervals_index: Named[Optional[VectorIndex]] = Field(
None,
description="""Index into the obs_intervals dataset.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
obs_intervals: Optional[NDArray[Shape["* num_intervals, 2 start_end"], np.float64]] = Field(
None,
description="""Observation intervals for each unit.""",
json_schema_extra={
"linkml_meta": {
"array": {"dimensions": [{"alias": "num_intervals"}, {"alias": "start_end", "exact_cardinality": 2}]}
"array": {
"dimensions": [
{"alias": "num_intervals"},
{"alias": "start_end", "exact_cardinality": 2},
]
}
}
},
)
electrodes_index: Named[Optional[VectorIndex]] = Field(
None,
description="""Index into electrodes.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
electrodes: Named[Optional[DynamicTableRegion]] = Field(
None,
description="""Electrode that each spike unit came from, specified using a DynamicTableRegion.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
electrode_group: Optional[List[ElectrodeGroup]] = Field(
None, description="""Electrode group that each spike unit came from."""
@ -407,13 +487,17 @@ class Units(DynamicTable):
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: NDArray[Shape["* num_rows"], int] = Field(
...,
description="""Array of unique identifiers for the rows of this dynamic table.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}},
)
vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""")
vector_data: Optional[List[VectorData]] = Field(
None, description="""Vector columns of this dynamic table."""
)
vector_index: Optional[List[VectorIndex]] = Field(
None, description="""Indices for the vector columns of this dynamic table."""
)
@ -428,13 +512,17 @@ class UnitsSpikeTimes(VectorData):
name: Literal["spike_times"] = Field(
"spike_times",
json_schema_extra={"linkml_meta": {"equals_string": "spike_times", "ifabsent": "string(spike_times)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "spike_times", "ifabsent": "string(spike_times)"}
},
)
resolution: Optional[np.float64] = 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."""
)
# Model rebuild

View file

@ -8,7 +8,12 @@ from typing import Any, ClassVar, List, Literal, Dict, Optional, Union
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator
import numpy as np
from numpydantic import NDArray, Shape
from ...core.v2_2_0.core_nwb_base import TimeSeries, TimeSeriesStartingTime, TimeSeriesSync, NWBContainer
from ...core.v2_2_0.core_nwb_base import (
TimeSeries,
TimeSeriesStartingTime,
TimeSeriesSync,
NWBContainer,
)
metamodel_version = "None"
version = "2.2.0"
@ -23,7 +28,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -79,7 +86,9 @@ class OptogeneticSeries(TimeSeries):
An optogenetic stimulus.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ogen", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ogen", "tree_root": True}
)
name: str = Field(...)
data: NDArray[Shape["* num_times"], np.number] = Field(
@ -109,7 +118,9 @@ class OptogeneticSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -122,7 +133,9 @@ class OptogeneticStimulusSite(NWBContainer):
A site of optogenetic stimulation.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ogen", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ogen", "tree_root": True}
)
name: str = Field(...)
description: str = Field(..., description="""Description of stimulation site.""")

View file

@ -18,7 +18,12 @@ from ...core.v2_2_0.core_nwb_base import (
ProcessingModule,
Images,
)
from ...hdmf_common.v1_1_0.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData
from ...hdmf_common.v1_1_0.hdmf_common_sparse import (
CSRMatrix,
CSRMatrixIndices,
CSRMatrixIndptr,
CSRMatrixData,
)
from ...hdmf_common.v1_1_0.hdmf_common_table import (
Data,
Index,
@ -40,7 +45,15 @@ from ...core.v2_2_0.core_nwb_image import (
IndexSeries,
)
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator
from pydantic import (
BaseModel,
ConfigDict,
Field,
RootModel,
field_validator,
ValidationInfo,
BeforeValidator,
)
from numpydantic import NDArray, Shape
metamodel_version = "None"
@ -56,7 +69,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -118,7 +133,9 @@ class TwoPhotonSeries(ImageSeries):
Image stack recorded over time from 2-photon microscope.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
name: str = Field(...)
pmt_gain: Optional[np.float32] = Field(None, description="""Photomultiplier gain.""")
@ -127,10 +144,16 @@ class TwoPhotonSeries(ImageSeries):
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[
Union[NDArray[Shape["2 width_height"], np.float32], NDArray[Shape["3 width_height"], np.float32]]
Union[
NDArray[Shape["2 width_height"], np.float32],
NDArray[Shape["3 width_height"], np.float32],
]
] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""")
data: Optional[
Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]]
Union[
NDArray[Shape["* frame, * x, * y"], np.number],
NDArray[Shape["* frame, * x, * y, * z"], np.number],
]
] = Field(None, description="""Binary data representing images across frames.""")
dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field(
None,
@ -167,7 +190,9 @@ class TwoPhotonSeries(ImageSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -180,16 +205,21 @@ class RoiResponseSeries(TimeSeries):
ROI responses over an imaging plane. The first dimension represents time. The second dimension, if present, represents ROIs.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
name: str = Field(...)
data: Union[NDArray[Shape["* num_times"], np.number], NDArray[Shape["* num_times, * num_rois"], np.number]] = Field(
..., description="""Signals from ROIs."""
)
data: Union[
NDArray[Shape["* num_times"], np.number],
NDArray[Shape["* num_times, * num_rois"], np.number],
] = Field(..., description="""Signals from ROIs.""")
rois: Named[DynamicTableRegion] = Field(
...,
description="""DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
description: Optional[str] = Field(None, description="""Description of the time series.""")
comments: Optional[str] = Field(
@ -213,7 +243,9 @@ class RoiResponseSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -226,7 +258,9 @@ 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).
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
children: Optional[List[RoiResponseSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "RoiResponseSeries"}]}}
@ -239,7 +273,9 @@ 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).
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
children: Optional[List[RoiResponseSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "RoiResponseSeries"}]}}
@ -252,7 +288,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
children: Optional[List[DynamicTable]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "DynamicTable"}]}}
@ -265,7 +303,9 @@ class ImagingPlane(NWBContainer):
An imaging plane and its metadata.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
name: str = Field(...)
description: Optional[str] = Field(None, description="""Description of the imaging plane.""")
@ -305,14 +345,18 @@ class ImagingPlaneManifold(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys"})
name: Literal["manifold"] = Field(
"manifold", json_schema_extra={"linkml_meta": {"equals_string": "manifold", "ifabsent": "string(manifold)"}}
"manifold",
json_schema_extra={
"linkml_meta": {"equals_string": "manifold", "ifabsent": "string(manifold)"}
},
)
conversion: Optional[np.float32] = 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'."""
None,
description="""Base unit of measurement for working with the data. The default value is 'meters'.""",
)
array: Optional[
Union[
@ -331,7 +375,9 @@ class ImagingPlaneOriginCoords(ConfiguredBaseModel):
name: Literal["origin_coords"] = Field(
"origin_coords",
json_schema_extra={"linkml_meta": {"equals_string": "origin_coords", "ifabsent": "string(origin_coords)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "origin_coords", "ifabsent": "string(origin_coords)"}
},
)
unit: Optional[str] = Field(
None, description="""Measurement units for origin_coords. The default value is 'meters'."""
@ -341,7 +387,10 @@ class ImagingPlaneOriginCoords(ConfiguredBaseModel):
json_schema_extra={
"linkml_meta": {
"array": {
"dimensions": [{"alias": "x_y", "exact_cardinality": 2}, {"alias": "x_y_z", "exact_cardinality": 3}]
"dimensions": [
{"alias": "x_y", "exact_cardinality": 2},
{"alias": "x_y_z", "exact_cardinality": 3},
]
}
}
},
@ -357,7 +406,9 @@ class ImagingPlaneGridSpacing(ConfiguredBaseModel):
name: Literal["grid_spacing"] = Field(
"grid_spacing",
json_schema_extra={"linkml_meta": {"equals_string": "grid_spacing", "ifabsent": "string(grid_spacing)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "grid_spacing", "ifabsent": "string(grid_spacing)"}
},
)
unit: Optional[str] = Field(
None, description="""Measurement units for grid_spacing. The default value is 'meters'."""
@ -367,7 +418,10 @@ class ImagingPlaneGridSpacing(ConfiguredBaseModel):
json_schema_extra={
"linkml_meta": {
"array": {
"dimensions": [{"alias": "x_y", "exact_cardinality": 2}, {"alias": "x_y_z", "exact_cardinality": 3}]
"dimensions": [
{"alias": "x_y", "exact_cardinality": 2},
{"alias": "x_y_z", "exact_cardinality": 3},
]
}
}
},
@ -383,7 +437,9 @@ class OpticalChannel(NWBContainer):
name: str = Field(...)
description: str = Field(..., description="""Description or other notes about the channel.""")
emission_lambda: np.float32 = Field(..., description="""Emission wavelength for channel, in nm.""")
emission_lambda: np.float32 = Field(
..., description="""Emission wavelength for channel, in nm."""
)
class MotionCorrection(NWBDataInterface):
@ -391,7 +447,9 @@ 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).
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
children: Optional[List[NWBDataInterface]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}]}}

View file

@ -9,7 +9,15 @@ from ...core.v2_2_0.core_nwb_image import GrayscaleImage
from ...core.v2_2_0.core_nwb_base import NWBData, NWBDataInterface
from numpydantic import NDArray, Shape
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator
from pydantic import (
BaseModel,
ConfigDict,
Field,
RootModel,
field_validator,
ValidationInfo,
BeforeValidator,
)
metamodel_version = "None"
version = "2.2.0"
@ -24,7 +32,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -80,17 +90,23 @@ class RetinotopyMap(NWBData):
Abstract two-dimensional map of responses. Array structure: [num_rows][num_columns]
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.retinotopy", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.retinotopy", "tree_root": True}
)
name: str = Field(...)
dimension: Optional[np.int32] = Field(
None,
description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""",
)
field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""")
field_of_view: Optional[np.float32] = Field(
None, description="""Size of viewing area, in meters."""
)
array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field(
None,
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}
},
)
@ -99,19 +115,27 @@ class AxisMap(RetinotopyMap):
Abstract two-dimensional map of responses to stimuli along a single response axis (e.g. eccentricity)
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.retinotopy", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.retinotopy", "tree_root": True}
)
name: str = Field(...)
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)."""
)
array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field(
None,
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}
},
)
dimension: Optional[np.int32] = Field(
None,
description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""",
)
field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""")
field_of_view: Optional[np.float32] = Field(
None, description="""Size of viewing area, in meters."""
)
class RetinotopyImage(GrayscaleImage):
@ -119,7 +143,9 @@ class RetinotopyImage(GrayscaleImage):
Gray-scale image related to retinotopic mapping. Array structure: [num_rows][num_columns]
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.retinotopy", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.retinotopy", "tree_root": True}
)
name: str = Field(...)
bits_per_pixel: Optional[np.int32] = Field(
@ -130,8 +156,12 @@ class RetinotopyImage(GrayscaleImage):
None,
description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""",
)
field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""")
format: Optional[str] = Field(None, description="""Format of image. Right now only 'raw' is supported.""")
field_of_view: Optional[np.float32] = Field(
None, description="""Size of viewing area, in meters."""
)
format: Optional[str] = Field(
None, description="""Format of image. Right now only 'raw' is supported."""
)
resolution: Optional[np.float32] = Field(
None, description="""Pixel resolution of the image, in pixels per centimeter."""
)
@ -150,38 +180,57 @@ 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. 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).
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.retinotopy", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.retinotopy", "tree_root": True}
)
name: str = Field("ImagingRetinotopy", json_schema_extra={"linkml_meta": {"ifabsent": "string(ImagingRetinotopy)"}})
name: str = Field(
"ImagingRetinotopy",
json_schema_extra={"linkml_meta": {"ifabsent": "string(ImagingRetinotopy)"}},
)
axis_1_phase_map: Named[AxisMap] = Field(
...,
description="""Phase response to stimulus on the first measured axis.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
axis_1_power_map: Named[Optional[AxisMap]] = 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.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
axis_2_phase_map: Named[AxisMap] = Field(
...,
description="""Phase response to stimulus on the second measured axis.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
axis_2_power_map: Named[Optional[AxisMap]] = Field(
None,
description="""Power response to stimulus on the second measured axis.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
sign_map: Named[RetinotopyMap] = Field(
...,
description="""Sine of the angle between the direction of the gradient in axis_1 and axis_2.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
axis_descriptions: NDArray[Shape["2 num_axes"], str] = Field(
...,
description="""Two-element array describing the contents of the two response axis fields. Description should be something like ['altitude', 'azimuth'] or '['radius', 'theta'].""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_axes", "exact_cardinality": 2}]}}},
json_schema_extra={
"linkml_meta": {
"array": {"dimensions": [{"alias": "num_axes", "exact_cardinality": 2}]}
}
},
)
focal_depth_image: ImagingRetinotopyFocalDepthImage = Field(
...,
@ -190,7 +239,9 @@ class ImagingRetinotopy(NWBDataInterface):
vasculature_image: Named[RetinotopyImage] = Field(
...,
description="""Gray-scale anatomical image of cortical surface. Array structure: [rows][columns]""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
@ -204,10 +255,15 @@ class ImagingRetinotopyFocalDepthImage(RetinotopyImage):
name: Literal["focal_depth_image"] = Field(
"focal_depth_image",
json_schema_extra={
"linkml_meta": {"equals_string": "focal_depth_image", "ifabsent": "string(focal_depth_image)"}
"linkml_meta": {
"equals_string": "focal_depth_image",
"ifabsent": "string(focal_depth_image)",
}
},
)
focal_depth: Optional[np.float32] = Field(None, description="""Focal depth offset, in meters.""")
focal_depth: Optional[np.float32] = Field(
None, description="""Focal depth offset, in meters."""
)
bits_per_pixel: Optional[np.int32] = Field(
None,
description="""Number of bits used to represent each value. This is necessary to determine maximum (white) pixel value.""",
@ -216,8 +272,12 @@ class ImagingRetinotopyFocalDepthImage(RetinotopyImage):
None,
description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""",
)
field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""")
format: Optional[str] = Field(None, description="""Format of image. Right now only 'raw' is supported.""")
field_of_view: Optional[np.float32] = Field(
None, description="""Size of viewing area, in meters."""
)
format: Optional[str] = Field(
None, description="""Format of image. Right now only 'raw' is supported."""
)
resolution: Optional[np.float32] = Field(
None, description="""Pixel resolution of the image, in pixels per centimeter."""
)

View file

@ -7,7 +7,12 @@ import sys
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator
import numpy as np
from ...hdmf_common.v1_1_0.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData
from ...hdmf_common.v1_1_0.hdmf_common_sparse import (
CSRMatrix,
CSRMatrixIndices,
CSRMatrixIndptr,
CSRMatrixData,
)
from ...hdmf_common.v1_1_0.hdmf_common_table import (
Data,
Index,
@ -144,7 +149,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")

View file

@ -23,7 +23,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -79,7 +81,9 @@ class NWBData(Data):
An abstract data type for a dataset.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
name: str = Field(...)
@ -89,7 +93,9 @@ 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)).
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
name: str = Field(...)
resolution: Optional[np.float32] = Field(
@ -110,7 +116,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
name: str = Field(...)
@ -120,7 +128,9 @@ class NWBDataInterface(NWBContainer):
An abstract data type for a generic container storing collections of data, as opposed to metadata.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
name: str = Field(...)
@ -130,7 +140,9 @@ class TimeSeries(NWBDataInterface):
General purpose time series.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
name: str = Field(...)
description: Optional[str] = Field(None, description="""Description of the time series.""")
@ -159,7 +171,9 @@ class TimeSeries(NWBDataInterface):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -175,7 +189,8 @@ class TimeSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
conversion: Optional[np.float32] = Field(
None,
@ -208,10 +223,14 @@ class TimeSeriesStartingTime(ConfiguredBaseModel):
name: Literal["starting_time"] = Field(
"starting_time",
json_schema_extra={"linkml_meta": {"equals_string": "starting_time", "ifabsent": "string(starting_time)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "starting_time", "ifabsent": "string(starting_time)"}
},
)
rate: Optional[np.float32] = 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'."""
)
value: np.float64 = Field(...)
@ -223,7 +242,8 @@ class TimeSeriesSync(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base"})
name: Literal["sync"] = Field(
"sync", json_schema_extra={"linkml_meta": {"equals_string": "sync", "ifabsent": "string(sync)"}}
"sync",
json_schema_extra={"linkml_meta": {"equals_string": "sync", "ifabsent": "string(sync)"}},
)
@ -232,10 +252,15 @@ class ProcessingModule(NWBContainer):
A collection of processed data.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
children: Optional[List[Union[DynamicTable, NWBDataInterface]]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]}}
None,
json_schema_extra={
"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]}
},
)
name: str = Field(...)
@ -245,10 +270,14 @@ class Images(NWBDataInterface):
A collection of images.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
name: str = Field("Images", json_schema_extra={"linkml_meta": {"ifabsent": "string(Images)"}})
description: Optional[str] = Field(None, description="""Description of this collection of images.""")
description: Optional[str] = Field(
None, description="""Description of this collection of images."""
)
image: List[Image] = Field(..., description="""Images stored in this collection.""")

View file

@ -44,7 +44,12 @@ from ...core.v2_2_1.core_nwb_base import (
ProcessingModule,
Images,
)
from ...hdmf_common.v1_1_2.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData
from ...hdmf_common.v1_1_2.hdmf_common_sparse import (
CSRMatrix,
CSRMatrixIndices,
CSRMatrixIndptr,
CSRMatrixData,
)
from ...hdmf_common.v1_1_2.hdmf_common_table import (
Data,
Index,
@ -70,7 +75,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -126,11 +133,14 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
name: str = Field(...)
data: SpatialSeriesData = Field(
..., description="""1-D or 2-D array storing position or direction relative to some reference frame."""
...,
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."""
@ -157,7 +167,9 @@ class SpatialSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -173,14 +185,18 @@ class SpatialSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
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'.""",
)
array: Optional[
Union[NDArray[Shape["* num_times"], np.number], NDArray[Shape["* num_times, * num_features"], np.number]]
Union[
NDArray[Shape["* num_times"], np.number],
NDArray[Shape["* num_times, * num_features"], np.number],
]
] = Field(None)
@ -189,7 +205,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
children: Optional[List[IntervalSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "IntervalSeries"}]}}
@ -202,7 +220,9 @@ class BehavioralEvents(NWBDataInterface):
TimeSeries for storing behavioral events. See description of <a href=\"#BehavioralEpochs\">BehavioralEpochs</a> for more details.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
children: Optional[List[TimeSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}}
@ -215,7 +235,9 @@ class BehavioralTimeSeries(NWBDataInterface):
TimeSeries for storing Behavoioral time series data. See description of <a href=\"#BehavioralEpochs\">BehavioralEpochs</a> for more details.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
children: Optional[List[TimeSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}}
@ -228,7 +250,9 @@ class PupilTracking(NWBDataInterface):
Eye-tracking data, representing pupil size.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
children: Optional[List[TimeSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}}
@ -241,7 +265,9 @@ class EyeTracking(NWBDataInterface):
Eye-tracking data, representing direction of gaze.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
children: Optional[List[SpatialSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}}
@ -254,7 +280,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
children: Optional[List[SpatialSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}}
@ -267,7 +295,9 @@ class Position(NWBDataInterface):
Position data, whether along the x, x/y or x/y/z axis.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
children: Optional[List[SpatialSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}}

View file

@ -22,7 +22,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -62,14 +64,18 @@ class Device(NWBContainer):
Metadata about a data acquisition device, e.g., recording system, electrode, microscope.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.device", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.device", "tree_root": True}
)
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.""",
)
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."""
)
# Model rebuild

View file

@ -7,7 +7,15 @@ import sys
import numpy as np
from ...hdmf_common.v1_1_2.hdmf_common_table import DynamicTableRegion
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator
from pydantic import (
BaseModel,
ConfigDict,
Field,
RootModel,
field_validator,
ValidationInfo,
BeforeValidator,
)
from ...core.v2_2_1.core_nwb_base import (
TimeSeries,
TimeSeriesStartingTime,
@ -30,7 +38,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -75,7 +85,12 @@ linkml_meta = LinkMLMeta(
},
"default_prefix": "core.nwb.ecephys/",
"id": "core.nwb.ecephys",
"imports": ["core.nwb.base", "../../hdmf_common/v1_1_2/namespace", "core.nwb.device", "core.nwb.language"],
"imports": [
"core.nwb.base",
"../../hdmf_common/v1_1_2/namespace",
"core.nwb.device",
"core.nwb.language",
],
"name": "core.nwb.ecephys",
}
)
@ -86,7 +101,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
name: str = Field(...)
data: Union[
@ -97,7 +114,9 @@ class ElectricalSeries(TimeSeries):
electrodes: Named[DynamicTableRegion] = Field(
...,
description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field(
None,
@ -126,7 +145,9 @@ class ElectricalSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -139,7 +160,9 @@ 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).
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
name: str = Field(...)
data: Union[
@ -154,7 +177,9 @@ class SpikeEventSeries(ElectricalSeries):
electrodes: Named[DynamicTableRegion] = Field(
...,
description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field(
None,
@ -178,7 +203,9 @@ class SpikeEventSeries(ElectricalSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -191,9 +218,14 @@ class FeatureExtraction(NWBDataInterface):
Features, such as PC1 and PC2, that are extracted from signals stored in a SpikeEventSeries or other source.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
name: str = Field("FeatureExtraction", json_schema_extra={"linkml_meta": {"ifabsent": "string(FeatureExtraction)"}})
name: str = Field(
"FeatureExtraction",
json_schema_extra={"linkml_meta": {"ifabsent": "string(FeatureExtraction)"}},
)
description: NDArray[Shape["* num_features"], str] = Field(
...,
description="""Description of features (eg, ''PC1'') for each of the extracted features.""",
@ -204,7 +236,13 @@ class FeatureExtraction(NWBDataInterface):
description="""Multi-dimensional array of features extracted from each event.""",
json_schema_extra={
"linkml_meta": {
"array": {"dimensions": [{"alias": "num_events"}, {"alias": "num_channels"}, {"alias": "num_features"}]}
"array": {
"dimensions": [
{"alias": "num_events"},
{"alias": "num_channels"},
{"alias": "num_features"},
]
}
}
},
)
@ -216,7 +254,9 @@ class FeatureExtraction(NWBDataInterface):
electrodes: Named[DynamicTableRegion] = Field(
...,
description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
@ -225,9 +265,13 @@ class EventDetection(NWBDataInterface):
Detected spike events from voltage trace(s).
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
name: str = Field("EventDetection", json_schema_extra={"linkml_meta": {"ifabsent": "string(EventDetection)"}})
name: str = Field(
"EventDetection", json_schema_extra={"linkml_meta": {"ifabsent": "string(EventDetection)"}}
)
detection_method: str = Field(
...,
description="""Description of how events were detected, such as voltage threshold, or dV/dT threshold, as well as relevant values.""",
@ -249,7 +293,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
children: Optional[List[SpikeEventSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpikeEventSeries"}]}}
@ -262,7 +308,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
children: Optional[List[ElectricalSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "ElectricalSeries"}]}}
@ -275,7 +323,9 @@ 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 description or comments field.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
children: Optional[List[ElectricalSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "ElectricalSeries"}]}}
@ -288,7 +338,9 @@ class ElectrodeGroup(NWBContainer):
A physical grouping of electrodes, e.g. a shank of an array.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
name: str = Field(...)
description: Optional[str] = Field(None, description="""Description of this electrode group.""")
@ -309,7 +361,10 @@ class ElectrodeGroupPosition(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys"})
name: Literal["position"] = Field(
"position", json_schema_extra={"linkml_meta": {"equals_string": "position", "ifabsent": "string(position)"}}
"position",
json_schema_extra={
"linkml_meta": {"equals_string": "position", "ifabsent": "string(position)"}
},
)
x: Optional[np.float32] = Field(None, description="""x coordinate""")
y: Optional[np.float32] = Field(None, description="""y coordinate""")
@ -321,22 +376,33 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
name: str = Field("ClusterWaveforms", json_schema_extra={"linkml_meta": {"ifabsent": "string(ClusterWaveforms)"}})
waveform_filtering: str = Field(..., description="""Filtering applied to data before generating mean/sd""")
name: str = Field(
"ClusterWaveforms",
json_schema_extra={"linkml_meta": {"ifabsent": "string(ClusterWaveforms)"}},
)
waveform_filtering: str = Field(
..., description="""Filtering applied to data before generating mean/sd"""
)
waveform_mean: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = 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)""",
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]}}
"linkml_meta": {
"array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]}
}
},
)
waveform_sd: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = Field(
...,
description="""Stdev of waveforms for each cluster, using the same indices as in mean""",
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]}}
"linkml_meta": {
"array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]}
}
},
)
@ -346,9 +412,13 @@ class Clustering(NWBDataInterface):
DEPRECATED Clustered spike data, whether from automatic clustering tools (e.g., klustakwik) or as a result of manual sorting.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
name: str = Field("Clustering", json_schema_extra={"linkml_meta": {"ifabsent": "string(Clustering)"}})
name: str = Field(
"Clustering", json_schema_extra={"linkml_meta": {"ifabsent": "string(Clustering)"}}
)
description: str = Field(
...,
description="""Description of clusters or clustering, (e.g. cluster 0 is noise, clusters curated using Klusters, etc)""",

View file

@ -6,7 +6,15 @@ import re
import sys
import numpy as np
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator
from pydantic import (
BaseModel,
ConfigDict,
Field,
RootModel,
field_validator,
ValidationInfo,
BeforeValidator,
)
from numpydantic import NDArray, Shape
from ...hdmf_common.v1_1_2.hdmf_common_table import DynamicTable, VectorIndex, VectorData
from ...core.v2_2_1.core_nwb_base import TimeSeries
@ -24,7 +32,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -80,52 +90,70 @@ class TimeIntervals(DynamicTable):
A container for aggregating epoch data and the TimeSeries that each epoch applies to.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.epoch", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.epoch", "tree_root": True}
)
name: str = Field(...)
start_time: NDArray[Any, np.float32] = Field(
...,
description="""Start time of epoch, in seconds.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
stop_time: NDArray[Any, np.float32] = Field(
...,
description="""Stop time of epoch, in seconds.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
tags: Optional[NDArray[Any, str]] = Field(
None,
description="""User-defined tags that identify or categorize events.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
tags_index: Named[Optional[VectorIndex]] = Field(
None,
description="""Index for tags.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
timeseries: Optional[TimeIntervalsTimeseries] = Field(
None, description="""An index into a TimeSeries object."""
)
timeseries: Optional[TimeIntervalsTimeseries] = Field(None, description="""An index into a TimeSeries object.""")
timeseries_index: Named[Optional[VectorIndex]] = Field(
None,
description="""Index for timeseries.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
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: NDArray[Shape["* num_rows"], int] = Field(
...,
description="""Array of unique identifiers for the rows of this dynamic table.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}},
)
vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""")
vector_data: Optional[List[VectorData]] = Field(
None, description="""Vector columns of this dynamic table."""
)
vector_index: Optional[List[VectorIndex]] = Field(
None, description="""Indices for the vector columns of this dynamic table."""
)
@ -140,17 +168,24 @@ class TimeIntervalsTimeseries(VectorData):
name: Literal["timeseries"] = Field(
"timeseries",
json_schema_extra={"linkml_meta": {"equals_string": "timeseries", "ifabsent": "string(timeseries)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "timeseries", "ifabsent": "string(timeseries)"}
},
)
idx_start: Optional[np.int32] = Field(
None,
description="""Start index into the TimeSeries 'data' and 'timestamp' datasets of the referenced TimeSeries. The first dimension of those arrays is always time.""",
)
count: Optional[np.int32] = Field(
None, description="""Number of data samples available in this time series, during this epoch."""
None,
description="""Number of data samples available in this time series, during this epoch.""",
)
timeseries: Optional[TimeSeries] = Field(
None, description="""the TimeSeries that this index applies to."""
)
description: Optional[str] = Field(
None, description="""Description of what these vectors represent."""
)
timeseries: Optional[TimeSeries] = Field(None, description="""the TimeSeries that this index applies to.""")
description: Optional[str] = Field(None, description="""Description of what these vectors represent.""")
# Model rebuild

View file

@ -44,7 +44,12 @@ from ...core.v2_2_1.core_nwb_base import (
ProcessingModule,
Images,
)
from ...hdmf_common.v1_1_2.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData
from ...hdmf_common.v1_1_2.hdmf_common_sparse import (
CSRMatrix,
CSRMatrixIndices,
CSRMatrixIndptr,
CSRMatrixData,
)
from ...hdmf_common.v1_1_2.hdmf_common_table import (
Data,
Index,
@ -117,7 +122,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -184,10 +191,13 @@ class NWBFile(NWBContainer):
An NWB:N file storing cellular-based neurophysiology data from a single experimental session.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.file", "tree_root": True}
)
name: Literal["root"] = Field(
"root", json_schema_extra={"linkml_meta": {"equals_string": "root", "ifabsent": "string(root)"}}
"root",
json_schema_extra={"linkml_meta": {"equals_string": "root", "ifabsent": "string(root)"}},
)
nwb_version: Optional[str] = Field(
None,
@ -196,7 +206,9 @@ class NWBFile(NWBContainer):
file_create_date: NDArray[Shape["* num_modifications"], np.datetime64] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_modifications"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_modifications"}]}}
},
)
identifier: str = Field(
...,
@ -216,17 +228,23 @@ class NWBFile(NWBContainer):
acquisition: Optional[List[Union[DynamicTable, NWBDataInterface]]] = Field(
None,
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.""",
json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]}},
json_schema_extra={
"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]}
},
)
analysis: Optional[List[Union[DynamicTable, NWBContainer]]] = Field(
None,
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.""",
json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]}},
json_schema_extra={
"linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]}
},
)
scratch: Optional[List[Union[DynamicTable, NWBContainer]]] = 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.""",
json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]}},
json_schema_extra={
"linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]}
},
)
processing: Optional[List[ProcessingModule]] = Field(
None,
@ -266,7 +284,10 @@ class NWBFileStimulus(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file"})
name: Literal["stimulus"] = Field(
"stimulus", json_schema_extra={"linkml_meta": {"equals_string": "stimulus", "ifabsent": "string(stimulus)"}}
"stimulus",
json_schema_extra={
"linkml_meta": {"equals_string": "stimulus", "ifabsent": "string(stimulus)"}
},
)
presentation: Optional[List[TimeSeries]] = Field(
None,
@ -288,16 +309,27 @@ class NWBFileGeneral(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file"})
name: Literal["general"] = Field(
"general", json_schema_extra={"linkml_meta": {"equals_string": "general", "ifabsent": "string(general)"}}
"general",
json_schema_extra={
"linkml_meta": {"equals_string": "general", "ifabsent": "string(general)"}
},
)
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."""
)
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.""")
experimenter: Optional[NDArray[Shape["* num_experimenters"], str]] = Field(
None,
description="""Name of person(s) who performed the experiment. Can also specify roles of different people involved.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_experimenters"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_experimenters"}]}}
},
)
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[NDArray[Shape["* num_keywords"], str]] = Field(
None,
description="""Terms to search over.""",
@ -310,12 +342,15 @@ class NWBFileGeneral(ConfiguredBaseModel):
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."""
None,
description="""Experimental protocol, if applicable. e.g., include IACUC protocol number.""",
)
related_publications: Optional[NDArray[Shape["* num_publications"], str]] = Field(
None,
description="""Publication information. PMID, DOI, URL, etc.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_publications"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_publications"}]}}
},
)
session_id: Optional[str] = Field(None, description="""Lab-specific ID for the session.""")
slices: Optional[str] = Field(
@ -323,7 +358,8 @@ class NWBFileGeneral(ConfiguredBaseModel):
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."""
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."""
@ -346,7 +382,8 @@ class NWBFileGeneral(ConfiguredBaseModel):
json_schema_extra={"linkml_meta": {"any_of": [{"range": "Device"}]}},
)
subject: Optional[Subject] = Field(
None, description="""Information about the animal or person from which the data was measured."""
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."""
@ -375,7 +412,9 @@ class NWBFileGeneralSourceScript(ConfiguredBaseModel):
name: Literal["source_script"] = Field(
"source_script",
json_schema_extra={"linkml_meta": {"equals_string": "source_script", "ifabsent": "string(source_script)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "source_script", "ifabsent": "string(source_script)"}
},
)
file_name: Optional[str] = Field(None, description="""Name of script file.""")
value: str = Field(...)
@ -389,23 +428,33 @@ class Subject(NWBContainer):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file"})
name: Literal["subject"] = Field(
"subject", json_schema_extra={"linkml_meta": {"equals_string": "subject", "ifabsent": "string(subject)"}}
"subject",
json_schema_extra={
"linkml_meta": {"equals_string": "subject", "ifabsent": "string(subject)"}
},
)
age: Optional[str] = Field(
None, description="""Age of subject. Can be supplied instead of 'date_of_birth'."""
)
age: Optional[str] = Field(None, description="""Age of subject. Can be supplied instead of 'date_of_birth'.""")
date_of_birth: Optional[np.datetime64] = 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)."""
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.""")
species: Optional[str] = Field(None, description="""Species of subject.""")
subject_id: Optional[str] = Field(
None, description="""ID of animal/person used/participating in experiment (lab convention)."""
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."""
None,
description="""Weight at time of experiment, at time of surgery and at other important times.""",
)
@ -419,10 +468,15 @@ class NWBFileGeneralExtracellularEphys(ConfiguredBaseModel):
name: Literal["extracellular_ephys"] = Field(
"extracellular_ephys",
json_schema_extra={
"linkml_meta": {"equals_string": "extracellular_ephys", "ifabsent": "string(extracellular_ephys)"}
"linkml_meta": {
"equals_string": "extracellular_ephys",
"ifabsent": "string(extracellular_ephys)",
}
},
)
electrode_group: Optional[List[ElectrodeGroup]] = Field(None, description="""Physical group of electrodes.""")
electrode_group: Optional[List[ElectrodeGroup]] = Field(
None, description="""Physical group of electrodes."""
)
electrodes: Optional[NWBFileGeneralExtracellularEphysElectrodes] = Field(
None, description="""A table of all electrodes (i.e. channels) used for recording."""
)
@ -437,48 +491,62 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable):
name: Literal["electrodes"] = Field(
"electrodes",
json_schema_extra={"linkml_meta": {"equals_string": "electrodes", "ifabsent": "string(electrodes)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "electrodes", "ifabsent": "string(electrodes)"}
},
)
x: NDArray[Any, np.float32] = Field(
...,
description="""x coordinate of the channel location in the brain (+x is posterior).""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
y: NDArray[Any, np.float32] = Field(
...,
description="""y coordinate of the channel location in the brain (+y is inferior).""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
z: NDArray[Any, np.float32] = Field(
...,
description="""z coordinate of the channel location in the brain (+z is right).""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
imp: NDArray[Any, np.float32] = Field(
...,
description="""Impedance of the channel.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
location: NDArray[Any, str] = Field(
...,
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.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
filtering: NDArray[Any, np.float32] = Field(
...,
description="""Description of hardware filtering.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
group: List[ElectrodeGroup] = Field(
@ -488,48 +556,62 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable):
...,
description="""Name of the ElectrodeGroup this electrode is a part of.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
rel_x: Optional[NDArray[Any, np.float32]] = Field(
None,
description="""x coordinate in electrode group""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
rel_y: Optional[NDArray[Any, np.float32]] = Field(
None,
description="""y coordinate in electrode group""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
rel_z: Optional[NDArray[Any, np.float32]] = Field(
None,
description="""z coordinate in electrode group""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
reference: Optional[NDArray[Any, str]] = Field(
None,
description="""Description of the reference used for this electrode.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
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: NDArray[Shape["* num_rows"], int] = Field(
...,
description="""Array of unique identifiers for the rows of this dynamic table.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}},
)
vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""")
vector_data: Optional[List[VectorData]] = Field(
None, description="""Vector columns of this dynamic table."""
)
vector_index: Optional[List[VectorIndex]] = Field(
None, description="""Indices for the vector columns of this dynamic table."""
)
@ -545,7 +627,10 @@ class NWBFileGeneralIntracellularEphys(ConfiguredBaseModel):
name: Literal["intracellular_ephys"] = Field(
"intracellular_ephys",
json_schema_extra={
"linkml_meta": {"equals_string": "intracellular_ephys", "ifabsent": "string(intracellular_ephys)"}
"linkml_meta": {
"equals_string": "intracellular_ephys",
"ifabsent": "string(intracellular_ephys)",
}
},
)
filtering: Optional[str] = Field(

View file

@ -5,7 +5,12 @@ from enum import Enum
import re
import sys
import numpy as np
from ...hdmf_common.v1_1_2.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData
from ...hdmf_common.v1_1_2.hdmf_common_sparse import (
CSRMatrix,
CSRMatrixIndices,
CSRMatrixIndptr,
CSRMatrixData,
)
from ...hdmf_common.v1_1_2.hdmf_common_table import (
Data,
Index,
@ -30,7 +35,15 @@ from ...core.v2_2_1.core_nwb_base import (
Images,
)
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator
from pydantic import (
BaseModel,
ConfigDict,
Field,
RootModel,
field_validator,
ValidationInfo,
BeforeValidator,
)
from numpydantic import NDArray, Shape
metamodel_version = "None"
@ -46,7 +59,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -91,7 +106,12 @@ linkml_meta = LinkMLMeta(
},
"default_prefix": "core.nwb.icephys/",
"id": "core.nwb.icephys",
"imports": ["core.nwb.base", "core.nwb.device", "../../hdmf_common/v1_1_2/namespace", "core.nwb.language"],
"imports": [
"core.nwb.base",
"core.nwb.device",
"../../hdmf_common/v1_1_2/namespace",
"core.nwb.language",
],
"name": "core.nwb.icephys",
}
)
@ -102,7 +122,9 @@ class PatchClampSeries(TimeSeries):
An abstract base class for patch-clamp data - stimulus or response, current or voltage.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
stimulus_description: Optional[str] = Field(
@ -113,7 +135,8 @@ class PatchClampSeries(TimeSeries):
)
data: PatchClampSeriesData = Field(..., description="""Recorded voltage or current.""")
gain: Optional[np.float32] = Field(
None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp)."""
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.""")
comments: Optional[str] = Field(
@ -137,7 +160,9 @@ class PatchClampSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -153,7 +178,8 @@ class PatchClampSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
unit: Optional[str] = Field(
None,
@ -169,13 +195,17 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
data: CurrentClampSeriesData = Field(..., description="""Recorded voltage.""")
bias_current: Optional[np.float32] = Field(None, description="""Bias current, in amps.""")
bridge_balance: Optional[np.float32] = Field(None, description="""Bridge balance, in ohms.""")
capacitance_compensation: Optional[np.float32] = Field(None, description="""Capacitance compensation, in farads.""")
capacitance_compensation: Optional[np.float32] = Field(
None, description="""Capacitance compensation, in farads."""
)
stimulus_description: Optional[str] = Field(
None, description="""Protocol/stimulus name for this patch-clamp dataset."""
)
@ -183,7 +213,8 @@ class CurrentClampSeries(PatchClampSeries):
None, description="""Sweep number, allows to group different PatchClampSeries together."""
)
gain: Optional[np.float32] = Field(
None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp)."""
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.""")
comments: Optional[str] = Field(
@ -207,7 +238,9 @@ class CurrentClampSeries(PatchClampSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -223,7 +256,8 @@ class CurrentClampSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
unit: Optional[str] = Field(
None,
@ -237,11 +271,15 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
bias_current: np.float32 = Field(..., description="""Bias current, in amps, fixed to 0.0.""")
bridge_balance: np.float32 = Field(..., description="""Bridge balance, in ohms, fixed to 0.0.""")
bridge_balance: np.float32 = Field(
..., description="""Bridge balance, in ohms, fixed to 0.0."""
)
capacitance_compensation: np.float32 = Field(
..., description="""Capacitance compensation, in farads, fixed to 0.0."""
)
@ -253,7 +291,8 @@ class IZeroClampSeries(CurrentClampSeries):
None, description="""Sweep number, allows to group different PatchClampSeries together."""
)
gain: Optional[np.float32] = Field(
None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp)."""
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.""")
comments: Optional[str] = Field(
@ -277,7 +316,9 @@ class IZeroClampSeries(CurrentClampSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -290,7 +331,9 @@ class CurrentClampStimulusSeries(PatchClampSeries):
Stimulus current applied during current clamp recording.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
data: CurrentClampStimulusSeriesData = Field(..., description="""Stimulus current applied.""")
@ -301,7 +344,8 @@ class CurrentClampStimulusSeries(PatchClampSeries):
None, description="""Sweep number, allows to group different PatchClampSeries together."""
)
gain: Optional[np.float32] = Field(
None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp)."""
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.""")
comments: Optional[str] = Field(
@ -325,7 +369,9 @@ class CurrentClampStimulusSeries(PatchClampSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -341,7 +387,8 @@ class CurrentClampStimulusSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
unit: Optional[str] = Field(
None,
@ -355,7 +402,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
data: VoltageClampSeriesData = Field(..., description="""Recorded current.""")
@ -377,8 +426,8 @@ class VoltageClampSeries(PatchClampSeries):
whole_cell_capacitance_comp: Optional[VoltageClampSeriesWholeCellCapacitanceComp] = Field(
None, description="""Whole cell capacitance compensation, in farads."""
)
whole_cell_series_resistance_comp: Optional[VoltageClampSeriesWholeCellSeriesResistanceComp] = Field(
None, description="""Whole cell series resistance compensation, in ohms."""
whole_cell_series_resistance_comp: Optional[VoltageClampSeriesWholeCellSeriesResistanceComp] = (
Field(None, description="""Whole cell series resistance compensation, in ohms.""")
)
stimulus_description: Optional[str] = Field(
None, description="""Protocol/stimulus name for this patch-clamp dataset."""
@ -387,7 +436,8 @@ class VoltageClampSeries(PatchClampSeries):
None, description="""Sweep number, allows to group different PatchClampSeries together."""
)
gain: Optional[np.float32] = Field(
None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp)."""
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.""")
comments: Optional[str] = Field(
@ -411,7 +461,9 @@ class VoltageClampSeries(PatchClampSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -427,7 +479,8 @@ class VoltageClampSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
unit: Optional[str] = Field(
None,
@ -446,11 +499,15 @@ class VoltageClampSeriesCapacitanceFast(ConfiguredBaseModel):
name: Literal["capacitance_fast"] = Field(
"capacitance_fast",
json_schema_extra={
"linkml_meta": {"equals_string": "capacitance_fast", "ifabsent": "string(capacitance_fast)"}
"linkml_meta": {
"equals_string": "capacitance_fast",
"ifabsent": "string(capacitance_fast)",
}
},
)
unit: Optional[str] = Field(
None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'."""
None,
description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""",
)
value: np.float32 = Field(...)
@ -465,11 +522,15 @@ class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel):
name: Literal["capacitance_slow"] = Field(
"capacitance_slow",
json_schema_extra={
"linkml_meta": {"equals_string": "capacitance_slow", "ifabsent": "string(capacitance_slow)"}
"linkml_meta": {
"equals_string": "capacitance_slow",
"ifabsent": "string(capacitance_slow)",
}
},
)
unit: Optional[str] = Field(
None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'."""
None,
description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""",
)
value: np.float32 = Field(...)
@ -491,7 +552,8 @@ class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel):
},
)
unit: Optional[str] = Field(
None, description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'."""
None,
description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'.""",
)
value: np.float32 = Field(...)
@ -513,7 +575,8 @@ class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel):
},
)
unit: Optional[str] = Field(
None, description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'."""
None,
description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'.""",
)
value: np.float32 = Field(...)
@ -535,7 +598,8 @@ class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel):
},
)
unit: Optional[str] = Field(
None, description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'."""
None,
description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'.""",
)
value: np.float32 = Field(...)
@ -557,7 +621,8 @@ class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel):
},
)
unit: Optional[str] = Field(
None, description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'."""
None,
description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'.""",
)
value: np.float32 = Field(...)
@ -579,7 +644,8 @@ class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel):
},
)
unit: Optional[str] = Field(
None, description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'."""
None,
description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'.""",
)
value: np.float32 = Field(...)
@ -589,7 +655,9 @@ class VoltageClampStimulusSeries(PatchClampSeries):
Stimulus voltage applied during a voltage clamp recording.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
data: VoltageClampStimulusSeriesData = Field(..., description="""Stimulus voltage applied.""")
@ -600,7 +668,8 @@ class VoltageClampStimulusSeries(PatchClampSeries):
None, description="""Sweep number, allows to group different PatchClampSeries together."""
)
gain: Optional[np.float32] = Field(
None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp)."""
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.""")
comments: Optional[str] = Field(
@ -624,7 +693,9 @@ class VoltageClampStimulusSeries(PatchClampSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -640,7 +711,8 @@ class VoltageClampStimulusSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
unit: Optional[str] = Field(
None,
@ -654,19 +726,27 @@ class IntracellularElectrode(NWBContainer):
An intracellular electrode and its metadata.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
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.""")
initial_access_resistance: Optional[str] = Field(None, description="""Initial access resistance.""")
initial_access_resistance: Optional[str] = Field(
None, description="""Initial access resistance."""
)
location: Optional[str] = Field(
None,
description="""Location of the electrode. 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.""",
)
resistance: Optional[str] = Field(None, description="""Electrode resistance, in ohms.""")
seal: Optional[str] = Field(None, description="""Information about seal used for recording.""")
slice: Optional[str] = Field(None, description="""Information about slice used for recording.""")
slice: Optional[str] = Field(
None, description="""Information about slice used for recording."""
)
class SweepTable(DynamicTable):
@ -674,14 +754,18 @@ class SweepTable(DynamicTable):
The table which groups different PatchClampSeries together.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
sweep_number: NDArray[Any, np.uint32] = Field(
...,
description="""Sweep number of the PatchClampSeries in that row.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
series: List[PatchClampSeries] = Field(
@ -690,19 +774,25 @@ class SweepTable(DynamicTable):
series_index: Named[VectorIndex] = Field(
...,
description="""Index for series.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
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: NDArray[Shape["* num_rows"], int] = Field(
...,
description="""Array of unique identifiers for the rows of this dynamic table.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}},
)
vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""")
vector_data: Optional[List[VectorData]] = Field(
None, description="""Vector columns of this dynamic table."""
)
vector_index: Optional[List[VectorIndex]] = Field(
None, description="""Indices for the vector columns of this dynamic table."""
)

View file

@ -19,7 +19,12 @@ from ...core.v2_2_1.core_nwb_base import (
ProcessingModule,
Images,
)
from ...hdmf_common.v1_1_2.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData
from ...hdmf_common.v1_1_2.hdmf_common_sparse import (
CSRMatrix,
CSRMatrixIndices,
CSRMatrixIndptr,
CSRMatrixData,
)
from ...hdmf_common.v1_1_2.hdmf_common_table import (
Data,
Index,
@ -45,7 +50,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -101,7 +108,9 @@ class GrayscaleImage(Image):
A grayscale image.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.image", "tree_root": True}
)
name: str = Field(...)
resolution: Optional[np.float32] = Field(
@ -122,7 +131,9 @@ class RGBImage(Image):
A color image.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.image", "tree_root": True}
)
name: str = Field(...)
resolution: Optional[np.float32] = Field(
@ -143,7 +154,9 @@ class RGBAImage(Image):
A color image with transparency.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.image", "tree_root": True}
)
name: str = Field(...)
resolution: Optional[np.float32] = Field(
@ -164,11 +177,16 @@ 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].
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.image", "tree_root": True}
)
name: str = Field(...)
data: Optional[
Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]]
Union[
NDArray[Shape["* frame, * x, * y"], np.number],
NDArray[Shape["* frame, * x, * y, * z"], np.number],
]
] = Field(None, description="""Binary data representing images across frames.""")
dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field(
None,
@ -205,7 +223,9 @@ class ImageSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -222,7 +242,9 @@ class ImageSeriesExternalFile(ConfiguredBaseModel):
name: Literal["external_file"] = Field(
"external_file",
json_schema_extra={"linkml_meta": {"equals_string": "external_file", "ifabsent": "string(external_file)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "external_file", "ifabsent": "string(external_file)"}
},
)
starting_frame: Optional[np.int32] = Field(
None,
@ -238,11 +260,16 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.image", "tree_root": True}
)
name: str = Field(...)
data: Optional[
Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]]
Union[
NDArray[Shape["* frame, * x, * y"], np.number],
NDArray[Shape["* frame, * x, * y, * z"], np.number],
]
] = Field(None, description="""Binary data representing images across frames.""")
dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field(
None,
@ -279,7 +306,9 @@ class ImageMaskSeries(ImageSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -292,19 +321,29 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.image", "tree_root": True}
)
name: str = Field(...)
distance: Optional[np.float32] = Field(None, description="""Distance from camera/monitor to target/eye.""")
distance: Optional[np.float32] = Field(
None, description="""Distance from camera/monitor to target/eye."""
)
field_of_view: Optional[
Union[NDArray[Shape["2 width_height"], np.float32], NDArray[Shape["3 width_height_depth"], np.float32]]
Union[
NDArray[Shape["2 width_height"], np.float32],
NDArray[Shape["3 width_height_depth"], np.float32],
]
] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""")
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.""",
)
data: Optional[
Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]]
Union[
NDArray[Shape["* frame, * x, * y"], np.number],
NDArray[Shape["* frame, * x, * y, * z"], np.number],
]
] = Field(None, description="""Binary data representing images across frames.""")
dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field(
None,
@ -341,7 +380,9 @@ class OpticalSeries(ImageSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -354,7 +395,9 @@ class IndexSeries(TimeSeries):
Stores indices to image frames stored in an ImageSeries. The purpose of the ImageIndexSeries is to allow a static image stack to be stored somewhere, 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 ImageSeries, and the timestamps array indicates when that image was displayed.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.image", "tree_root": True}
)
name: str = Field(...)
data: NDArray[Shape["* num_times"], np.int32] = Field(
@ -384,7 +427,9 @@ class IndexSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,

View file

@ -7,10 +7,23 @@ import sys
import numpy as np
from ...core.v2_2_1.core_nwb_base import TimeSeries, TimeSeriesStartingTime, TimeSeriesSync
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator
from pydantic import (
BaseModel,
ConfigDict,
Field,
RootModel,
field_validator,
ValidationInfo,
BeforeValidator,
)
from ...core.v2_2_1.core_nwb_ecephys import ElectrodeGroup
from numpydantic import NDArray, Shape
from ...hdmf_common.v1_1_2.hdmf_common_table import DynamicTable, VectorData, VectorIndex, DynamicTableRegion
from ...hdmf_common.v1_1_2.hdmf_common_table import (
DynamicTable,
VectorData,
VectorIndex,
DynamicTableRegion,
)
metamodel_version = "None"
version = "2.2.1"
@ -25,7 +38,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -70,7 +85,12 @@ linkml_meta = LinkMLMeta(
},
"default_prefix": "core.nwb.misc/",
"id": "core.nwb.misc",
"imports": ["core.nwb.base", "../../hdmf_common/v1_1_2/namespace", "core.nwb.ecephys", "core.nwb.language"],
"imports": [
"core.nwb.base",
"../../hdmf_common/v1_1_2/namespace",
"core.nwb.ecephys",
"core.nwb.language",
],
"name": "core.nwb.misc",
}
)
@ -81,10 +101,14 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.misc", "tree_root": True}
)
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[NDArray[Shape["* num_features"], str]] = Field(
None,
description="""Units of each feature.""",
@ -117,7 +141,9 @@ class AbstractFeatureSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -133,14 +159,18 @@ class AbstractFeatureSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
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[
Union[NDArray[Shape["* num_times"], np.number], NDArray[Shape["* num_times, * num_features"], np.number]]
Union[
NDArray[Shape["* num_times"], np.number],
NDArray[Shape["* num_times, * num_features"], np.number],
]
] = Field(None)
@ -149,7 +179,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.misc", "tree_root": True}
)
name: str = Field(...)
data: NDArray[Shape["* num_times"], str] = Field(
@ -179,7 +211,9 @@ class AnnotationSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -192,7 +226,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.misc", "tree_root": True}
)
name: str = Field(...)
data: NDArray[Shape["* num_times"], np.int8] = Field(
@ -222,7 +258,9 @@ class IntervalSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -235,10 +273,14 @@ class DecompositionSeries(TimeSeries):
Spectral analysis of a time series, e.g. of an LFP or a speech signal.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.misc", "tree_root": True}
)
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.""")
bands: DecompositionSeriesBands = Field(
...,
@ -266,7 +308,9 @@ class DecompositionSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -282,7 +326,8 @@ class DecompositionSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
unit: Optional[str] = Field(
None,
@ -292,7 +337,13 @@ class DecompositionSeriesData(ConfiguredBaseModel):
None,
json_schema_extra={
"linkml_meta": {
"array": {"dimensions": [{"alias": "num_times"}, {"alias": "num_channels"}, {"alias": "num_bands"}]}
"array": {
"dimensions": [
{"alias": "num_times"},
{"alias": "num_channels"},
{"alias": "num_bands"},
]
}
}
},
)
@ -306,13 +357,16 @@ class DecompositionSeriesBands(DynamicTable):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"})
name: Literal["bands"] = Field(
"bands", json_schema_extra={"linkml_meta": {"equals_string": "bands", "ifabsent": "string(bands)"}}
"bands",
json_schema_extra={"linkml_meta": {"equals_string": "bands", "ifabsent": "string(bands)"}},
)
band_name: NDArray[Any, str] = Field(
...,
description="""Name of the band, e.g. theta.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
band_limits: NDArray[Shape["* num_bands, 2 low_high"], np.float32] = Field(
@ -320,7 +374,12 @@ class DecompositionSeriesBands(DynamicTable):
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.""",
json_schema_extra={
"linkml_meta": {
"array": {"dimensions": [{"alias": "num_bands"}, {"alias": "low_high", "exact_cardinality": 2}]}
"array": {
"dimensions": [
{"alias": "num_bands"},
{"alias": "low_high", "exact_cardinality": 2},
]
}
}
},
)
@ -338,13 +397,17 @@ class DecompositionSeriesBands(DynamicTable):
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: NDArray[Shape["* num_rows"], int] = Field(
...,
description="""Array of unique identifiers for the rows of this dynamic table.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}},
)
vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""")
vector_data: Optional[List[VectorData]] = Field(
None, description="""Vector columns of this dynamic table."""
)
vector_index: Optional[List[VectorIndex]] = Field(
None, description="""Indices for the vector columns of this dynamic table."""
)
@ -355,38 +418,55 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.misc", "tree_root": True}
)
name: str = Field("Units", json_schema_extra={"linkml_meta": {"ifabsent": "string(Units)"}})
spike_times_index: Named[Optional[VectorIndex]] = Field(
None,
description="""Index into the spike_times dataset.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
spike_times: Optional[UnitsSpikeTimes] = Field(
None, description="""Spike times for each unit."""
)
spike_times: Optional[UnitsSpikeTimes] = Field(None, description="""Spike times for each unit.""")
obs_intervals_index: Named[Optional[VectorIndex]] = Field(
None,
description="""Index into the obs_intervals dataset.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
obs_intervals: Optional[NDArray[Shape["* num_intervals, 2 start_end"], np.float64]] = Field(
None,
description="""Observation intervals for each unit.""",
json_schema_extra={
"linkml_meta": {
"array": {"dimensions": [{"alias": "num_intervals"}, {"alias": "start_end", "exact_cardinality": 2}]}
"array": {
"dimensions": [
{"alias": "num_intervals"},
{"alias": "start_end", "exact_cardinality": 2},
]
}
}
},
)
electrodes_index: Named[Optional[VectorIndex]] = Field(
None,
description="""Index into electrodes.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
electrodes: Named[Optional[DynamicTableRegion]] = Field(
None,
description="""Electrode that each spike unit came from, specified using a DynamicTableRegion.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
electrode_group: Optional[List[ElectrodeGroup]] = Field(
None, description="""Electrode group that each spike unit came from."""
@ -407,13 +487,17 @@ class Units(DynamicTable):
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: NDArray[Shape["* num_rows"], int] = Field(
...,
description="""Array of unique identifiers for the rows of this dynamic table.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}},
)
vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""")
vector_data: Optional[List[VectorData]] = Field(
None, description="""Vector columns of this dynamic table."""
)
vector_index: Optional[List[VectorIndex]] = Field(
None, description="""Indices for the vector columns of this dynamic table."""
)
@ -428,13 +512,17 @@ class UnitsSpikeTimes(VectorData):
name: Literal["spike_times"] = Field(
"spike_times",
json_schema_extra={"linkml_meta": {"equals_string": "spike_times", "ifabsent": "string(spike_times)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "spike_times", "ifabsent": "string(spike_times)"}
},
)
resolution: Optional[np.float64] = 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."""
)
# Model rebuild

View file

@ -8,7 +8,12 @@ from typing import Any, ClassVar, List, Literal, Dict, Optional, Union
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator
import numpy as np
from numpydantic import NDArray, Shape
from ...core.v2_2_1.core_nwb_base import TimeSeries, TimeSeriesStartingTime, TimeSeriesSync, NWBContainer
from ...core.v2_2_1.core_nwb_base import (
TimeSeries,
TimeSeriesStartingTime,
TimeSeriesSync,
NWBContainer,
)
metamodel_version = "None"
version = "2.2.1"
@ -23,7 +28,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -79,7 +86,9 @@ class OptogeneticSeries(TimeSeries):
An optogenetic stimulus.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ogen", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ogen", "tree_root": True}
)
name: str = Field(...)
data: NDArray[Shape["* num_times"], np.number] = Field(
@ -109,7 +118,9 @@ class OptogeneticSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -122,7 +133,9 @@ class OptogeneticStimulusSite(NWBContainer):
A site of optogenetic stimulation.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ogen", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ogen", "tree_root": True}
)
name: str = Field(...)
description: str = Field(..., description="""Description of stimulation site.""")

View file

@ -18,7 +18,12 @@ from ...core.v2_2_1.core_nwb_base import (
ProcessingModule,
Images,
)
from ...hdmf_common.v1_1_2.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData
from ...hdmf_common.v1_1_2.hdmf_common_sparse import (
CSRMatrix,
CSRMatrixIndices,
CSRMatrixIndptr,
CSRMatrixData,
)
from ...hdmf_common.v1_1_2.hdmf_common_table import (
Data,
Index,
@ -40,7 +45,15 @@ from ...core.v2_2_1.core_nwb_image import (
IndexSeries,
)
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator
from pydantic import (
BaseModel,
ConfigDict,
Field,
RootModel,
field_validator,
ValidationInfo,
BeforeValidator,
)
from numpydantic import NDArray, Shape
metamodel_version = "None"
@ -56,7 +69,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -118,7 +133,9 @@ class TwoPhotonSeries(ImageSeries):
Image stack recorded over time from 2-photon microscope.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
name: str = Field(...)
pmt_gain: Optional[np.float32] = Field(None, description="""Photomultiplier gain.""")
@ -127,10 +144,16 @@ class TwoPhotonSeries(ImageSeries):
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[
Union[NDArray[Shape["2 width_height"], np.float32], NDArray[Shape["3 width_height"], np.float32]]
Union[
NDArray[Shape["2 width_height"], np.float32],
NDArray[Shape["3 width_height"], np.float32],
]
] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""")
data: Optional[
Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]]
Union[
NDArray[Shape["* frame, * x, * y"], np.number],
NDArray[Shape["* frame, * x, * y, * z"], np.number],
]
] = Field(None, description="""Binary data representing images across frames.""")
dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field(
None,
@ -167,7 +190,9 @@ class TwoPhotonSeries(ImageSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -180,16 +205,21 @@ class RoiResponseSeries(TimeSeries):
ROI responses over an imaging plane. The first dimension represents time. The second dimension, if present, represents ROIs.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
name: str = Field(...)
data: Union[NDArray[Shape["* num_times"], np.number], NDArray[Shape["* num_times, * num_rois"], np.number]] = Field(
..., description="""Signals from ROIs."""
)
data: Union[
NDArray[Shape["* num_times"], np.number],
NDArray[Shape["* num_times, * num_rois"], np.number],
] = Field(..., description="""Signals from ROIs.""")
rois: Named[DynamicTableRegion] = Field(
...,
description="""DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
description: Optional[str] = Field(None, description="""Description of the time series.""")
comments: Optional[str] = Field(
@ -213,7 +243,9 @@ class RoiResponseSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -226,7 +258,9 @@ 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).
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
children: Optional[List[RoiResponseSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "RoiResponseSeries"}]}}
@ -239,7 +273,9 @@ 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).
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
children: Optional[List[RoiResponseSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "RoiResponseSeries"}]}}
@ -252,7 +288,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
children: Optional[List[DynamicTable]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "DynamicTable"}]}}
@ -265,7 +303,9 @@ class ImagingPlane(NWBContainer):
An imaging plane and its metadata.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
name: str = Field(...)
description: Optional[str] = Field(None, description="""Description of the imaging plane.""")
@ -305,14 +345,18 @@ class ImagingPlaneManifold(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys"})
name: Literal["manifold"] = Field(
"manifold", json_schema_extra={"linkml_meta": {"equals_string": "manifold", "ifabsent": "string(manifold)"}}
"manifold",
json_schema_extra={
"linkml_meta": {"equals_string": "manifold", "ifabsent": "string(manifold)"}
},
)
conversion: Optional[np.float32] = 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'."""
None,
description="""Base unit of measurement for working with the data. The default value is 'meters'.""",
)
array: Optional[
Union[
@ -331,7 +375,9 @@ class ImagingPlaneOriginCoords(ConfiguredBaseModel):
name: Literal["origin_coords"] = Field(
"origin_coords",
json_schema_extra={"linkml_meta": {"equals_string": "origin_coords", "ifabsent": "string(origin_coords)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "origin_coords", "ifabsent": "string(origin_coords)"}
},
)
unit: Optional[str] = Field(
None, description="""Measurement units for origin_coords. The default value is 'meters'."""
@ -341,7 +387,10 @@ class ImagingPlaneOriginCoords(ConfiguredBaseModel):
json_schema_extra={
"linkml_meta": {
"array": {
"dimensions": [{"alias": "x_y", "exact_cardinality": 2}, {"alias": "x_y_z", "exact_cardinality": 3}]
"dimensions": [
{"alias": "x_y", "exact_cardinality": 2},
{"alias": "x_y_z", "exact_cardinality": 3},
]
}
}
},
@ -357,7 +406,9 @@ class ImagingPlaneGridSpacing(ConfiguredBaseModel):
name: Literal["grid_spacing"] = Field(
"grid_spacing",
json_schema_extra={"linkml_meta": {"equals_string": "grid_spacing", "ifabsent": "string(grid_spacing)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "grid_spacing", "ifabsent": "string(grid_spacing)"}
},
)
unit: Optional[str] = Field(
None, description="""Measurement units for grid_spacing. The default value is 'meters'."""
@ -367,7 +418,10 @@ class ImagingPlaneGridSpacing(ConfiguredBaseModel):
json_schema_extra={
"linkml_meta": {
"array": {
"dimensions": [{"alias": "x_y", "exact_cardinality": 2}, {"alias": "x_y_z", "exact_cardinality": 3}]
"dimensions": [
{"alias": "x_y", "exact_cardinality": 2},
{"alias": "x_y_z", "exact_cardinality": 3},
]
}
}
},
@ -383,7 +437,9 @@ class OpticalChannel(NWBContainer):
name: str = Field(...)
description: str = Field(..., description="""Description or other notes about the channel.""")
emission_lambda: np.float32 = Field(..., description="""Emission wavelength for channel, in nm.""")
emission_lambda: np.float32 = Field(
..., description="""Emission wavelength for channel, in nm."""
)
class MotionCorrection(NWBDataInterface):
@ -391,7 +447,9 @@ 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).
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
children: Optional[List[NWBDataInterface]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}]}}

View file

@ -9,7 +9,15 @@ from ...core.v2_2_1.core_nwb_image import GrayscaleImage
from ...core.v2_2_1.core_nwb_base import NWBData, NWBDataInterface
from numpydantic import NDArray, Shape
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator
from pydantic import (
BaseModel,
ConfigDict,
Field,
RootModel,
field_validator,
ValidationInfo,
BeforeValidator,
)
metamodel_version = "None"
version = "2.2.1"
@ -24,7 +32,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -80,17 +90,23 @@ class RetinotopyMap(NWBData):
Abstract two-dimensional map of responses. Array structure: [num_rows][num_columns]
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.retinotopy", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.retinotopy", "tree_root": True}
)
name: str = Field(...)
dimension: Optional[np.int32] = Field(
None,
description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""",
)
field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""")
field_of_view: Optional[np.float32] = Field(
None, description="""Size of viewing area, in meters."""
)
array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field(
None,
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}
},
)
@ -99,19 +115,27 @@ class AxisMap(RetinotopyMap):
Abstract two-dimensional map of responses to stimuli along a single response axis (e.g. eccentricity)
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.retinotopy", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.retinotopy", "tree_root": True}
)
name: str = Field(...)
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)."""
)
array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field(
None,
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}
},
)
dimension: Optional[np.int32] = Field(
None,
description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""",
)
field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""")
field_of_view: Optional[np.float32] = Field(
None, description="""Size of viewing area, in meters."""
)
class RetinotopyImage(GrayscaleImage):
@ -119,7 +143,9 @@ class RetinotopyImage(GrayscaleImage):
Gray-scale image related to retinotopic mapping. Array structure: [num_rows][num_columns]
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.retinotopy", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.retinotopy", "tree_root": True}
)
name: str = Field(...)
bits_per_pixel: Optional[np.int32] = Field(
@ -130,8 +156,12 @@ class RetinotopyImage(GrayscaleImage):
None,
description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""",
)
field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""")
format: Optional[str] = Field(None, description="""Format of image. Right now only 'raw' is supported.""")
field_of_view: Optional[np.float32] = Field(
None, description="""Size of viewing area, in meters."""
)
format: Optional[str] = Field(
None, description="""Format of image. Right now only 'raw' is supported."""
)
resolution: Optional[np.float32] = Field(
None, description="""Pixel resolution of the image, in pixels per centimeter."""
)
@ -150,38 +180,57 @@ 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. 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).
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.retinotopy", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.retinotopy", "tree_root": True}
)
name: str = Field("ImagingRetinotopy", json_schema_extra={"linkml_meta": {"ifabsent": "string(ImagingRetinotopy)"}})
name: str = Field(
"ImagingRetinotopy",
json_schema_extra={"linkml_meta": {"ifabsent": "string(ImagingRetinotopy)"}},
)
axis_1_phase_map: Named[AxisMap] = Field(
...,
description="""Phase response to stimulus on the first measured axis.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
axis_1_power_map: Named[Optional[AxisMap]] = 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.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
axis_2_phase_map: Named[AxisMap] = Field(
...,
description="""Phase response to stimulus on the second measured axis.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
axis_2_power_map: Named[Optional[AxisMap]] = Field(
None,
description="""Power response to stimulus on the second measured axis.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
sign_map: Named[RetinotopyMap] = Field(
...,
description="""Sine of the angle between the direction of the gradient in axis_1 and axis_2.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
axis_descriptions: NDArray[Shape["2 num_axes"], str] = Field(
...,
description="""Two-element array describing the contents of the two response axis fields. Description should be something like ['altitude', 'azimuth'] or '['radius', 'theta'].""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_axes", "exact_cardinality": 2}]}}},
json_schema_extra={
"linkml_meta": {
"array": {"dimensions": [{"alias": "num_axes", "exact_cardinality": 2}]}
}
},
)
focal_depth_image: ImagingRetinotopyFocalDepthImage = Field(
...,
@ -190,7 +239,9 @@ class ImagingRetinotopy(NWBDataInterface):
vasculature_image: Named[RetinotopyImage] = Field(
...,
description="""Gray-scale anatomical image of cortical surface. Array structure: [rows][columns]""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
@ -204,10 +255,15 @@ class ImagingRetinotopyFocalDepthImage(RetinotopyImage):
name: Literal["focal_depth_image"] = Field(
"focal_depth_image",
json_schema_extra={
"linkml_meta": {"equals_string": "focal_depth_image", "ifabsent": "string(focal_depth_image)"}
"linkml_meta": {
"equals_string": "focal_depth_image",
"ifabsent": "string(focal_depth_image)",
}
},
)
focal_depth: Optional[np.float32] = Field(None, description="""Focal depth offset, in meters.""")
focal_depth: Optional[np.float32] = Field(
None, description="""Focal depth offset, in meters."""
)
bits_per_pixel: Optional[np.int32] = Field(
None,
description="""Number of bits used to represent each value. This is necessary to determine maximum (white) pixel value.""",
@ -216,8 +272,12 @@ class ImagingRetinotopyFocalDepthImage(RetinotopyImage):
None,
description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""",
)
field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""")
format: Optional[str] = Field(None, description="""Format of image. Right now only 'raw' is supported.""")
field_of_view: Optional[np.float32] = Field(
None, description="""Size of viewing area, in meters."""
)
format: Optional[str] = Field(
None, description="""Format of image. Right now only 'raw' is supported."""
)
resolution: Optional[np.float32] = Field(
None, description="""Pixel resolution of the image, in pixels per centimeter."""
)

View file

@ -7,7 +7,12 @@ import sys
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator
import numpy as np
from ...hdmf_common.v1_1_2.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData
from ...hdmf_common.v1_1_2.hdmf_common_sparse import (
CSRMatrix,
CSRMatrixIndices,
CSRMatrixIndptr,
CSRMatrixData,
)
from ...hdmf_common.v1_1_2.hdmf_common_table import (
Data,
Index,
@ -144,7 +149,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")

View file

@ -23,7 +23,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -79,7 +81,9 @@ class NWBData(Data):
An abstract data type for a dataset.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
name: str = Field(...)
@ -89,7 +93,9 @@ 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)).
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
name: str = Field(...)
resolution: Optional[np.float32] = Field(
@ -110,7 +116,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
name: str = Field(...)
@ -120,7 +128,9 @@ class NWBDataInterface(NWBContainer):
An abstract data type for a generic container storing collections of data, as opposed to metadata.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
name: str = Field(...)
@ -130,7 +140,9 @@ class TimeSeries(NWBDataInterface):
General purpose time series.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
name: str = Field(...)
description: Optional[str] = Field(None, description="""Description of the time series.""")
@ -159,7 +171,9 @@ class TimeSeries(NWBDataInterface):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -175,7 +189,8 @@ class TimeSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
conversion: Optional[np.float32] = Field(
None,
@ -208,10 +223,14 @@ class TimeSeriesStartingTime(ConfiguredBaseModel):
name: Literal["starting_time"] = Field(
"starting_time",
json_schema_extra={"linkml_meta": {"equals_string": "starting_time", "ifabsent": "string(starting_time)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "starting_time", "ifabsent": "string(starting_time)"}
},
)
rate: Optional[np.float32] = 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'."""
)
value: np.float64 = Field(...)
@ -223,7 +242,8 @@ class TimeSeriesSync(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base"})
name: Literal["sync"] = Field(
"sync", json_schema_extra={"linkml_meta": {"equals_string": "sync", "ifabsent": "string(sync)"}}
"sync",
json_schema_extra={"linkml_meta": {"equals_string": "sync", "ifabsent": "string(sync)"}},
)
@ -232,10 +252,15 @@ class ProcessingModule(NWBContainer):
A collection of processed data.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
children: Optional[List[Union[DynamicTable, NWBDataInterface]]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]}}
None,
json_schema_extra={
"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]}
},
)
name: str = Field(...)
@ -245,10 +270,14 @@ class Images(NWBDataInterface):
A collection of images.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
name: str = Field("Images", json_schema_extra={"linkml_meta": {"ifabsent": "string(Images)"}})
description: Optional[str] = Field(None, description="""Description of this collection of images.""")
description: Optional[str] = Field(
None, description="""Description of this collection of images."""
)
image: List[Image] = Field(..., description="""Images stored in this collection.""")

View file

@ -44,7 +44,12 @@ from ...core.v2_2_2.core_nwb_base import (
ProcessingModule,
Images,
)
from ...hdmf_common.v1_1_3.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData
from ...hdmf_common.v1_1_3.hdmf_common_sparse import (
CSRMatrix,
CSRMatrixIndices,
CSRMatrixIndptr,
CSRMatrixData,
)
from ...hdmf_common.v1_1_3.hdmf_common_table import (
Data,
Index,
@ -70,7 +75,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -126,11 +133,14 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
name: str = Field(...)
data: SpatialSeriesData = Field(
..., description="""1-D or 2-D array storing position or direction relative to some reference frame."""
...,
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."""
@ -157,7 +167,9 @@ class SpatialSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -173,14 +185,18 @@ class SpatialSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
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'.""",
)
array: Optional[
Union[NDArray[Shape["* num_times"], np.number], NDArray[Shape["* num_times, * num_features"], np.number]]
Union[
NDArray[Shape["* num_times"], np.number],
NDArray[Shape["* num_times, * num_features"], np.number],
]
] = Field(None)
@ -189,7 +205,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
children: Optional[List[IntervalSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "IntervalSeries"}]}}
@ -202,7 +220,9 @@ class BehavioralEvents(NWBDataInterface):
TimeSeries for storing behavioral events. See description of <a href=\"#BehavioralEpochs\">BehavioralEpochs</a> for more details.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
children: Optional[List[TimeSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}}
@ -215,7 +235,9 @@ class BehavioralTimeSeries(NWBDataInterface):
TimeSeries for storing Behavoioral time series data. See description of <a href=\"#BehavioralEpochs\">BehavioralEpochs</a> for more details.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
children: Optional[List[TimeSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}}
@ -228,7 +250,9 @@ class PupilTracking(NWBDataInterface):
Eye-tracking data, representing pupil size.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
children: Optional[List[TimeSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}}
@ -241,7 +265,9 @@ class EyeTracking(NWBDataInterface):
Eye-tracking data, representing direction of gaze.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
children: Optional[List[SpatialSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}}
@ -254,7 +280,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
children: Optional[List[SpatialSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}}
@ -267,7 +295,9 @@ class Position(NWBDataInterface):
Position data, whether along the x, x/y or x/y/z axis.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
children: Optional[List[SpatialSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}}

View file

@ -22,7 +22,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -62,14 +64,18 @@ class Device(NWBContainer):
Metadata about a data acquisition device, e.g., recording system, electrode, microscope.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.device", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.device", "tree_root": True}
)
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.""",
)
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."""
)
# Model rebuild

View file

@ -7,7 +7,15 @@ import sys
import numpy as np
from ...hdmf_common.v1_1_3.hdmf_common_table import DynamicTableRegion
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator
from pydantic import (
BaseModel,
ConfigDict,
Field,
RootModel,
field_validator,
ValidationInfo,
BeforeValidator,
)
from ...core.v2_2_2.core_nwb_base import (
TimeSeries,
TimeSeriesStartingTime,
@ -30,7 +38,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -75,7 +85,12 @@ linkml_meta = LinkMLMeta(
},
"default_prefix": "core.nwb.ecephys/",
"id": "core.nwb.ecephys",
"imports": ["core.nwb.base", "../../hdmf_common/v1_1_3/namespace", "core.nwb.device", "core.nwb.language"],
"imports": [
"core.nwb.base",
"../../hdmf_common/v1_1_3/namespace",
"core.nwb.device",
"core.nwb.language",
],
"name": "core.nwb.ecephys",
}
)
@ -86,7 +101,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
name: str = Field(...)
data: Union[
@ -97,7 +114,9 @@ class ElectricalSeries(TimeSeries):
electrodes: Named[DynamicTableRegion] = Field(
...,
description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field(
None,
@ -126,7 +145,9 @@ class ElectricalSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -139,7 +160,9 @@ 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).
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
name: str = Field(...)
data: Union[
@ -154,7 +177,9 @@ class SpikeEventSeries(ElectricalSeries):
electrodes: Named[DynamicTableRegion] = Field(
...,
description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field(
None,
@ -178,7 +203,9 @@ class SpikeEventSeries(ElectricalSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -191,9 +218,14 @@ class FeatureExtraction(NWBDataInterface):
Features, such as PC1 and PC2, that are extracted from signals stored in a SpikeEventSeries or other source.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
name: str = Field("FeatureExtraction", json_schema_extra={"linkml_meta": {"ifabsent": "string(FeatureExtraction)"}})
name: str = Field(
"FeatureExtraction",
json_schema_extra={"linkml_meta": {"ifabsent": "string(FeatureExtraction)"}},
)
description: NDArray[Shape["* num_features"], str] = Field(
...,
description="""Description of features (eg, ''PC1'') for each of the extracted features.""",
@ -204,7 +236,13 @@ class FeatureExtraction(NWBDataInterface):
description="""Multi-dimensional array of features extracted from each event.""",
json_schema_extra={
"linkml_meta": {
"array": {"dimensions": [{"alias": "num_events"}, {"alias": "num_channels"}, {"alias": "num_features"}]}
"array": {
"dimensions": [
{"alias": "num_events"},
{"alias": "num_channels"},
{"alias": "num_features"},
]
}
}
},
)
@ -216,7 +254,9 @@ class FeatureExtraction(NWBDataInterface):
electrodes: Named[DynamicTableRegion] = Field(
...,
description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
@ -225,9 +265,13 @@ class EventDetection(NWBDataInterface):
Detected spike events from voltage trace(s).
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
name: str = Field("EventDetection", json_schema_extra={"linkml_meta": {"ifabsent": "string(EventDetection)"}})
name: str = Field(
"EventDetection", json_schema_extra={"linkml_meta": {"ifabsent": "string(EventDetection)"}}
)
detection_method: str = Field(
...,
description="""Description of how events were detected, such as voltage threshold, or dV/dT threshold, as well as relevant values.""",
@ -249,7 +293,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
children: Optional[List[SpikeEventSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpikeEventSeries"}]}}
@ -262,7 +308,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
children: Optional[List[ElectricalSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "ElectricalSeries"}]}}
@ -275,7 +323,9 @@ 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 description or comments field.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
children: Optional[List[ElectricalSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "ElectricalSeries"}]}}
@ -288,7 +338,9 @@ class ElectrodeGroup(NWBContainer):
A physical grouping of electrodes, e.g. a shank of an array.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
name: str = Field(...)
description: Optional[str] = Field(None, description="""Description of this electrode group.""")
@ -309,7 +361,10 @@ class ElectrodeGroupPosition(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys"})
name: Literal["position"] = Field(
"position", json_schema_extra={"linkml_meta": {"equals_string": "position", "ifabsent": "string(position)"}}
"position",
json_schema_extra={
"linkml_meta": {"equals_string": "position", "ifabsent": "string(position)"}
},
)
x: Optional[np.float32] = Field(None, description="""x coordinate""")
y: Optional[np.float32] = Field(None, description="""y coordinate""")
@ -321,22 +376,33 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
name: str = Field("ClusterWaveforms", json_schema_extra={"linkml_meta": {"ifabsent": "string(ClusterWaveforms)"}})
waveform_filtering: str = Field(..., description="""Filtering applied to data before generating mean/sd""")
name: str = Field(
"ClusterWaveforms",
json_schema_extra={"linkml_meta": {"ifabsent": "string(ClusterWaveforms)"}},
)
waveform_filtering: str = Field(
..., description="""Filtering applied to data before generating mean/sd"""
)
waveform_mean: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = 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)""",
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]}}
"linkml_meta": {
"array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]}
}
},
)
waveform_sd: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = Field(
...,
description="""Stdev of waveforms for each cluster, using the same indices as in mean""",
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]}}
"linkml_meta": {
"array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]}
}
},
)
@ -346,9 +412,13 @@ class Clustering(NWBDataInterface):
DEPRECATED Clustered spike data, whether from automatic clustering tools (e.g., klustakwik) or as a result of manual sorting.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
name: str = Field("Clustering", json_schema_extra={"linkml_meta": {"ifabsent": "string(Clustering)"}})
name: str = Field(
"Clustering", json_schema_extra={"linkml_meta": {"ifabsent": "string(Clustering)"}}
)
description: str = Field(
...,
description="""Description of clusters or clustering, (e.g. cluster 0 is noise, clusters curated using Klusters, etc)""",

View file

@ -6,7 +6,15 @@ import re
import sys
import numpy as np
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator
from pydantic import (
BaseModel,
ConfigDict,
Field,
RootModel,
field_validator,
ValidationInfo,
BeforeValidator,
)
from numpydantic import NDArray, Shape
from ...hdmf_common.v1_1_3.hdmf_common_table import DynamicTable, VectorIndex, VectorData
from ...core.v2_2_2.core_nwb_base import TimeSeries
@ -24,7 +32,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -80,52 +90,70 @@ class TimeIntervals(DynamicTable):
A container for aggregating epoch data and the TimeSeries that each epoch applies to.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.epoch", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.epoch", "tree_root": True}
)
name: str = Field(...)
start_time: NDArray[Any, np.float32] = Field(
...,
description="""Start time of epoch, in seconds.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
stop_time: NDArray[Any, np.float32] = Field(
...,
description="""Stop time of epoch, in seconds.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
tags: Optional[NDArray[Any, str]] = Field(
None,
description="""User-defined tags that identify or categorize events.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
tags_index: Named[Optional[VectorIndex]] = Field(
None,
description="""Index for tags.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
timeseries: Optional[TimeIntervalsTimeseries] = Field(
None, description="""An index into a TimeSeries object."""
)
timeseries: Optional[TimeIntervalsTimeseries] = Field(None, description="""An index into a TimeSeries object.""")
timeseries_index: Named[Optional[VectorIndex]] = Field(
None,
description="""Index for timeseries.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
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: NDArray[Shape["* num_rows"], int] = Field(
...,
description="""Array of unique identifiers for the rows of this dynamic table.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}},
)
vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""")
vector_data: Optional[List[VectorData]] = Field(
None, description="""Vector columns of this dynamic table."""
)
vector_index: Optional[List[VectorIndex]] = Field(
None, description="""Indices for the vector columns of this dynamic table."""
)
@ -140,17 +168,24 @@ class TimeIntervalsTimeseries(VectorData):
name: Literal["timeseries"] = Field(
"timeseries",
json_schema_extra={"linkml_meta": {"equals_string": "timeseries", "ifabsent": "string(timeseries)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "timeseries", "ifabsent": "string(timeseries)"}
},
)
idx_start: Optional[np.int32] = Field(
None,
description="""Start index into the TimeSeries 'data' and 'timestamp' datasets of the referenced TimeSeries. The first dimension of those arrays is always time.""",
)
count: Optional[np.int32] = Field(
None, description="""Number of data samples available in this time series, during this epoch."""
None,
description="""Number of data samples available in this time series, during this epoch.""",
)
timeseries: Optional[TimeSeries] = Field(
None, description="""the TimeSeries that this index applies to."""
)
description: Optional[str] = Field(
None, description="""Description of what these vectors represent."""
)
timeseries: Optional[TimeSeries] = Field(None, description="""the TimeSeries that this index applies to.""")
description: Optional[str] = Field(None, description="""Description of what these vectors represent.""")
array: Optional[
Union[
NDArray[Shape["* dim0"], Any],

View file

@ -44,7 +44,12 @@ from ...core.v2_2_2.core_nwb_base import (
ProcessingModule,
Images,
)
from ...hdmf_common.v1_1_3.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData
from ...hdmf_common.v1_1_3.hdmf_common_sparse import (
CSRMatrix,
CSRMatrixIndices,
CSRMatrixIndptr,
CSRMatrixData,
)
from ...hdmf_common.v1_1_3.hdmf_common_table import (
Data,
Index,
@ -113,7 +118,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -180,10 +187,13 @@ class NWBFile(NWBContainer):
An NWB:N file storing cellular-based neurophysiology data from a single experimental session.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.file", "tree_root": True}
)
name: Literal["root"] = Field(
"root", json_schema_extra={"linkml_meta": {"equals_string": "root", "ifabsent": "string(root)"}}
"root",
json_schema_extra={"linkml_meta": {"equals_string": "root", "ifabsent": "string(root)"}},
)
nwb_version: Optional[str] = Field(
None,
@ -192,7 +202,9 @@ class NWBFile(NWBContainer):
file_create_date: NDArray[Shape["* num_modifications"], np.datetime64] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_modifications"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_modifications"}]}}
},
)
identifier: str = Field(
...,
@ -212,17 +224,23 @@ class NWBFile(NWBContainer):
acquisition: Optional[List[Union[DynamicTable, NWBDataInterface]]] = Field(
None,
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.""",
json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]}},
json_schema_extra={
"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]}
},
)
analysis: Optional[List[Union[DynamicTable, NWBContainer]]] = Field(
None,
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.""",
json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]}},
json_schema_extra={
"linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]}
},
)
scratch: Optional[List[Union[DynamicTable, NWBContainer]]] = 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.""",
json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]}},
json_schema_extra={
"linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]}
},
)
processing: Optional[List[ProcessingModule]] = Field(
None,
@ -262,7 +280,10 @@ class NWBFileStimulus(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file"})
name: Literal["stimulus"] = Field(
"stimulus", json_schema_extra={"linkml_meta": {"equals_string": "stimulus", "ifabsent": "string(stimulus)"}}
"stimulus",
json_schema_extra={
"linkml_meta": {"equals_string": "stimulus", "ifabsent": "string(stimulus)"}
},
)
presentation: Optional[List[TimeSeries]] = Field(
None,
@ -284,16 +305,27 @@ class NWBFileGeneral(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file"})
name: Literal["general"] = Field(
"general", json_schema_extra={"linkml_meta": {"equals_string": "general", "ifabsent": "string(general)"}}
"general",
json_schema_extra={
"linkml_meta": {"equals_string": "general", "ifabsent": "string(general)"}
},
)
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."""
)
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.""")
experimenter: Optional[NDArray[Shape["* num_experimenters"], str]] = Field(
None,
description="""Name of person(s) who performed the experiment. Can also specify roles of different people involved.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_experimenters"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_experimenters"}]}}
},
)
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[NDArray[Shape["* num_keywords"], str]] = Field(
None,
description="""Terms to search over.""",
@ -306,12 +338,15 @@ class NWBFileGeneral(ConfiguredBaseModel):
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."""
None,
description="""Experimental protocol, if applicable. e.g., include IACUC protocol number.""",
)
related_publications: Optional[NDArray[Shape["* num_publications"], str]] = Field(
None,
description="""Publication information. PMID, DOI, URL, etc.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_publications"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_publications"}]}}
},
)
session_id: Optional[str] = Field(None, description="""Lab-specific ID for the session.""")
slices: Optional[str] = Field(
@ -319,7 +354,8 @@ class NWBFileGeneral(ConfiguredBaseModel):
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."""
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."""
@ -342,7 +378,8 @@ class NWBFileGeneral(ConfiguredBaseModel):
json_schema_extra={"linkml_meta": {"any_of": [{"range": "Device"}]}},
)
subject: Optional[Subject] = Field(
None, description="""Information about the animal or person from which the data was measured."""
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."""
@ -371,7 +408,9 @@ class NWBFileGeneralSourceScript(ConfiguredBaseModel):
name: Literal["source_script"] = Field(
"source_script",
json_schema_extra={"linkml_meta": {"equals_string": "source_script", "ifabsent": "string(source_script)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "source_script", "ifabsent": "string(source_script)"}
},
)
file_name: Optional[str] = Field(None, description="""Name of script file.""")
value: str = Field(...)
@ -385,23 +424,33 @@ class Subject(NWBContainer):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file"})
name: Literal["subject"] = Field(
"subject", json_schema_extra={"linkml_meta": {"equals_string": "subject", "ifabsent": "string(subject)"}}
"subject",
json_schema_extra={
"linkml_meta": {"equals_string": "subject", "ifabsent": "string(subject)"}
},
)
age: Optional[str] = Field(
None, description="""Age of subject. Can be supplied instead of 'date_of_birth'."""
)
age: Optional[str] = Field(None, description="""Age of subject. Can be supplied instead of 'date_of_birth'.""")
date_of_birth: Optional[np.datetime64] = 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)."""
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.""")
species: Optional[str] = Field(None, description="""Species of subject.""")
subject_id: Optional[str] = Field(
None, description="""ID of animal/person used/participating in experiment (lab convention)."""
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."""
None,
description="""Weight at time of experiment, at time of surgery and at other important times.""",
)
@ -415,10 +464,15 @@ class NWBFileGeneralExtracellularEphys(ConfiguredBaseModel):
name: Literal["extracellular_ephys"] = Field(
"extracellular_ephys",
json_schema_extra={
"linkml_meta": {"equals_string": "extracellular_ephys", "ifabsent": "string(extracellular_ephys)"}
"linkml_meta": {
"equals_string": "extracellular_ephys",
"ifabsent": "string(extracellular_ephys)",
}
},
)
electrode_group: Optional[List[ElectrodeGroup]] = Field(None, description="""Physical group of electrodes.""")
electrode_group: Optional[List[ElectrodeGroup]] = Field(
None, description="""Physical group of electrodes."""
)
electrodes: Optional[NWBFileGeneralExtracellularEphysElectrodes] = Field(
None, description="""A table of all electrodes (i.e. channels) used for recording."""
)
@ -433,48 +487,62 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable):
name: Literal["electrodes"] = Field(
"electrodes",
json_schema_extra={"linkml_meta": {"equals_string": "electrodes", "ifabsent": "string(electrodes)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "electrodes", "ifabsent": "string(electrodes)"}
},
)
x: NDArray[Any, np.float32] = Field(
...,
description="""x coordinate of the channel location in the brain (+x is posterior).""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
y: NDArray[Any, np.float32] = Field(
...,
description="""y coordinate of the channel location in the brain (+y is inferior).""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
z: NDArray[Any, np.float32] = Field(
...,
description="""z coordinate of the channel location in the brain (+z is right).""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
imp: NDArray[Any, np.float32] = Field(
...,
description="""Impedance of the channel.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
location: NDArray[Any, str] = Field(
...,
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.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
filtering: NDArray[Any, np.float32] = Field(
...,
description="""Description of hardware filtering.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
group: List[ElectrodeGroup] = Field(
@ -484,48 +552,62 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable):
...,
description="""Name of the ElectrodeGroup this electrode is a part of.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
rel_x: Optional[NDArray[Any, np.float32]] = Field(
None,
description="""x coordinate in electrode group""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
rel_y: Optional[NDArray[Any, np.float32]] = Field(
None,
description="""y coordinate in electrode group""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
rel_z: Optional[NDArray[Any, np.float32]] = Field(
None,
description="""z coordinate in electrode group""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
reference: Optional[NDArray[Any, str]] = Field(
None,
description="""Description of the reference used for this electrode.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
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: NDArray[Shape["* num_rows"], int] = Field(
...,
description="""Array of unique identifiers for the rows of this dynamic table.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}},
)
vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""")
vector_data: Optional[List[VectorData]] = Field(
None, description="""Vector columns of this dynamic table."""
)
vector_index: Optional[List[VectorIndex]] = Field(
None, description="""Indices for the vector columns of this dynamic table."""
)
@ -541,7 +623,10 @@ class NWBFileGeneralIntracellularEphys(ConfiguredBaseModel):
name: Literal["intracellular_ephys"] = Field(
"intracellular_ephys",
json_schema_extra={
"linkml_meta": {"equals_string": "intracellular_ephys", "ifabsent": "string(intracellular_ephys)"}
"linkml_meta": {
"equals_string": "intracellular_ephys",
"ifabsent": "string(intracellular_ephys)",
}
},
)
filtering: Optional[str] = Field(

View file

@ -5,7 +5,12 @@ from enum import Enum
import re
import sys
import numpy as np
from ...hdmf_common.v1_1_3.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData
from ...hdmf_common.v1_1_3.hdmf_common_sparse import (
CSRMatrix,
CSRMatrixIndices,
CSRMatrixIndptr,
CSRMatrixData,
)
from ...hdmf_common.v1_1_3.hdmf_common_table import (
Data,
Index,
@ -30,7 +35,15 @@ from ...core.v2_2_2.core_nwb_base import (
Images,
)
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator
from pydantic import (
BaseModel,
ConfigDict,
Field,
RootModel,
field_validator,
ValidationInfo,
BeforeValidator,
)
from numpydantic import NDArray, Shape
metamodel_version = "None"
@ -46,7 +59,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -91,7 +106,12 @@ linkml_meta = LinkMLMeta(
},
"default_prefix": "core.nwb.icephys/",
"id": "core.nwb.icephys",
"imports": ["core.nwb.base", "core.nwb.device", "../../hdmf_common/v1_1_3/namespace", "core.nwb.language"],
"imports": [
"core.nwb.base",
"core.nwb.device",
"../../hdmf_common/v1_1_3/namespace",
"core.nwb.language",
],
"name": "core.nwb.icephys",
}
)
@ -102,7 +122,9 @@ class PatchClampSeries(TimeSeries):
An abstract base class for patch-clamp data - stimulus or response, current or voltage.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
stimulus_description: Optional[str] = Field(
@ -113,7 +135,8 @@ class PatchClampSeries(TimeSeries):
)
data: PatchClampSeriesData = Field(..., description="""Recorded voltage or current.""")
gain: Optional[np.float32] = Field(
None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp)."""
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.""")
comments: Optional[str] = Field(
@ -137,7 +160,9 @@ class PatchClampSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -153,7 +178,8 @@ class PatchClampSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
unit: Optional[str] = Field(
None,
@ -169,13 +195,17 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
data: CurrentClampSeriesData = Field(..., description="""Recorded voltage.""")
bias_current: Optional[np.float32] = Field(None, description="""Bias current, in amps.""")
bridge_balance: Optional[np.float32] = Field(None, description="""Bridge balance, in ohms.""")
capacitance_compensation: Optional[np.float32] = Field(None, description="""Capacitance compensation, in farads.""")
capacitance_compensation: Optional[np.float32] = Field(
None, description="""Capacitance compensation, in farads."""
)
stimulus_description: Optional[str] = Field(
None, description="""Protocol/stimulus name for this patch-clamp dataset."""
)
@ -183,7 +213,8 @@ class CurrentClampSeries(PatchClampSeries):
None, description="""Sweep number, allows to group different PatchClampSeries together."""
)
gain: Optional[np.float32] = Field(
None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp)."""
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.""")
comments: Optional[str] = Field(
@ -207,7 +238,9 @@ class CurrentClampSeries(PatchClampSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -223,7 +256,8 @@ class CurrentClampSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
unit: Optional[str] = Field(
None,
@ -237,11 +271,15 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
bias_current: np.float32 = Field(..., description="""Bias current, in amps, fixed to 0.0.""")
bridge_balance: np.float32 = Field(..., description="""Bridge balance, in ohms, fixed to 0.0.""")
bridge_balance: np.float32 = Field(
..., description="""Bridge balance, in ohms, fixed to 0.0."""
)
capacitance_compensation: np.float32 = Field(
..., description="""Capacitance compensation, in farads, fixed to 0.0."""
)
@ -253,7 +291,8 @@ class IZeroClampSeries(CurrentClampSeries):
None, description="""Sweep number, allows to group different PatchClampSeries together."""
)
gain: Optional[np.float32] = Field(
None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp)."""
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.""")
comments: Optional[str] = Field(
@ -277,7 +316,9 @@ class IZeroClampSeries(CurrentClampSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -290,7 +331,9 @@ class CurrentClampStimulusSeries(PatchClampSeries):
Stimulus current applied during current clamp recording.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
data: CurrentClampStimulusSeriesData = Field(..., description="""Stimulus current applied.""")
@ -301,7 +344,8 @@ class CurrentClampStimulusSeries(PatchClampSeries):
None, description="""Sweep number, allows to group different PatchClampSeries together."""
)
gain: Optional[np.float32] = Field(
None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp)."""
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.""")
comments: Optional[str] = Field(
@ -325,7 +369,9 @@ class CurrentClampStimulusSeries(PatchClampSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -341,7 +387,8 @@ class CurrentClampStimulusSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
unit: Optional[str] = Field(
None,
@ -355,7 +402,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
data: VoltageClampSeriesData = Field(..., description="""Recorded current.""")
@ -377,8 +426,8 @@ class VoltageClampSeries(PatchClampSeries):
whole_cell_capacitance_comp: Optional[VoltageClampSeriesWholeCellCapacitanceComp] = Field(
None, description="""Whole cell capacitance compensation, in farads."""
)
whole_cell_series_resistance_comp: Optional[VoltageClampSeriesWholeCellSeriesResistanceComp] = Field(
None, description="""Whole cell series resistance compensation, in ohms."""
whole_cell_series_resistance_comp: Optional[VoltageClampSeriesWholeCellSeriesResistanceComp] = (
Field(None, description="""Whole cell series resistance compensation, in ohms.""")
)
stimulus_description: Optional[str] = Field(
None, description="""Protocol/stimulus name for this patch-clamp dataset."""
@ -387,7 +436,8 @@ class VoltageClampSeries(PatchClampSeries):
None, description="""Sweep number, allows to group different PatchClampSeries together."""
)
gain: Optional[np.float32] = Field(
None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp)."""
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.""")
comments: Optional[str] = Field(
@ -411,7 +461,9 @@ class VoltageClampSeries(PatchClampSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -427,7 +479,8 @@ class VoltageClampSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
unit: Optional[str] = Field(
None,
@ -446,11 +499,15 @@ class VoltageClampSeriesCapacitanceFast(ConfiguredBaseModel):
name: Literal["capacitance_fast"] = Field(
"capacitance_fast",
json_schema_extra={
"linkml_meta": {"equals_string": "capacitance_fast", "ifabsent": "string(capacitance_fast)"}
"linkml_meta": {
"equals_string": "capacitance_fast",
"ifabsent": "string(capacitance_fast)",
}
},
)
unit: Optional[str] = Field(
None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'."""
None,
description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""",
)
value: np.float32 = Field(...)
@ -465,11 +522,15 @@ class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel):
name: Literal["capacitance_slow"] = Field(
"capacitance_slow",
json_schema_extra={
"linkml_meta": {"equals_string": "capacitance_slow", "ifabsent": "string(capacitance_slow)"}
"linkml_meta": {
"equals_string": "capacitance_slow",
"ifabsent": "string(capacitance_slow)",
}
},
)
unit: Optional[str] = Field(
None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'."""
None,
description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""",
)
value: np.float32 = Field(...)
@ -491,7 +552,8 @@ class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel):
},
)
unit: Optional[str] = Field(
None, description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'."""
None,
description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'.""",
)
value: np.float32 = Field(...)
@ -513,7 +575,8 @@ class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel):
},
)
unit: Optional[str] = Field(
None, description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'."""
None,
description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'.""",
)
value: np.float32 = Field(...)
@ -535,7 +598,8 @@ class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel):
},
)
unit: Optional[str] = Field(
None, description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'."""
None,
description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'.""",
)
value: np.float32 = Field(...)
@ -557,7 +621,8 @@ class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel):
},
)
unit: Optional[str] = Field(
None, description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'."""
None,
description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'.""",
)
value: np.float32 = Field(...)
@ -579,7 +644,8 @@ class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel):
},
)
unit: Optional[str] = Field(
None, description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'."""
None,
description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'.""",
)
value: np.float32 = Field(...)
@ -589,7 +655,9 @@ class VoltageClampStimulusSeries(PatchClampSeries):
Stimulus voltage applied during a voltage clamp recording.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
data: VoltageClampStimulusSeriesData = Field(..., description="""Stimulus voltage applied.""")
@ -600,7 +668,8 @@ class VoltageClampStimulusSeries(PatchClampSeries):
None, description="""Sweep number, allows to group different PatchClampSeries together."""
)
gain: Optional[np.float32] = Field(
None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp)."""
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.""")
comments: Optional[str] = Field(
@ -624,7 +693,9 @@ class VoltageClampStimulusSeries(PatchClampSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -640,7 +711,8 @@ class VoltageClampStimulusSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
unit: Optional[str] = Field(
None,
@ -654,19 +726,27 @@ class IntracellularElectrode(NWBContainer):
An intracellular electrode and its metadata.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
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.""")
initial_access_resistance: Optional[str] = Field(None, description="""Initial access resistance.""")
initial_access_resistance: Optional[str] = Field(
None, description="""Initial access resistance."""
)
location: Optional[str] = Field(
None,
description="""Location of the electrode. 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.""",
)
resistance: Optional[str] = Field(None, description="""Electrode resistance, in ohms.""")
seal: Optional[str] = Field(None, description="""Information about seal used for recording.""")
slice: Optional[str] = Field(None, description="""Information about slice used for recording.""")
slice: Optional[str] = Field(
None, description="""Information about slice used for recording."""
)
class SweepTable(DynamicTable):
@ -674,14 +754,18 @@ class SweepTable(DynamicTable):
The table which groups different PatchClampSeries together.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
sweep_number: NDArray[Any, np.uint32] = Field(
...,
description="""Sweep number of the PatchClampSeries in that row.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
series: List[PatchClampSeries] = Field(
@ -690,19 +774,25 @@ class SweepTable(DynamicTable):
series_index: Named[VectorIndex] = Field(
...,
description="""Index for series.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
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: NDArray[Shape["* num_rows"], int] = Field(
...,
description="""Array of unique identifiers for the rows of this dynamic table.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}},
)
vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""")
vector_data: Optional[List[VectorData]] = Field(
None, description="""Vector columns of this dynamic table."""
)
vector_index: Optional[List[VectorIndex]] = Field(
None, description="""Indices for the vector columns of this dynamic table."""
)

View file

@ -19,7 +19,12 @@ from ...core.v2_2_2.core_nwb_base import (
ProcessingModule,
Images,
)
from ...hdmf_common.v1_1_3.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData
from ...hdmf_common.v1_1_3.hdmf_common_sparse import (
CSRMatrix,
CSRMatrixIndices,
CSRMatrixIndptr,
CSRMatrixData,
)
from ...hdmf_common.v1_1_3.hdmf_common_table import (
Data,
Index,
@ -45,7 +50,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -101,7 +108,9 @@ class GrayscaleImage(Image):
A grayscale image.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.image", "tree_root": True}
)
name: str = Field(...)
resolution: Optional[np.float32] = Field(
@ -122,7 +131,9 @@ class RGBImage(Image):
A color image.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.image", "tree_root": True}
)
name: str = Field(...)
resolution: Optional[np.float32] = Field(
@ -143,7 +154,9 @@ class RGBAImage(Image):
A color image with transparency.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.image", "tree_root": True}
)
name: str = Field(...)
resolution: Optional[np.float32] = Field(
@ -164,11 +177,16 @@ 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].
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.image", "tree_root": True}
)
name: str = Field(...)
data: Optional[
Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]]
Union[
NDArray[Shape["* frame, * x, * y"], np.number],
NDArray[Shape["* frame, * x, * y, * z"], np.number],
]
] = Field(None, description="""Binary data representing images across frames.""")
dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field(
None,
@ -205,7 +223,9 @@ class ImageSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -222,7 +242,9 @@ class ImageSeriesExternalFile(ConfiguredBaseModel):
name: Literal["external_file"] = Field(
"external_file",
json_schema_extra={"linkml_meta": {"equals_string": "external_file", "ifabsent": "string(external_file)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "external_file", "ifabsent": "string(external_file)"}
},
)
starting_frame: Optional[np.int32] = Field(
None,
@ -238,11 +260,16 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.image", "tree_root": True}
)
name: str = Field(...)
data: Optional[
Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]]
Union[
NDArray[Shape["* frame, * x, * y"], np.number],
NDArray[Shape["* frame, * x, * y, * z"], np.number],
]
] = Field(None, description="""Binary data representing images across frames.""")
dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field(
None,
@ -279,7 +306,9 @@ class ImageMaskSeries(ImageSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -292,15 +321,23 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.image", "tree_root": True}
)
name: str = Field(...)
distance: Optional[np.float32] = Field(None, description="""Distance from camera/monitor to target/eye.""")
distance: Optional[np.float32] = Field(
None, description="""Distance from camera/monitor to target/eye."""
)
field_of_view: Optional[
Union[NDArray[Shape["2 width_height"], np.float32], NDArray[Shape["3 width_height_depth"], np.float32]]
Union[
NDArray[Shape["2 width_height"], np.float32],
NDArray[Shape["3 width_height_depth"], np.float32],
]
] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""")
data: Union[
NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, 3 r_g_b"], np.number]
NDArray[Shape["* frame, * x, * y"], np.number],
NDArray[Shape["* frame, * x, * y, 3 r_g_b"], np.number],
] = Field(..., description="""Images presented to subject, either grayscale or RGB""")
orientation: Optional[str] = Field(
None,
@ -341,7 +378,9 @@ class OpticalSeries(ImageSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -354,7 +393,9 @@ class IndexSeries(TimeSeries):
Stores indices to image frames stored in an ImageSeries. The purpose of the ImageIndexSeries is to allow a static image stack to be stored somewhere, 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 ImageSeries, and the timestamps array indicates when that image was displayed.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.image", "tree_root": True}
)
name: str = Field(...)
data: NDArray[Shape["* num_times"], np.int32] = Field(
@ -384,7 +425,9 @@ class IndexSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,

View file

@ -7,10 +7,23 @@ import sys
import numpy as np
from ...core.v2_2_2.core_nwb_base import TimeSeries, TimeSeriesStartingTime, TimeSeriesSync
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator
from pydantic import (
BaseModel,
ConfigDict,
Field,
RootModel,
field_validator,
ValidationInfo,
BeforeValidator,
)
from ...core.v2_2_2.core_nwb_ecephys import ElectrodeGroup
from numpydantic import NDArray, Shape
from ...hdmf_common.v1_1_3.hdmf_common_table import DynamicTable, VectorData, VectorIndex, DynamicTableRegion
from ...hdmf_common.v1_1_3.hdmf_common_table import (
DynamicTable,
VectorData,
VectorIndex,
DynamicTableRegion,
)
metamodel_version = "None"
version = "2.2.2"
@ -25,7 +38,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -70,7 +85,12 @@ linkml_meta = LinkMLMeta(
},
"default_prefix": "core.nwb.misc/",
"id": "core.nwb.misc",
"imports": ["core.nwb.base", "../../hdmf_common/v1_1_3/namespace", "core.nwb.ecephys", "core.nwb.language"],
"imports": [
"core.nwb.base",
"../../hdmf_common/v1_1_3/namespace",
"core.nwb.ecephys",
"core.nwb.language",
],
"name": "core.nwb.misc",
}
)
@ -81,10 +101,14 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.misc", "tree_root": True}
)
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[NDArray[Shape["* num_features"], str]] = Field(
None,
description="""Units of each feature.""",
@ -117,7 +141,9 @@ class AbstractFeatureSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -133,14 +159,18 @@ class AbstractFeatureSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
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[
Union[NDArray[Shape["* num_times"], np.number], NDArray[Shape["* num_times, * num_features"], np.number]]
Union[
NDArray[Shape["* num_times"], np.number],
NDArray[Shape["* num_times, * num_features"], np.number],
]
] = Field(None)
@ -149,7 +179,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.misc", "tree_root": True}
)
name: str = Field(...)
data: NDArray[Shape["* num_times"], str] = Field(
@ -179,7 +211,9 @@ class AnnotationSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -192,7 +226,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.misc", "tree_root": True}
)
name: str = Field(...)
data: NDArray[Shape["* num_times"], np.int8] = Field(
@ -222,7 +258,9 @@ class IntervalSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -235,10 +273,14 @@ class DecompositionSeries(TimeSeries):
Spectral analysis of a time series, e.g. of an LFP or a speech signal.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.misc", "tree_root": True}
)
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.""")
bands: DecompositionSeriesBands = Field(
...,
@ -266,7 +308,9 @@ class DecompositionSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -282,7 +326,8 @@ class DecompositionSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
unit: Optional[str] = Field(
None,
@ -292,7 +337,13 @@ class DecompositionSeriesData(ConfiguredBaseModel):
None,
json_schema_extra={
"linkml_meta": {
"array": {"dimensions": [{"alias": "num_times"}, {"alias": "num_channels"}, {"alias": "num_bands"}]}
"array": {
"dimensions": [
{"alias": "num_times"},
{"alias": "num_channels"},
{"alias": "num_bands"},
]
}
}
},
)
@ -306,13 +357,16 @@ class DecompositionSeriesBands(DynamicTable):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"})
name: Literal["bands"] = Field(
"bands", json_schema_extra={"linkml_meta": {"equals_string": "bands", "ifabsent": "string(bands)"}}
"bands",
json_schema_extra={"linkml_meta": {"equals_string": "bands", "ifabsent": "string(bands)"}},
)
band_name: NDArray[Any, str] = Field(
...,
description="""Name of the band, e.g. theta.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
band_limits: NDArray[Shape["* num_bands, 2 low_high"], np.float32] = Field(
@ -320,7 +374,12 @@ class DecompositionSeriesBands(DynamicTable):
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.""",
json_schema_extra={
"linkml_meta": {
"array": {"dimensions": [{"alias": "num_bands"}, {"alias": "low_high", "exact_cardinality": 2}]}
"array": {
"dimensions": [
{"alias": "num_bands"},
{"alias": "low_high", "exact_cardinality": 2},
]
}
}
},
)
@ -338,13 +397,17 @@ class DecompositionSeriesBands(DynamicTable):
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: NDArray[Shape["* num_rows"], int] = Field(
...,
description="""Array of unique identifiers for the rows of this dynamic table.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}},
)
vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""")
vector_data: Optional[List[VectorData]] = Field(
None, description="""Vector columns of this dynamic table."""
)
vector_index: Optional[List[VectorIndex]] = Field(
None, description="""Indices for the vector columns of this dynamic table."""
)
@ -355,38 +418,55 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.misc", "tree_root": True}
)
name: str = Field("Units", json_schema_extra={"linkml_meta": {"ifabsent": "string(Units)"}})
spike_times_index: Named[Optional[VectorIndex]] = Field(
None,
description="""Index into the spike_times dataset.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
spike_times: Optional[UnitsSpikeTimes] = Field(
None, description="""Spike times for each unit."""
)
spike_times: Optional[UnitsSpikeTimes] = Field(None, description="""Spike times for each unit.""")
obs_intervals_index: Named[Optional[VectorIndex]] = Field(
None,
description="""Index into the obs_intervals dataset.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
obs_intervals: Optional[NDArray[Shape["* num_intervals, 2 start_end"], np.float64]] = Field(
None,
description="""Observation intervals for each unit.""",
json_schema_extra={
"linkml_meta": {
"array": {"dimensions": [{"alias": "num_intervals"}, {"alias": "start_end", "exact_cardinality": 2}]}
"array": {
"dimensions": [
{"alias": "num_intervals"},
{"alias": "start_end", "exact_cardinality": 2},
]
}
}
},
)
electrodes_index: Named[Optional[VectorIndex]] = Field(
None,
description="""Index into electrodes.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
electrodes: Named[Optional[DynamicTableRegion]] = Field(
None,
description="""Electrode that each spike unit came from, specified using a DynamicTableRegion.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
electrode_group: Optional[List[ElectrodeGroup]] = Field(
None, description="""Electrode group that each spike unit came from."""
@ -407,13 +487,17 @@ class Units(DynamicTable):
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: NDArray[Shape["* num_rows"], int] = Field(
...,
description="""Array of unique identifiers for the rows of this dynamic table.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}},
)
vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""")
vector_data: Optional[List[VectorData]] = Field(
None, description="""Vector columns of this dynamic table."""
)
vector_index: Optional[List[VectorIndex]] = Field(
None, description="""Indices for the vector columns of this dynamic table."""
)
@ -428,13 +512,17 @@ class UnitsSpikeTimes(VectorData):
name: Literal["spike_times"] = Field(
"spike_times",
json_schema_extra={"linkml_meta": {"equals_string": "spike_times", "ifabsent": "string(spike_times)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "spike_times", "ifabsent": "string(spike_times)"}
},
)
resolution: Optional[np.float64] = 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[
Union[
NDArray[Shape["* dim0"], Any],

View file

@ -8,7 +8,12 @@ from typing import Any, ClassVar, List, Literal, Dict, Optional, Union
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator
import numpy as np
from numpydantic import NDArray, Shape
from ...core.v2_2_2.core_nwb_base import TimeSeries, TimeSeriesStartingTime, TimeSeriesSync, NWBContainer
from ...core.v2_2_2.core_nwb_base import (
TimeSeries,
TimeSeriesStartingTime,
TimeSeriesSync,
NWBContainer,
)
metamodel_version = "None"
version = "2.2.2"
@ -23,7 +28,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -79,7 +86,9 @@ class OptogeneticSeries(TimeSeries):
An optogenetic stimulus.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ogen", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ogen", "tree_root": True}
)
name: str = Field(...)
data: NDArray[Shape["* num_times"], np.number] = Field(
@ -109,7 +118,9 @@ class OptogeneticSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -122,7 +133,9 @@ class OptogeneticStimulusSite(NWBContainer):
A site of optogenetic stimulation.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ogen", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ogen", "tree_root": True}
)
name: str = Field(...)
description: str = Field(..., description="""Description of stimulation site.""")

View file

@ -18,7 +18,12 @@ from ...core.v2_2_2.core_nwb_base import (
ProcessingModule,
Images,
)
from ...hdmf_common.v1_1_3.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData
from ...hdmf_common.v1_1_3.hdmf_common_sparse import (
CSRMatrix,
CSRMatrixIndices,
CSRMatrixIndptr,
CSRMatrixData,
)
from ...hdmf_common.v1_1_3.hdmf_common_table import (
Data,
Index,
@ -40,7 +45,15 @@ from ...core.v2_2_2.core_nwb_image import (
IndexSeries,
)
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator
from pydantic import (
BaseModel,
ConfigDict,
Field,
RootModel,
field_validator,
ValidationInfo,
BeforeValidator,
)
from numpydantic import NDArray, Shape
metamodel_version = "None"
@ -56,7 +69,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -118,7 +133,9 @@ class TwoPhotonSeries(ImageSeries):
Image stack recorded over time from 2-photon microscope.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
name: str = Field(...)
pmt_gain: Optional[np.float32] = Field(None, description="""Photomultiplier gain.""")
@ -127,10 +144,16 @@ class TwoPhotonSeries(ImageSeries):
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[
Union[NDArray[Shape["2 width_height"], np.float32], NDArray[Shape["3 width_height"], np.float32]]
Union[
NDArray[Shape["2 width_height"], np.float32],
NDArray[Shape["3 width_height"], np.float32],
]
] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""")
data: Optional[
Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]]
Union[
NDArray[Shape["* frame, * x, * y"], np.number],
NDArray[Shape["* frame, * x, * y, * z"], np.number],
]
] = Field(None, description="""Binary data representing images across frames.""")
dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field(
None,
@ -167,7 +190,9 @@ class TwoPhotonSeries(ImageSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -180,16 +205,21 @@ class RoiResponseSeries(TimeSeries):
ROI responses over an imaging plane. The first dimension represents time. The second dimension, if present, represents ROIs.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
name: str = Field(...)
data: Union[NDArray[Shape["* num_times"], np.number], NDArray[Shape["* num_times, * num_rois"], np.number]] = Field(
..., description="""Signals from ROIs."""
)
data: Union[
NDArray[Shape["* num_times"], np.number],
NDArray[Shape["* num_times, * num_rois"], np.number],
] = Field(..., description="""Signals from ROIs.""")
rois: Named[DynamicTableRegion] = Field(
...,
description="""DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
description: Optional[str] = Field(None, description="""Description of the time series.""")
comments: Optional[str] = Field(
@ -213,7 +243,9 @@ class RoiResponseSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -226,7 +258,9 @@ 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).
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
children: Optional[List[RoiResponseSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "RoiResponseSeries"}]}}
@ -239,7 +273,9 @@ 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).
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
children: Optional[List[RoiResponseSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "RoiResponseSeries"}]}}
@ -252,7 +288,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
children: Optional[List[DynamicTable]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "DynamicTable"}]}}
@ -265,7 +303,9 @@ class ImagingPlane(NWBContainer):
An imaging plane and its metadata.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
children: Optional[List[NWBContainer]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBContainer"}]}}
@ -278,7 +318,9 @@ 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).
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
children: Optional[List[NWBDataInterface]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}]}}

View file

@ -23,7 +23,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -79,9 +81,14 @@ 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).
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.retinotopy", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.retinotopy", "tree_root": True}
)
name: str = Field("ImagingRetinotopy", json_schema_extra={"linkml_meta": {"ifabsent": "string(ImagingRetinotopy)"}})
name: str = Field(
"ImagingRetinotopy",
json_schema_extra={"linkml_meta": {"ifabsent": "string(ImagingRetinotopy)"}},
)
axis_1_phase_map: ImagingRetinotopyAxis1PhaseMap = Field(
..., description="""Phase response to stimulus on the first measured axis."""
)
@ -100,7 +107,9 @@ class ImagingRetinotopy(NWBDataInterface):
...,
description="""Two-element array describing the contents of the two response axis fields. Description should be something like ['altitude', 'azimuth'] or '['radius', 'theta'].""",
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "axis_1_axis_2", "exact_cardinality": 2}]}}
"linkml_meta": {
"array": {"dimensions": [{"alias": "axis_1_axis_2", "exact_cardinality": 2}]}
}
},
)
focal_depth_image: Optional[ImagingRetinotopyFocalDepthImage] = Field(
@ -108,10 +117,12 @@ class ImagingRetinotopy(NWBDataInterface):
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."""
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]"""
...,
description="""Gray-scale anatomical image of cortical surface. Array structure: [rows][columns]""",
)
@ -125,18 +136,27 @@ class ImagingRetinotopyAxis1PhaseMap(ConfiguredBaseModel):
name: Literal["axis_1_phase_map"] = Field(
"axis_1_phase_map",
json_schema_extra={
"linkml_meta": {"equals_string": "axis_1_phase_map", "ifabsent": "string(axis_1_phase_map)"}
"linkml_meta": {
"equals_string": "axis_1_phase_map",
"ifabsent": "string(axis_1_phase_map)",
}
},
)
dimension: Optional[np.int32] = Field(
None,
description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""",
)
field_of_view: Optional[np.float32] = 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).""")
field_of_view: Optional[np.float32] = 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)."""
)
array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field(
None,
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}
},
)
@ -150,18 +170,27 @@ class ImagingRetinotopyAxis1PowerMap(ConfiguredBaseModel):
name: Literal["axis_1_power_map"] = Field(
"axis_1_power_map",
json_schema_extra={
"linkml_meta": {"equals_string": "axis_1_power_map", "ifabsent": "string(axis_1_power_map)"}
"linkml_meta": {
"equals_string": "axis_1_power_map",
"ifabsent": "string(axis_1_power_map)",
}
},
)
dimension: Optional[np.int32] = Field(
None,
description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""",
)
field_of_view: Optional[np.float32] = 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).""")
field_of_view: Optional[np.float32] = 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)."""
)
array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field(
None,
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}
},
)
@ -175,18 +204,27 @@ class ImagingRetinotopyAxis2PhaseMap(ConfiguredBaseModel):
name: Literal["axis_2_phase_map"] = Field(
"axis_2_phase_map",
json_schema_extra={
"linkml_meta": {"equals_string": "axis_2_phase_map", "ifabsent": "string(axis_2_phase_map)"}
"linkml_meta": {
"equals_string": "axis_2_phase_map",
"ifabsent": "string(axis_2_phase_map)",
}
},
)
dimension: Optional[np.int32] = Field(
None,
description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""",
)
field_of_view: Optional[np.float32] = 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).""")
field_of_view: Optional[np.float32] = 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)."""
)
array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field(
None,
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}
},
)
@ -200,18 +238,27 @@ class ImagingRetinotopyAxis2PowerMap(ConfiguredBaseModel):
name: Literal["axis_2_power_map"] = Field(
"axis_2_power_map",
json_schema_extra={
"linkml_meta": {"equals_string": "axis_2_power_map", "ifabsent": "string(axis_2_power_map)"}
"linkml_meta": {
"equals_string": "axis_2_power_map",
"ifabsent": "string(axis_2_power_map)",
}
},
)
dimension: Optional[np.int32] = Field(
None,
description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""",
)
field_of_view: Optional[np.float32] = 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).""")
field_of_view: Optional[np.float32] = 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)."""
)
array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field(
None,
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}
},
)
@ -225,7 +272,10 @@ class ImagingRetinotopyFocalDepthImage(ConfiguredBaseModel):
name: Literal["focal_depth_image"] = Field(
"focal_depth_image",
json_schema_extra={
"linkml_meta": {"equals_string": "focal_depth_image", "ifabsent": "string(focal_depth_image)"}
"linkml_meta": {
"equals_string": "focal_depth_image",
"ifabsent": "string(focal_depth_image)",
}
},
)
bits_per_pixel: Optional[np.int32] = Field(
@ -236,12 +286,20 @@ class ImagingRetinotopyFocalDepthImage(ConfiguredBaseModel):
None,
description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""",
)
field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""")
focal_depth: Optional[np.float32] = Field(None, description="""Focal depth offset, in meters.""")
format: Optional[str] = Field(None, description="""Format of image. Right now only 'raw' is supported.""")
field_of_view: Optional[np.float32] = Field(
None, description="""Size of viewing area, in meters."""
)
focal_depth: Optional[np.float32] = Field(
None, description="""Focal depth offset, in meters."""
)
format: Optional[str] = Field(
None, description="""Format of image. Right now only 'raw' is supported."""
)
array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.uint16]] = Field(
None,
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}
},
)
@ -253,16 +311,23 @@ class ImagingRetinotopySignMap(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.retinotopy"})
name: Literal["sign_map"] = Field(
"sign_map", json_schema_extra={"linkml_meta": {"equals_string": "sign_map", "ifabsent": "string(sign_map)"}}
"sign_map",
json_schema_extra={
"linkml_meta": {"equals_string": "sign_map", "ifabsent": "string(sign_map)"}
},
)
dimension: Optional[np.int32] = Field(
None,
description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""",
)
field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""")
field_of_view: Optional[np.float32] = Field(
None, description="""Size of viewing area, in meters."""
)
array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field(
None,
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}
},
)
@ -276,7 +341,10 @@ class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel):
name: Literal["vasculature_image"] = Field(
"vasculature_image",
json_schema_extra={
"linkml_meta": {"equals_string": "vasculature_image", "ifabsent": "string(vasculature_image)"}
"linkml_meta": {
"equals_string": "vasculature_image",
"ifabsent": "string(vasculature_image)",
}
},
)
bits_per_pixel: Optional[np.int32] = Field(
@ -287,11 +355,17 @@ class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel):
None,
description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""",
)
field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""")
format: Optional[str] = Field(None, description="""Format of image. Right now only 'raw' is supported.""")
field_of_view: Optional[np.float32] = Field(
None, description="""Size of viewing area, in meters."""
)
format: Optional[str] = Field(
None, description="""Format of image. Right now only 'raw' is supported."""
)
array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.uint16]] = Field(
None,
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}
},
)

View file

@ -7,7 +7,12 @@ import sys
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator
import numpy as np
from ...hdmf_common.v1_1_3.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData
from ...hdmf_common.v1_1_3.hdmf_common_sparse import (
CSRMatrix,
CSRMatrixIndices,
CSRMatrixIndptr,
CSRMatrixData,
)
from ...hdmf_common.v1_1_3.hdmf_common_table import (
Data,
Index,
@ -143,7 +148,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")

View file

@ -23,7 +23,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -79,7 +81,9 @@ class NWBData(Data):
An abstract data type for a dataset.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
name: str = Field(...)
@ -89,7 +93,9 @@ 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)).
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
name: str = Field(...)
resolution: Optional[np.float32] = Field(
@ -110,7 +116,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
name: str = Field(...)
@ -120,7 +128,9 @@ class NWBDataInterface(NWBContainer):
An abstract data type for a generic container storing collections of data, as opposed to metadata.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
name: str = Field(...)
@ -130,7 +140,9 @@ class TimeSeries(NWBDataInterface):
General purpose time series.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
name: str = Field(...)
description: Optional[str] = Field(None, description="""Description of the time series.""")
@ -159,7 +171,9 @@ class TimeSeries(NWBDataInterface):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -175,7 +189,8 @@ class TimeSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
conversion: Optional[np.float32] = Field(
None,
@ -208,10 +223,14 @@ class TimeSeriesStartingTime(ConfiguredBaseModel):
name: Literal["starting_time"] = Field(
"starting_time",
json_schema_extra={"linkml_meta": {"equals_string": "starting_time", "ifabsent": "string(starting_time)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "starting_time", "ifabsent": "string(starting_time)"}
},
)
rate: Optional[np.float32] = 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'."""
)
value: np.float64 = Field(...)
@ -223,7 +242,8 @@ class TimeSeriesSync(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base"})
name: Literal["sync"] = Field(
"sync", json_schema_extra={"linkml_meta": {"equals_string": "sync", "ifabsent": "string(sync)"}}
"sync",
json_schema_extra={"linkml_meta": {"equals_string": "sync", "ifabsent": "string(sync)"}},
)
@ -232,10 +252,15 @@ class ProcessingModule(NWBContainer):
A collection of processed data.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
children: Optional[List[Union[DynamicTable, NWBDataInterface]]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]}}
None,
json_schema_extra={
"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]}
},
)
name: str = Field(...)
@ -245,10 +270,14 @@ class Images(NWBDataInterface):
A collection of images.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
name: str = Field("Images", json_schema_extra={"linkml_meta": {"ifabsent": "string(Images)"}})
description: Optional[str] = Field(None, description="""Description of this collection of images.""")
description: Optional[str] = Field(
None, description="""Description of this collection of images."""
)
image: List[Image] = Field(..., description="""Images stored in this collection.""")

View file

@ -44,7 +44,12 @@ from ...core.v2_2_4.core_nwb_base import (
ProcessingModule,
Images,
)
from ...hdmf_common.v1_1_3.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData
from ...hdmf_common.v1_1_3.hdmf_common_sparse import (
CSRMatrix,
CSRMatrixIndices,
CSRMatrixIndptr,
CSRMatrixData,
)
from ...hdmf_common.v1_1_3.hdmf_common_table import (
Data,
Index,
@ -70,7 +75,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -126,11 +133,14 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
name: str = Field(...)
data: SpatialSeriesData = Field(
..., description="""1-D or 2-D array storing position or direction relative to some reference frame."""
...,
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."""
@ -157,7 +167,9 @@ class SpatialSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -173,14 +185,18 @@ class SpatialSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
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'.""",
)
array: Optional[
Union[NDArray[Shape["* num_times"], np.number], NDArray[Shape["* num_times, * num_features"], np.number]]
Union[
NDArray[Shape["* num_times"], np.number],
NDArray[Shape["* num_times, * num_features"], np.number],
]
] = Field(None)
@ -189,7 +205,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
children: Optional[List[IntervalSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "IntervalSeries"}]}}
@ -202,7 +220,9 @@ class BehavioralEvents(NWBDataInterface):
TimeSeries for storing behavioral events. See description of <a href=\"#BehavioralEpochs\">BehavioralEpochs</a> for more details.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
children: Optional[List[TimeSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}}
@ -215,7 +235,9 @@ class BehavioralTimeSeries(NWBDataInterface):
TimeSeries for storing Behavoioral time series data. See description of <a href=\"#BehavioralEpochs\">BehavioralEpochs</a> for more details.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
children: Optional[List[TimeSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}}
@ -228,7 +250,9 @@ class PupilTracking(NWBDataInterface):
Eye-tracking data, representing pupil size.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
children: Optional[List[TimeSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}}
@ -241,7 +265,9 @@ class EyeTracking(NWBDataInterface):
Eye-tracking data, representing direction of gaze.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
children: Optional[List[SpatialSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}}
@ -254,7 +280,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
children: Optional[List[SpatialSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}}
@ -267,7 +295,9 @@ class Position(NWBDataInterface):
Position data, whether along the x, x/y or x/y/z axis.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
children: Optional[List[SpatialSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}}

View file

@ -22,7 +22,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -62,14 +64,18 @@ class Device(NWBContainer):
Metadata about a data acquisition device, e.g., recording system, electrode, microscope.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.device", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.device", "tree_root": True}
)
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.""",
)
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."""
)
# Model rebuild

View file

@ -7,7 +7,15 @@ import sys
import numpy as np
from ...hdmf_common.v1_1_3.hdmf_common_table import DynamicTableRegion
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator
from pydantic import (
BaseModel,
ConfigDict,
Field,
RootModel,
field_validator,
ValidationInfo,
BeforeValidator,
)
from ...core.v2_2_4.core_nwb_base import (
TimeSeries,
TimeSeriesStartingTime,
@ -30,7 +38,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -75,7 +85,12 @@ linkml_meta = LinkMLMeta(
},
"default_prefix": "core.nwb.ecephys/",
"id": "core.nwb.ecephys",
"imports": ["core.nwb.base", "../../hdmf_common/v1_1_3/namespace", "core.nwb.device", "core.nwb.language"],
"imports": [
"core.nwb.base",
"../../hdmf_common/v1_1_3/namespace",
"core.nwb.device",
"core.nwb.language",
],
"name": "core.nwb.ecephys",
}
)
@ -86,7 +101,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
name: str = Field(...)
data: Union[
@ -97,7 +114,9 @@ class ElectricalSeries(TimeSeries):
electrodes: Named[DynamicTableRegion] = Field(
...,
description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field(
None,
@ -126,7 +145,9 @@ class ElectricalSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -139,7 +160,9 @@ 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).
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
name: str = Field(...)
data: Union[
@ -154,7 +177,9 @@ class SpikeEventSeries(ElectricalSeries):
electrodes: Named[DynamicTableRegion] = Field(
...,
description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field(
None,
@ -178,7 +203,9 @@ class SpikeEventSeries(ElectricalSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -191,9 +218,14 @@ class FeatureExtraction(NWBDataInterface):
Features, such as PC1 and PC2, that are extracted from signals stored in a SpikeEventSeries or other source.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
name: str = Field("FeatureExtraction", json_schema_extra={"linkml_meta": {"ifabsent": "string(FeatureExtraction)"}})
name: str = Field(
"FeatureExtraction",
json_schema_extra={"linkml_meta": {"ifabsent": "string(FeatureExtraction)"}},
)
description: NDArray[Shape["* num_features"], str] = Field(
...,
description="""Description of features (eg, ''PC1'') for each of the extracted features.""",
@ -204,7 +236,13 @@ class FeatureExtraction(NWBDataInterface):
description="""Multi-dimensional array of features extracted from each event.""",
json_schema_extra={
"linkml_meta": {
"array": {"dimensions": [{"alias": "num_events"}, {"alias": "num_channels"}, {"alias": "num_features"}]}
"array": {
"dimensions": [
{"alias": "num_events"},
{"alias": "num_channels"},
{"alias": "num_features"},
]
}
}
},
)
@ -216,7 +254,9 @@ class FeatureExtraction(NWBDataInterface):
electrodes: Named[DynamicTableRegion] = Field(
...,
description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
@ -225,9 +265,13 @@ class EventDetection(NWBDataInterface):
Detected spike events from voltage trace(s).
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
name: str = Field("EventDetection", json_schema_extra={"linkml_meta": {"ifabsent": "string(EventDetection)"}})
name: str = Field(
"EventDetection", json_schema_extra={"linkml_meta": {"ifabsent": "string(EventDetection)"}}
)
detection_method: str = Field(
...,
description="""Description of how events were detected, such as voltage threshold, or dV/dT threshold, as well as relevant values.""",
@ -249,7 +293,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
children: Optional[List[SpikeEventSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpikeEventSeries"}]}}
@ -262,7 +308,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
children: Optional[List[ElectricalSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "ElectricalSeries"}]}}
@ -275,7 +323,9 @@ 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 description or comments field.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
children: Optional[List[ElectricalSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "ElectricalSeries"}]}}
@ -288,7 +338,9 @@ class ElectrodeGroup(NWBContainer):
A physical grouping of electrodes, e.g. a shank of an array.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
name: str = Field(...)
description: Optional[str] = Field(None, description="""Description of this electrode group.""")
@ -309,7 +361,10 @@ class ElectrodeGroupPosition(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys"})
name: Literal["position"] = Field(
"position", json_schema_extra={"linkml_meta": {"equals_string": "position", "ifabsent": "string(position)"}}
"position",
json_schema_extra={
"linkml_meta": {"equals_string": "position", "ifabsent": "string(position)"}
},
)
x: Optional[np.float32] = Field(None, description="""x coordinate""")
y: Optional[np.float32] = Field(None, description="""y coordinate""")
@ -321,22 +376,33 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
name: str = Field("ClusterWaveforms", json_schema_extra={"linkml_meta": {"ifabsent": "string(ClusterWaveforms)"}})
waveform_filtering: str = Field(..., description="""Filtering applied to data before generating mean/sd""")
name: str = Field(
"ClusterWaveforms",
json_schema_extra={"linkml_meta": {"ifabsent": "string(ClusterWaveforms)"}},
)
waveform_filtering: str = Field(
..., description="""Filtering applied to data before generating mean/sd"""
)
waveform_mean: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = 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)""",
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]}}
"linkml_meta": {
"array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]}
}
},
)
waveform_sd: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = Field(
...,
description="""Stdev of waveforms for each cluster, using the same indices as in mean""",
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]}}
"linkml_meta": {
"array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]}
}
},
)
@ -346,9 +412,13 @@ class Clustering(NWBDataInterface):
DEPRECATED Clustered spike data, whether from automatic clustering tools (e.g., klustakwik) or as a result of manual sorting.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
name: str = Field("Clustering", json_schema_extra={"linkml_meta": {"ifabsent": "string(Clustering)"}})
name: str = Field(
"Clustering", json_schema_extra={"linkml_meta": {"ifabsent": "string(Clustering)"}}
)
description: str = Field(
...,
description="""Description of clusters or clustering, (e.g. cluster 0 is noise, clusters curated using Klusters, etc)""",

View file

@ -6,7 +6,15 @@ import re
import sys
import numpy as np
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator
from pydantic import (
BaseModel,
ConfigDict,
Field,
RootModel,
field_validator,
ValidationInfo,
BeforeValidator,
)
from numpydantic import NDArray, Shape
from ...hdmf_common.v1_1_3.hdmf_common_table import DynamicTable, VectorIndex, VectorData
from ...core.v2_2_4.core_nwb_base import TimeSeries
@ -24,7 +32,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -80,52 +90,70 @@ class TimeIntervals(DynamicTable):
A container for aggregating epoch data and the TimeSeries that each epoch applies to.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.epoch", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.epoch", "tree_root": True}
)
name: str = Field(...)
start_time: NDArray[Any, np.float32] = Field(
...,
description="""Start time of epoch, in seconds.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
stop_time: NDArray[Any, np.float32] = Field(
...,
description="""Stop time of epoch, in seconds.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
tags: Optional[NDArray[Any, str]] = Field(
None,
description="""User-defined tags that identify or categorize events.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
tags_index: Named[Optional[VectorIndex]] = Field(
None,
description="""Index for tags.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
timeseries: Optional[TimeIntervalsTimeseries] = Field(
None, description="""An index into a TimeSeries object."""
)
timeseries: Optional[TimeIntervalsTimeseries] = Field(None, description="""An index into a TimeSeries object.""")
timeseries_index: Named[Optional[VectorIndex]] = Field(
None,
description="""Index for timeseries.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
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: NDArray[Shape["* num_rows"], int] = Field(
...,
description="""Array of unique identifiers for the rows of this dynamic table.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}},
)
vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""")
vector_data: Optional[List[VectorData]] = Field(
None, description="""Vector columns of this dynamic table."""
)
vector_index: Optional[List[VectorIndex]] = Field(
None, description="""Indices for the vector columns of this dynamic table."""
)
@ -140,17 +168,24 @@ class TimeIntervalsTimeseries(VectorData):
name: Literal["timeseries"] = Field(
"timeseries",
json_schema_extra={"linkml_meta": {"equals_string": "timeseries", "ifabsent": "string(timeseries)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "timeseries", "ifabsent": "string(timeseries)"}
},
)
idx_start: Optional[np.int32] = Field(
None,
description="""Start index into the TimeSeries 'data' and 'timestamp' datasets of the referenced TimeSeries. The first dimension of those arrays is always time.""",
)
count: Optional[np.int32] = Field(
None, description="""Number of data samples available in this time series, during this epoch."""
None,
description="""Number of data samples available in this time series, during this epoch.""",
)
timeseries: Optional[TimeSeries] = Field(
None, description="""the TimeSeries that this index applies to."""
)
description: Optional[str] = Field(
None, description="""Description of what these vectors represent."""
)
timeseries: Optional[TimeSeries] = Field(None, description="""the TimeSeries that this index applies to.""")
description: Optional[str] = Field(None, description="""Description of what these vectors represent.""")
array: Optional[
Union[
NDArray[Shape["* dim0"], Any],

View file

@ -44,7 +44,12 @@ from ...core.v2_2_4.core_nwb_base import (
ProcessingModule,
Images,
)
from ...hdmf_common.v1_1_3.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData
from ...hdmf_common.v1_1_3.hdmf_common_sparse import (
CSRMatrix,
CSRMatrixIndices,
CSRMatrixIndptr,
CSRMatrixData,
)
from ...hdmf_common.v1_1_3.hdmf_common_table import (
Data,
Index,
@ -119,7 +124,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -186,10 +193,14 @@ class ScratchData(NWBData):
Any one-off datasets
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.file", "tree_root": True}
)
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"""
)
class NWBFile(NWBContainer):
@ -197,10 +208,13 @@ class NWBFile(NWBContainer):
An NWB:N file storing cellular-based neurophysiology data from a single experimental session.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.file", "tree_root": True}
)
name: Literal["root"] = Field(
"root", json_schema_extra={"linkml_meta": {"equals_string": "root", "ifabsent": "string(root)"}}
"root",
json_schema_extra={"linkml_meta": {"equals_string": "root", "ifabsent": "string(root)"}},
)
nwb_version: Optional[str] = Field(
None,
@ -209,7 +223,9 @@ class NWBFile(NWBContainer):
file_create_date: NDArray[Shape["* num_modifications"], np.datetime64] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_modifications"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_modifications"}]}}
},
)
identifier: str = Field(
...,
@ -229,17 +245,23 @@ class NWBFile(NWBContainer):
acquisition: Optional[List[Union[DynamicTable, NWBDataInterface]]] = Field(
None,
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.""",
json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]}},
json_schema_extra={
"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]}
},
)
analysis: Optional[List[Union[DynamicTable, NWBContainer]]] = Field(
None,
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.""",
json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]}},
json_schema_extra={
"linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]}
},
)
scratch: Optional[List[Union[DynamicTable, NWBContainer]]] = 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.""",
json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]}},
json_schema_extra={
"linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]}
},
)
processing: Optional[List[ProcessingModule]] = Field(
None,
@ -279,7 +301,10 @@ class NWBFileStimulus(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file"})
name: Literal["stimulus"] = Field(
"stimulus", json_schema_extra={"linkml_meta": {"equals_string": "stimulus", "ifabsent": "string(stimulus)"}}
"stimulus",
json_schema_extra={
"linkml_meta": {"equals_string": "stimulus", "ifabsent": "string(stimulus)"}
},
)
presentation: Optional[List[TimeSeries]] = Field(
None,
@ -301,16 +326,27 @@ class NWBFileGeneral(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file"})
name: Literal["general"] = Field(
"general", json_schema_extra={"linkml_meta": {"equals_string": "general", "ifabsent": "string(general)"}}
"general",
json_schema_extra={
"linkml_meta": {"equals_string": "general", "ifabsent": "string(general)"}
},
)
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."""
)
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.""")
experimenter: Optional[NDArray[Shape["* num_experimenters"], str]] = Field(
None,
description="""Name of person(s) who performed the experiment. Can also specify roles of different people involved.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_experimenters"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_experimenters"}]}}
},
)
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[NDArray[Shape["* num_keywords"], str]] = Field(
None,
description="""Terms to search over.""",
@ -323,12 +359,15 @@ class NWBFileGeneral(ConfiguredBaseModel):
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."""
None,
description="""Experimental protocol, if applicable. e.g., include IACUC protocol number.""",
)
related_publications: Optional[NDArray[Shape["* num_publications"], str]] = Field(
None,
description="""Publication information. PMID, DOI, URL, etc.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_publications"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_publications"}]}}
},
)
session_id: Optional[str] = Field(None, description="""Lab-specific ID for the session.""")
slices: Optional[str] = Field(
@ -336,7 +375,8 @@ class NWBFileGeneral(ConfiguredBaseModel):
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."""
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."""
@ -359,7 +399,8 @@ class NWBFileGeneral(ConfiguredBaseModel):
json_schema_extra={"linkml_meta": {"any_of": [{"range": "Device"}]}},
)
subject: Optional[Subject] = Field(
None, description="""Information about the animal or person from which the data was measured."""
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."""
@ -388,7 +429,9 @@ class NWBFileGeneralSourceScript(ConfiguredBaseModel):
name: Literal["source_script"] = Field(
"source_script",
json_schema_extra={"linkml_meta": {"equals_string": "source_script", "ifabsent": "string(source_script)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "source_script", "ifabsent": "string(source_script)"}
},
)
file_name: Optional[str] = Field(None, description="""Name of script file.""")
value: str = Field(...)
@ -404,10 +447,15 @@ class NWBFileGeneralExtracellularEphys(ConfiguredBaseModel):
name: Literal["extracellular_ephys"] = Field(
"extracellular_ephys",
json_schema_extra={
"linkml_meta": {"equals_string": "extracellular_ephys", "ifabsent": "string(extracellular_ephys)"}
"linkml_meta": {
"equals_string": "extracellular_ephys",
"ifabsent": "string(extracellular_ephys)",
}
},
)
electrode_group: Optional[List[ElectrodeGroup]] = Field(None, description="""Physical group of electrodes.""")
electrode_group: Optional[List[ElectrodeGroup]] = Field(
None, description="""Physical group of electrodes."""
)
electrodes: Optional[NWBFileGeneralExtracellularEphysElectrodes] = Field(
None, description="""A table of all electrodes (i.e. channels) used for recording."""
)
@ -422,48 +470,62 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable):
name: Literal["electrodes"] = Field(
"electrodes",
json_schema_extra={"linkml_meta": {"equals_string": "electrodes", "ifabsent": "string(electrodes)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "electrodes", "ifabsent": "string(electrodes)"}
},
)
x: NDArray[Any, np.float32] = Field(
...,
description="""x coordinate of the channel location in the brain (+x is posterior).""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
y: NDArray[Any, np.float32] = Field(
...,
description="""y coordinate of the channel location in the brain (+y is inferior).""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
z: NDArray[Any, np.float32] = Field(
...,
description="""z coordinate of the channel location in the brain (+z is right).""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
imp: NDArray[Any, np.float32] = Field(
...,
description="""Impedance of the channel.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
location: NDArray[Any, str] = Field(
...,
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.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
filtering: NDArray[Any, np.float32] = Field(
...,
description="""Description of hardware filtering.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
group: List[ElectrodeGroup] = Field(
@ -473,48 +535,62 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable):
...,
description="""Name of the ElectrodeGroup this electrode is a part of.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
rel_x: Optional[NDArray[Any, np.float32]] = Field(
None,
description="""x coordinate in electrode group""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
rel_y: Optional[NDArray[Any, np.float32]] = Field(
None,
description="""y coordinate in electrode group""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
rel_z: Optional[NDArray[Any, np.float32]] = Field(
None,
description="""z coordinate in electrode group""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
reference: Optional[NDArray[Any, str]] = Field(
None,
description="""Description of the reference used for this electrode.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
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: NDArray[Shape["* num_rows"], int] = Field(
...,
description="""Array of unique identifiers for the rows of this dynamic table.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}},
)
vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""")
vector_data: Optional[List[VectorData]] = Field(
None, description="""Vector columns of this dynamic table."""
)
vector_index: Optional[List[VectorIndex]] = Field(
None, description="""Indices for the vector columns of this dynamic table."""
)
@ -530,7 +606,10 @@ class NWBFileGeneralIntracellularEphys(ConfiguredBaseModel):
name: Literal["intracellular_ephys"] = Field(
"intracellular_ephys",
json_schema_extra={
"linkml_meta": {"equals_string": "intracellular_ephys", "ifabsent": "string(intracellular_ephys)"}
"linkml_meta": {
"equals_string": "intracellular_ephys",
"ifabsent": "string(intracellular_ephys)",
}
},
)
filtering: Optional[str] = Field(
@ -550,7 +629,9 @@ class LabMetaData(NWBContainer):
Lab-specific meta-data.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.file", "tree_root": True}
)
name: str = Field(...)
@ -560,24 +641,33 @@ class Subject(NWBContainer):
Information about the animal or person from which the data was measured.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.file", "tree_root": True}
)
name: str = Field(...)
age: Optional[str] = Field(None, description="""Age of subject. Can be supplied instead of 'date_of_birth'.""")
age: Optional[str] = Field(
None, description="""Age of subject. Can be supplied instead of 'date_of_birth'."""
)
date_of_birth: Optional[np.datetime64] = 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)."""
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.""")
species: Optional[str] = Field(None, description="""Species of subject.""")
subject_id: Optional[str] = Field(
None, description="""ID of animal/person used/participating in experiment (lab convention)."""
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."""
None,
description="""Weight at time of experiment, at time of surgery and at other important times.""",
)

View file

@ -5,7 +5,12 @@ from enum import Enum
import re
import sys
import numpy as np
from ...hdmf_common.v1_1_3.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData
from ...hdmf_common.v1_1_3.hdmf_common_sparse import (
CSRMatrix,
CSRMatrixIndices,
CSRMatrixIndptr,
CSRMatrixData,
)
from ...hdmf_common.v1_1_3.hdmf_common_table import (
Data,
Index,
@ -30,7 +35,15 @@ from ...core.v2_2_4.core_nwb_base import (
Images,
)
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator
from pydantic import (
BaseModel,
ConfigDict,
Field,
RootModel,
field_validator,
ValidationInfo,
BeforeValidator,
)
from numpydantic import NDArray, Shape
metamodel_version = "None"
@ -46,7 +59,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -91,7 +106,12 @@ linkml_meta = LinkMLMeta(
},
"default_prefix": "core.nwb.icephys/",
"id": "core.nwb.icephys",
"imports": ["core.nwb.base", "core.nwb.device", "../../hdmf_common/v1_1_3/namespace", "core.nwb.language"],
"imports": [
"core.nwb.base",
"core.nwb.device",
"../../hdmf_common/v1_1_3/namespace",
"core.nwb.language",
],
"name": "core.nwb.icephys",
}
)
@ -102,7 +122,9 @@ class PatchClampSeries(TimeSeries):
An abstract base class for patch-clamp data - stimulus or response, current or voltage.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
stimulus_description: Optional[str] = Field(
@ -113,7 +135,8 @@ class PatchClampSeries(TimeSeries):
)
data: PatchClampSeriesData = Field(..., description="""Recorded voltage or current.""")
gain: Optional[np.float32] = Field(
None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp)."""
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.""")
comments: Optional[str] = Field(
@ -137,7 +160,9 @@ class PatchClampSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -153,7 +178,8 @@ class PatchClampSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
unit: Optional[str] = Field(
None,
@ -169,13 +195,17 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
data: CurrentClampSeriesData = Field(..., description="""Recorded voltage.""")
bias_current: Optional[np.float32] = Field(None, description="""Bias current, in amps.""")
bridge_balance: Optional[np.float32] = Field(None, description="""Bridge balance, in ohms.""")
capacitance_compensation: Optional[np.float32] = Field(None, description="""Capacitance compensation, in farads.""")
capacitance_compensation: Optional[np.float32] = Field(
None, description="""Capacitance compensation, in farads."""
)
stimulus_description: Optional[str] = Field(
None, description="""Protocol/stimulus name for this patch-clamp dataset."""
)
@ -183,7 +213,8 @@ class CurrentClampSeries(PatchClampSeries):
None, description="""Sweep number, allows to group different PatchClampSeries together."""
)
gain: Optional[np.float32] = Field(
None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp)."""
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.""")
comments: Optional[str] = Field(
@ -207,7 +238,9 @@ class CurrentClampSeries(PatchClampSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -223,7 +256,8 @@ class CurrentClampSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
unit: Optional[str] = Field(
None,
@ -237,11 +271,15 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
bias_current: np.float32 = Field(..., description="""Bias current, in amps, fixed to 0.0.""")
bridge_balance: np.float32 = Field(..., description="""Bridge balance, in ohms, fixed to 0.0.""")
bridge_balance: np.float32 = Field(
..., description="""Bridge balance, in ohms, fixed to 0.0."""
)
capacitance_compensation: np.float32 = Field(
..., description="""Capacitance compensation, in farads, fixed to 0.0."""
)
@ -253,7 +291,8 @@ class IZeroClampSeries(CurrentClampSeries):
None, description="""Sweep number, allows to group different PatchClampSeries together."""
)
gain: Optional[np.float32] = Field(
None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp)."""
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.""")
comments: Optional[str] = Field(
@ -277,7 +316,9 @@ class IZeroClampSeries(CurrentClampSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -290,7 +331,9 @@ class CurrentClampStimulusSeries(PatchClampSeries):
Stimulus current applied during current clamp recording.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
data: CurrentClampStimulusSeriesData = Field(..., description="""Stimulus current applied.""")
@ -301,7 +344,8 @@ class CurrentClampStimulusSeries(PatchClampSeries):
None, description="""Sweep number, allows to group different PatchClampSeries together."""
)
gain: Optional[np.float32] = Field(
None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp)."""
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.""")
comments: Optional[str] = Field(
@ -325,7 +369,9 @@ class CurrentClampStimulusSeries(PatchClampSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -341,7 +387,8 @@ class CurrentClampStimulusSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
unit: Optional[str] = Field(
None,
@ -355,7 +402,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
data: VoltageClampSeriesData = Field(..., description="""Recorded current.""")
@ -377,8 +426,8 @@ class VoltageClampSeries(PatchClampSeries):
whole_cell_capacitance_comp: Optional[VoltageClampSeriesWholeCellCapacitanceComp] = Field(
None, description="""Whole cell capacitance compensation, in farads."""
)
whole_cell_series_resistance_comp: Optional[VoltageClampSeriesWholeCellSeriesResistanceComp] = Field(
None, description="""Whole cell series resistance compensation, in ohms."""
whole_cell_series_resistance_comp: Optional[VoltageClampSeriesWholeCellSeriesResistanceComp] = (
Field(None, description="""Whole cell series resistance compensation, in ohms.""")
)
stimulus_description: Optional[str] = Field(
None, description="""Protocol/stimulus name for this patch-clamp dataset."""
@ -387,7 +436,8 @@ class VoltageClampSeries(PatchClampSeries):
None, description="""Sweep number, allows to group different PatchClampSeries together."""
)
gain: Optional[np.float32] = Field(
None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp)."""
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.""")
comments: Optional[str] = Field(
@ -411,7 +461,9 @@ class VoltageClampSeries(PatchClampSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -427,7 +479,8 @@ class VoltageClampSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
unit: Optional[str] = Field(
None,
@ -446,11 +499,15 @@ class VoltageClampSeriesCapacitanceFast(ConfiguredBaseModel):
name: Literal["capacitance_fast"] = Field(
"capacitance_fast",
json_schema_extra={
"linkml_meta": {"equals_string": "capacitance_fast", "ifabsent": "string(capacitance_fast)"}
"linkml_meta": {
"equals_string": "capacitance_fast",
"ifabsent": "string(capacitance_fast)",
}
},
)
unit: Optional[str] = Field(
None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'."""
None,
description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""",
)
value: np.float32 = Field(...)
@ -465,11 +522,15 @@ class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel):
name: Literal["capacitance_slow"] = Field(
"capacitance_slow",
json_schema_extra={
"linkml_meta": {"equals_string": "capacitance_slow", "ifabsent": "string(capacitance_slow)"}
"linkml_meta": {
"equals_string": "capacitance_slow",
"ifabsent": "string(capacitance_slow)",
}
},
)
unit: Optional[str] = Field(
None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'."""
None,
description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""",
)
value: np.float32 = Field(...)
@ -491,7 +552,8 @@ class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel):
},
)
unit: Optional[str] = Field(
None, description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'."""
None,
description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'.""",
)
value: np.float32 = Field(...)
@ -513,7 +575,8 @@ class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel):
},
)
unit: Optional[str] = Field(
None, description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'."""
None,
description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'.""",
)
value: np.float32 = Field(...)
@ -535,7 +598,8 @@ class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel):
},
)
unit: Optional[str] = Field(
None, description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'."""
None,
description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'.""",
)
value: np.float32 = Field(...)
@ -557,7 +621,8 @@ class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel):
},
)
unit: Optional[str] = Field(
None, description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'."""
None,
description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'.""",
)
value: np.float32 = Field(...)
@ -579,7 +644,8 @@ class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel):
},
)
unit: Optional[str] = Field(
None, description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'."""
None,
description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'.""",
)
value: np.float32 = Field(...)
@ -589,7 +655,9 @@ class VoltageClampStimulusSeries(PatchClampSeries):
Stimulus voltage applied during a voltage clamp recording.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
data: VoltageClampStimulusSeriesData = Field(..., description="""Stimulus voltage applied.""")
@ -600,7 +668,8 @@ class VoltageClampStimulusSeries(PatchClampSeries):
None, description="""Sweep number, allows to group different PatchClampSeries together."""
)
gain: Optional[np.float32] = Field(
None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp)."""
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.""")
comments: Optional[str] = Field(
@ -624,7 +693,9 @@ class VoltageClampStimulusSeries(PatchClampSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -640,7 +711,8 @@ class VoltageClampStimulusSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
unit: Optional[str] = Field(
None,
@ -654,19 +726,27 @@ class IntracellularElectrode(NWBContainer):
An intracellular electrode and its metadata.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
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.""")
initial_access_resistance: Optional[str] = Field(None, description="""Initial access resistance.""")
initial_access_resistance: Optional[str] = Field(
None, description="""Initial access resistance."""
)
location: Optional[str] = Field(
None,
description="""Location of the electrode. 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.""",
)
resistance: Optional[str] = Field(None, description="""Electrode resistance, in ohms.""")
seal: Optional[str] = Field(None, description="""Information about seal used for recording.""")
slice: Optional[str] = Field(None, description="""Information about slice used for recording.""")
slice: Optional[str] = Field(
None, description="""Information about slice used for recording."""
)
class SweepTable(DynamicTable):
@ -674,14 +754,18 @@ class SweepTable(DynamicTable):
The table which groups different PatchClampSeries together.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
sweep_number: NDArray[Any, np.uint32] = Field(
...,
description="""Sweep number of the PatchClampSeries in that row.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
series: List[PatchClampSeries] = Field(
@ -690,19 +774,25 @@ class SweepTable(DynamicTable):
series_index: Named[VectorIndex] = Field(
...,
description="""Index for series.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
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: NDArray[Shape["* num_rows"], int] = Field(
...,
description="""Array of unique identifiers for the rows of this dynamic table.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}},
)
vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""")
vector_data: Optional[List[VectorData]] = Field(
None, description="""Vector columns of this dynamic table."""
)
vector_index: Optional[List[VectorIndex]] = Field(
None, description="""Indices for the vector columns of this dynamic table."""
)

View file

@ -19,7 +19,12 @@ from ...core.v2_2_4.core_nwb_base import (
ProcessingModule,
Images,
)
from ...hdmf_common.v1_1_3.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData
from ...hdmf_common.v1_1_3.hdmf_common_sparse import (
CSRMatrix,
CSRMatrixIndices,
CSRMatrixIndptr,
CSRMatrixData,
)
from ...hdmf_common.v1_1_3.hdmf_common_table import (
Data,
Index,
@ -45,7 +50,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -101,7 +108,9 @@ class GrayscaleImage(Image):
A grayscale image.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.image", "tree_root": True}
)
name: str = Field(...)
resolution: Optional[np.float32] = Field(
@ -122,7 +131,9 @@ class RGBImage(Image):
A color image.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.image", "tree_root": True}
)
name: str = Field(...)
resolution: Optional[np.float32] = Field(
@ -143,7 +154,9 @@ class RGBAImage(Image):
A color image with transparency.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.image", "tree_root": True}
)
name: str = Field(...)
resolution: Optional[np.float32] = Field(
@ -164,11 +177,16 @@ 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].
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.image", "tree_root": True}
)
name: str = Field(...)
data: Optional[
Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]]
Union[
NDArray[Shape["* frame, * x, * y"], np.number],
NDArray[Shape["* frame, * x, * y, * z"], np.number],
]
] = Field(None, description="""Binary data representing images across frames.""")
dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field(
None,
@ -205,7 +223,9 @@ class ImageSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -222,7 +242,9 @@ class ImageSeriesExternalFile(ConfiguredBaseModel):
name: Literal["external_file"] = Field(
"external_file",
json_schema_extra={"linkml_meta": {"equals_string": "external_file", "ifabsent": "string(external_file)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "external_file", "ifabsent": "string(external_file)"}
},
)
starting_frame: Optional[np.int32] = Field(
None,
@ -238,11 +260,16 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.image", "tree_root": True}
)
name: str = Field(...)
data: Optional[
Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]]
Union[
NDArray[Shape["* frame, * x, * y"], np.number],
NDArray[Shape["* frame, * x, * y, * z"], np.number],
]
] = Field(None, description="""Binary data representing images across frames.""")
dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field(
None,
@ -279,7 +306,9 @@ class ImageMaskSeries(ImageSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -292,15 +321,23 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.image", "tree_root": True}
)
name: str = Field(...)
distance: Optional[np.float32] = Field(None, description="""Distance from camera/monitor to target/eye.""")
distance: Optional[np.float32] = Field(
None, description="""Distance from camera/monitor to target/eye."""
)
field_of_view: Optional[
Union[NDArray[Shape["2 width_height"], np.float32], NDArray[Shape["3 width_height_depth"], np.float32]]
Union[
NDArray[Shape["2 width_height"], np.float32],
NDArray[Shape["3 width_height_depth"], np.float32],
]
] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""")
data: Union[
NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, 3 r_g_b"], np.number]
NDArray[Shape["* frame, * x, * y"], np.number],
NDArray[Shape["* frame, * x, * y, 3 r_g_b"], np.number],
] = Field(..., description="""Images presented to subject, either grayscale or RGB""")
orientation: Optional[str] = Field(
None,
@ -341,7 +378,9 @@ class OpticalSeries(ImageSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -354,7 +393,9 @@ class IndexSeries(TimeSeries):
Stores indices to image frames stored in an ImageSeries. The purpose of the ImageIndexSeries is to allow a static image stack to be stored somewhere, 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 ImageSeries, and the timestamps array indicates when that image was displayed.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.image", "tree_root": True}
)
name: str = Field(...)
data: NDArray[Shape["* num_times"], np.int32] = Field(
@ -384,7 +425,9 @@ class IndexSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,

View file

@ -7,10 +7,23 @@ import sys
import numpy as np
from ...core.v2_2_4.core_nwb_base import TimeSeries, TimeSeriesStartingTime, TimeSeriesSync
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator
from pydantic import (
BaseModel,
ConfigDict,
Field,
RootModel,
field_validator,
ValidationInfo,
BeforeValidator,
)
from ...core.v2_2_4.core_nwb_ecephys import ElectrodeGroup
from numpydantic import NDArray, Shape
from ...hdmf_common.v1_1_3.hdmf_common_table import DynamicTable, VectorData, VectorIndex, DynamicTableRegion
from ...hdmf_common.v1_1_3.hdmf_common_table import (
DynamicTable,
VectorData,
VectorIndex,
DynamicTableRegion,
)
metamodel_version = "None"
version = "2.2.4"
@ -25,7 +38,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -70,7 +85,12 @@ linkml_meta = LinkMLMeta(
},
"default_prefix": "core.nwb.misc/",
"id": "core.nwb.misc",
"imports": ["core.nwb.base", "../../hdmf_common/v1_1_3/namespace", "core.nwb.ecephys", "core.nwb.language"],
"imports": [
"core.nwb.base",
"../../hdmf_common/v1_1_3/namespace",
"core.nwb.ecephys",
"core.nwb.language",
],
"name": "core.nwb.misc",
}
)
@ -81,10 +101,14 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.misc", "tree_root": True}
)
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[NDArray[Shape["* num_features"], str]] = Field(
None,
description="""Units of each feature.""",
@ -117,7 +141,9 @@ class AbstractFeatureSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -133,14 +159,18 @@ class AbstractFeatureSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
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[
Union[NDArray[Shape["* num_times"], np.number], NDArray[Shape["* num_times, * num_features"], np.number]]
Union[
NDArray[Shape["* num_times"], np.number],
NDArray[Shape["* num_times, * num_features"], np.number],
]
] = Field(None)
@ -149,7 +179,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.misc", "tree_root": True}
)
name: str = Field(...)
data: NDArray[Shape["* num_times"], str] = Field(
@ -179,7 +211,9 @@ class AnnotationSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -192,7 +226,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.misc", "tree_root": True}
)
name: str = Field(...)
data: NDArray[Shape["* num_times"], np.int8] = Field(
@ -222,7 +258,9 @@ class IntervalSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -235,10 +273,14 @@ class DecompositionSeries(TimeSeries):
Spectral analysis of a time series, e.g. of an LFP or a speech signal.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.misc", "tree_root": True}
)
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.""")
bands: DecompositionSeriesBands = Field(
...,
@ -266,7 +308,9 @@ class DecompositionSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -282,7 +326,8 @@ class DecompositionSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
unit: Optional[str] = Field(
None,
@ -292,7 +337,13 @@ class DecompositionSeriesData(ConfiguredBaseModel):
None,
json_schema_extra={
"linkml_meta": {
"array": {"dimensions": [{"alias": "num_times"}, {"alias": "num_channels"}, {"alias": "num_bands"}]}
"array": {
"dimensions": [
{"alias": "num_times"},
{"alias": "num_channels"},
{"alias": "num_bands"},
]
}
}
},
)
@ -306,13 +357,16 @@ class DecompositionSeriesBands(DynamicTable):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"})
name: Literal["bands"] = Field(
"bands", json_schema_extra={"linkml_meta": {"equals_string": "bands", "ifabsent": "string(bands)"}}
"bands",
json_schema_extra={"linkml_meta": {"equals_string": "bands", "ifabsent": "string(bands)"}},
)
band_name: NDArray[Any, str] = Field(
...,
description="""Name of the band, e.g. theta.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
band_limits: NDArray[Shape["* num_bands, 2 low_high"], np.float32] = Field(
@ -320,7 +374,12 @@ class DecompositionSeriesBands(DynamicTable):
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.""",
json_schema_extra={
"linkml_meta": {
"array": {"dimensions": [{"alias": "num_bands"}, {"alias": "low_high", "exact_cardinality": 2}]}
"array": {
"dimensions": [
{"alias": "num_bands"},
{"alias": "low_high", "exact_cardinality": 2},
]
}
}
},
)
@ -338,13 +397,17 @@ class DecompositionSeriesBands(DynamicTable):
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: NDArray[Shape["* num_rows"], int] = Field(
...,
description="""Array of unique identifiers for the rows of this dynamic table.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}},
)
vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""")
vector_data: Optional[List[VectorData]] = Field(
None, description="""Vector columns of this dynamic table."""
)
vector_index: Optional[List[VectorIndex]] = Field(
None, description="""Indices for the vector columns of this dynamic table."""
)
@ -355,38 +418,55 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.misc", "tree_root": True}
)
name: str = Field("Units", json_schema_extra={"linkml_meta": {"ifabsent": "string(Units)"}})
spike_times_index: Named[Optional[VectorIndex]] = Field(
None,
description="""Index into the spike_times dataset.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
spike_times: Optional[UnitsSpikeTimes] = Field(
None, description="""Spike times for each unit."""
)
spike_times: Optional[UnitsSpikeTimes] = Field(None, description="""Spike times for each unit.""")
obs_intervals_index: Named[Optional[VectorIndex]] = Field(
None,
description="""Index into the obs_intervals dataset.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
obs_intervals: Optional[NDArray[Shape["* num_intervals, 2 start_end"], np.float64]] = Field(
None,
description="""Observation intervals for each unit.""",
json_schema_extra={
"linkml_meta": {
"array": {"dimensions": [{"alias": "num_intervals"}, {"alias": "start_end", "exact_cardinality": 2}]}
"array": {
"dimensions": [
{"alias": "num_intervals"},
{"alias": "start_end", "exact_cardinality": 2},
]
}
}
},
)
electrodes_index: Named[Optional[VectorIndex]] = Field(
None,
description="""Index into electrodes.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
electrodes: Named[Optional[DynamicTableRegion]] = Field(
None,
description="""Electrode that each spike unit came from, specified using a DynamicTableRegion.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
electrode_group: Optional[List[ElectrodeGroup]] = Field(
None, description="""Electrode group that each spike unit came from."""
@ -407,13 +487,17 @@ class Units(DynamicTable):
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: NDArray[Shape["* num_rows"], int] = Field(
...,
description="""Array of unique identifiers for the rows of this dynamic table.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}},
)
vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""")
vector_data: Optional[List[VectorData]] = Field(
None, description="""Vector columns of this dynamic table."""
)
vector_index: Optional[List[VectorIndex]] = Field(
None, description="""Indices for the vector columns of this dynamic table."""
)
@ -428,13 +512,17 @@ class UnitsSpikeTimes(VectorData):
name: Literal["spike_times"] = Field(
"spike_times",
json_schema_extra={"linkml_meta": {"equals_string": "spike_times", "ifabsent": "string(spike_times)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "spike_times", "ifabsent": "string(spike_times)"}
},
)
resolution: Optional[np.float64] = 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[
Union[
NDArray[Shape["* dim0"], Any],

View file

@ -8,7 +8,12 @@ from typing import Any, ClassVar, List, Literal, Dict, Optional, Union
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator
import numpy as np
from numpydantic import NDArray, Shape
from ...core.v2_2_4.core_nwb_base import TimeSeries, TimeSeriesStartingTime, TimeSeriesSync, NWBContainer
from ...core.v2_2_4.core_nwb_base import (
TimeSeries,
TimeSeriesStartingTime,
TimeSeriesSync,
NWBContainer,
)
metamodel_version = "None"
version = "2.2.4"
@ -23,7 +28,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -79,7 +86,9 @@ class OptogeneticSeries(TimeSeries):
An optogenetic stimulus.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ogen", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ogen", "tree_root": True}
)
name: str = Field(...)
data: NDArray[Shape["* num_times"], np.number] = Field(
@ -109,7 +118,9 @@ class OptogeneticSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -122,7 +133,9 @@ class OptogeneticStimulusSite(NWBContainer):
A site of optogenetic stimulation.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ogen", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ogen", "tree_root": True}
)
name: str = Field(...)
description: str = Field(..., description="""Description of stimulation site.""")

View file

@ -18,7 +18,12 @@ from ...core.v2_2_4.core_nwb_base import (
ProcessingModule,
Images,
)
from ...hdmf_common.v1_1_3.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData
from ...hdmf_common.v1_1_3.hdmf_common_sparse import (
CSRMatrix,
CSRMatrixIndices,
CSRMatrixIndptr,
CSRMatrixData,
)
from ...hdmf_common.v1_1_3.hdmf_common_table import (
Data,
Index,
@ -40,7 +45,15 @@ from ...core.v2_2_4.core_nwb_image import (
IndexSeries,
)
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator
from pydantic import (
BaseModel,
ConfigDict,
Field,
RootModel,
field_validator,
ValidationInfo,
BeforeValidator,
)
from numpydantic import NDArray, Shape
metamodel_version = "None"
@ -56,7 +69,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -118,7 +133,9 @@ class TwoPhotonSeries(ImageSeries):
Image stack recorded over time from 2-photon microscope.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
name: str = Field(...)
pmt_gain: Optional[np.float32] = Field(None, description="""Photomultiplier gain.""")
@ -127,10 +144,16 @@ class TwoPhotonSeries(ImageSeries):
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[
Union[NDArray[Shape["2 width_height"], np.float32], NDArray[Shape["3 width_height"], np.float32]]
Union[
NDArray[Shape["2 width_height"], np.float32],
NDArray[Shape["3 width_height"], np.float32],
]
] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""")
data: Optional[
Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]]
Union[
NDArray[Shape["* frame, * x, * y"], np.number],
NDArray[Shape["* frame, * x, * y, * z"], np.number],
]
] = Field(None, description="""Binary data representing images across frames.""")
dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field(
None,
@ -167,7 +190,9 @@ class TwoPhotonSeries(ImageSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -180,16 +205,21 @@ class RoiResponseSeries(TimeSeries):
ROI responses over an imaging plane. The first dimension represents time. The second dimension, if present, represents ROIs.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
name: str = Field(...)
data: Union[NDArray[Shape["* num_times"], np.number], NDArray[Shape["* num_times, * num_rois"], np.number]] = Field(
..., description="""Signals from ROIs."""
)
data: Union[
NDArray[Shape["* num_times"], np.number],
NDArray[Shape["* num_times, * num_rois"], np.number],
] = Field(..., description="""Signals from ROIs.""")
rois: Named[DynamicTableRegion] = Field(
...,
description="""DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
description: Optional[str] = Field(None, description="""Description of the time series.""")
comments: Optional[str] = Field(
@ -213,7 +243,9 @@ class RoiResponseSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -226,7 +258,9 @@ 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).
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
children: Optional[List[RoiResponseSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "RoiResponseSeries"}]}}
@ -239,7 +273,9 @@ 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).
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
children: Optional[List[RoiResponseSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "RoiResponseSeries"}]}}
@ -252,7 +288,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
children: Optional[List[PlaneSegmentation]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "PlaneSegmentation"}]}}
@ -265,7 +303,9 @@ class PlaneSegmentation(DynamicTable):
Results from image segmentation of a specific imaging plane.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
name: str = Field(...)
image_mask: Optional[PlaneSegmentationImageMask] = Field(
@ -275,7 +315,9 @@ class PlaneSegmentation(DynamicTable):
pixel_mask_index: Named[Optional[VectorIndex]] = Field(
None,
description="""Index into pixel_mask.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
pixel_mask: Optional[PlaneSegmentationPixelMask] = Field(
None,
@ -284,7 +326,9 @@ class PlaneSegmentation(DynamicTable):
voxel_mask_index: Named[Optional[VectorIndex]] = Field(
None,
description="""Index into voxel_mask.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
voxel_mask: Optional[PlaneSegmentationVoxelMask] = Field(
None,
@ -299,13 +343,17 @@ class PlaneSegmentation(DynamicTable):
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: NDArray[Shape["* num_rows"], int] = Field(
...,
description="""Array of unique identifiers for the rows of this dynamic table.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}},
)
vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""")
vector_data: Optional[List[VectorData]] = Field(
None, description="""Vector columns of this dynamic table."""
)
vector_index: Optional[List[VectorIndex]] = Field(
None, description="""Indices for the vector columns of this dynamic table."""
)
@ -320,9 +368,13 @@ class PlaneSegmentationImageMask(VectorData):
name: Literal["image_mask"] = Field(
"image_mask",
json_schema_extra={"linkml_meta": {"equals_string": "image_mask", "ifabsent": "string(image_mask)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "image_mask", "ifabsent": "string(image_mask)"}
},
)
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[
Union[
NDArray[Shape["* dim0"], Any],
@ -342,12 +394,16 @@ class PlaneSegmentationPixelMask(VectorData):
name: Literal["pixel_mask"] = Field(
"pixel_mask",
json_schema_extra={"linkml_meta": {"equals_string": "pixel_mask", "ifabsent": "string(pixel_mask)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "pixel_mask", "ifabsent": "string(pixel_mask)"}
},
)
x: Optional[np.uint32] = Field(None, description="""Pixel x-coordinate.""")
y: Optional[np.uint32] = Field(None, description="""Pixel y-coordinate.""")
weight: Optional[np.float32] = Field(None, description="""Weight of the pixel.""")
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[
Union[
NDArray[Shape["* dim0"], Any],
@ -367,13 +423,17 @@ class PlaneSegmentationVoxelMask(VectorData):
name: Literal["voxel_mask"] = Field(
"voxel_mask",
json_schema_extra={"linkml_meta": {"equals_string": "voxel_mask", "ifabsent": "string(voxel_mask)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "voxel_mask", "ifabsent": "string(voxel_mask)"}
},
)
x: Optional[np.uint32] = Field(None, description="""Voxel x-coordinate.""")
y: Optional[np.uint32] = Field(None, description="""Voxel y-coordinate.""")
z: Optional[np.uint32] = Field(None, description="""Voxel z-coordinate.""")
weight: Optional[np.float32] = Field(None, description="""Weight of the voxel.""")
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[
Union[
NDArray[Shape["* dim0"], Any],
@ -389,7 +449,9 @@ class ImagingPlane(NWBContainer):
An imaging plane and its metadata.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
children: Optional[List[OpticalChannel]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "OpticalChannel"}]}}
@ -402,11 +464,15 @@ class OpticalChannel(NWBContainer):
An optical channel used to record from an imaging plane.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
name: str = Field(...)
description: str = Field(..., description="""Description or other notes about the channel.""")
emission_lambda: np.float32 = Field(..., description="""Emission wavelength for channel, in nm.""")
emission_lambda: np.float32 = Field(
..., description="""Emission wavelength for channel, in nm."""
)
class MotionCorrection(NWBDataInterface):
@ -414,7 +480,9 @@ 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).
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
children: Optional[List[CorrectedImageStack]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "CorrectedImageStack"}]}}
@ -427,10 +495,14 @@ class CorrectedImageStack(NWBDataInterface):
Reuslts from motion correction of an image stack.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
name: str = Field(...)
corrected: ImageSeries = Field(..., description="""Image stack with frames shifted to the common coordinates.""")
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.""",

View file

@ -23,7 +23,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -79,9 +81,14 @@ 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).
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.retinotopy", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.retinotopy", "tree_root": True}
)
name: str = Field("ImagingRetinotopy", json_schema_extra={"linkml_meta": {"ifabsent": "string(ImagingRetinotopy)"}})
name: str = Field(
"ImagingRetinotopy",
json_schema_extra={"linkml_meta": {"ifabsent": "string(ImagingRetinotopy)"}},
)
axis_1_phase_map: ImagingRetinotopyAxis1PhaseMap = Field(
..., description="""Phase response to stimulus on the first measured axis."""
)
@ -100,7 +107,9 @@ class ImagingRetinotopy(NWBDataInterface):
...,
description="""Two-element array describing the contents of the two response axis fields. Description should be something like ['altitude', 'azimuth'] or '['radius', 'theta'].""",
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "axis_1_axis_2", "exact_cardinality": 2}]}}
"linkml_meta": {
"array": {"dimensions": [{"alias": "axis_1_axis_2", "exact_cardinality": 2}]}
}
},
)
focal_depth_image: Optional[ImagingRetinotopyFocalDepthImage] = Field(
@ -108,10 +117,12 @@ class ImagingRetinotopy(NWBDataInterface):
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."""
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]"""
...,
description="""Gray-scale anatomical image of cortical surface. Array structure: [rows][columns]""",
)
@ -125,18 +136,27 @@ class ImagingRetinotopyAxis1PhaseMap(ConfiguredBaseModel):
name: Literal["axis_1_phase_map"] = Field(
"axis_1_phase_map",
json_schema_extra={
"linkml_meta": {"equals_string": "axis_1_phase_map", "ifabsent": "string(axis_1_phase_map)"}
"linkml_meta": {
"equals_string": "axis_1_phase_map",
"ifabsent": "string(axis_1_phase_map)",
}
},
)
dimension: Optional[np.int32] = Field(
None,
description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""",
)
field_of_view: Optional[np.float32] = 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).""")
field_of_view: Optional[np.float32] = 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)."""
)
array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field(
None,
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}
},
)
@ -150,18 +170,27 @@ class ImagingRetinotopyAxis1PowerMap(ConfiguredBaseModel):
name: Literal["axis_1_power_map"] = Field(
"axis_1_power_map",
json_schema_extra={
"linkml_meta": {"equals_string": "axis_1_power_map", "ifabsent": "string(axis_1_power_map)"}
"linkml_meta": {
"equals_string": "axis_1_power_map",
"ifabsent": "string(axis_1_power_map)",
}
},
)
dimension: Optional[np.int32] = Field(
None,
description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""",
)
field_of_view: Optional[np.float32] = 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).""")
field_of_view: Optional[np.float32] = 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)."""
)
array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field(
None,
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}
},
)
@ -175,18 +204,27 @@ class ImagingRetinotopyAxis2PhaseMap(ConfiguredBaseModel):
name: Literal["axis_2_phase_map"] = Field(
"axis_2_phase_map",
json_schema_extra={
"linkml_meta": {"equals_string": "axis_2_phase_map", "ifabsent": "string(axis_2_phase_map)"}
"linkml_meta": {
"equals_string": "axis_2_phase_map",
"ifabsent": "string(axis_2_phase_map)",
}
},
)
dimension: Optional[np.int32] = Field(
None,
description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""",
)
field_of_view: Optional[np.float32] = 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).""")
field_of_view: Optional[np.float32] = 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)."""
)
array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field(
None,
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}
},
)
@ -200,18 +238,27 @@ class ImagingRetinotopyAxis2PowerMap(ConfiguredBaseModel):
name: Literal["axis_2_power_map"] = Field(
"axis_2_power_map",
json_schema_extra={
"linkml_meta": {"equals_string": "axis_2_power_map", "ifabsent": "string(axis_2_power_map)"}
"linkml_meta": {
"equals_string": "axis_2_power_map",
"ifabsent": "string(axis_2_power_map)",
}
},
)
dimension: Optional[np.int32] = Field(
None,
description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""",
)
field_of_view: Optional[np.float32] = 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).""")
field_of_view: Optional[np.float32] = 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)."""
)
array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field(
None,
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}
},
)
@ -225,7 +272,10 @@ class ImagingRetinotopyFocalDepthImage(ConfiguredBaseModel):
name: Literal["focal_depth_image"] = Field(
"focal_depth_image",
json_schema_extra={
"linkml_meta": {"equals_string": "focal_depth_image", "ifabsent": "string(focal_depth_image)"}
"linkml_meta": {
"equals_string": "focal_depth_image",
"ifabsent": "string(focal_depth_image)",
}
},
)
bits_per_pixel: Optional[np.int32] = Field(
@ -236,12 +286,20 @@ class ImagingRetinotopyFocalDepthImage(ConfiguredBaseModel):
None,
description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""",
)
field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""")
focal_depth: Optional[np.float32] = Field(None, description="""Focal depth offset, in meters.""")
format: Optional[str] = Field(None, description="""Format of image. Right now only 'raw' is supported.""")
field_of_view: Optional[np.float32] = Field(
None, description="""Size of viewing area, in meters."""
)
focal_depth: Optional[np.float32] = Field(
None, description="""Focal depth offset, in meters."""
)
format: Optional[str] = Field(
None, description="""Format of image. Right now only 'raw' is supported."""
)
array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.uint16]] = Field(
None,
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}
},
)
@ -253,16 +311,23 @@ class ImagingRetinotopySignMap(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.retinotopy"})
name: Literal["sign_map"] = Field(
"sign_map", json_schema_extra={"linkml_meta": {"equals_string": "sign_map", "ifabsent": "string(sign_map)"}}
"sign_map",
json_schema_extra={
"linkml_meta": {"equals_string": "sign_map", "ifabsent": "string(sign_map)"}
},
)
dimension: Optional[np.int32] = Field(
None,
description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""",
)
field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""")
field_of_view: Optional[np.float32] = Field(
None, description="""Size of viewing area, in meters."""
)
array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field(
None,
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}
},
)
@ -276,7 +341,10 @@ class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel):
name: Literal["vasculature_image"] = Field(
"vasculature_image",
json_schema_extra={
"linkml_meta": {"equals_string": "vasculature_image", "ifabsent": "string(vasculature_image)"}
"linkml_meta": {
"equals_string": "vasculature_image",
"ifabsent": "string(vasculature_image)",
}
},
)
bits_per_pixel: Optional[np.int32] = Field(
@ -287,11 +355,17 @@ class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel):
None,
description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""",
)
field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""")
format: Optional[str] = Field(None, description="""Format of image. Right now only 'raw' is supported.""")
field_of_view: Optional[np.float32] = Field(
None, description="""Size of viewing area, in meters."""
)
format: Optional[str] = Field(
None, description="""Format of image. Right now only 'raw' is supported."""
)
array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.uint16]] = Field(
None,
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}
},
)

View file

@ -7,7 +7,12 @@ import sys
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator
import numpy as np
from ...hdmf_common.v1_1_3.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData
from ...hdmf_common.v1_1_3.hdmf_common_sparse import (
CSRMatrix,
CSRMatrixIndices,
CSRMatrixIndptr,
CSRMatrixData,
)
from ...hdmf_common.v1_1_3.hdmf_common_table import (
Data,
Index,
@ -151,7 +156,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")

View file

@ -23,7 +23,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -79,7 +81,9 @@ class NWBData(Data):
An abstract data type for a dataset.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
name: str = Field(...)
@ -89,7 +93,9 @@ 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)).
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
name: str = Field(...)
resolution: Optional[np.float32] = Field(
@ -110,7 +116,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
name: str = Field(...)
@ -120,7 +128,9 @@ class NWBDataInterface(NWBContainer):
An abstract data type for a generic container storing collections of data, as opposed to metadata.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
name: str = Field(...)
@ -130,7 +140,9 @@ class TimeSeries(NWBDataInterface):
General purpose time series.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
name: str = Field(...)
description: Optional[str] = Field(None, description="""Description of the time series.""")
@ -159,7 +171,9 @@ class TimeSeries(NWBDataInterface):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -175,7 +189,8 @@ class TimeSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
conversion: Optional[np.float32] = Field(
None,
@ -208,10 +223,14 @@ class TimeSeriesStartingTime(ConfiguredBaseModel):
name: Literal["starting_time"] = Field(
"starting_time",
json_schema_extra={"linkml_meta": {"equals_string": "starting_time", "ifabsent": "string(starting_time)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "starting_time", "ifabsent": "string(starting_time)"}
},
)
rate: Optional[np.float32] = 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'."""
)
value: np.float64 = Field(...)
@ -223,7 +242,8 @@ class TimeSeriesSync(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base"})
name: Literal["sync"] = Field(
"sync", json_schema_extra={"linkml_meta": {"equals_string": "sync", "ifabsent": "string(sync)"}}
"sync",
json_schema_extra={"linkml_meta": {"equals_string": "sync", "ifabsent": "string(sync)"}},
)
@ -232,10 +252,15 @@ class ProcessingModule(NWBContainer):
A collection of processed data.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
children: Optional[List[Union[DynamicTable, NWBDataInterface]]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]}}
None,
json_schema_extra={
"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]}
},
)
name: str = Field(...)
@ -245,10 +270,14 @@ class Images(NWBDataInterface):
A collection of images.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
name: str = Field("Images", json_schema_extra={"linkml_meta": {"ifabsent": "string(Images)"}})
description: Optional[str] = Field(None, description="""Description of this collection of images.""")
description: Optional[str] = Field(
None, description="""Description of this collection of images."""
)
image: List[Image] = Field(..., description="""Images stored in this collection.""")

View file

@ -44,7 +44,12 @@ from ...core.v2_2_5.core_nwb_base import (
ProcessingModule,
Images,
)
from ...hdmf_common.v1_1_3.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData
from ...hdmf_common.v1_1_3.hdmf_common_sparse import (
CSRMatrix,
CSRMatrixIndices,
CSRMatrixIndptr,
CSRMatrixData,
)
from ...hdmf_common.v1_1_3.hdmf_common_table import (
Data,
Index,
@ -70,7 +75,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -126,11 +133,14 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
name: str = Field(...)
data: SpatialSeriesData = Field(
..., description="""1-D or 2-D array storing position or direction relative to some reference frame."""
...,
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."""
@ -157,7 +167,9 @@ class SpatialSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -173,14 +185,18 @@ class SpatialSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
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'.""",
)
array: Optional[
Union[NDArray[Shape["* num_times"], np.number], NDArray[Shape["* num_times, * num_features"], np.number]]
Union[
NDArray[Shape["* num_times"], np.number],
NDArray[Shape["* num_times, * num_features"], np.number],
]
] = Field(None)
@ -189,7 +205,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
children: Optional[List[IntervalSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "IntervalSeries"}]}}
@ -202,7 +220,9 @@ class BehavioralEvents(NWBDataInterface):
TimeSeries for storing behavioral events. See description of <a href=\"#BehavioralEpochs\">BehavioralEpochs</a> for more details.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
children: Optional[List[TimeSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}}
@ -215,7 +235,9 @@ class BehavioralTimeSeries(NWBDataInterface):
TimeSeries for storing Behavoioral time series data. See description of <a href=\"#BehavioralEpochs\">BehavioralEpochs</a> for more details.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
children: Optional[List[TimeSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}}
@ -228,7 +250,9 @@ class PupilTracking(NWBDataInterface):
Eye-tracking data, representing pupil size.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
children: Optional[List[TimeSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}}
@ -241,7 +265,9 @@ class EyeTracking(NWBDataInterface):
Eye-tracking data, representing direction of gaze.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
children: Optional[List[SpatialSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}}
@ -254,7 +280,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
children: Optional[List[SpatialSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}}
@ -267,7 +295,9 @@ class Position(NWBDataInterface):
Position data, whether along the x, x/y or x/y/z axis.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
children: Optional[List[SpatialSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}}

View file

@ -22,7 +22,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -62,14 +64,18 @@ class Device(NWBContainer):
Metadata about a data acquisition device, e.g., recording system, electrode, microscope.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.device", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.device", "tree_root": True}
)
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.""",
)
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."""
)
# Model rebuild

View file

@ -7,7 +7,15 @@ import sys
import numpy as np
from ...hdmf_common.v1_1_3.hdmf_common_table import DynamicTableRegion
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator
from pydantic import (
BaseModel,
ConfigDict,
Field,
RootModel,
field_validator,
ValidationInfo,
BeforeValidator,
)
from ...core.v2_2_5.core_nwb_base import (
TimeSeries,
TimeSeriesStartingTime,
@ -30,7 +38,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -75,7 +85,12 @@ linkml_meta = LinkMLMeta(
},
"default_prefix": "core.nwb.ecephys/",
"id": "core.nwb.ecephys",
"imports": ["core.nwb.base", "../../hdmf_common/v1_1_3/namespace", "core.nwb.device", "core.nwb.language"],
"imports": [
"core.nwb.base",
"../../hdmf_common/v1_1_3/namespace",
"core.nwb.device",
"core.nwb.language",
],
"name": "core.nwb.ecephys",
}
)
@ -86,7 +101,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
name: str = Field(...)
data: Union[
@ -97,7 +114,9 @@ class ElectricalSeries(TimeSeries):
electrodes: Named[DynamicTableRegion] = Field(
...,
description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field(
None,
@ -126,7 +145,9 @@ class ElectricalSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -139,7 +160,9 @@ 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).
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
name: str = Field(...)
data: Union[
@ -154,7 +177,9 @@ class SpikeEventSeries(ElectricalSeries):
electrodes: Named[DynamicTableRegion] = Field(
...,
description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field(
None,
@ -178,7 +203,9 @@ class SpikeEventSeries(ElectricalSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -191,9 +218,14 @@ class FeatureExtraction(NWBDataInterface):
Features, such as PC1 and PC2, that are extracted from signals stored in a SpikeEventSeries or other source.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
name: str = Field("FeatureExtraction", json_schema_extra={"linkml_meta": {"ifabsent": "string(FeatureExtraction)"}})
name: str = Field(
"FeatureExtraction",
json_schema_extra={"linkml_meta": {"ifabsent": "string(FeatureExtraction)"}},
)
description: NDArray[Shape["* num_features"], str] = Field(
...,
description="""Description of features (eg, ''PC1'') for each of the extracted features.""",
@ -204,7 +236,13 @@ class FeatureExtraction(NWBDataInterface):
description="""Multi-dimensional array of features extracted from each event.""",
json_schema_extra={
"linkml_meta": {
"array": {"dimensions": [{"alias": "num_events"}, {"alias": "num_channels"}, {"alias": "num_features"}]}
"array": {
"dimensions": [
{"alias": "num_events"},
{"alias": "num_channels"},
{"alias": "num_features"},
]
}
}
},
)
@ -216,7 +254,9 @@ class FeatureExtraction(NWBDataInterface):
electrodes: Named[DynamicTableRegion] = Field(
...,
description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
@ -225,9 +265,13 @@ class EventDetection(NWBDataInterface):
Detected spike events from voltage trace(s).
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
name: str = Field("EventDetection", json_schema_extra={"linkml_meta": {"ifabsent": "string(EventDetection)"}})
name: str = Field(
"EventDetection", json_schema_extra={"linkml_meta": {"ifabsent": "string(EventDetection)"}}
)
detection_method: str = Field(
...,
description="""Description of how events were detected, such as voltage threshold, or dV/dT threshold, as well as relevant values.""",
@ -249,7 +293,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
children: Optional[List[SpikeEventSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpikeEventSeries"}]}}
@ -262,7 +308,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
children: Optional[List[ElectricalSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "ElectricalSeries"}]}}
@ -275,7 +323,9 @@ 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 description or comments field.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
children: Optional[List[ElectricalSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "ElectricalSeries"}]}}
@ -288,7 +338,9 @@ class ElectrodeGroup(NWBContainer):
A physical grouping of electrodes, e.g. a shank of an array.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
name: str = Field(...)
description: Optional[str] = Field(None, description="""Description of this electrode group.""")
@ -309,7 +361,10 @@ class ElectrodeGroupPosition(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys"})
name: Literal["position"] = Field(
"position", json_schema_extra={"linkml_meta": {"equals_string": "position", "ifabsent": "string(position)"}}
"position",
json_schema_extra={
"linkml_meta": {"equals_string": "position", "ifabsent": "string(position)"}
},
)
x: Optional[np.float32] = Field(None, description="""x coordinate""")
y: Optional[np.float32] = Field(None, description="""y coordinate""")
@ -321,22 +376,33 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
name: str = Field("ClusterWaveforms", json_schema_extra={"linkml_meta": {"ifabsent": "string(ClusterWaveforms)"}})
waveform_filtering: str = Field(..., description="""Filtering applied to data before generating mean/sd""")
name: str = Field(
"ClusterWaveforms",
json_schema_extra={"linkml_meta": {"ifabsent": "string(ClusterWaveforms)"}},
)
waveform_filtering: str = Field(
..., description="""Filtering applied to data before generating mean/sd"""
)
waveform_mean: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = 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)""",
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]}}
"linkml_meta": {
"array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]}
}
},
)
waveform_sd: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = Field(
...,
description="""Stdev of waveforms for each cluster, using the same indices as in mean""",
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]}}
"linkml_meta": {
"array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]}
}
},
)
@ -346,9 +412,13 @@ class Clustering(NWBDataInterface):
DEPRECATED Clustered spike data, whether from automatic clustering tools (e.g., klustakwik) or as a result of manual sorting.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
name: str = Field("Clustering", json_schema_extra={"linkml_meta": {"ifabsent": "string(Clustering)"}})
name: str = Field(
"Clustering", json_schema_extra={"linkml_meta": {"ifabsent": "string(Clustering)"}}
)
description: str = Field(
...,
description="""Description of clusters or clustering, (e.g. cluster 0 is noise, clusters curated using Klusters, etc)""",

View file

@ -6,7 +6,15 @@ import re
import sys
import numpy as np
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator
from pydantic import (
BaseModel,
ConfigDict,
Field,
RootModel,
field_validator,
ValidationInfo,
BeforeValidator,
)
from numpydantic import NDArray, Shape
from ...hdmf_common.v1_1_3.hdmf_common_table import DynamicTable, VectorIndex, VectorData
from ...core.v2_2_5.core_nwb_base import TimeSeries
@ -24,7 +32,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -80,52 +90,70 @@ class TimeIntervals(DynamicTable):
A container for aggregating epoch data and the TimeSeries that each epoch applies to.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.epoch", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.epoch", "tree_root": True}
)
name: str = Field(...)
start_time: NDArray[Any, np.float32] = Field(
...,
description="""Start time of epoch, in seconds.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
stop_time: NDArray[Any, np.float32] = Field(
...,
description="""Stop time of epoch, in seconds.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
tags: Optional[NDArray[Any, str]] = Field(
None,
description="""User-defined tags that identify or categorize events.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
tags_index: Named[Optional[VectorIndex]] = Field(
None,
description="""Index for tags.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
timeseries: Optional[TimeIntervalsTimeseries] = Field(
None, description="""An index into a TimeSeries object."""
)
timeseries: Optional[TimeIntervalsTimeseries] = Field(None, description="""An index into a TimeSeries object.""")
timeseries_index: Named[Optional[VectorIndex]] = Field(
None,
description="""Index for timeseries.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
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: NDArray[Shape["* num_rows"], int] = Field(
...,
description="""Array of unique identifiers for the rows of this dynamic table.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}},
)
vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""")
vector_data: Optional[List[VectorData]] = Field(
None, description="""Vector columns of this dynamic table."""
)
vector_index: Optional[List[VectorIndex]] = Field(
None, description="""Indices for the vector columns of this dynamic table."""
)
@ -140,17 +168,24 @@ class TimeIntervalsTimeseries(VectorData):
name: Literal["timeseries"] = Field(
"timeseries",
json_schema_extra={"linkml_meta": {"equals_string": "timeseries", "ifabsent": "string(timeseries)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "timeseries", "ifabsent": "string(timeseries)"}
},
)
idx_start: Optional[np.int32] = Field(
None,
description="""Start index into the TimeSeries 'data' and 'timestamp' datasets of the referenced TimeSeries. The first dimension of those arrays is always time.""",
)
count: Optional[np.int32] = Field(
None, description="""Number of data samples available in this time series, during this epoch."""
None,
description="""Number of data samples available in this time series, during this epoch.""",
)
timeseries: Optional[TimeSeries] = Field(
None, description="""the TimeSeries that this index applies to."""
)
description: Optional[str] = Field(
None, description="""Description of what these vectors represent."""
)
timeseries: Optional[TimeSeries] = Field(None, description="""the TimeSeries that this index applies to.""")
description: Optional[str] = Field(None, description="""Description of what these vectors represent.""")
array: Optional[
Union[
NDArray[Shape["* dim0"], Any],

View file

@ -44,7 +44,12 @@ from ...core.v2_2_5.core_nwb_base import (
ProcessingModule,
Images,
)
from ...hdmf_common.v1_1_3.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData
from ...hdmf_common.v1_1_3.hdmf_common_sparse import (
CSRMatrix,
CSRMatrixIndices,
CSRMatrixIndptr,
CSRMatrixData,
)
from ...hdmf_common.v1_1_3.hdmf_common_table import (
Data,
Index,
@ -119,7 +124,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -186,10 +193,14 @@ class ScratchData(NWBData):
Any one-off datasets
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.file", "tree_root": True}
)
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"""
)
class NWBFile(NWBContainer):
@ -197,10 +208,13 @@ class NWBFile(NWBContainer):
An NWB:N file storing cellular-based neurophysiology data from a single experimental session.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.file", "tree_root": True}
)
name: Literal["root"] = Field(
"root", json_schema_extra={"linkml_meta": {"equals_string": "root", "ifabsent": "string(root)"}}
"root",
json_schema_extra={"linkml_meta": {"equals_string": "root", "ifabsent": "string(root)"}},
)
nwb_version: Optional[str] = Field(
None,
@ -209,7 +223,9 @@ class NWBFile(NWBContainer):
file_create_date: NDArray[Shape["* num_modifications"], np.datetime64] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_modifications"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_modifications"}]}}
},
)
identifier: str = Field(
...,
@ -229,17 +245,23 @@ class NWBFile(NWBContainer):
acquisition: Optional[List[Union[DynamicTable, NWBDataInterface]]] = Field(
None,
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.""",
json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]}},
json_schema_extra={
"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]}
},
)
analysis: Optional[List[Union[DynamicTable, NWBContainer]]] = Field(
None,
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.""",
json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]}},
json_schema_extra={
"linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]}
},
)
scratch: Optional[List[Union[DynamicTable, NWBContainer]]] = 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.""",
json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]}},
json_schema_extra={
"linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]}
},
)
processing: Optional[List[ProcessingModule]] = Field(
None,
@ -279,7 +301,10 @@ class NWBFileStimulus(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file"})
name: Literal["stimulus"] = Field(
"stimulus", json_schema_extra={"linkml_meta": {"equals_string": "stimulus", "ifabsent": "string(stimulus)"}}
"stimulus",
json_schema_extra={
"linkml_meta": {"equals_string": "stimulus", "ifabsent": "string(stimulus)"}
},
)
presentation: Optional[List[TimeSeries]] = Field(
None,
@ -301,16 +326,27 @@ class NWBFileGeneral(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file"})
name: Literal["general"] = Field(
"general", json_schema_extra={"linkml_meta": {"equals_string": "general", "ifabsent": "string(general)"}}
"general",
json_schema_extra={
"linkml_meta": {"equals_string": "general", "ifabsent": "string(general)"}
},
)
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."""
)
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.""")
experimenter: Optional[NDArray[Shape["* num_experimenters"], str]] = Field(
None,
description="""Name of person(s) who performed the experiment. Can also specify roles of different people involved.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_experimenters"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_experimenters"}]}}
},
)
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[NDArray[Shape["* num_keywords"], str]] = Field(
None,
description="""Terms to search over.""",
@ -323,12 +359,15 @@ class NWBFileGeneral(ConfiguredBaseModel):
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."""
None,
description="""Experimental protocol, if applicable. e.g., include IACUC protocol number.""",
)
related_publications: Optional[NDArray[Shape["* num_publications"], str]] = Field(
None,
description="""Publication information. PMID, DOI, URL, etc.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_publications"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_publications"}]}}
},
)
session_id: Optional[str] = Field(None, description="""Lab-specific ID for the session.""")
slices: Optional[str] = Field(
@ -336,7 +375,8 @@ class NWBFileGeneral(ConfiguredBaseModel):
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."""
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."""
@ -359,7 +399,8 @@ class NWBFileGeneral(ConfiguredBaseModel):
json_schema_extra={"linkml_meta": {"any_of": [{"range": "Device"}]}},
)
subject: Optional[Subject] = Field(
None, description="""Information about the animal or person from which the data was measured."""
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."""
@ -388,7 +429,9 @@ class NWBFileGeneralSourceScript(ConfiguredBaseModel):
name: Literal["source_script"] = Field(
"source_script",
json_schema_extra={"linkml_meta": {"equals_string": "source_script", "ifabsent": "string(source_script)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "source_script", "ifabsent": "string(source_script)"}
},
)
file_name: Optional[str] = Field(None, description="""Name of script file.""")
value: str = Field(...)
@ -404,10 +447,15 @@ class NWBFileGeneralExtracellularEphys(ConfiguredBaseModel):
name: Literal["extracellular_ephys"] = Field(
"extracellular_ephys",
json_schema_extra={
"linkml_meta": {"equals_string": "extracellular_ephys", "ifabsent": "string(extracellular_ephys)"}
"linkml_meta": {
"equals_string": "extracellular_ephys",
"ifabsent": "string(extracellular_ephys)",
}
},
)
electrode_group: Optional[List[ElectrodeGroup]] = Field(None, description="""Physical group of electrodes.""")
electrode_group: Optional[List[ElectrodeGroup]] = Field(
None, description="""Physical group of electrodes."""
)
electrodes: Optional[NWBFileGeneralExtracellularEphysElectrodes] = Field(
None, description="""A table of all electrodes (i.e. channels) used for recording."""
)
@ -422,48 +470,62 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable):
name: Literal["electrodes"] = Field(
"electrodes",
json_schema_extra={"linkml_meta": {"equals_string": "electrodes", "ifabsent": "string(electrodes)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "electrodes", "ifabsent": "string(electrodes)"}
},
)
x: NDArray[Any, np.float32] = Field(
...,
description="""x coordinate of the channel location in the brain (+x is posterior).""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
y: NDArray[Any, np.float32] = Field(
...,
description="""y coordinate of the channel location in the brain (+y is inferior).""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
z: NDArray[Any, np.float32] = Field(
...,
description="""z coordinate of the channel location in the brain (+z is right).""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
imp: NDArray[Any, np.float32] = Field(
...,
description="""Impedance of the channel.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
location: NDArray[Any, str] = Field(
...,
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.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
filtering: NDArray[Any, np.float32] = Field(
...,
description="""Description of hardware filtering.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
group: List[ElectrodeGroup] = Field(
@ -473,48 +535,62 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable):
...,
description="""Name of the ElectrodeGroup this electrode is a part of.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
rel_x: Optional[NDArray[Any, np.float32]] = Field(
None,
description="""x coordinate in electrode group""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
rel_y: Optional[NDArray[Any, np.float32]] = Field(
None,
description="""y coordinate in electrode group""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
rel_z: Optional[NDArray[Any, np.float32]] = Field(
None,
description="""z coordinate in electrode group""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
reference: Optional[NDArray[Any, str]] = Field(
None,
description="""Description of the reference used for this electrode.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
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: NDArray[Shape["* num_rows"], int] = Field(
...,
description="""Array of unique identifiers for the rows of this dynamic table.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}},
)
vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""")
vector_data: Optional[List[VectorData]] = Field(
None, description="""Vector columns of this dynamic table."""
)
vector_index: Optional[List[VectorIndex]] = Field(
None, description="""Indices for the vector columns of this dynamic table."""
)
@ -530,7 +606,10 @@ class NWBFileGeneralIntracellularEphys(ConfiguredBaseModel):
name: Literal["intracellular_ephys"] = Field(
"intracellular_ephys",
json_schema_extra={
"linkml_meta": {"equals_string": "intracellular_ephys", "ifabsent": "string(intracellular_ephys)"}
"linkml_meta": {
"equals_string": "intracellular_ephys",
"ifabsent": "string(intracellular_ephys)",
}
},
)
filtering: Optional[str] = Field(
@ -550,7 +629,9 @@ class LabMetaData(NWBContainer):
Lab-specific meta-data.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.file", "tree_root": True}
)
name: str = Field(...)
@ -560,24 +641,33 @@ class Subject(NWBContainer):
Information about the animal or person from which the data was measured.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.file", "tree_root": True}
)
name: str = Field(...)
age: Optional[str] = Field(None, description="""Age of subject. Can be supplied instead of 'date_of_birth'.""")
age: Optional[str] = Field(
None, description="""Age of subject. Can be supplied instead of 'date_of_birth'."""
)
date_of_birth: Optional[np.datetime64] = 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)."""
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.""")
species: Optional[str] = Field(None, description="""Species of subject.""")
subject_id: Optional[str] = Field(
None, description="""ID of animal/person used/participating in experiment (lab convention)."""
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."""
None,
description="""Weight at time of experiment, at time of surgery and at other important times.""",
)

View file

@ -5,7 +5,12 @@ from enum import Enum
import re
import sys
import numpy as np
from ...hdmf_common.v1_1_3.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData
from ...hdmf_common.v1_1_3.hdmf_common_sparse import (
CSRMatrix,
CSRMatrixIndices,
CSRMatrixIndptr,
CSRMatrixData,
)
from ...hdmf_common.v1_1_3.hdmf_common_table import (
Data,
Index,
@ -30,7 +35,15 @@ from ...core.v2_2_5.core_nwb_base import (
Images,
)
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator
from pydantic import (
BaseModel,
ConfigDict,
Field,
RootModel,
field_validator,
ValidationInfo,
BeforeValidator,
)
from numpydantic import NDArray, Shape
metamodel_version = "None"
@ -46,7 +59,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -91,7 +106,12 @@ linkml_meta = LinkMLMeta(
},
"default_prefix": "core.nwb.icephys/",
"id": "core.nwb.icephys",
"imports": ["core.nwb.base", "core.nwb.device", "../../hdmf_common/v1_1_3/namespace", "core.nwb.language"],
"imports": [
"core.nwb.base",
"core.nwb.device",
"../../hdmf_common/v1_1_3/namespace",
"core.nwb.language",
],
"name": "core.nwb.icephys",
}
)
@ -102,7 +122,9 @@ class PatchClampSeries(TimeSeries):
An abstract base class for patch-clamp data - stimulus or response, current or voltage.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
stimulus_description: Optional[str] = Field(
@ -113,7 +135,8 @@ class PatchClampSeries(TimeSeries):
)
data: PatchClampSeriesData = Field(..., description="""Recorded voltage or current.""")
gain: Optional[np.float32] = Field(
None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp)."""
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.""")
comments: Optional[str] = Field(
@ -137,7 +160,9 @@ class PatchClampSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -153,7 +178,8 @@ class PatchClampSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
unit: Optional[str] = Field(
None,
@ -169,13 +195,17 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
data: CurrentClampSeriesData = Field(..., description="""Recorded voltage.""")
bias_current: Optional[np.float32] = Field(None, description="""Bias current, in amps.""")
bridge_balance: Optional[np.float32] = Field(None, description="""Bridge balance, in ohms.""")
capacitance_compensation: Optional[np.float32] = Field(None, description="""Capacitance compensation, in farads.""")
capacitance_compensation: Optional[np.float32] = Field(
None, description="""Capacitance compensation, in farads."""
)
stimulus_description: Optional[str] = Field(
None, description="""Protocol/stimulus name for this patch-clamp dataset."""
)
@ -183,7 +213,8 @@ class CurrentClampSeries(PatchClampSeries):
None, description="""Sweep number, allows to group different PatchClampSeries together."""
)
gain: Optional[np.float32] = Field(
None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp)."""
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.""")
comments: Optional[str] = Field(
@ -207,7 +238,9 @@ class CurrentClampSeries(PatchClampSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -223,7 +256,8 @@ class CurrentClampSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
unit: Optional[str] = Field(
None,
@ -237,11 +271,15 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
bias_current: np.float32 = Field(..., description="""Bias current, in amps, fixed to 0.0.""")
bridge_balance: np.float32 = Field(..., description="""Bridge balance, in ohms, fixed to 0.0.""")
bridge_balance: np.float32 = Field(
..., description="""Bridge balance, in ohms, fixed to 0.0."""
)
capacitance_compensation: np.float32 = Field(
..., description="""Capacitance compensation, in farads, fixed to 0.0."""
)
@ -253,7 +291,8 @@ class IZeroClampSeries(CurrentClampSeries):
None, description="""Sweep number, allows to group different PatchClampSeries together."""
)
gain: Optional[np.float32] = Field(
None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp)."""
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.""")
comments: Optional[str] = Field(
@ -277,7 +316,9 @@ class IZeroClampSeries(CurrentClampSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -290,7 +331,9 @@ class CurrentClampStimulusSeries(PatchClampSeries):
Stimulus current applied during current clamp recording.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
data: CurrentClampStimulusSeriesData = Field(..., description="""Stimulus current applied.""")
@ -301,7 +344,8 @@ class CurrentClampStimulusSeries(PatchClampSeries):
None, description="""Sweep number, allows to group different PatchClampSeries together."""
)
gain: Optional[np.float32] = Field(
None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp)."""
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.""")
comments: Optional[str] = Field(
@ -325,7 +369,9 @@ class CurrentClampStimulusSeries(PatchClampSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -341,7 +387,8 @@ class CurrentClampStimulusSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
unit: Optional[str] = Field(
None,
@ -355,7 +402,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
data: VoltageClampSeriesData = Field(..., description="""Recorded current.""")
@ -377,8 +426,8 @@ class VoltageClampSeries(PatchClampSeries):
whole_cell_capacitance_comp: Optional[VoltageClampSeriesWholeCellCapacitanceComp] = Field(
None, description="""Whole cell capacitance compensation, in farads."""
)
whole_cell_series_resistance_comp: Optional[VoltageClampSeriesWholeCellSeriesResistanceComp] = Field(
None, description="""Whole cell series resistance compensation, in ohms."""
whole_cell_series_resistance_comp: Optional[VoltageClampSeriesWholeCellSeriesResistanceComp] = (
Field(None, description="""Whole cell series resistance compensation, in ohms.""")
)
stimulus_description: Optional[str] = Field(
None, description="""Protocol/stimulus name for this patch-clamp dataset."""
@ -387,7 +436,8 @@ class VoltageClampSeries(PatchClampSeries):
None, description="""Sweep number, allows to group different PatchClampSeries together."""
)
gain: Optional[np.float32] = Field(
None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp)."""
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.""")
comments: Optional[str] = Field(
@ -411,7 +461,9 @@ class VoltageClampSeries(PatchClampSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -427,7 +479,8 @@ class VoltageClampSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
unit: Optional[str] = Field(
None,
@ -446,11 +499,15 @@ class VoltageClampSeriesCapacitanceFast(ConfiguredBaseModel):
name: Literal["capacitance_fast"] = Field(
"capacitance_fast",
json_schema_extra={
"linkml_meta": {"equals_string": "capacitance_fast", "ifabsent": "string(capacitance_fast)"}
"linkml_meta": {
"equals_string": "capacitance_fast",
"ifabsent": "string(capacitance_fast)",
}
},
)
unit: Optional[str] = Field(
None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'."""
None,
description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""",
)
value: np.float32 = Field(...)
@ -465,11 +522,15 @@ class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel):
name: Literal["capacitance_slow"] = Field(
"capacitance_slow",
json_schema_extra={
"linkml_meta": {"equals_string": "capacitance_slow", "ifabsent": "string(capacitance_slow)"}
"linkml_meta": {
"equals_string": "capacitance_slow",
"ifabsent": "string(capacitance_slow)",
}
},
)
unit: Optional[str] = Field(
None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'."""
None,
description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""",
)
value: np.float32 = Field(...)
@ -491,7 +552,8 @@ class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel):
},
)
unit: Optional[str] = Field(
None, description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'."""
None,
description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'.""",
)
value: np.float32 = Field(...)
@ -513,7 +575,8 @@ class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel):
},
)
unit: Optional[str] = Field(
None, description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'."""
None,
description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'.""",
)
value: np.float32 = Field(...)
@ -535,7 +598,8 @@ class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel):
},
)
unit: Optional[str] = Field(
None, description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'."""
None,
description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'.""",
)
value: np.float32 = Field(...)
@ -557,7 +621,8 @@ class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel):
},
)
unit: Optional[str] = Field(
None, description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'."""
None,
description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'.""",
)
value: np.float32 = Field(...)
@ -579,7 +644,8 @@ class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel):
},
)
unit: Optional[str] = Field(
None, description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'."""
None,
description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'.""",
)
value: np.float32 = Field(...)
@ -589,7 +655,9 @@ class VoltageClampStimulusSeries(PatchClampSeries):
Stimulus voltage applied during a voltage clamp recording.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
data: VoltageClampStimulusSeriesData = Field(..., description="""Stimulus voltage applied.""")
@ -600,7 +668,8 @@ class VoltageClampStimulusSeries(PatchClampSeries):
None, description="""Sweep number, allows to group different PatchClampSeries together."""
)
gain: Optional[np.float32] = Field(
None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp)."""
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.""")
comments: Optional[str] = Field(
@ -624,7 +693,9 @@ class VoltageClampStimulusSeries(PatchClampSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -640,7 +711,8 @@ class VoltageClampStimulusSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
unit: Optional[str] = Field(
None,
@ -654,19 +726,27 @@ class IntracellularElectrode(NWBContainer):
An intracellular electrode and its metadata.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
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.""")
initial_access_resistance: Optional[str] = Field(None, description="""Initial access resistance.""")
initial_access_resistance: Optional[str] = Field(
None, description="""Initial access resistance."""
)
location: Optional[str] = Field(
None,
description="""Location of the electrode. 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.""",
)
resistance: Optional[str] = Field(None, description="""Electrode resistance, in ohms.""")
seal: Optional[str] = Field(None, description="""Information about seal used for recording.""")
slice: Optional[str] = Field(None, description="""Information about slice used for recording.""")
slice: Optional[str] = Field(
None, description="""Information about slice used for recording."""
)
class SweepTable(DynamicTable):
@ -674,14 +754,18 @@ class SweepTable(DynamicTable):
The table which groups different PatchClampSeries together.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
sweep_number: NDArray[Any, np.uint32] = Field(
...,
description="""Sweep number of the PatchClampSeries in that row.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
series: List[PatchClampSeries] = Field(
@ -690,19 +774,25 @@ class SweepTable(DynamicTable):
series_index: Named[VectorIndex] = Field(
...,
description="""Index for series.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
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: NDArray[Shape["* num_rows"], int] = Field(
...,
description="""Array of unique identifiers for the rows of this dynamic table.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}},
)
vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""")
vector_data: Optional[List[VectorData]] = Field(
None, description="""Vector columns of this dynamic table."""
)
vector_index: Optional[List[VectorIndex]] = Field(
None, description="""Indices for the vector columns of this dynamic table."""
)

View file

@ -19,7 +19,12 @@ from ...core.v2_2_5.core_nwb_base import (
ProcessingModule,
Images,
)
from ...hdmf_common.v1_1_3.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData
from ...hdmf_common.v1_1_3.hdmf_common_sparse import (
CSRMatrix,
CSRMatrixIndices,
CSRMatrixIndptr,
CSRMatrixData,
)
from ...hdmf_common.v1_1_3.hdmf_common_table import (
Data,
Index,
@ -45,7 +50,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -101,7 +108,9 @@ class GrayscaleImage(Image):
A grayscale image.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.image", "tree_root": True}
)
name: str = Field(...)
resolution: Optional[np.float32] = Field(
@ -122,7 +131,9 @@ class RGBImage(Image):
A color image.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.image", "tree_root": True}
)
name: str = Field(...)
resolution: Optional[np.float32] = Field(
@ -143,7 +154,9 @@ class RGBAImage(Image):
A color image with transparency.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.image", "tree_root": True}
)
name: str = Field(...)
resolution: Optional[np.float32] = Field(
@ -164,11 +177,16 @@ 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].
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.image", "tree_root": True}
)
name: str = Field(...)
data: Optional[
Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]]
Union[
NDArray[Shape["* frame, * x, * y"], np.number],
NDArray[Shape["* frame, * x, * y, * z"], np.number],
]
] = Field(None, description="""Binary data representing images across frames.""")
dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field(
None,
@ -205,7 +223,9 @@ class ImageSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -222,7 +242,9 @@ class ImageSeriesExternalFile(ConfiguredBaseModel):
name: Literal["external_file"] = Field(
"external_file",
json_schema_extra={"linkml_meta": {"equals_string": "external_file", "ifabsent": "string(external_file)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "external_file", "ifabsent": "string(external_file)"}
},
)
starting_frame: Optional[np.int32] = Field(
None,
@ -238,11 +260,16 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.image", "tree_root": True}
)
name: str = Field(...)
data: Optional[
Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]]
Union[
NDArray[Shape["* frame, * x, * y"], np.number],
NDArray[Shape["* frame, * x, * y, * z"], np.number],
]
] = Field(None, description="""Binary data representing images across frames.""")
dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field(
None,
@ -279,7 +306,9 @@ class ImageMaskSeries(ImageSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -292,15 +321,23 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.image", "tree_root": True}
)
name: str = Field(...)
distance: Optional[np.float32] = Field(None, description="""Distance from camera/monitor to target/eye.""")
distance: Optional[np.float32] = Field(
None, description="""Distance from camera/monitor to target/eye."""
)
field_of_view: Optional[
Union[NDArray[Shape["2 width_height"], np.float32], NDArray[Shape["3 width_height_depth"], np.float32]]
Union[
NDArray[Shape["2 width_height"], np.float32],
NDArray[Shape["3 width_height_depth"], np.float32],
]
] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""")
data: Union[
NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, 3 r_g_b"], np.number]
NDArray[Shape["* frame, * x, * y"], np.number],
NDArray[Shape["* frame, * x, * y, 3 r_g_b"], np.number],
] = Field(..., description="""Images presented to subject, either grayscale or RGB""")
orientation: Optional[str] = Field(
None,
@ -341,7 +378,9 @@ class OpticalSeries(ImageSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -354,7 +393,9 @@ class IndexSeries(TimeSeries):
Stores indices to image frames stored in an ImageSeries. The purpose of the ImageIndexSeries is to allow a static image stack to be stored somewhere, 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 ImageSeries, and the timestamps array indicates when that image was displayed.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.image", "tree_root": True}
)
name: str = Field(...)
data: NDArray[Shape["* num_times"], np.int32] = Field(
@ -384,7 +425,9 @@ class IndexSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,

View file

@ -7,10 +7,23 @@ import sys
import numpy as np
from ...core.v2_2_5.core_nwb_base import TimeSeries, TimeSeriesStartingTime, TimeSeriesSync
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator
from pydantic import (
BaseModel,
ConfigDict,
Field,
RootModel,
field_validator,
ValidationInfo,
BeforeValidator,
)
from ...core.v2_2_5.core_nwb_ecephys import ElectrodeGroup
from numpydantic import NDArray, Shape
from ...hdmf_common.v1_1_3.hdmf_common_table import DynamicTable, VectorData, VectorIndex, DynamicTableRegion
from ...hdmf_common.v1_1_3.hdmf_common_table import (
DynamicTable,
VectorData,
VectorIndex,
DynamicTableRegion,
)
metamodel_version = "None"
version = "2.2.5"
@ -25,7 +38,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -70,7 +85,12 @@ linkml_meta = LinkMLMeta(
},
"default_prefix": "core.nwb.misc/",
"id": "core.nwb.misc",
"imports": ["core.nwb.base", "../../hdmf_common/v1_1_3/namespace", "core.nwb.ecephys", "core.nwb.language"],
"imports": [
"core.nwb.base",
"../../hdmf_common/v1_1_3/namespace",
"core.nwb.ecephys",
"core.nwb.language",
],
"name": "core.nwb.misc",
}
)
@ -81,10 +101,14 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.misc", "tree_root": True}
)
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[NDArray[Shape["* num_features"], str]] = Field(
None,
description="""Units of each feature.""",
@ -117,7 +141,9 @@ class AbstractFeatureSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -133,14 +159,18 @@ class AbstractFeatureSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
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[
Union[NDArray[Shape["* num_times"], np.number], NDArray[Shape["* num_times, * num_features"], np.number]]
Union[
NDArray[Shape["* num_times"], np.number],
NDArray[Shape["* num_times, * num_features"], np.number],
]
] = Field(None)
@ -149,7 +179,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.misc", "tree_root": True}
)
name: str = Field(...)
data: NDArray[Shape["* num_times"], str] = Field(
@ -179,7 +211,9 @@ class AnnotationSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -192,7 +226,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.misc", "tree_root": True}
)
name: str = Field(...)
data: NDArray[Shape["* num_times"], np.int8] = Field(
@ -222,7 +258,9 @@ class IntervalSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -235,10 +273,14 @@ class DecompositionSeries(TimeSeries):
Spectral analysis of a time series, e.g. of an LFP or a speech signal.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.misc", "tree_root": True}
)
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.""")
bands: DecompositionSeriesBands = Field(
...,
@ -266,7 +308,9 @@ class DecompositionSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -282,7 +326,8 @@ class DecompositionSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
unit: Optional[str] = Field(
None,
@ -292,7 +337,13 @@ class DecompositionSeriesData(ConfiguredBaseModel):
None,
json_schema_extra={
"linkml_meta": {
"array": {"dimensions": [{"alias": "num_times"}, {"alias": "num_channels"}, {"alias": "num_bands"}]}
"array": {
"dimensions": [
{"alias": "num_times"},
{"alias": "num_channels"},
{"alias": "num_bands"},
]
}
}
},
)
@ -306,13 +357,16 @@ class DecompositionSeriesBands(DynamicTable):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"})
name: Literal["bands"] = Field(
"bands", json_schema_extra={"linkml_meta": {"equals_string": "bands", "ifabsent": "string(bands)"}}
"bands",
json_schema_extra={"linkml_meta": {"equals_string": "bands", "ifabsent": "string(bands)"}},
)
band_name: NDArray[Any, str] = Field(
...,
description="""Name of the band, e.g. theta.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
band_limits: NDArray[Shape["* num_bands, 2 low_high"], np.float32] = Field(
@ -320,7 +374,12 @@ class DecompositionSeriesBands(DynamicTable):
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.""",
json_schema_extra={
"linkml_meta": {
"array": {"dimensions": [{"alias": "num_bands"}, {"alias": "low_high", "exact_cardinality": 2}]}
"array": {
"dimensions": [
{"alias": "num_bands"},
{"alias": "low_high", "exact_cardinality": 2},
]
}
}
},
)
@ -338,13 +397,17 @@ class DecompositionSeriesBands(DynamicTable):
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: NDArray[Shape["* num_rows"], int] = Field(
...,
description="""Array of unique identifiers for the rows of this dynamic table.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}},
)
vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""")
vector_data: Optional[List[VectorData]] = Field(
None, description="""Vector columns of this dynamic table."""
)
vector_index: Optional[List[VectorIndex]] = Field(
None, description="""Indices for the vector columns of this dynamic table."""
)
@ -355,38 +418,55 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.misc", "tree_root": True}
)
name: str = Field("Units", json_schema_extra={"linkml_meta": {"ifabsent": "string(Units)"}})
spike_times_index: Named[Optional[VectorIndex]] = Field(
None,
description="""Index into the spike_times dataset.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
spike_times: Optional[UnitsSpikeTimes] = Field(
None, description="""Spike times for each unit."""
)
spike_times: Optional[UnitsSpikeTimes] = Field(None, description="""Spike times for each unit.""")
obs_intervals_index: Named[Optional[VectorIndex]] = Field(
None,
description="""Index into the obs_intervals dataset.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
obs_intervals: Optional[NDArray[Shape["* num_intervals, 2 start_end"], np.float64]] = Field(
None,
description="""Observation intervals for each unit.""",
json_schema_extra={
"linkml_meta": {
"array": {"dimensions": [{"alias": "num_intervals"}, {"alias": "start_end", "exact_cardinality": 2}]}
"array": {
"dimensions": [
{"alias": "num_intervals"},
{"alias": "start_end", "exact_cardinality": 2},
]
}
}
},
)
electrodes_index: Named[Optional[VectorIndex]] = Field(
None,
description="""Index into electrodes.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
electrodes: Named[Optional[DynamicTableRegion]] = Field(
None,
description="""Electrode that each spike unit came from, specified using a DynamicTableRegion.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
electrode_group: Optional[List[ElectrodeGroup]] = Field(
None, description="""Electrode group that each spike unit came from."""
@ -407,13 +487,17 @@ class Units(DynamicTable):
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: NDArray[Shape["* num_rows"], int] = Field(
...,
description="""Array of unique identifiers for the rows of this dynamic table.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}},
)
vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""")
vector_data: Optional[List[VectorData]] = Field(
None, description="""Vector columns of this dynamic table."""
)
vector_index: Optional[List[VectorIndex]] = Field(
None, description="""Indices for the vector columns of this dynamic table."""
)
@ -428,13 +512,17 @@ class UnitsSpikeTimes(VectorData):
name: Literal["spike_times"] = Field(
"spike_times",
json_schema_extra={"linkml_meta": {"equals_string": "spike_times", "ifabsent": "string(spike_times)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "spike_times", "ifabsent": "string(spike_times)"}
},
)
resolution: Optional[np.float64] = 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[
Union[
NDArray[Shape["* dim0"], Any],

View file

@ -8,7 +8,12 @@ from typing import Any, ClassVar, List, Literal, Dict, Optional, Union
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator
import numpy as np
from numpydantic import NDArray, Shape
from ...core.v2_2_5.core_nwb_base import TimeSeries, TimeSeriesStartingTime, TimeSeriesSync, NWBContainer
from ...core.v2_2_5.core_nwb_base import (
TimeSeries,
TimeSeriesStartingTime,
TimeSeriesSync,
NWBContainer,
)
metamodel_version = "None"
version = "2.2.5"
@ -23,7 +28,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -79,7 +86,9 @@ class OptogeneticSeries(TimeSeries):
An optogenetic stimulus.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ogen", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ogen", "tree_root": True}
)
name: str = Field(...)
data: NDArray[Shape["* num_times"], np.number] = Field(
@ -109,7 +118,9 @@ class OptogeneticSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -122,7 +133,9 @@ class OptogeneticStimulusSite(NWBContainer):
A site of optogenetic stimulation.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ogen", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ogen", "tree_root": True}
)
name: str = Field(...)
description: str = Field(..., description="""Description of stimulation site.""")

View file

@ -18,7 +18,12 @@ from ...core.v2_2_5.core_nwb_base import (
ProcessingModule,
Images,
)
from ...hdmf_common.v1_1_3.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData
from ...hdmf_common.v1_1_3.hdmf_common_sparse import (
CSRMatrix,
CSRMatrixIndices,
CSRMatrixIndptr,
CSRMatrixData,
)
from ...hdmf_common.v1_1_3.hdmf_common_table import (
Data,
Index,
@ -40,7 +45,15 @@ from ...core.v2_2_5.core_nwb_image import (
IndexSeries,
)
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator
from pydantic import (
BaseModel,
ConfigDict,
Field,
RootModel,
field_validator,
ValidationInfo,
BeforeValidator,
)
from numpydantic import NDArray, Shape
metamodel_version = "None"
@ -56,7 +69,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -118,7 +133,9 @@ class TwoPhotonSeries(ImageSeries):
Image stack recorded over time from 2-photon microscope.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
name: str = Field(...)
pmt_gain: Optional[np.float32] = Field(None, description="""Photomultiplier gain.""")
@ -127,10 +144,16 @@ class TwoPhotonSeries(ImageSeries):
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[
Union[NDArray[Shape["2 width_height"], np.float32], NDArray[Shape["3 width_height_depth"], np.float32]]
Union[
NDArray[Shape["2 width_height"], np.float32],
NDArray[Shape["3 width_height_depth"], np.float32],
]
] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""")
data: Optional[
Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]]
Union[
NDArray[Shape["* frame, * x, * y"], np.number],
NDArray[Shape["* frame, * x, * y, * z"], np.number],
]
] = Field(None, description="""Binary data representing images across frames.""")
dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field(
None,
@ -167,7 +190,9 @@ class TwoPhotonSeries(ImageSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -180,16 +205,21 @@ class RoiResponseSeries(TimeSeries):
ROI responses over an imaging plane. The first dimension represents time. The second dimension, if present, represents ROIs.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
name: str = Field(...)
data: Union[NDArray[Shape["* num_times"], np.number], NDArray[Shape["* num_times, * num_rois"], np.number]] = Field(
..., description="""Signals from ROIs."""
)
data: Union[
NDArray[Shape["* num_times"], np.number],
NDArray[Shape["* num_times, * num_rois"], np.number],
] = Field(..., description="""Signals from ROIs.""")
rois: Named[DynamicTableRegion] = Field(
...,
description="""DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
description: Optional[str] = Field(None, description="""Description of the time series.""")
comments: Optional[str] = Field(
@ -213,7 +243,9 @@ class RoiResponseSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -226,7 +258,9 @@ 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).
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
children: Optional[List[RoiResponseSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "RoiResponseSeries"}]}}
@ -239,7 +273,9 @@ 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).
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
children: Optional[List[RoiResponseSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "RoiResponseSeries"}]}}
@ -252,7 +288,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
children: Optional[List[PlaneSegmentation]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "PlaneSegmentation"}]}}
@ -265,7 +303,9 @@ class PlaneSegmentation(DynamicTable):
Results from image segmentation of a specific imaging plane.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
name: str = Field(...)
image_mask: Optional[PlaneSegmentationImageMask] = Field(
@ -275,7 +315,9 @@ class PlaneSegmentation(DynamicTable):
pixel_mask_index: Named[Optional[VectorIndex]] = Field(
None,
description="""Index into pixel_mask.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
pixel_mask: Optional[PlaneSegmentationPixelMask] = Field(
None,
@ -284,7 +326,9 @@ class PlaneSegmentation(DynamicTable):
voxel_mask_index: Named[Optional[VectorIndex]] = Field(
None,
description="""Index into voxel_mask.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
voxel_mask: Optional[PlaneSegmentationVoxelMask] = Field(
None,
@ -299,13 +343,17 @@ class PlaneSegmentation(DynamicTable):
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: NDArray[Shape["* num_rows"], int] = Field(
...,
description="""Array of unique identifiers for the rows of this dynamic table.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}]}}},
)
vector_data: Optional[List[VectorData]] = Field(None, description="""Vector columns of this dynamic table.""")
vector_data: Optional[List[VectorData]] = Field(
None, description="""Vector columns of this dynamic table."""
)
vector_index: Optional[List[VectorIndex]] = Field(
None, description="""Indices for the vector columns of this dynamic table."""
)
@ -320,9 +368,13 @@ class PlaneSegmentationImageMask(VectorData):
name: Literal["image_mask"] = Field(
"image_mask",
json_schema_extra={"linkml_meta": {"equals_string": "image_mask", "ifabsent": "string(image_mask)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "image_mask", "ifabsent": "string(image_mask)"}
},
)
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[
Union[
NDArray[Shape["* dim0"], Any],
@ -342,12 +394,16 @@ class PlaneSegmentationPixelMask(VectorData):
name: Literal["pixel_mask"] = Field(
"pixel_mask",
json_schema_extra={"linkml_meta": {"equals_string": "pixel_mask", "ifabsent": "string(pixel_mask)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "pixel_mask", "ifabsent": "string(pixel_mask)"}
},
)
x: Optional[np.uint32] = Field(None, description="""Pixel x-coordinate.""")
y: Optional[np.uint32] = Field(None, description="""Pixel y-coordinate.""")
weight: Optional[np.float32] = Field(None, description="""Weight of the pixel.""")
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[
Union[
NDArray[Shape["* dim0"], Any],
@ -367,13 +423,17 @@ class PlaneSegmentationVoxelMask(VectorData):
name: Literal["voxel_mask"] = Field(
"voxel_mask",
json_schema_extra={"linkml_meta": {"equals_string": "voxel_mask", "ifabsent": "string(voxel_mask)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "voxel_mask", "ifabsent": "string(voxel_mask)"}
},
)
x: Optional[np.uint32] = Field(None, description="""Voxel x-coordinate.""")
y: Optional[np.uint32] = Field(None, description="""Voxel y-coordinate.""")
z: Optional[np.uint32] = Field(None, description="""Voxel z-coordinate.""")
weight: Optional[np.float32] = Field(None, description="""Weight of the voxel.""")
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[
Union[
NDArray[Shape["* dim0"], Any],
@ -389,7 +449,9 @@ class ImagingPlane(NWBContainer):
An imaging plane and its metadata.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
children: Optional[List[OpticalChannel]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "OpticalChannel"}]}}
@ -402,11 +464,15 @@ class OpticalChannel(NWBContainer):
An optical channel used to record from an imaging plane.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
name: str = Field(...)
description: str = Field(..., description="""Description or other notes about the channel.""")
emission_lambda: np.float32 = Field(..., description="""Emission wavelength for channel, in nm.""")
emission_lambda: np.float32 = Field(
..., description="""Emission wavelength for channel, in nm."""
)
class MotionCorrection(NWBDataInterface):
@ -414,7 +480,9 @@ 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).
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
children: Optional[List[CorrectedImageStack]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "CorrectedImageStack"}]}}
@ -427,10 +495,14 @@ class CorrectedImageStack(NWBDataInterface):
Reuslts from motion correction of an image stack.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
name: str = Field(...)
corrected: ImageSeries = Field(..., description="""Image stack with frames shifted to the common coordinates.""")
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.""",

View file

@ -23,7 +23,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -79,9 +81,14 @@ 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).
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.retinotopy", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.retinotopy", "tree_root": True}
)
name: str = Field("ImagingRetinotopy", json_schema_extra={"linkml_meta": {"ifabsent": "string(ImagingRetinotopy)"}})
name: str = Field(
"ImagingRetinotopy",
json_schema_extra={"linkml_meta": {"ifabsent": "string(ImagingRetinotopy)"}},
)
axis_1_phase_map: ImagingRetinotopyAxis1PhaseMap = Field(
..., description="""Phase response to stimulus on the first measured axis."""
)
@ -100,7 +107,9 @@ class ImagingRetinotopy(NWBDataInterface):
...,
description="""Two-element array describing the contents of the two response axis fields. Description should be something like ['altitude', 'azimuth'] or '['radius', 'theta'].""",
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "axis_1_axis_2", "exact_cardinality": 2}]}}
"linkml_meta": {
"array": {"dimensions": [{"alias": "axis_1_axis_2", "exact_cardinality": 2}]}
}
},
)
focal_depth_image: Optional[ImagingRetinotopyFocalDepthImage] = Field(
@ -108,10 +117,12 @@ class ImagingRetinotopy(NWBDataInterface):
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."""
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]"""
...,
description="""Gray-scale anatomical image of cortical surface. Array structure: [rows][columns]""",
)
@ -125,18 +136,27 @@ class ImagingRetinotopyAxis1PhaseMap(ConfiguredBaseModel):
name: Literal["axis_1_phase_map"] = Field(
"axis_1_phase_map",
json_schema_extra={
"linkml_meta": {"equals_string": "axis_1_phase_map", "ifabsent": "string(axis_1_phase_map)"}
"linkml_meta": {
"equals_string": "axis_1_phase_map",
"ifabsent": "string(axis_1_phase_map)",
}
},
)
dimension: Optional[np.int32] = Field(
None,
description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""",
)
field_of_view: Optional[np.float32] = 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).""")
field_of_view: Optional[np.float32] = 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)."""
)
array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field(
None,
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}
},
)
@ -150,18 +170,27 @@ class ImagingRetinotopyAxis1PowerMap(ConfiguredBaseModel):
name: Literal["axis_1_power_map"] = Field(
"axis_1_power_map",
json_schema_extra={
"linkml_meta": {"equals_string": "axis_1_power_map", "ifabsent": "string(axis_1_power_map)"}
"linkml_meta": {
"equals_string": "axis_1_power_map",
"ifabsent": "string(axis_1_power_map)",
}
},
)
dimension: Optional[np.int32] = Field(
None,
description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""",
)
field_of_view: Optional[np.float32] = 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).""")
field_of_view: Optional[np.float32] = 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)."""
)
array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field(
None,
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}
},
)
@ -175,18 +204,27 @@ class ImagingRetinotopyAxis2PhaseMap(ConfiguredBaseModel):
name: Literal["axis_2_phase_map"] = Field(
"axis_2_phase_map",
json_schema_extra={
"linkml_meta": {"equals_string": "axis_2_phase_map", "ifabsent": "string(axis_2_phase_map)"}
"linkml_meta": {
"equals_string": "axis_2_phase_map",
"ifabsent": "string(axis_2_phase_map)",
}
},
)
dimension: Optional[np.int32] = Field(
None,
description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""",
)
field_of_view: Optional[np.float32] = 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).""")
field_of_view: Optional[np.float32] = 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)."""
)
array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field(
None,
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}
},
)
@ -200,18 +238,27 @@ class ImagingRetinotopyAxis2PowerMap(ConfiguredBaseModel):
name: Literal["axis_2_power_map"] = Field(
"axis_2_power_map",
json_schema_extra={
"linkml_meta": {"equals_string": "axis_2_power_map", "ifabsent": "string(axis_2_power_map)"}
"linkml_meta": {
"equals_string": "axis_2_power_map",
"ifabsent": "string(axis_2_power_map)",
}
},
)
dimension: Optional[np.int32] = Field(
None,
description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""",
)
field_of_view: Optional[np.float32] = 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).""")
field_of_view: Optional[np.float32] = 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)."""
)
array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field(
None,
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}
},
)
@ -225,7 +272,10 @@ class ImagingRetinotopyFocalDepthImage(ConfiguredBaseModel):
name: Literal["focal_depth_image"] = Field(
"focal_depth_image",
json_schema_extra={
"linkml_meta": {"equals_string": "focal_depth_image", "ifabsent": "string(focal_depth_image)"}
"linkml_meta": {
"equals_string": "focal_depth_image",
"ifabsent": "string(focal_depth_image)",
}
},
)
bits_per_pixel: Optional[np.int32] = Field(
@ -236,12 +286,20 @@ class ImagingRetinotopyFocalDepthImage(ConfiguredBaseModel):
None,
description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""",
)
field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""")
focal_depth: Optional[np.float32] = Field(None, description="""Focal depth offset, in meters.""")
format: Optional[str] = Field(None, description="""Format of image. Right now only 'raw' is supported.""")
field_of_view: Optional[np.float32] = Field(
None, description="""Size of viewing area, in meters."""
)
focal_depth: Optional[np.float32] = Field(
None, description="""Focal depth offset, in meters."""
)
format: Optional[str] = Field(
None, description="""Format of image. Right now only 'raw' is supported."""
)
array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.uint16]] = Field(
None,
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}
},
)
@ -253,16 +311,23 @@ class ImagingRetinotopySignMap(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.retinotopy"})
name: Literal["sign_map"] = Field(
"sign_map", json_schema_extra={"linkml_meta": {"equals_string": "sign_map", "ifabsent": "string(sign_map)"}}
"sign_map",
json_schema_extra={
"linkml_meta": {"equals_string": "sign_map", "ifabsent": "string(sign_map)"}
},
)
dimension: Optional[np.int32] = Field(
None,
description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""",
)
field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""")
field_of_view: Optional[np.float32] = Field(
None, description="""Size of viewing area, in meters."""
)
array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field(
None,
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}
},
)
@ -276,7 +341,10 @@ class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel):
name: Literal["vasculature_image"] = Field(
"vasculature_image",
json_schema_extra={
"linkml_meta": {"equals_string": "vasculature_image", "ifabsent": "string(vasculature_image)"}
"linkml_meta": {
"equals_string": "vasculature_image",
"ifabsent": "string(vasculature_image)",
}
},
)
bits_per_pixel: Optional[np.int32] = Field(
@ -287,11 +355,17 @@ class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel):
None,
description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""",
)
field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""")
format: Optional[str] = Field(None, description="""Format of image. Right now only 'raw' is supported.""")
field_of_view: Optional[np.float32] = Field(
None, description="""Size of viewing area, in meters."""
)
format: Optional[str] = Field(
None, description="""Format of image. Right now only 'raw' is supported."""
)
array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.uint16]] = Field(
None,
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}
},
)

View file

@ -7,7 +7,12 @@ import sys
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator
import numpy as np
from ...hdmf_common.v1_1_3.hdmf_common_sparse import CSRMatrix, CSRMatrixIndices, CSRMatrixIndptr, CSRMatrixData
from ...hdmf_common.v1_1_3.hdmf_common_sparse import (
CSRMatrix,
CSRMatrixIndices,
CSRMatrixIndptr,
CSRMatrixData,
)
from ...hdmf_common.v1_1_3.hdmf_common_table import (
Data,
Index,
@ -151,7 +156,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")

View file

@ -24,7 +24,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -69,7 +71,11 @@ linkml_meta = LinkMLMeta(
},
"default_prefix": "core.nwb.base/",
"id": "core.nwb.base",
"imports": ["../../hdmf_common/v1_5_0/namespace", "../../hdmf_common/v1_5_0/namespace", "core.nwb.language"],
"imports": [
"../../hdmf_common/v1_5_0/namespace",
"../../hdmf_common/v1_5_0/namespace",
"core.nwb.language",
],
"name": "core.nwb.base",
}
)
@ -80,7 +86,9 @@ class NWBData(Data):
An abstract data type for a dataset.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
name: str = Field(...)
@ -90,7 +98,9 @@ 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)).
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
name: str = Field(...)
resolution: Optional[np.float32] = Field(
@ -111,7 +121,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
name: str = Field(...)
@ -121,7 +133,9 @@ class NWBDataInterface(NWBContainer):
An abstract data type for a generic container storing collections of data, as opposed to metadata.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
name: str = Field(...)
@ -131,7 +145,9 @@ class TimeSeries(NWBDataInterface):
General purpose time series.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
name: str = Field(...)
description: Optional[str] = Field(None, description="""Description of the time series.""")
@ -160,7 +176,9 @@ class TimeSeries(NWBDataInterface):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -176,7 +194,8 @@ class TimeSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
conversion: Optional[np.float32] = Field(
None,
@ -213,10 +232,14 @@ class TimeSeriesStartingTime(ConfiguredBaseModel):
name: Literal["starting_time"] = Field(
"starting_time",
json_schema_extra={"linkml_meta": {"equals_string": "starting_time", "ifabsent": "string(starting_time)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "starting_time", "ifabsent": "string(starting_time)"}
},
)
rate: Optional[np.float32] = 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'."""
)
value: np.float64 = Field(...)
@ -228,7 +251,8 @@ class TimeSeriesSync(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base"})
name: Literal["sync"] = Field(
"sync", json_schema_extra={"linkml_meta": {"equals_string": "sync", "ifabsent": "string(sync)"}}
"sync",
json_schema_extra={"linkml_meta": {"equals_string": "sync", "ifabsent": "string(sync)"}},
)
@ -237,10 +261,15 @@ class ProcessingModule(NWBContainer):
A collection of processed data.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
children: Optional[List[Union[DynamicTable, NWBDataInterface]]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]}}
None,
json_schema_extra={
"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]}
},
)
name: str = Field(...)
@ -250,10 +279,14 @@ class Images(NWBDataInterface):
A collection of images.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
name: str = Field("Images", json_schema_extra={"linkml_meta": {"ifabsent": "string(Images)"}})
description: Optional[str] = Field(None, description="""Description of this collection of images.""")
description: Optional[str] = Field(
None, description="""Description of this collection of images."""
)
image: List[Image] = Field(..., description="""Images stored in this collection.""")

View file

@ -69,7 +69,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -125,11 +127,14 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
name: str = Field(...)
data: SpatialSeriesData = Field(
..., description="""1-D or 2-D array storing position or direction relative to some reference frame."""
...,
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."""
@ -156,7 +161,9 @@ class SpatialSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -172,14 +179,18 @@ class SpatialSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
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'.""",
)
array: Optional[
Union[NDArray[Shape["* num_times"], np.number], NDArray[Shape["* num_times, * num_features"], np.number]]
Union[
NDArray[Shape["* num_times"], np.number],
NDArray[Shape["* num_times, * num_features"], np.number],
]
] = Field(None)
@ -188,7 +199,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
children: Optional[List[IntervalSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "IntervalSeries"}]}}
@ -201,7 +214,9 @@ class BehavioralEvents(NWBDataInterface):
TimeSeries for storing behavioral events. See description of <a href=\"#BehavioralEpochs\">BehavioralEpochs</a> for more details.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
children: Optional[List[TimeSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}}
@ -214,7 +229,9 @@ class BehavioralTimeSeries(NWBDataInterface):
TimeSeries for storing Behavoioral time series data. See description of <a href=\"#BehavioralEpochs\">BehavioralEpochs</a> for more details.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
children: Optional[List[TimeSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}}
@ -227,7 +244,9 @@ class PupilTracking(NWBDataInterface):
Eye-tracking data, representing pupil size.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
children: Optional[List[TimeSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}}
@ -240,7 +259,9 @@ class EyeTracking(NWBDataInterface):
Eye-tracking data, representing direction of gaze.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
children: Optional[List[SpatialSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}}
@ -253,7 +274,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
children: Optional[List[SpatialSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}}
@ -266,7 +289,9 @@ class Position(NWBDataInterface):
Position data, whether along the x, x/y or x/y/z axis.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
children: Optional[List[SpatialSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}}

View file

@ -22,7 +22,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -62,14 +64,18 @@ class Device(NWBContainer):
Metadata about a data acquisition device, e.g., recording system, electrode, microscope.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.device", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.device", "tree_root": True}
)
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.""",
)
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."""
)
# Model rebuild

View file

@ -7,7 +7,15 @@ import sys
import numpy as np
from ...hdmf_common.v1_5_0.hdmf_common_table import DynamicTableRegion
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator
from pydantic import (
BaseModel,
ConfigDict,
Field,
RootModel,
field_validator,
ValidationInfo,
BeforeValidator,
)
from ...core.v2_3_0.core_nwb_base import (
TimeSeries,
TimeSeriesStartingTime,
@ -30,7 +38,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -75,7 +85,12 @@ linkml_meta = LinkMLMeta(
},
"default_prefix": "core.nwb.ecephys/",
"id": "core.nwb.ecephys",
"imports": ["core.nwb.base", "../../hdmf_common/v1_5_0/namespace", "core.nwb.device", "core.nwb.language"],
"imports": [
"core.nwb.base",
"../../hdmf_common/v1_5_0/namespace",
"core.nwb.device",
"core.nwb.language",
],
"name": "core.nwb.ecephys",
}
)
@ -86,7 +101,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
name: str = Field(...)
filtering: Optional[str] = Field(
@ -101,7 +118,9 @@ class ElectricalSeries(TimeSeries):
electrodes: Named[DynamicTableRegion] = Field(
...,
description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field(
None,
@ -130,7 +149,9 @@ class ElectricalSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -143,7 +164,9 @@ 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).
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
name: str = Field(...)
data: Union[
@ -162,7 +185,9 @@ class SpikeEventSeries(ElectricalSeries):
electrodes: Named[DynamicTableRegion] = Field(
...,
description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field(
None,
@ -186,7 +211,9 @@ class SpikeEventSeries(ElectricalSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -199,9 +226,14 @@ class FeatureExtraction(NWBDataInterface):
Features, such as PC1 and PC2, that are extracted from signals stored in a SpikeEventSeries or other source.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
name: str = Field("FeatureExtraction", json_schema_extra={"linkml_meta": {"ifabsent": "string(FeatureExtraction)"}})
name: str = Field(
"FeatureExtraction",
json_schema_extra={"linkml_meta": {"ifabsent": "string(FeatureExtraction)"}},
)
description: NDArray[Shape["* num_features"], str] = Field(
...,
description="""Description of features (eg, ''PC1'') for each of the extracted features.""",
@ -212,7 +244,13 @@ class FeatureExtraction(NWBDataInterface):
description="""Multi-dimensional array of features extracted from each event.""",
json_schema_extra={
"linkml_meta": {
"array": {"dimensions": [{"alias": "num_events"}, {"alias": "num_channels"}, {"alias": "num_features"}]}
"array": {
"dimensions": [
{"alias": "num_events"},
{"alias": "num_channels"},
{"alias": "num_features"},
]
}
}
},
)
@ -224,7 +262,9 @@ class FeatureExtraction(NWBDataInterface):
electrodes: Named[DynamicTableRegion] = Field(
...,
description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
@ -233,9 +273,13 @@ class EventDetection(NWBDataInterface):
Detected spike events from voltage trace(s).
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
name: str = Field("EventDetection", json_schema_extra={"linkml_meta": {"ifabsent": "string(EventDetection)"}})
name: str = Field(
"EventDetection", json_schema_extra={"linkml_meta": {"ifabsent": "string(EventDetection)"}}
)
detection_method: str = Field(
...,
description="""Description of how events were detected, such as voltage threshold, or dV/dT threshold, as well as relevant values.""",
@ -257,7 +301,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
children: Optional[List[SpikeEventSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpikeEventSeries"}]}}
@ -270,7 +316,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
children: Optional[List[ElectricalSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "ElectricalSeries"}]}}
@ -283,7 +331,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
children: Optional[List[ElectricalSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "ElectricalSeries"}]}}
@ -296,7 +346,9 @@ class ElectrodeGroup(NWBContainer):
A physical grouping of electrodes, e.g. a shank of an array.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
name: str = Field(...)
description: Optional[str] = Field(None, description="""Description of this electrode group.""")
@ -317,7 +369,10 @@ class ElectrodeGroupPosition(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys"})
name: Literal["position"] = Field(
"position", json_schema_extra={"linkml_meta": {"equals_string": "position", "ifabsent": "string(position)"}}
"position",
json_schema_extra={
"linkml_meta": {"equals_string": "position", "ifabsent": "string(position)"}
},
)
x: Optional[np.float32] = Field(None, description="""x coordinate""")
y: Optional[np.float32] = Field(None, description="""y coordinate""")
@ -329,22 +384,33 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
name: str = Field("ClusterWaveforms", json_schema_extra={"linkml_meta": {"ifabsent": "string(ClusterWaveforms)"}})
waveform_filtering: str = Field(..., description="""Filtering applied to data before generating mean/sd""")
name: str = Field(
"ClusterWaveforms",
json_schema_extra={"linkml_meta": {"ifabsent": "string(ClusterWaveforms)"}},
)
waveform_filtering: str = Field(
..., description="""Filtering applied to data before generating mean/sd"""
)
waveform_mean: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = 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)""",
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]}}
"linkml_meta": {
"array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]}
}
},
)
waveform_sd: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = Field(
...,
description="""Stdev of waveforms for each cluster, using the same indices as in mean""",
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]}}
"linkml_meta": {
"array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]}
}
},
)
@ -354,9 +420,13 @@ class Clustering(NWBDataInterface):
DEPRECATED Clustered spike data, whether from automatic clustering tools (e.g., klustakwik) or as a result of manual sorting.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
name: str = Field("Clustering", json_schema_extra={"linkml_meta": {"ifabsent": "string(Clustering)"}})
name: str = Field(
"Clustering", json_schema_extra={"linkml_meta": {"ifabsent": "string(Clustering)"}}
)
description: str = Field(
...,
description="""Description of clusters or clustering, (e.g. cluster 0 is noise, clusters curated using Klusters, etc)""",

View file

@ -6,7 +6,15 @@ import re
import sys
import numpy as np
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator
from pydantic import (
BaseModel,
ConfigDict,
Field,
RootModel,
field_validator,
ValidationInfo,
BeforeValidator,
)
from numpydantic import NDArray, Shape
from ...hdmf_common.v1_5_0.hdmf_common_table import DynamicTable, VectorIndex, VectorData
from ...core.v2_3_0.core_nwb_base import TimeSeries
@ -24,7 +32,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -80,46 +90,62 @@ class TimeIntervals(DynamicTable):
A container for aggregating epoch data and the TimeSeries that each epoch applies to.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.epoch", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.epoch", "tree_root": True}
)
name: str = Field(...)
start_time: NDArray[Any, np.float32] = Field(
...,
description="""Start time of epoch, in seconds.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
stop_time: NDArray[Any, np.float32] = Field(
...,
description="""Stop time of epoch, in seconds.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
tags: Optional[NDArray[Any, str]] = Field(
None,
description="""User-defined tags that identify or categorize events.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
tags_index: Named[Optional[VectorIndex]] = Field(
None,
description="""Index for tags.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
timeseries: Optional[TimeIntervalsTimeseries] = Field(
None, description="""An index into a TimeSeries object."""
)
timeseries: Optional[TimeIntervalsTimeseries] = Field(None, description="""An index into a TimeSeries object.""")
timeseries_index: Named[Optional[VectorIndex]] = Field(
None,
description="""Index for timeseries.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
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: NDArray[Shape["* num_rows"], int] = Field(
...,
description="""Array of unique identifiers for the rows of this dynamic table.""",
@ -139,17 +165,24 @@ class TimeIntervalsTimeseries(VectorData):
name: Literal["timeseries"] = Field(
"timeseries",
json_schema_extra={"linkml_meta": {"equals_string": "timeseries", "ifabsent": "string(timeseries)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "timeseries", "ifabsent": "string(timeseries)"}
},
)
idx_start: Optional[np.int32] = Field(
None,
description="""Start index into the TimeSeries 'data' and 'timestamp' datasets of the referenced TimeSeries. The first dimension of those arrays is always time.""",
)
count: Optional[np.int32] = Field(
None, description="""Number of data samples available in this time series, during this epoch."""
None,
description="""Number of data samples available in this time series, during this epoch.""",
)
timeseries: Optional[TimeSeries] = Field(
None, description="""the TimeSeries that this index applies to."""
)
description: Optional[str] = Field(
None, description="""Description of what these vectors represent."""
)
timeseries: Optional[TimeSeries] = Field(None, description="""the TimeSeries that this index applies to.""")
description: Optional[str] = Field(None, description="""Description of what these vectors represent.""")
array: Optional[
Union[
NDArray[Shape["* dim0"], Any],

View file

@ -118,7 +118,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -185,10 +187,14 @@ class ScratchData(NWBData):
Any one-off datasets
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.file", "tree_root": True}
)
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"""
)
class NWBFile(NWBContainer):
@ -196,10 +202,13 @@ class NWBFile(NWBContainer):
An NWB:N file storing cellular-based neurophysiology data from a single experimental session.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.file", "tree_root": True}
)
name: Literal["root"] = Field(
"root", json_schema_extra={"linkml_meta": {"equals_string": "root", "ifabsent": "string(root)"}}
"root",
json_schema_extra={"linkml_meta": {"equals_string": "root", "ifabsent": "string(root)"}},
)
nwb_version: Optional[str] = Field(
None,
@ -208,7 +217,9 @@ class NWBFile(NWBContainer):
file_create_date: NDArray[Shape["* num_modifications"], np.datetime64] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_modifications"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_modifications"}]}}
},
)
identifier: str = Field(
...,
@ -228,17 +239,23 @@ class NWBFile(NWBContainer):
acquisition: Optional[List[Union[DynamicTable, NWBDataInterface]]] = Field(
None,
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.""",
json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]}},
json_schema_extra={
"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]}
},
)
analysis: Optional[List[Union[DynamicTable, NWBContainer]]] = Field(
None,
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.""",
json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]}},
json_schema_extra={
"linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]}
},
)
scratch: Optional[List[Union[DynamicTable, NWBContainer]]] = 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.""",
json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]}},
json_schema_extra={
"linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]}
},
)
processing: Optional[List[ProcessingModule]] = Field(
None,
@ -278,7 +295,10 @@ class NWBFileStimulus(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file"})
name: Literal["stimulus"] = Field(
"stimulus", json_schema_extra={"linkml_meta": {"equals_string": "stimulus", "ifabsent": "string(stimulus)"}}
"stimulus",
json_schema_extra={
"linkml_meta": {"equals_string": "stimulus", "ifabsent": "string(stimulus)"}
},
)
presentation: Optional[List[TimeSeries]] = Field(
None,
@ -300,16 +320,27 @@ class NWBFileGeneral(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file"})
name: Literal["general"] = Field(
"general", json_schema_extra={"linkml_meta": {"equals_string": "general", "ifabsent": "string(general)"}}
"general",
json_schema_extra={
"linkml_meta": {"equals_string": "general", "ifabsent": "string(general)"}
},
)
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."""
)
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.""")
experimenter: Optional[NDArray[Shape["* num_experimenters"], str]] = Field(
None,
description="""Name of person(s) who performed the experiment. Can also specify roles of different people involved.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_experimenters"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_experimenters"}]}}
},
)
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[NDArray[Shape["* num_keywords"], str]] = Field(
None,
description="""Terms to search over.""",
@ -322,12 +353,15 @@ class NWBFileGeneral(ConfiguredBaseModel):
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."""
None,
description="""Experimental protocol, if applicable. e.g., include IACUC protocol number.""",
)
related_publications: Optional[NDArray[Shape["* num_publications"], str]] = Field(
None,
description="""Publication information. PMID, DOI, URL, etc.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_publications"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_publications"}]}}
},
)
session_id: Optional[str] = Field(None, description="""Lab-specific ID for the session.""")
slices: Optional[str] = Field(
@ -335,7 +369,8 @@ class NWBFileGeneral(ConfiguredBaseModel):
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."""
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."""
@ -358,7 +393,8 @@ class NWBFileGeneral(ConfiguredBaseModel):
json_schema_extra={"linkml_meta": {"any_of": [{"range": "Device"}]}},
)
subject: Optional[Subject] = Field(
None, description="""Information about the animal or person from which the data was measured."""
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."""
@ -387,7 +423,9 @@ class NWBFileGeneralSourceScript(ConfiguredBaseModel):
name: Literal["source_script"] = Field(
"source_script",
json_schema_extra={"linkml_meta": {"equals_string": "source_script", "ifabsent": "string(source_script)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "source_script", "ifabsent": "string(source_script)"}
},
)
file_name: Optional[str] = Field(None, description="""Name of script file.""")
value: str = Field(...)
@ -403,10 +441,15 @@ class NWBFileGeneralExtracellularEphys(ConfiguredBaseModel):
name: Literal["extracellular_ephys"] = Field(
"extracellular_ephys",
json_schema_extra={
"linkml_meta": {"equals_string": "extracellular_ephys", "ifabsent": "string(extracellular_ephys)"}
"linkml_meta": {
"equals_string": "extracellular_ephys",
"ifabsent": "string(extracellular_ephys)",
}
},
)
electrode_group: Optional[List[ElectrodeGroup]] = Field(None, description="""Physical group of electrodes.""")
electrode_group: Optional[List[ElectrodeGroup]] = Field(
None, description="""Physical group of electrodes."""
)
electrodes: Optional[NWBFileGeneralExtracellularEphysElectrodes] = Field(
None, description="""A table of all electrodes (i.e. channels) used for recording."""
)
@ -421,48 +464,62 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable):
name: Literal["electrodes"] = Field(
"electrodes",
json_schema_extra={"linkml_meta": {"equals_string": "electrodes", "ifabsent": "string(electrodes)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "electrodes", "ifabsent": "string(electrodes)"}
},
)
x: NDArray[Any, np.float32] = Field(
...,
description="""x coordinate of the channel location in the brain (+x is posterior).""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
y: NDArray[Any, np.float32] = Field(
...,
description="""y coordinate of the channel location in the brain (+y is inferior).""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
z: NDArray[Any, np.float32] = Field(
...,
description="""z coordinate of the channel location in the brain (+z is right).""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
imp: NDArray[Any, np.float32] = Field(
...,
description="""Impedance of the channel, in ohms.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
location: NDArray[Any, str] = Field(
...,
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.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
filtering: NDArray[Any, np.float32] = Field(
...,
description="""Description of hardware filtering, including the filter name and frequency cutoffs.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
group: List[ElectrodeGroup] = Field(
@ -472,42 +529,54 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable):
...,
description="""Name of the ElectrodeGroup this electrode is a part of.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
rel_x: Optional[NDArray[Any, np.float32]] = Field(
None,
description="""x coordinate in electrode group""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
rel_y: Optional[NDArray[Any, np.float32]] = Field(
None,
description="""y coordinate in electrode group""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
rel_z: Optional[NDArray[Any, np.float32]] = Field(
None,
description="""z coordinate in electrode group""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
reference: Optional[NDArray[Any, str]] = Field(
None,
description="""Description of the reference used for this electrode.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
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: NDArray[Shape["* num_rows"], int] = Field(
...,
description="""Array of unique identifiers for the rows of this dynamic table.""",
@ -528,7 +597,10 @@ class NWBFileGeneralIntracellularEphys(ConfiguredBaseModel):
name: Literal["intracellular_ephys"] = Field(
"intracellular_ephys",
json_schema_extra={
"linkml_meta": {"equals_string": "intracellular_ephys", "ifabsent": "string(intracellular_ephys)"}
"linkml_meta": {
"equals_string": "intracellular_ephys",
"ifabsent": "string(intracellular_ephys)",
}
},
)
filtering: Optional[str] = Field(
@ -548,7 +620,9 @@ class LabMetaData(NWBContainer):
Lab-specific meta-data.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.file", "tree_root": True}
)
name: str = Field(...)
@ -558,25 +632,34 @@ class Subject(NWBContainer):
Information about the animal or person from which the data was measured.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.file", "tree_root": True}
)
name: str = Field(...)
age: Optional[str] = Field(None, description="""Age of subject. Can be supplied instead of 'date_of_birth'.""")
age: Optional[str] = Field(
None, description="""Age of subject. Can be supplied instead of 'date_of_birth'."""
)
date_of_birth: Optional[np.datetime64] = 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)."""
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.""")
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)."""
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."""
None,
description="""Weight at time of experiment, at time of surgery and at other important times.""",
)

View file

@ -29,7 +29,15 @@ from ...core.v2_3_0.core_nwb_base import (
Images,
)
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator
from pydantic import (
BaseModel,
ConfigDict,
Field,
RootModel,
field_validator,
ValidationInfo,
BeforeValidator,
)
from numpydantic import NDArray, Shape
metamodel_version = "None"
@ -45,7 +53,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -90,7 +100,12 @@ linkml_meta = LinkMLMeta(
},
"default_prefix": "core.nwb.icephys/",
"id": "core.nwb.icephys",
"imports": ["core.nwb.base", "core.nwb.device", "../../hdmf_common/v1_5_0/namespace", "core.nwb.language"],
"imports": [
"core.nwb.base",
"core.nwb.device",
"../../hdmf_common/v1_5_0/namespace",
"core.nwb.language",
],
"name": "core.nwb.icephys",
}
)
@ -101,7 +116,9 @@ class PatchClampSeries(TimeSeries):
An abstract base class for patch-clamp data - stimulus or response, current or voltage.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
stimulus_description: Optional[str] = Field(
@ -112,7 +129,8 @@ class PatchClampSeries(TimeSeries):
)
data: PatchClampSeriesData = Field(..., description="""Recorded voltage or current.""")
gain: Optional[np.float32] = Field(
None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp)."""
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.""")
comments: Optional[str] = Field(
@ -136,7 +154,9 @@ class PatchClampSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -152,7 +172,8 @@ class PatchClampSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
unit: Optional[str] = Field(
None,
@ -168,13 +189,17 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
data: CurrentClampSeriesData = Field(..., description="""Recorded voltage.""")
bias_current: Optional[np.float32] = Field(None, description="""Bias current, in amps.""")
bridge_balance: Optional[np.float32] = Field(None, description="""Bridge balance, in ohms.""")
capacitance_compensation: Optional[np.float32] = Field(None, description="""Capacitance compensation, in farads.""")
capacitance_compensation: Optional[np.float32] = Field(
None, description="""Capacitance compensation, in farads."""
)
stimulus_description: Optional[str] = Field(
None, description="""Protocol/stimulus name for this patch-clamp dataset."""
)
@ -182,7 +207,8 @@ class CurrentClampSeries(PatchClampSeries):
None, description="""Sweep number, allows to group different PatchClampSeries together."""
)
gain: Optional[np.float32] = Field(
None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp)."""
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.""")
comments: Optional[str] = Field(
@ -206,7 +232,9 @@ class CurrentClampSeries(PatchClampSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -222,7 +250,8 @@ class CurrentClampSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
unit: Optional[str] = Field(
None,
@ -236,14 +265,19 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
stimulus_description: Optional[str] = Field(
None, description="""An IZeroClampSeries has no stimulus, so this attribute is automatically set to \"N/A\""""
None,
description="""An IZeroClampSeries has no stimulus, so this attribute is automatically set to \"N/A\"""",
)
bias_current: np.float32 = Field(..., description="""Bias current, in amps, fixed to 0.0.""")
bridge_balance: np.float32 = Field(..., description="""Bridge balance, in ohms, fixed to 0.0.""")
bridge_balance: np.float32 = Field(
..., description="""Bridge balance, in ohms, fixed to 0.0."""
)
capacitance_compensation: np.float32 = Field(
..., description="""Capacitance compensation, in farads, fixed to 0.0."""
)
@ -252,7 +286,8 @@ class IZeroClampSeries(CurrentClampSeries):
None, description="""Sweep number, allows to group different PatchClampSeries together."""
)
gain: Optional[np.float32] = Field(
None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp)."""
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.""")
comments: Optional[str] = Field(
@ -276,7 +311,9 @@ class IZeroClampSeries(CurrentClampSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -289,7 +326,9 @@ class CurrentClampStimulusSeries(PatchClampSeries):
Stimulus current applied during current clamp recording.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
data: CurrentClampStimulusSeriesData = Field(..., description="""Stimulus current applied.""")
@ -300,7 +339,8 @@ class CurrentClampStimulusSeries(PatchClampSeries):
None, description="""Sweep number, allows to group different PatchClampSeries together."""
)
gain: Optional[np.float32] = Field(
None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp)."""
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.""")
comments: Optional[str] = Field(
@ -324,7 +364,9 @@ class CurrentClampStimulusSeries(PatchClampSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -340,7 +382,8 @@ class CurrentClampStimulusSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
unit: Optional[str] = Field(
None,
@ -354,7 +397,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
data: VoltageClampSeriesData = Field(..., description="""Recorded current.""")
@ -376,8 +421,8 @@ class VoltageClampSeries(PatchClampSeries):
whole_cell_capacitance_comp: Optional[VoltageClampSeriesWholeCellCapacitanceComp] = Field(
None, description="""Whole cell capacitance compensation, in farads."""
)
whole_cell_series_resistance_comp: Optional[VoltageClampSeriesWholeCellSeriesResistanceComp] = Field(
None, description="""Whole cell series resistance compensation, in ohms."""
whole_cell_series_resistance_comp: Optional[VoltageClampSeriesWholeCellSeriesResistanceComp] = (
Field(None, description="""Whole cell series resistance compensation, in ohms.""")
)
stimulus_description: Optional[str] = Field(
None, description="""Protocol/stimulus name for this patch-clamp dataset."""
@ -386,7 +431,8 @@ class VoltageClampSeries(PatchClampSeries):
None, description="""Sweep number, allows to group different PatchClampSeries together."""
)
gain: Optional[np.float32] = Field(
None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp)."""
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.""")
comments: Optional[str] = Field(
@ -410,7 +456,9 @@ class VoltageClampSeries(PatchClampSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -426,7 +474,8 @@ class VoltageClampSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
unit: Optional[str] = Field(
None,
@ -445,11 +494,15 @@ class VoltageClampSeriesCapacitanceFast(ConfiguredBaseModel):
name: Literal["capacitance_fast"] = Field(
"capacitance_fast",
json_schema_extra={
"linkml_meta": {"equals_string": "capacitance_fast", "ifabsent": "string(capacitance_fast)"}
"linkml_meta": {
"equals_string": "capacitance_fast",
"ifabsent": "string(capacitance_fast)",
}
},
)
unit: Optional[str] = Field(
None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'."""
None,
description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""",
)
value: np.float32 = Field(...)
@ -464,11 +517,15 @@ class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel):
name: Literal["capacitance_slow"] = Field(
"capacitance_slow",
json_schema_extra={
"linkml_meta": {"equals_string": "capacitance_slow", "ifabsent": "string(capacitance_slow)"}
"linkml_meta": {
"equals_string": "capacitance_slow",
"ifabsent": "string(capacitance_slow)",
}
},
)
unit: Optional[str] = Field(
None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'."""
None,
description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""",
)
value: np.float32 = Field(...)
@ -490,7 +547,8 @@ class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel):
},
)
unit: Optional[str] = Field(
None, description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'."""
None,
description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'.""",
)
value: np.float32 = Field(...)
@ -512,7 +570,8 @@ class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel):
},
)
unit: Optional[str] = Field(
None, description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'."""
None,
description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'.""",
)
value: np.float32 = Field(...)
@ -534,7 +593,8 @@ class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel):
},
)
unit: Optional[str] = Field(
None, description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'."""
None,
description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'.""",
)
value: np.float32 = Field(...)
@ -556,7 +616,8 @@ class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel):
},
)
unit: Optional[str] = Field(
None, description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'."""
None,
description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'.""",
)
value: np.float32 = Field(...)
@ -578,7 +639,8 @@ class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel):
},
)
unit: Optional[str] = Field(
None, description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'."""
None,
description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'.""",
)
value: np.float32 = Field(...)
@ -588,7 +650,9 @@ class VoltageClampStimulusSeries(PatchClampSeries):
Stimulus voltage applied during a voltage clamp recording.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
data: VoltageClampStimulusSeriesData = Field(..., description="""Stimulus voltage applied.""")
@ -599,7 +663,8 @@ class VoltageClampStimulusSeries(PatchClampSeries):
None, description="""Sweep number, allows to group different PatchClampSeries together."""
)
gain: Optional[np.float32] = Field(
None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp)."""
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.""")
comments: Optional[str] = Field(
@ -623,7 +688,9 @@ class VoltageClampStimulusSeries(PatchClampSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -639,7 +706,8 @@ class VoltageClampStimulusSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
unit: Optional[str] = Field(
None,
@ -653,19 +721,27 @@ class IntracellularElectrode(NWBContainer):
An intracellular electrode and its metadata.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
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.""")
initial_access_resistance: Optional[str] = Field(None, description="""Initial access resistance.""")
initial_access_resistance: Optional[str] = Field(
None, description="""Initial access resistance."""
)
location: Optional[str] = Field(
None,
description="""Location of the electrode. 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.""",
)
resistance: Optional[str] = Field(None, description="""Electrode resistance, in ohms.""")
seal: Optional[str] = Field(None, description="""Information about seal used for recording.""")
slice: Optional[str] = Field(None, description="""Information about slice used for recording.""")
slice: Optional[str] = Field(
None, description="""Information about slice used for recording."""
)
class SweepTable(DynamicTable):
@ -673,14 +749,18 @@ class SweepTable(DynamicTable):
The table which groups different PatchClampSeries together.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
sweep_number: NDArray[Any, np.uint32] = Field(
...,
description="""Sweep number of the PatchClampSeries in that row.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
series: List[PatchClampSeries] = Field(
@ -689,13 +769,17 @@ class SweepTable(DynamicTable):
series_index: Named[VectorIndex] = Field(
...,
description="""Index for series.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
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: NDArray[Shape["* num_rows"], int] = Field(
...,
description="""Array of unique identifiers for the rows of this dynamic table.""",

View file

@ -45,7 +45,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -101,7 +103,9 @@ class GrayscaleImage(Image):
A grayscale image.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.image", "tree_root": True}
)
name: str = Field(...)
resolution: Optional[np.float32] = Field(
@ -122,7 +126,9 @@ class RGBImage(Image):
A color image.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.image", "tree_root": True}
)
name: str = Field(...)
resolution: Optional[np.float32] = Field(
@ -143,7 +149,9 @@ class RGBAImage(Image):
A color image with transparency.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.image", "tree_root": True}
)
name: str = Field(...)
resolution: Optional[np.float32] = Field(
@ -164,11 +172,16 @@ 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].
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.image", "tree_root": True}
)
name: str = Field(...)
data: Optional[
Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]]
Union[
NDArray[Shape["* frame, * x, * y"], np.number],
NDArray[Shape["* frame, * x, * y, * z"], np.number],
]
] = Field(None, description="""Binary data representing images across frames.""")
dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field(
None,
@ -205,7 +218,9 @@ class ImageSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -222,7 +237,9 @@ class ImageSeriesExternalFile(ConfiguredBaseModel):
name: Literal["external_file"] = Field(
"external_file",
json_schema_extra={"linkml_meta": {"equals_string": "external_file", "ifabsent": "string(external_file)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "external_file", "ifabsent": "string(external_file)"}
},
)
starting_frame: Optional[np.int32] = Field(
None,
@ -238,11 +255,16 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.image", "tree_root": True}
)
name: str = Field(...)
data: Optional[
Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]]
Union[
NDArray[Shape["* frame, * x, * y"], np.number],
NDArray[Shape["* frame, * x, * y, * z"], np.number],
]
] = Field(None, description="""Binary data representing images across frames.""")
dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field(
None,
@ -279,7 +301,9 @@ class ImageMaskSeries(ImageSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -292,15 +316,23 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.image", "tree_root": True}
)
name: str = Field(...)
distance: Optional[np.float32] = Field(None, description="""Distance from camera/monitor to target/eye.""")
distance: Optional[np.float32] = Field(
None, description="""Distance from camera/monitor to target/eye."""
)
field_of_view: Optional[
Union[NDArray[Shape["2 width_height"], np.float32], NDArray[Shape["3 width_height_depth"], np.float32]]
Union[
NDArray[Shape["2 width_height"], np.float32],
NDArray[Shape["3 width_height_depth"], np.float32],
]
] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""")
data: Union[
NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, 3 r_g_b"], np.number]
NDArray[Shape["* frame, * x, * y"], np.number],
NDArray[Shape["* frame, * x, * y, 3 r_g_b"], np.number],
] = Field(..., description="""Images presented to subject, either grayscale or RGB""")
orientation: Optional[str] = Field(
None,
@ -341,7 +373,9 @@ class OpticalSeries(ImageSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -354,7 +388,9 @@ class IndexSeries(TimeSeries):
Stores indices to image frames stored in an ImageSeries. The purpose of the ImageIndexSeries is to allow a static image stack to be stored somewhere, 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 ImageSeries, and the timestamps array indicates when that image was displayed.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.image", "tree_root": True}
)
name: str = Field(...)
data: NDArray[Shape["* num_times"], np.int32] = Field(
@ -384,7 +420,9 @@ class IndexSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,

View file

@ -8,9 +8,22 @@ import numpy as np
from ...core.v2_3_0.core_nwb_base import TimeSeries, TimeSeriesStartingTime, TimeSeriesSync
from ...core.v2_3_0.core_nwb_ecephys import ElectrodeGroup
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator
from pydantic import (
BaseModel,
ConfigDict,
Field,
RootModel,
field_validator,
ValidationInfo,
BeforeValidator,
)
from numpydantic import NDArray, Shape
from ...hdmf_common.v1_5_0.hdmf_common_table import DynamicTableRegion, DynamicTable, VectorData, VectorIndex
from ...hdmf_common.v1_5_0.hdmf_common_table import (
DynamicTableRegion,
DynamicTable,
VectorData,
VectorIndex,
)
metamodel_version = "None"
version = "2.3.0"
@ -25,7 +38,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -70,7 +85,12 @@ linkml_meta = LinkMLMeta(
},
"default_prefix": "core.nwb.misc/",
"id": "core.nwb.misc",
"imports": ["core.nwb.base", "../../hdmf_common/v1_5_0/namespace", "core.nwb.ecephys", "core.nwb.language"],
"imports": [
"core.nwb.base",
"../../hdmf_common/v1_5_0/namespace",
"core.nwb.ecephys",
"core.nwb.language",
],
"name": "core.nwb.misc",
}
)
@ -81,10 +101,14 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.misc", "tree_root": True}
)
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[NDArray[Shape["* num_features"], str]] = Field(
None,
description="""Units of each feature.""",
@ -117,7 +141,9 @@ class AbstractFeatureSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -133,14 +159,18 @@ class AbstractFeatureSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
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[
Union[NDArray[Shape["* num_times"], np.number], NDArray[Shape["* num_times, * num_features"], np.number]]
Union[
NDArray[Shape["* num_times"], np.number],
NDArray[Shape["* num_times, * num_features"], np.number],
]
] = Field(None)
@ -149,7 +179,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.misc", "tree_root": True}
)
name: str = Field(...)
data: NDArray[Shape["* num_times"], str] = Field(
@ -179,7 +211,9 @@ class AnnotationSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -192,7 +226,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.misc", "tree_root": True}
)
name: str = Field(...)
data: NDArray[Shape["* num_times"], np.int8] = Field(
@ -222,7 +258,9 @@ class IntervalSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -235,15 +273,21 @@ class DecompositionSeries(TimeSeries):
Spectral analysis of a time series, e.g. of an LFP or a speech signal.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.misc", "tree_root": True}
)
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.""")
source_channels: Named[Optional[DynamicTableRegion]] = Field(
None,
description="""DynamicTableRegion pointer to the channels that this decomposition series was generated from.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
bands: DecompositionSeriesBands = Field(
...,
@ -271,7 +315,9 @@ class DecompositionSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -287,7 +333,8 @@ class DecompositionSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
unit: Optional[str] = Field(
None,
@ -297,7 +344,13 @@ class DecompositionSeriesData(ConfiguredBaseModel):
None,
json_schema_extra={
"linkml_meta": {
"array": {"dimensions": [{"alias": "num_times"}, {"alias": "num_channels"}, {"alias": "num_bands"}]}
"array": {
"dimensions": [
{"alias": "num_times"},
{"alias": "num_channels"},
{"alias": "num_bands"},
]
}
}
},
)
@ -311,13 +364,16 @@ class DecompositionSeriesBands(DynamicTable):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"})
name: Literal["bands"] = Field(
"bands", json_schema_extra={"linkml_meta": {"equals_string": "bands", "ifabsent": "string(bands)"}}
"bands",
json_schema_extra={"linkml_meta": {"equals_string": "bands", "ifabsent": "string(bands)"}},
)
band_name: NDArray[Any, str] = Field(
...,
description="""Name of the band, e.g. theta.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
band_limits: NDArray[Shape["* num_bands, 2 low_high"], np.float32] = Field(
@ -325,7 +381,12 @@ class DecompositionSeriesBands(DynamicTable):
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.""",
json_schema_extra={
"linkml_meta": {
"array": {"dimensions": [{"alias": "num_bands"}, {"alias": "low_high", "exact_cardinality": 2}]}
"array": {
"dimensions": [
{"alias": "num_bands"},
{"alias": "low_high", "exact_cardinality": 2},
]
}
}
},
)
@ -343,7 +404,9 @@ class DecompositionSeriesBands(DynamicTable):
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: NDArray[Shape["* num_rows"], int] = Field(
...,
description="""Array of unique identifiers for the rows of this dynamic table.""",
@ -359,38 +422,55 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.misc", "tree_root": True}
)
name: str = Field("Units", json_schema_extra={"linkml_meta": {"ifabsent": "string(Units)"}})
spike_times_index: Named[Optional[VectorIndex]] = Field(
None,
description="""Index into the spike_times dataset.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
spike_times: Optional[UnitsSpikeTimes] = Field(
None, description="""Spike times for each unit."""
)
spike_times: Optional[UnitsSpikeTimes] = Field(None, description="""Spike times for each unit.""")
obs_intervals_index: Named[Optional[VectorIndex]] = Field(
None,
description="""Index into the obs_intervals dataset.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
obs_intervals: Optional[NDArray[Shape["* num_intervals, 2 start_end"], np.float64]] = Field(
None,
description="""Observation intervals for each unit.""",
json_schema_extra={
"linkml_meta": {
"array": {"dimensions": [{"alias": "num_intervals"}, {"alias": "start_end", "exact_cardinality": 2}]}
"array": {
"dimensions": [
{"alias": "num_intervals"},
{"alias": "start_end", "exact_cardinality": 2},
]
}
}
},
)
electrodes_index: Named[Optional[VectorIndex]] = Field(
None,
description="""Index into electrodes.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
electrodes: Named[Optional[DynamicTableRegion]] = Field(
None,
description="""Electrode that each spike unit came from, specified using a DynamicTableRegion.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
electrode_group: Optional[List[ElectrodeGroup]] = Field(
None, description="""Electrode group that each spike unit came from."""
@ -411,24 +491,32 @@ class Units(DynamicTable):
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.""",
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_waveforms"}, {"alias": "num_samples"}]}}
"linkml_meta": {
"array": {"dimensions": [{"alias": "num_waveforms"}, {"alias": "num_samples"}]}
}
},
)
waveforms_index: Named[Optional[VectorIndex]] = Field(
None,
description="""Index into the waveforms dataset. One value for every spike event. See 'waveforms' for more detail.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
waveforms_index_index: Named[Optional[VectorIndex]] = Field(
None,
description="""Index into the waveforms_index dataset. One value for every unit (row in the table). See 'waveforms' for more detail.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
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: NDArray[Shape["* num_rows"], int] = Field(
...,
description="""Array of unique identifiers for the rows of this dynamic table.""",
@ -448,13 +536,17 @@ class UnitsSpikeTimes(VectorData):
name: Literal["spike_times"] = Field(
"spike_times",
json_schema_extra={"linkml_meta": {"equals_string": "spike_times", "ifabsent": "string(spike_times)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "spike_times", "ifabsent": "string(spike_times)"}
},
)
resolution: Optional[np.float64] = 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[
Union[
NDArray[Shape["* dim0"], Any],

View file

@ -8,7 +8,12 @@ from typing import Any, ClassVar, List, Literal, Dict, Optional, Union
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator
import numpy as np
from numpydantic import NDArray, Shape
from ...core.v2_3_0.core_nwb_base import TimeSeries, TimeSeriesStartingTime, TimeSeriesSync, NWBContainer
from ...core.v2_3_0.core_nwb_base import (
TimeSeries,
TimeSeriesStartingTime,
TimeSeriesSync,
NWBContainer,
)
metamodel_version = "None"
version = "2.3.0"
@ -23,7 +28,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -79,7 +86,9 @@ class OptogeneticSeries(TimeSeries):
An optogenetic stimulus.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ogen", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ogen", "tree_root": True}
)
name: str = Field(...)
data: NDArray[Shape["* num_times"], np.number] = Field(
@ -109,7 +118,9 @@ class OptogeneticSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -122,7 +133,9 @@ class OptogeneticStimulusSite(NWBContainer):
A site of optogenetic stimulation.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ogen", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ogen", "tree_root": True}
)
name: str = Field(...)
description: str = Field(..., description="""Description of stimulation site.""")

View file

@ -39,7 +39,15 @@ from ...core.v2_3_0.core_nwb_image import (
IndexSeries,
)
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator
from pydantic import (
BaseModel,
ConfigDict,
Field,
RootModel,
field_validator,
ValidationInfo,
BeforeValidator,
)
from numpydantic import NDArray, Shape
metamodel_version = "None"
@ -55,7 +63,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -117,7 +127,9 @@ class TwoPhotonSeries(ImageSeries):
Image stack recorded over time from 2-photon microscope.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
name: str = Field(...)
pmt_gain: Optional[np.float32] = Field(None, description="""Photomultiplier gain.""")
@ -126,10 +138,16 @@ class TwoPhotonSeries(ImageSeries):
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[
Union[NDArray[Shape["2 width_height"], np.float32], NDArray[Shape["3 width_height_depth"], np.float32]]
Union[
NDArray[Shape["2 width_height"], np.float32],
NDArray[Shape["3 width_height_depth"], np.float32],
]
] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""")
data: Optional[
Union[NDArray[Shape["* frame, * x, * y"], np.number], NDArray[Shape["* frame, * x, * y, * z"], np.number]]
Union[
NDArray[Shape["* frame, * x, * y"], np.number],
NDArray[Shape["* frame, * x, * y, * z"], np.number],
]
] = Field(None, description="""Binary data representing images across frames.""")
dimension: Optional[NDArray[Shape["* rank"], np.int32]] = Field(
None,
@ -166,7 +184,9 @@ class TwoPhotonSeries(ImageSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -179,16 +199,21 @@ class RoiResponseSeries(TimeSeries):
ROI responses over an imaging plane. The first dimension represents time. The second dimension, if present, represents ROIs.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
name: str = Field(...)
data: Union[NDArray[Shape["* num_times"], np.number], NDArray[Shape["* num_times, * num_rois"], np.number]] = Field(
..., description="""Signals from ROIs."""
)
data: Union[
NDArray[Shape["* num_times"], np.number],
NDArray[Shape["* num_times, * num_rois"], np.number],
] = Field(..., description="""Signals from ROIs.""")
rois: Named[DynamicTableRegion] = Field(
...,
description="""DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
description: Optional[str] = Field(None, description="""Description of the time series.""")
comments: Optional[str] = Field(
@ -212,7 +237,9 @@ class RoiResponseSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -225,7 +252,9 @@ 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).
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
children: Optional[List[RoiResponseSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "RoiResponseSeries"}]}}
@ -238,7 +267,9 @@ 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).
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
children: Optional[List[RoiResponseSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "RoiResponseSeries"}]}}
@ -251,7 +282,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
children: Optional[List[PlaneSegmentation]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "PlaneSegmentation"}]}}
@ -264,7 +297,9 @@ class PlaneSegmentation(DynamicTable):
Results from image segmentation of a specific imaging plane.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
name: str = Field(...)
image_mask: Optional[PlaneSegmentationImageMask] = Field(
@ -274,7 +309,9 @@ class PlaneSegmentation(DynamicTable):
pixel_mask_index: Named[Optional[VectorIndex]] = Field(
None,
description="""Index into pixel_mask.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
pixel_mask: Optional[PlaneSegmentationPixelMask] = Field(
None,
@ -283,7 +320,9 @@ class PlaneSegmentation(DynamicTable):
voxel_mask_index: Named[Optional[VectorIndex]] = Field(
None,
description="""Index into voxel_mask.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
voxel_mask: Optional[PlaneSegmentationVoxelMask] = Field(
None,
@ -298,7 +337,9 @@ class PlaneSegmentation(DynamicTable):
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: NDArray[Shape["* num_rows"], int] = Field(
...,
description="""Array of unique identifiers for the rows of this dynamic table.""",
@ -318,9 +359,13 @@ class PlaneSegmentationImageMask(VectorData):
name: Literal["image_mask"] = Field(
"image_mask",
json_schema_extra={"linkml_meta": {"equals_string": "image_mask", "ifabsent": "string(image_mask)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "image_mask", "ifabsent": "string(image_mask)"}
},
)
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[
Union[
NDArray[Shape["* dim0"], Any],
@ -340,12 +385,16 @@ class PlaneSegmentationPixelMask(VectorData):
name: Literal["pixel_mask"] = Field(
"pixel_mask",
json_schema_extra={"linkml_meta": {"equals_string": "pixel_mask", "ifabsent": "string(pixel_mask)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "pixel_mask", "ifabsent": "string(pixel_mask)"}
},
)
x: Optional[np.uint32] = Field(None, description="""Pixel x-coordinate.""")
y: Optional[np.uint32] = Field(None, description="""Pixel y-coordinate.""")
weight: Optional[np.float32] = Field(None, description="""Weight of the pixel.""")
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[
Union[
NDArray[Shape["* dim0"], Any],
@ -365,13 +414,17 @@ class PlaneSegmentationVoxelMask(VectorData):
name: Literal["voxel_mask"] = Field(
"voxel_mask",
json_schema_extra={"linkml_meta": {"equals_string": "voxel_mask", "ifabsent": "string(voxel_mask)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "voxel_mask", "ifabsent": "string(voxel_mask)"}
},
)
x: Optional[np.uint32] = Field(None, description="""Voxel x-coordinate.""")
y: Optional[np.uint32] = Field(None, description="""Voxel y-coordinate.""")
z: Optional[np.uint32] = Field(None, description="""Voxel z-coordinate.""")
weight: Optional[np.float32] = Field(None, description="""Weight of the voxel.""")
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[
Union[
NDArray[Shape["* dim0"], Any],
@ -387,7 +440,9 @@ class ImagingPlane(NWBContainer):
An imaging plane and its metadata.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
children: Optional[List[OpticalChannel]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "OpticalChannel"}]}}
@ -400,11 +455,15 @@ class OpticalChannel(NWBContainer):
An optical channel used to record from an imaging plane.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
name: str = Field(...)
description: str = Field(..., description="""Description or other notes about the channel.""")
emission_lambda: np.float32 = Field(..., description="""Emission wavelength for channel, in nm.""")
emission_lambda: np.float32 = Field(
..., description="""Emission wavelength for channel, in nm."""
)
class MotionCorrection(NWBDataInterface):
@ -412,7 +471,9 @@ 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).
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
children: Optional[List[CorrectedImageStack]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "CorrectedImageStack"}]}}
@ -425,10 +486,14 @@ class CorrectedImageStack(NWBDataInterface):
Reuslts from motion correction of an image stack.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ophys", "tree_root": True}
)
name: str = Field(...)
corrected: ImageSeries = Field(..., description="""Image stack with frames shifted to the common coordinates.""")
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.""",

View file

@ -23,7 +23,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -79,9 +81,14 @@ 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).
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.retinotopy", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.retinotopy", "tree_root": True}
)
name: str = Field("ImagingRetinotopy", json_schema_extra={"linkml_meta": {"ifabsent": "string(ImagingRetinotopy)"}})
name: str = Field(
"ImagingRetinotopy",
json_schema_extra={"linkml_meta": {"ifabsent": "string(ImagingRetinotopy)"}},
)
axis_1_phase_map: ImagingRetinotopyAxis1PhaseMap = Field(
..., description="""Phase response to stimulus on the first measured axis."""
)
@ -100,7 +107,9 @@ class ImagingRetinotopy(NWBDataInterface):
...,
description="""Two-element array describing the contents of the two response axis fields. Description should be something like ['altitude', 'azimuth'] or '['radius', 'theta'].""",
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "axis_1_axis_2", "exact_cardinality": 2}]}}
"linkml_meta": {
"array": {"dimensions": [{"alias": "axis_1_axis_2", "exact_cardinality": 2}]}
}
},
)
focal_depth_image: Optional[ImagingRetinotopyFocalDepthImage] = Field(
@ -108,10 +117,12 @@ class ImagingRetinotopy(NWBDataInterface):
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."""
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]"""
...,
description="""Gray-scale anatomical image of cortical surface. Array structure: [rows][columns]""",
)
@ -125,18 +136,27 @@ class ImagingRetinotopyAxis1PhaseMap(ConfiguredBaseModel):
name: Literal["axis_1_phase_map"] = Field(
"axis_1_phase_map",
json_schema_extra={
"linkml_meta": {"equals_string": "axis_1_phase_map", "ifabsent": "string(axis_1_phase_map)"}
"linkml_meta": {
"equals_string": "axis_1_phase_map",
"ifabsent": "string(axis_1_phase_map)",
}
},
)
dimension: Optional[np.int32] = Field(
None,
description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""",
)
field_of_view: Optional[np.float32] = 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).""")
field_of_view: Optional[np.float32] = 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)."""
)
array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field(
None,
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}
},
)
@ -150,18 +170,27 @@ class ImagingRetinotopyAxis1PowerMap(ConfiguredBaseModel):
name: Literal["axis_1_power_map"] = Field(
"axis_1_power_map",
json_schema_extra={
"linkml_meta": {"equals_string": "axis_1_power_map", "ifabsent": "string(axis_1_power_map)"}
"linkml_meta": {
"equals_string": "axis_1_power_map",
"ifabsent": "string(axis_1_power_map)",
}
},
)
dimension: Optional[np.int32] = Field(
None,
description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""",
)
field_of_view: Optional[np.float32] = 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).""")
field_of_view: Optional[np.float32] = 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)."""
)
array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field(
None,
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}
},
)
@ -175,18 +204,27 @@ class ImagingRetinotopyAxis2PhaseMap(ConfiguredBaseModel):
name: Literal["axis_2_phase_map"] = Field(
"axis_2_phase_map",
json_schema_extra={
"linkml_meta": {"equals_string": "axis_2_phase_map", "ifabsent": "string(axis_2_phase_map)"}
"linkml_meta": {
"equals_string": "axis_2_phase_map",
"ifabsent": "string(axis_2_phase_map)",
}
},
)
dimension: Optional[np.int32] = Field(
None,
description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""",
)
field_of_view: Optional[np.float32] = 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).""")
field_of_view: Optional[np.float32] = 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)."""
)
array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field(
None,
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}
},
)
@ -200,18 +238,27 @@ class ImagingRetinotopyAxis2PowerMap(ConfiguredBaseModel):
name: Literal["axis_2_power_map"] = Field(
"axis_2_power_map",
json_schema_extra={
"linkml_meta": {"equals_string": "axis_2_power_map", "ifabsent": "string(axis_2_power_map)"}
"linkml_meta": {
"equals_string": "axis_2_power_map",
"ifabsent": "string(axis_2_power_map)",
}
},
)
dimension: Optional[np.int32] = Field(
None,
description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""",
)
field_of_view: Optional[np.float32] = 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).""")
field_of_view: Optional[np.float32] = 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)."""
)
array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field(
None,
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}
},
)
@ -225,7 +272,10 @@ class ImagingRetinotopyFocalDepthImage(ConfiguredBaseModel):
name: Literal["focal_depth_image"] = Field(
"focal_depth_image",
json_schema_extra={
"linkml_meta": {"equals_string": "focal_depth_image", "ifabsent": "string(focal_depth_image)"}
"linkml_meta": {
"equals_string": "focal_depth_image",
"ifabsent": "string(focal_depth_image)",
}
},
)
bits_per_pixel: Optional[np.int32] = Field(
@ -236,12 +286,20 @@ class ImagingRetinotopyFocalDepthImage(ConfiguredBaseModel):
None,
description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""",
)
field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""")
focal_depth: Optional[np.float32] = Field(None, description="""Focal depth offset, in meters.""")
format: Optional[str] = Field(None, description="""Format of image. Right now only 'raw' is supported.""")
field_of_view: Optional[np.float32] = Field(
None, description="""Size of viewing area, in meters."""
)
focal_depth: Optional[np.float32] = Field(
None, description="""Focal depth offset, in meters."""
)
format: Optional[str] = Field(
None, description="""Format of image. Right now only 'raw' is supported."""
)
array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.uint16]] = Field(
None,
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}
},
)
@ -253,16 +311,23 @@ class ImagingRetinotopySignMap(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.retinotopy"})
name: Literal["sign_map"] = Field(
"sign_map", json_schema_extra={"linkml_meta": {"equals_string": "sign_map", "ifabsent": "string(sign_map)"}}
"sign_map",
json_schema_extra={
"linkml_meta": {"equals_string": "sign_map", "ifabsent": "string(sign_map)"}
},
)
dimension: Optional[np.int32] = Field(
None,
description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""",
)
field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""")
field_of_view: Optional[np.float32] = Field(
None, description="""Size of viewing area, in meters."""
)
array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.float32]] = Field(
None,
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}
},
)
@ -276,7 +341,10 @@ class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel):
name: Literal["vasculature_image"] = Field(
"vasculature_image",
json_schema_extra={
"linkml_meta": {"equals_string": "vasculature_image", "ifabsent": "string(vasculature_image)"}
"linkml_meta": {
"equals_string": "vasculature_image",
"ifabsent": "string(vasculature_image)",
}
},
)
bits_per_pixel: Optional[np.int32] = Field(
@ -287,11 +355,17 @@ class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel):
None,
description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""",
)
field_of_view: Optional[np.float32] = Field(None, description="""Size of viewing area, in meters.""")
format: Optional[str] = Field(None, description="""Format of image. Right now only 'raw' is supported.""")
field_of_view: Optional[np.float32] = Field(
None, description="""Size of viewing area, in meters."""
)
format: Optional[str] = Field(
None, description="""Format of image. Right now only 'raw' is supported."""
)
array: Optional[NDArray[Shape["* num_rows, * num_cols"], np.uint16]] = Field(
None,
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_rows"}, {"alias": "num_cols"}]}}
},
)

View file

@ -159,7 +159,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")

View file

@ -24,7 +24,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -69,7 +71,11 @@ linkml_meta = LinkMLMeta(
},
"default_prefix": "core.nwb.base/",
"id": "core.nwb.base",
"imports": ["../../hdmf_common/v1_5_0/namespace", "../../hdmf_common/v1_5_0/namespace", "core.nwb.language"],
"imports": [
"../../hdmf_common/v1_5_0/namespace",
"../../hdmf_common/v1_5_0/namespace",
"core.nwb.language",
],
"name": "core.nwb.base",
}
)
@ -80,7 +86,9 @@ class NWBData(Data):
An abstract data type for a dataset.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
name: str = Field(...)
@ -90,18 +98,25 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
name: str = Field("timeseries", json_schema_extra={"linkml_meta": {"ifabsent": "string(timeseries)"}})
name: str = Field(
"timeseries", json_schema_extra={"linkml_meta": {"ifabsent": "string(timeseries)"}}
)
idx_start: np.int32 = Field(
...,
description="""Start index into the TimeSeries 'data' and 'timestamp' datasets of the referenced TimeSeries. The first dimension of those arrays is always time.""",
)
count: np.int32 = Field(
..., description="""Number of data samples available in this time series, during this epoch"""
...,
description="""Number of data samples available in this time series, during this epoch""",
)
timeseries: TimeSeries = Field(..., description="""The TimeSeries 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[
Union[
NDArray[Shape["* dim0"], Any],
@ -117,7 +132,9 @@ 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)).
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
name: str = Field(...)
resolution: Optional[np.float32] = Field(
@ -138,7 +155,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
name: str = Field(...)
@ -148,7 +167,9 @@ class NWBDataInterface(NWBContainer):
An abstract data type for a generic container storing collections of data, as opposed to metadata.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
name: str = Field(...)
@ -158,7 +179,9 @@ class TimeSeries(NWBDataInterface):
General purpose time series.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
name: str = Field(...)
description: Optional[str] = Field(None, description="""Description of the time series.""")
@ -187,7 +210,9 @@ class TimeSeries(NWBDataInterface):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -203,7 +228,8 @@ class TimeSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
conversion: Optional[np.float32] = Field(
None,
@ -240,10 +266,14 @@ class TimeSeriesStartingTime(ConfiguredBaseModel):
name: Literal["starting_time"] = Field(
"starting_time",
json_schema_extra={"linkml_meta": {"equals_string": "starting_time", "ifabsent": "string(starting_time)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "starting_time", "ifabsent": "string(starting_time)"}
},
)
rate: Optional[np.float32] = 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'."""
)
value: np.float64 = Field(...)
@ -255,7 +285,8 @@ class TimeSeriesSync(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base"})
name: Literal["sync"] = Field(
"sync", json_schema_extra={"linkml_meta": {"equals_string": "sync", "ifabsent": "string(sync)"}}
"sync",
json_schema_extra={"linkml_meta": {"equals_string": "sync", "ifabsent": "string(sync)"}},
)
@ -264,10 +295,15 @@ class ProcessingModule(NWBContainer):
A collection of processed data.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
children: Optional[List[Union[DynamicTable, NWBDataInterface]]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]}}
None,
json_schema_extra={
"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]}
},
)
name: str = Field(...)
@ -277,10 +313,14 @@ class Images(NWBDataInterface):
A collection of images.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.base", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.base", "tree_root": True}
)
name: str = Field("Images", json_schema_extra={"linkml_meta": {"ifabsent": "string(Images)"}})
description: Optional[str] = Field(None, description="""Description of this collection of images.""")
description: Optional[str] = Field(
None, description="""Description of this collection of images."""
)
image: List[Image] = Field(..., description="""Images stored in this collection.""")

View file

@ -70,7 +70,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -126,11 +128,14 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
name: str = Field(...)
data: SpatialSeriesData = Field(
..., description="""1-D or 2-D array storing position or direction relative to some reference frame."""
...,
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."""
@ -157,7 +162,9 @@ class SpatialSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -173,14 +180,18 @@ class SpatialSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
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'.""",
)
array: Optional[
Union[NDArray[Shape["* num_times"], np.number], NDArray[Shape["* num_times, * num_features"], np.number]]
Union[
NDArray[Shape["* num_times"], np.number],
NDArray[Shape["* num_times, * num_features"], np.number],
]
] = Field(None)
@ -189,7 +200,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
children: Optional[List[IntervalSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "IntervalSeries"}]}}
@ -202,7 +215,9 @@ class BehavioralEvents(NWBDataInterface):
TimeSeries for storing behavioral events. See description of <a href=\"#BehavioralEpochs\">BehavioralEpochs</a> for more details.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
children: Optional[List[TimeSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}}
@ -215,7 +230,9 @@ class BehavioralTimeSeries(NWBDataInterface):
TimeSeries for storing Behavoioral time series data. See description of <a href=\"#BehavioralEpochs\">BehavioralEpochs</a> for more details.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
children: Optional[List[TimeSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}}
@ -228,7 +245,9 @@ class PupilTracking(NWBDataInterface):
Eye-tracking data, representing pupil size.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
children: Optional[List[TimeSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "TimeSeries"}]}}
@ -241,7 +260,9 @@ class EyeTracking(NWBDataInterface):
Eye-tracking data, representing direction of gaze.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
children: Optional[List[SpatialSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}}
@ -254,7 +275,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
children: Optional[List[SpatialSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}}
@ -267,7 +290,9 @@ class Position(NWBDataInterface):
Position data, whether along the x, x/y or x/y/z axis.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.behavior", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.behavior", "tree_root": True}
)
children: Optional[List[SpatialSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpatialSeries"}]}}

View file

@ -22,7 +22,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -62,14 +64,18 @@ class Device(NWBContainer):
Metadata about a data acquisition device, e.g., recording system, electrode, microscope.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.device", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.device", "tree_root": True}
)
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.""",
)
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."""
)
# Model rebuild

View file

@ -7,7 +7,15 @@ import sys
import numpy as np
from ...hdmf_common.v1_5_0.hdmf_common_table import DynamicTableRegion
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator
from pydantic import (
BaseModel,
ConfigDict,
Field,
RootModel,
field_validator,
ValidationInfo,
BeforeValidator,
)
from ...core.v2_4_0.core_nwb_base import (
TimeSeries,
TimeSeriesStartingTime,
@ -30,7 +38,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -75,7 +85,12 @@ linkml_meta = LinkMLMeta(
},
"default_prefix": "core.nwb.ecephys/",
"id": "core.nwb.ecephys",
"imports": ["core.nwb.base", "../../hdmf_common/v1_5_0/namespace", "core.nwb.device", "core.nwb.language"],
"imports": [
"core.nwb.base",
"../../hdmf_common/v1_5_0/namespace",
"core.nwb.device",
"core.nwb.language",
],
"name": "core.nwb.ecephys",
}
)
@ -86,7 +101,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
name: str = Field(...)
filtering: Optional[str] = Field(
@ -101,7 +118,9 @@ class ElectricalSeries(TimeSeries):
electrodes: Named[DynamicTableRegion] = Field(
...,
description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field(
None,
@ -130,7 +149,9 @@ class ElectricalSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -143,7 +164,9 @@ 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).
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
name: str = Field(...)
data: Union[
@ -162,7 +185,9 @@ class SpikeEventSeries(ElectricalSeries):
electrodes: Named[DynamicTableRegion] = Field(
...,
description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
channel_conversion: Optional[NDArray[Shape["* num_channels"], np.float32]] = Field(
None,
@ -186,7 +211,9 @@ class SpikeEventSeries(ElectricalSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -199,9 +226,14 @@ class FeatureExtraction(NWBDataInterface):
Features, such as PC1 and PC2, that are extracted from signals stored in a SpikeEventSeries or other source.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
name: str = Field("FeatureExtraction", json_schema_extra={"linkml_meta": {"ifabsent": "string(FeatureExtraction)"}})
name: str = Field(
"FeatureExtraction",
json_schema_extra={"linkml_meta": {"ifabsent": "string(FeatureExtraction)"}},
)
description: NDArray[Shape["* num_features"], str] = Field(
...,
description="""Description of features (eg, ''PC1'') for each of the extracted features.""",
@ -212,7 +244,13 @@ class FeatureExtraction(NWBDataInterface):
description="""Multi-dimensional array of features extracted from each event.""",
json_schema_extra={
"linkml_meta": {
"array": {"dimensions": [{"alias": "num_events"}, {"alias": "num_channels"}, {"alias": "num_features"}]}
"array": {
"dimensions": [
{"alias": "num_events"},
{"alias": "num_channels"},
{"alias": "num_features"},
]
}
}
},
)
@ -224,7 +262,9 @@ class FeatureExtraction(NWBDataInterface):
electrodes: Named[DynamicTableRegion] = Field(
...,
description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
@ -233,9 +273,13 @@ class EventDetection(NWBDataInterface):
Detected spike events from voltage trace(s).
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
name: str = Field("EventDetection", json_schema_extra={"linkml_meta": {"ifabsent": "string(EventDetection)"}})
name: str = Field(
"EventDetection", json_schema_extra={"linkml_meta": {"ifabsent": "string(EventDetection)"}}
)
detection_method: str = Field(
...,
description="""Description of how events were detected, such as voltage threshold, or dV/dT threshold, as well as relevant values.""",
@ -257,7 +301,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
children: Optional[List[SpikeEventSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "SpikeEventSeries"}]}}
@ -270,7 +316,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
children: Optional[List[ElectricalSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "ElectricalSeries"}]}}
@ -283,7 +331,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
children: Optional[List[ElectricalSeries]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "ElectricalSeries"}]}}
@ -296,7 +346,9 @@ class ElectrodeGroup(NWBContainer):
A physical grouping of electrodes, e.g. a shank of an array.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
name: str = Field(...)
description: Optional[str] = Field(None, description="""Description of this electrode group.""")
@ -317,7 +369,10 @@ class ElectrodeGroupPosition(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys"})
name: Literal["position"] = Field(
"position", json_schema_extra={"linkml_meta": {"equals_string": "position", "ifabsent": "string(position)"}}
"position",
json_schema_extra={
"linkml_meta": {"equals_string": "position", "ifabsent": "string(position)"}
},
)
x: Optional[np.float32] = Field(None, description="""x coordinate""")
y: Optional[np.float32] = Field(None, description="""y coordinate""")
@ -329,22 +384,33 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
name: str = Field("ClusterWaveforms", json_schema_extra={"linkml_meta": {"ifabsent": "string(ClusterWaveforms)"}})
waveform_filtering: str = Field(..., description="""Filtering applied to data before generating mean/sd""")
name: str = Field(
"ClusterWaveforms",
json_schema_extra={"linkml_meta": {"ifabsent": "string(ClusterWaveforms)"}},
)
waveform_filtering: str = Field(
..., description="""Filtering applied to data before generating mean/sd"""
)
waveform_mean: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = 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)""",
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]}}
"linkml_meta": {
"array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]}
}
},
)
waveform_sd: NDArray[Shape["* num_clusters, * num_samples"], np.float32] = Field(
...,
description="""Stdev of waveforms for each cluster, using the same indices as in mean""",
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]}}
"linkml_meta": {
"array": {"dimensions": [{"alias": "num_clusters"}, {"alias": "num_samples"}]}
}
},
)
@ -354,9 +420,13 @@ class Clustering(NWBDataInterface):
DEPRECATED Clustered spike data, whether from automatic clustering tools (e.g., klustakwik) or as a result of manual sorting.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.ecephys", "tree_root": True}
)
name: str = Field("Clustering", json_schema_extra={"linkml_meta": {"ifabsent": "string(Clustering)"}})
name: str = Field(
"Clustering", json_schema_extra={"linkml_meta": {"ifabsent": "string(Clustering)"}}
)
description: str = Field(
...,
description="""Description of clusters or clustering, (e.g. cluster 0 is noise, clusters curated using Klusters, etc)""",

View file

@ -6,7 +6,15 @@ import re
import sys
import numpy as np
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator
from pydantic import (
BaseModel,
ConfigDict,
Field,
RootModel,
field_validator,
ValidationInfo,
BeforeValidator,
)
from numpydantic import NDArray, Shape
from ...hdmf_common.v1_5_0.hdmf_common_table import DynamicTable, VectorIndex, VectorData
from ...core.v2_4_0.core_nwb_base import TimeSeries
@ -24,7 +32,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -80,46 +90,62 @@ class TimeIntervals(DynamicTable):
A container for aggregating epoch data and the TimeSeries that each epoch applies to.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.epoch", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.epoch", "tree_root": True}
)
name: str = Field(...)
start_time: NDArray[Any, np.float32] = Field(
...,
description="""Start time of epoch, in seconds.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
stop_time: NDArray[Any, np.float32] = Field(
...,
description="""Stop time of epoch, in seconds.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
tags: Optional[NDArray[Any, str]] = Field(
None,
description="""User-defined tags that identify or categorize events.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
tags_index: Named[Optional[VectorIndex]] = Field(
None,
description="""Index for tags.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
timeseries: Optional[TimeIntervalsTimeseries] = Field(
None, description="""An index into a TimeSeries object."""
)
timeseries: Optional[TimeIntervalsTimeseries] = Field(None, description="""An index into a TimeSeries object.""")
timeseries_index: Named[Optional[VectorIndex]] = Field(
None,
description="""Index for timeseries.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
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: NDArray[Shape["* num_rows"], int] = Field(
...,
description="""Array of unique identifiers for the rows of this dynamic table.""",
@ -139,17 +165,24 @@ class TimeIntervalsTimeseries(VectorData):
name: Literal["timeseries"] = Field(
"timeseries",
json_schema_extra={"linkml_meta": {"equals_string": "timeseries", "ifabsent": "string(timeseries)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "timeseries", "ifabsent": "string(timeseries)"}
},
)
idx_start: Optional[np.int32] = Field(
None,
description="""Start index into the TimeSeries 'data' and 'timestamp' datasets of the referenced TimeSeries. The first dimension of those arrays is always time.""",
)
count: Optional[np.int32] = Field(
None, description="""Number of data samples available in this time series, during this epoch."""
None,
description="""Number of data samples available in this time series, during this epoch.""",
)
timeseries: Optional[TimeSeries] = Field(
None, description="""the TimeSeries that this index applies to."""
)
description: Optional[str] = Field(
None, description="""Description of what these vectors represent."""
)
timeseries: Optional[TimeSeries] = Field(None, description="""the TimeSeries that this index applies to.""")
description: Optional[str] = Field(None, description="""Description of what these vectors represent.""")
array: Optional[
Union[
NDArray[Shape["* dim0"], Any],

View file

@ -131,7 +131,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -198,10 +200,14 @@ class ScratchData(NWBData):
Any one-off datasets
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.file", "tree_root": True}
)
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"""
)
class NWBFile(NWBContainer):
@ -209,10 +215,13 @@ class NWBFile(NWBContainer):
An NWB:N file storing cellular-based neurophysiology data from a single experimental session.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.file", "tree_root": True}
)
name: Literal["root"] = Field(
"root", json_schema_extra={"linkml_meta": {"equals_string": "root", "ifabsent": "string(root)"}}
"root",
json_schema_extra={"linkml_meta": {"equals_string": "root", "ifabsent": "string(root)"}},
)
nwb_version: Optional[str] = Field(
None,
@ -221,7 +230,9 @@ class NWBFile(NWBContainer):
file_create_date: NDArray[Shape["* num_modifications"], np.datetime64] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_modifications"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_modifications"}]}}
},
)
identifier: str = Field(
...,
@ -241,17 +252,23 @@ class NWBFile(NWBContainer):
acquisition: Optional[List[Union[DynamicTable, NWBDataInterface]]] = Field(
None,
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.""",
json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]}},
json_schema_extra={
"linkml_meta": {"any_of": [{"range": "NWBDataInterface"}, {"range": "DynamicTable"}]}
},
)
analysis: Optional[List[Union[DynamicTable, NWBContainer]]] = Field(
None,
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.""",
json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]}},
json_schema_extra={
"linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]}
},
)
scratch: Optional[List[Union[DynamicTable, NWBContainer]]] = 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.""",
json_schema_extra={"linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]}},
json_schema_extra={
"linkml_meta": {"any_of": [{"range": "NWBContainer"}, {"range": "DynamicTable"}]}
},
)
processing: Optional[List[ProcessingModule]] = Field(
None,
@ -291,7 +308,10 @@ class NWBFileStimulus(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file"})
name: Literal["stimulus"] = Field(
"stimulus", json_schema_extra={"linkml_meta": {"equals_string": "stimulus", "ifabsent": "string(stimulus)"}}
"stimulus",
json_schema_extra={
"linkml_meta": {"equals_string": "stimulus", "ifabsent": "string(stimulus)"}
},
)
presentation: Optional[List[TimeSeries]] = Field(
None,
@ -313,16 +333,27 @@ class NWBFileGeneral(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file"})
name: Literal["general"] = Field(
"general", json_schema_extra={"linkml_meta": {"equals_string": "general", "ifabsent": "string(general)"}}
"general",
json_schema_extra={
"linkml_meta": {"equals_string": "general", "ifabsent": "string(general)"}
},
)
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."""
)
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.""")
experimenter: Optional[NDArray[Shape["* num_experimenters"], str]] = Field(
None,
description="""Name of person(s) who performed the experiment. Can also specify roles of different people involved.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_experimenters"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_experimenters"}]}}
},
)
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[NDArray[Shape["* num_keywords"], str]] = Field(
None,
description="""Terms to search over.""",
@ -335,12 +366,15 @@ class NWBFileGeneral(ConfiguredBaseModel):
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."""
None,
description="""Experimental protocol, if applicable. e.g., include IACUC protocol number.""",
)
related_publications: Optional[NDArray[Shape["* num_publications"], str]] = Field(
None,
description="""Publication information. PMID, DOI, URL, etc.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_publications"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_publications"}]}}
},
)
session_id: Optional[str] = Field(None, description="""Lab-specific ID for the session.""")
slices: Optional[str] = Field(
@ -348,7 +382,8 @@ class NWBFileGeneral(ConfiguredBaseModel):
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."""
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."""
@ -371,7 +406,8 @@ class NWBFileGeneral(ConfiguredBaseModel):
json_schema_extra={"linkml_meta": {"any_of": [{"range": "Device"}]}},
)
subject: Optional[Subject] = Field(
None, description="""Information about the animal or person from which the data was measured."""
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."""
@ -400,7 +436,9 @@ class NWBFileGeneralSourceScript(ConfiguredBaseModel):
name: Literal["source_script"] = Field(
"source_script",
json_schema_extra={"linkml_meta": {"equals_string": "source_script", "ifabsent": "string(source_script)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "source_script", "ifabsent": "string(source_script)"}
},
)
file_name: Optional[str] = Field(None, description="""Name of script file.""")
value: str = Field(...)
@ -416,10 +454,15 @@ class NWBFileGeneralExtracellularEphys(ConfiguredBaseModel):
name: Literal["extracellular_ephys"] = Field(
"extracellular_ephys",
json_schema_extra={
"linkml_meta": {"equals_string": "extracellular_ephys", "ifabsent": "string(extracellular_ephys)"}
"linkml_meta": {
"equals_string": "extracellular_ephys",
"ifabsent": "string(extracellular_ephys)",
}
},
)
electrode_group: Optional[List[ElectrodeGroup]] = Field(None, description="""Physical group of electrodes.""")
electrode_group: Optional[List[ElectrodeGroup]] = Field(
None, description="""Physical group of electrodes."""
)
electrodes: Optional[NWBFileGeneralExtracellularEphysElectrodes] = Field(
None, description="""A table of all electrodes (i.e. channels) used for recording."""
)
@ -434,48 +477,62 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable):
name: Literal["electrodes"] = Field(
"electrodes",
json_schema_extra={"linkml_meta": {"equals_string": "electrodes", "ifabsent": "string(electrodes)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "electrodes", "ifabsent": "string(electrodes)"}
},
)
x: NDArray[Any, np.float32] = Field(
...,
description="""x coordinate of the channel location in the brain (+x is posterior).""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
y: NDArray[Any, np.float32] = Field(
...,
description="""y coordinate of the channel location in the brain (+y is inferior).""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
z: NDArray[Any, np.float32] = Field(
...,
description="""z coordinate of the channel location in the brain (+z is right).""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
imp: NDArray[Any, np.float32] = Field(
...,
description="""Impedance of the channel, in ohms.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
location: NDArray[Any, str] = Field(
...,
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.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
filtering: NDArray[Any, str] = Field(
...,
description="""Description of hardware filtering, including the filter name and frequency cutoffs.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
group: List[ElectrodeGroup] = Field(
@ -485,42 +542,54 @@ class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable):
...,
description="""Name of the ElectrodeGroup this electrode is a part of.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
rel_x: Optional[NDArray[Any, np.float32]] = Field(
None,
description="""x coordinate in electrode group""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
rel_y: Optional[NDArray[Any, np.float32]] = Field(
None,
description="""y coordinate in electrode group""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
rel_z: Optional[NDArray[Any, np.float32]] = Field(
None,
description="""z coordinate in electrode group""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
reference: Optional[NDArray[Any, str]] = Field(
None,
description="""Description of the reference used for this electrode.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
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: NDArray[Shape["* num_rows"], int] = Field(
...,
description="""Array of unique identifiers for the rows of this dynamic table.""",
@ -541,7 +610,10 @@ class NWBFileGeneralIntracellularEphys(ConfiguredBaseModel):
name: Literal["intracellular_ephys"] = Field(
"intracellular_ephys",
json_schema_extra={
"linkml_meta": {"equals_string": "intracellular_ephys", "ifabsent": "string(intracellular_ephys)"}
"linkml_meta": {
"equals_string": "intracellular_ephys",
"ifabsent": "string(intracellular_ephys)",
}
},
)
filtering: Optional[str] = Field(
@ -582,7 +654,9 @@ class LabMetaData(NWBContainer):
Lab-specific meta-data.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.file", "tree_root": True}
)
name: str = Field(...)
@ -592,25 +666,34 @@ class Subject(NWBContainer):
Information about the animal or person from which the data was measured.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.file", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.file", "tree_root": True}
)
name: str = Field(...)
age: Optional[str] = Field(None, description="""Age of subject. Can be supplied instead of 'date_of_birth'.""")
age: Optional[str] = Field(
None, description="""Age of subject. Can be supplied instead of 'date_of_birth'."""
)
date_of_birth: Optional[np.datetime64] = 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)."""
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.""")
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)."""
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."""
None,
description="""Weight at time of experiment, at time of surgery and at other important times.""",
)

View file

@ -30,7 +30,15 @@ from ...core.v2_4_0.core_nwb_base import (
Images,
)
from typing import Any, ClassVar, List, Literal, Dict, Optional, Union, Annotated, Type, TypeVar
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator, ValidationInfo, BeforeValidator
from pydantic import (
BaseModel,
ConfigDict,
Field,
RootModel,
field_validator,
ValidationInfo,
BeforeValidator,
)
from numpydantic import NDArray, Shape
metamodel_version = "None"
@ -46,7 +54,9 @@ class ConfiguredBaseModel(BaseModel):
use_enum_values=True,
strict=False,
)
hdf5_path: Optional[str] = Field(None, description="The absolute path that this object is stored in an NWB file")
hdf5_path: Optional[str] = Field(
None, description="The absolute path that this object is stored in an NWB file"
)
object_id: Optional[str] = Field(None, description="Unique UUID for each object")
@ -91,7 +101,12 @@ linkml_meta = LinkMLMeta(
},
"default_prefix": "core.nwb.icephys/",
"id": "core.nwb.icephys",
"imports": ["core.nwb.base", "core.nwb.device", "../../hdmf_common/v1_5_0/namespace", "core.nwb.language"],
"imports": [
"core.nwb.base",
"core.nwb.device",
"../../hdmf_common/v1_5_0/namespace",
"core.nwb.language",
],
"name": "core.nwb.icephys",
}
)
@ -102,7 +117,9 @@ class PatchClampSeries(TimeSeries):
An abstract base class for patch-clamp data - stimulus or response, current or voltage.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
stimulus_description: Optional[str] = Field(
@ -113,7 +130,8 @@ class PatchClampSeries(TimeSeries):
)
data: PatchClampSeriesData = Field(..., description="""Recorded voltage or current.""")
gain: Optional[np.float32] = Field(
None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp)."""
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.""")
comments: Optional[str] = Field(
@ -137,7 +155,9 @@ class PatchClampSeries(TimeSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -153,7 +173,8 @@ class PatchClampSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
unit: Optional[str] = Field(
None,
@ -169,13 +190,17 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
data: CurrentClampSeriesData = Field(..., description="""Recorded voltage.""")
bias_current: Optional[np.float32] = Field(None, description="""Bias current, in amps.""")
bridge_balance: Optional[np.float32] = Field(None, description="""Bridge balance, in ohms.""")
capacitance_compensation: Optional[np.float32] = Field(None, description="""Capacitance compensation, in farads.""")
capacitance_compensation: Optional[np.float32] = Field(
None, description="""Capacitance compensation, in farads."""
)
stimulus_description: Optional[str] = Field(
None, description="""Protocol/stimulus name for this patch-clamp dataset."""
)
@ -183,7 +208,8 @@ class CurrentClampSeries(PatchClampSeries):
None, description="""Sweep number, allows to group different PatchClampSeries together."""
)
gain: Optional[np.float32] = Field(
None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp)."""
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.""")
comments: Optional[str] = Field(
@ -207,7 +233,9 @@ class CurrentClampSeries(PatchClampSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -223,7 +251,8 @@ class CurrentClampSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
unit: Optional[str] = Field(
None,
@ -237,14 +266,19 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
stimulus_description: Optional[str] = Field(
None, description="""An IZeroClampSeries has no stimulus, so this attribute is automatically set to \"N/A\""""
None,
description="""An IZeroClampSeries has no stimulus, so this attribute is automatically set to \"N/A\"""",
)
bias_current: np.float32 = Field(..., description="""Bias current, in amps, fixed to 0.0.""")
bridge_balance: np.float32 = Field(..., description="""Bridge balance, in ohms, fixed to 0.0.""")
bridge_balance: np.float32 = Field(
..., description="""Bridge balance, in ohms, fixed to 0.0."""
)
capacitance_compensation: np.float32 = Field(
..., description="""Capacitance compensation, in farads, fixed to 0.0."""
)
@ -253,7 +287,8 @@ class IZeroClampSeries(CurrentClampSeries):
None, description="""Sweep number, allows to group different PatchClampSeries together."""
)
gain: Optional[np.float32] = Field(
None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp)."""
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.""")
comments: Optional[str] = Field(
@ -277,7 +312,9 @@ class IZeroClampSeries(CurrentClampSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -290,7 +327,9 @@ class CurrentClampStimulusSeries(PatchClampSeries):
Stimulus current applied during current clamp recording.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
data: CurrentClampStimulusSeriesData = Field(..., description="""Stimulus current applied.""")
@ -301,7 +340,8 @@ class CurrentClampStimulusSeries(PatchClampSeries):
None, description="""Sweep number, allows to group different PatchClampSeries together."""
)
gain: Optional[np.float32] = Field(
None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp)."""
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.""")
comments: Optional[str] = Field(
@ -325,7 +365,9 @@ class CurrentClampStimulusSeries(PatchClampSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -341,7 +383,8 @@ class CurrentClampStimulusSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
unit: Optional[str] = Field(
None,
@ -355,7 +398,9 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
data: VoltageClampSeriesData = Field(..., description="""Recorded current.""")
@ -377,8 +422,8 @@ class VoltageClampSeries(PatchClampSeries):
whole_cell_capacitance_comp: Optional[VoltageClampSeriesWholeCellCapacitanceComp] = Field(
None, description="""Whole cell capacitance compensation, in farads."""
)
whole_cell_series_resistance_comp: Optional[VoltageClampSeriesWholeCellSeriesResistanceComp] = Field(
None, description="""Whole cell series resistance compensation, in ohms."""
whole_cell_series_resistance_comp: Optional[VoltageClampSeriesWholeCellSeriesResistanceComp] = (
Field(None, description="""Whole cell series resistance compensation, in ohms.""")
)
stimulus_description: Optional[str] = Field(
None, description="""Protocol/stimulus name for this patch-clamp dataset."""
@ -387,7 +432,8 @@ class VoltageClampSeries(PatchClampSeries):
None, description="""Sweep number, allows to group different PatchClampSeries together."""
)
gain: Optional[np.float32] = Field(
None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp)."""
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.""")
comments: Optional[str] = Field(
@ -411,7 +457,9 @@ class VoltageClampSeries(PatchClampSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -427,7 +475,8 @@ class VoltageClampSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
unit: Optional[str] = Field(
None,
@ -446,11 +495,15 @@ class VoltageClampSeriesCapacitanceFast(ConfiguredBaseModel):
name: Literal["capacitance_fast"] = Field(
"capacitance_fast",
json_schema_extra={
"linkml_meta": {"equals_string": "capacitance_fast", "ifabsent": "string(capacitance_fast)"}
"linkml_meta": {
"equals_string": "capacitance_fast",
"ifabsent": "string(capacitance_fast)",
}
},
)
unit: Optional[str] = Field(
None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'."""
None,
description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""",
)
value: np.float32 = Field(...)
@ -465,11 +518,15 @@ class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel):
name: Literal["capacitance_slow"] = Field(
"capacitance_slow",
json_schema_extra={
"linkml_meta": {"equals_string": "capacitance_slow", "ifabsent": "string(capacitance_slow)"}
"linkml_meta": {
"equals_string": "capacitance_slow",
"ifabsent": "string(capacitance_slow)",
}
},
)
unit: Optional[str] = Field(
None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'."""
None,
description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""",
)
value: np.float32 = Field(...)
@ -491,7 +548,8 @@ class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel):
},
)
unit: Optional[str] = Field(
None, description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'."""
None,
description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'.""",
)
value: np.float32 = Field(...)
@ -513,7 +571,8 @@ class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel):
},
)
unit: Optional[str] = Field(
None, description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'."""
None,
description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'.""",
)
value: np.float32 = Field(...)
@ -535,7 +594,8 @@ class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel):
},
)
unit: Optional[str] = Field(
None, description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'."""
None,
description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'.""",
)
value: np.float32 = Field(...)
@ -557,7 +617,8 @@ class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel):
},
)
unit: Optional[str] = Field(
None, description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'."""
None,
description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'.""",
)
value: np.float32 = Field(...)
@ -579,7 +640,8 @@ class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel):
},
)
unit: Optional[str] = Field(
None, description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'."""
None,
description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'.""",
)
value: np.float32 = Field(...)
@ -589,7 +651,9 @@ class VoltageClampStimulusSeries(PatchClampSeries):
Stimulus voltage applied during a voltage clamp recording.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
data: VoltageClampStimulusSeriesData = Field(..., description="""Stimulus voltage applied.""")
@ -600,7 +664,8 @@ class VoltageClampStimulusSeries(PatchClampSeries):
None, description="""Sweep number, allows to group different PatchClampSeries together."""
)
gain: Optional[np.float32] = Field(
None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp)."""
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.""")
comments: Optional[str] = Field(
@ -624,7 +689,9 @@ class VoltageClampStimulusSeries(PatchClampSeries):
control_description: Optional[NDArray[Shape["* num_control_values"], str]] = 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.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}},
json_schema_extra={
"linkml_meta": {"array": {"dimensions": [{"alias": "num_control_values"}]}}
},
)
sync: Optional[TimeSeriesSync] = Field(
None,
@ -640,7 +707,8 @@ class VoltageClampStimulusSeriesData(ConfiguredBaseModel):
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys"})
name: Literal["data"] = Field(
"data", json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}}
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
unit: Optional[str] = Field(
None,
@ -654,19 +722,27 @@ class IntracellularElectrode(NWBContainer):
An intracellular electrode and its metadata.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
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.""")
initial_access_resistance: Optional[str] = Field(None, description="""Initial access resistance.""")
initial_access_resistance: Optional[str] = Field(
None, description="""Initial access resistance."""
)
location: Optional[str] = Field(
None,
description="""Location of the electrode. 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.""",
)
resistance: Optional[str] = Field(None, description="""Electrode resistance, in ohms.""")
seal: Optional[str] = Field(None, description="""Information about seal used for recording.""")
slice: Optional[str] = Field(None, description="""Information about slice used for recording.""")
slice: Optional[str] = Field(
None, description="""Information about slice used for recording."""
)
class SweepTable(DynamicTable):
@ -674,14 +750,18 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: str = Field(...)
sweep_number: NDArray[Any, np.uint32] = Field(
...,
description="""Sweep number of the PatchClampSeries in that row.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
series: List[PatchClampSeries] = Field(
@ -690,13 +770,17 @@ class SweepTable(DynamicTable):
series_index: Named[VectorIndex] = Field(
...,
description="""Index for series.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
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: NDArray[Shape["* num_rows"], int] = Field(
...,
description="""Array of unique identifiers for the rows of this dynamic table.""",
@ -712,10 +796,14 @@ class IntracellularElectrodesTable(DynamicTable):
Table for storing intracellular electrode related metadata.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
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: List[IntracellularElectrode] = Field(
..., description="""Column for storing the reference to the intracellular electrode."""
)
@ -738,14 +826,20 @@ class IntracellularStimuliTable(DynamicTable):
Table for storing intracellular stimulus related metadata.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
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: Named[TimeSeriesReferenceVectorData] = Field(
...,
description="""Column storing the reference to the recorded stimulus for the recording (rows).""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
colnames: Optional[str] = Field(
None,
@ -766,14 +860,20 @@ class IntracellularResponsesTable(DynamicTable):
Table for storing intracellular response related metadata.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
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: Named[TimeSeriesReferenceVectorData] = Field(
...,
description="""Column storing the reference to the recorded response for the recording (rows)""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
colnames: Optional[str] = Field(
None,
@ -794,12 +894,17 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: Literal["intracellular_recordings"] = Field(
"intracellular_recordings",
json_schema_extra={
"linkml_meta": {"equals_string": "intracellular_recordings", "ifabsent": "string(intracellular_recordings)"}
"linkml_meta": {
"equals_string": "intracellular_recordings",
"ifabsent": "string(intracellular_recordings)",
}
},
)
description: Optional[str] = Field(
@ -837,27 +942,37 @@ class SimultaneousRecordingsTable(DynamicTable):
A table for grouping different intracellular recordings from the IntracellularRecordingsTable table together that were recorded simultaneously from different electrodes.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: Literal["simultaneous_recordings"] = Field(
"simultaneous_recordings",
json_schema_extra={
"linkml_meta": {"equals_string": "simultaneous_recordings", "ifabsent": "string(simultaneous_recordings)"}
"linkml_meta": {
"equals_string": "simultaneous_recordings",
"ifabsent": "string(simultaneous_recordings)",
}
},
)
recordings: SimultaneousRecordingsTableRecordings = Field(
..., description="""A reference to one or more rows in the IntracellularRecordingsTable table."""
...,
description="""A reference to one or more rows in the IntracellularRecordingsTable table.""",
)
recordings_index: Named[VectorIndex] = Field(
...,
description="""Index dataset for the recordings column.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
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: NDArray[Shape["* num_rows"], int] = Field(
...,
description="""Array of unique identifiers for the rows of this dynamic table.""",
@ -877,13 +992,17 @@ class SimultaneousRecordingsTableRecordings(DynamicTableRegion):
name: Literal["recordings"] = Field(
"recordings",
json_schema_extra={"linkml_meta": {"equals_string": "recordings", "ifabsent": "string(recordings)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "recordings", "ifabsent": "string(recordings)"}
},
)
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[
Union[
NDArray[Shape["* dim0"], Any],
@ -899,34 +1018,46 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: Literal["sequential_recordings"] = Field(
"sequential_recordings",
json_schema_extra={
"linkml_meta": {"equals_string": "sequential_recordings", "ifabsent": "string(sequential_recordings)"}
"linkml_meta": {
"equals_string": "sequential_recordings",
"ifabsent": "string(sequential_recordings)",
}
},
)
simultaneous_recordings: SequentialRecordingsTableSimultaneousRecordings = Field(
..., description="""A reference to one or more rows in the SimultaneousRecordingsTable table."""
...,
description="""A reference to one or more rows in the SimultaneousRecordingsTable table.""",
)
simultaneous_recordings_index: Named[VectorIndex] = Field(
...,
description="""Index dataset for the simultaneous_recordings column.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
stimulus_type: NDArray[Any, str] = Field(
...,
description="""The type of stimulus used for the sequential recording.""",
json_schema_extra={
"linkml_meta": {"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}}
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
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: NDArray[Shape["* num_rows"], int] = Field(
...,
description="""Array of unique identifiers for the rows of this dynamic table.""",
@ -947,14 +1078,19 @@ class SequentialRecordingsTableSimultaneousRecordings(DynamicTableRegion):
name: Literal["simultaneous_recordings"] = Field(
"simultaneous_recordings",
json_schema_extra={
"linkml_meta": {"equals_string": "simultaneous_recordings", "ifabsent": "string(simultaneous_recordings)"}
"linkml_meta": {
"equals_string": "simultaneous_recordings",
"ifabsent": "string(simultaneous_recordings)",
}
},
)
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[
Union[
NDArray[Shape["* dim0"], Any],
@ -970,25 +1106,34 @@ 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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: Literal["repetitions"] = Field(
"repetitions",
json_schema_extra={"linkml_meta": {"equals_string": "repetitions", "ifabsent": "string(repetitions)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "repetitions", "ifabsent": "string(repetitions)"}
},
)
sequential_recordings: RepetitionsTableSequentialRecordings = Field(
..., description="""A reference to one or more rows in the SequentialRecordingsTable table."""
...,
description="""A reference to one or more rows in the SequentialRecordingsTable table.""",
)
sequential_recordings_index: Named[VectorIndex] = Field(
...,
description="""Index dataset for the sequential_recordings column.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
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: NDArray[Shape["* num_rows"], int] = Field(
...,
description="""Array of unique identifiers for the rows of this dynamic table.""",
@ -1009,14 +1154,19 @@ class RepetitionsTableSequentialRecordings(DynamicTableRegion):
name: Literal["sequential_recordings"] = Field(
"sequential_recordings",
json_schema_extra={
"linkml_meta": {"equals_string": "sequential_recordings", "ifabsent": "string(sequential_recordings)"}
"linkml_meta": {
"equals_string": "sequential_recordings",
"ifabsent": "string(sequential_recordings)",
}
},
)
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[
Union[
NDArray[Shape["* dim0"], Any],
@ -1032,12 +1182,17 @@ class ExperimentalConditionsTable(DynamicTable):
A table for grouping different intracellular recording repetitions together that belong to the same experimental condition.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.icephys", "tree_root": True})
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta(
{"from_schema": "core.nwb.icephys", "tree_root": True}
)
name: Literal["experimental_conditions"] = Field(
"experimental_conditions",
json_schema_extra={
"linkml_meta": {"equals_string": "experimental_conditions", "ifabsent": "string(experimental_conditions)"}
"linkml_meta": {
"equals_string": "experimental_conditions",
"ifabsent": "string(experimental_conditions)",
}
},
)
repetitions: ExperimentalConditionsTableRepetitions = Field(
@ -1046,13 +1201,17 @@ class ExperimentalConditionsTable(DynamicTable):
repetitions_index: Named[VectorIndex] = Field(
...,
description="""Index dataset for the repetitions column.""",
json_schema_extra={"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}},
json_schema_extra={
"linkml_meta": {"annotations": {"named": {"tag": "named", "value": True}}}
},
)
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: NDArray[Shape["* num_rows"], int] = Field(
...,
description="""Array of unique identifiers for the rows of this dynamic table.""",
@ -1072,13 +1231,17 @@ class ExperimentalConditionsTableRepetitions(DynamicTableRegion):
name: Literal["repetitions"] = Field(
"repetitions",
json_schema_extra={"linkml_meta": {"equals_string": "repetitions", "ifabsent": "string(repetitions)"}},
json_schema_extra={
"linkml_meta": {"equals_string": "repetitions", "ifabsent": "string(repetitions)"}
},
)
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[
Union[
NDArray[Shape["* dim0"], Any],

Some files were not shown because too many files have changed in this diff Show more