model update

This commit is contained in:
sneakers-the-rat 2024-09-19 19:22:33 -07:00
parent 03ba6568a3
commit e06c8ad656
Signed by untrusted user who does not match committer: jonny
GPG key ID: 6DCB96EF1E4D232D
203 changed files with 9981 additions and 3800 deletions

View file

@ -22,7 +22,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -28,7 +28,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -21,7 +21,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -38,7 +38,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -36,7 +36,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -40,7 +40,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -42,7 +42,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -22,7 +22,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -38,7 +38,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -28,7 +28,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -39,7 +39,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -31,7 +31,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -149,7 +149,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -22,7 +22,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -28,7 +28,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -21,7 +21,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -38,7 +38,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -36,7 +36,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -40,7 +40,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -42,7 +42,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -22,7 +22,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -38,7 +38,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -28,7 +28,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -39,7 +39,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -31,7 +31,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -149,7 +149,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -22,7 +22,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -28,7 +28,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -21,7 +21,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -38,7 +38,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -36,7 +36,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -40,7 +40,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -42,7 +42,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -22,7 +22,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -38,7 +38,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -28,7 +28,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -39,7 +39,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -22,7 +22,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -152,7 +152,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -22,7 +22,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -28,7 +28,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -21,7 +21,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -38,7 +38,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -36,7 +36,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -41,7 +41,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -42,7 +42,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -22,7 +22,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -38,7 +38,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -28,7 +28,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -45,7 +45,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -22,7 +22,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -159,7 +159,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -22,7 +22,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -28,7 +28,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -21,7 +21,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -38,7 +38,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -36,7 +36,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -41,7 +41,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -42,7 +42,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -22,7 +22,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -38,7 +38,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -28,7 +28,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -45,7 +45,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -22,7 +22,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -159,7 +159,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -23,7 +23,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -28,7 +28,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,
@ -176,6 +176,20 @@ class SpatialSeriesData(ConfiguredBaseModel):
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
continuity: Optional[str] = Field(
None,
description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""",
)
conversion: Optional[float] = Field(
1.0,
description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(1.0)"}},
)
resolution: Optional[float] = Field(
-1.0,
description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(-1.0)"}},
)
unit: Optional[str] = Field(
"meters",
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'.""",

View file

@ -21,7 +21,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -38,7 +38,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,
@ -156,11 +156,12 @@ class ElectricalSeries(TimeSeries):
None,
description="""Filtering applied to all channels of the data. For example, if this ElectricalSeries represents high-pass-filtered data (also known as AP Band), then this value could be \"High-pass 4-pole Bessel filter at 500 Hz\". If this ElectricalSeries represents low-pass-filtered LFP data and the type of filter is unknown, then this value could be \"Low-pass filter at 300 Hz\". If a non-standard filter type is used, provide as much detail about the filter properties as possible.""",
)
data: Union[
NDArray[Shape["* num_times"], float],
NDArray[Shape["* num_times, * num_channels"], float],
NDArray[Shape["* num_times, * num_channels, * num_samples"], float],
] = Field(..., description="""Recorded voltage data.""")
channel_conversion: Optional[NDArray[Shape["* num_channels"], float]] = Field(
None,
description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_channels"}]}}},
)
data: ElectricalSeriesData = Field(..., description="""Recorded voltage data.""")
electrodes: Named[DynamicTableRegion] = Field(
...,
description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""",
@ -173,11 +174,6 @@ class ElectricalSeries(TimeSeries):
}
},
)
channel_conversion: Optional[NDArray[Shape["* num_channels"], float]] = Field(
None,
description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_channels"}]}}},
)
description: Optional[str] = Field(
"no description",
description="""Description of the time series.""",
@ -215,6 +211,45 @@ class ElectricalSeries(TimeSeries):
)
class ElectricalSeriesData(ConfiguredBaseModel):
"""
Recorded voltage data.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys"})
name: Literal["data"] = Field(
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
continuity: Optional[str] = Field(
None,
description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""",
)
conversion: Optional[float] = Field(
1.0,
description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(1.0)"}},
)
resolution: Optional[float] = Field(
-1.0,
description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(-1.0)"}},
)
unit: Literal["volts"] = Field(
"volts",
description="""Base unit of measurement for working with the data. This value is fixed to 'volts'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion' and 'channel_conversion' (if present).""",
json_schema_extra={"linkml_meta": {"equals_string": "volts", "ifabsent": "string(volts)"}},
)
value: Optional[
Union[
NDArray[Shape["* num_times"], float],
NDArray[Shape["* num_times, * num_channels"], float],
NDArray[Shape["* num_times, * num_channels, * num_samples"], float],
]
] = Field(None)
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).
@ -225,10 +260,7 @@ class SpikeEventSeries(ElectricalSeries):
)
name: str = Field(...)
data: Union[
NDArray[Shape["* num_events, * num_samples"], float],
NDArray[Shape["* num_events, * num_channels, * num_samples"], float],
] = Field(..., description="""Spike waveforms.""")
data: SpikeEventSeriesData = Field(..., description="""Spike waveforms.""")
timestamps: NDArray[Shape["* num_times"], float] = Field(
...,
description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time. Timestamps are required for the events. Unlike for TimeSeries, timestamps are required for SpikeEventSeries and are thus re-specified here.""",
@ -238,6 +270,11 @@ class SpikeEventSeries(ElectricalSeries):
None,
description="""Filtering applied to all channels of the data. For example, if this ElectricalSeries represents high-pass-filtered data (also known as AP Band), then this value could be \"High-pass 4-pole Bessel filter at 500 Hz\". If this ElectricalSeries represents low-pass-filtered LFP data and the type of filter is unknown, then this value could be \"Low-pass filter at 300 Hz\". If a non-standard filter type is used, provide as much detail about the filter properties as possible.""",
)
channel_conversion: Optional[NDArray[Shape["* num_channels"], float]] = Field(
None,
description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_channels"}]}}},
)
electrodes: Named[DynamicTableRegion] = Field(
...,
description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""",
@ -250,11 +287,6 @@ class SpikeEventSeries(ElectricalSeries):
}
},
)
channel_conversion: Optional[NDArray[Shape["* num_channels"], float]] = Field(
None,
description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_channels"}]}}},
)
description: Optional[str] = Field(
"no description",
description="""Description of the time series.""",
@ -287,6 +319,44 @@ class SpikeEventSeries(ElectricalSeries):
)
class SpikeEventSeriesData(ConfiguredBaseModel):
"""
Spike waveforms.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys"})
name: Literal["data"] = Field(
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
continuity: Optional[str] = Field(
None,
description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""",
)
conversion: Optional[float] = Field(
1.0,
description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(1.0)"}},
)
resolution: Optional[float] = Field(
-1.0,
description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(-1.0)"}},
)
unit: Literal["volts"] = Field(
"volts",
description="""Unit of measurement for waveforms, which is fixed to 'volts'.""",
json_schema_extra={"linkml_meta": {"equals_string": "volts", "ifabsent": "string(volts)"}},
)
value: Optional[
Union[
NDArray[Shape["* num_events, * num_samples"], float],
NDArray[Shape["* num_events, * num_channels, * num_samples"], float],
]
] = Field(None)
class FeatureExtraction(NWBDataInterface):
"""
Features, such as PC1 and PC2, that are extracted from signals stored in a SpikeEventSeries or other source.
@ -561,7 +631,9 @@ class Clustering(NWBDataInterface):
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
ElectricalSeries.model_rebuild()
ElectricalSeriesData.model_rebuild()
SpikeEventSeries.model_rebuild()
SpikeEventSeriesData.model_rebuild()
FeatureExtraction.model_rebuild()
EventDetection.model_rebuild()
EventWaveform.model_rebuild()

View file

@ -36,7 +36,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -25,7 +25,12 @@ from ...core.v2_3_0.core_nwb_icephys import IntracellularElectrode, SweepTable
from ...core.v2_3_0.core_nwb_misc import Units
from ...core.v2_3_0.core_nwb_ogen import OptogeneticStimulusSite
from ...core.v2_3_0.core_nwb_ophys import ImagingPlane
from ...hdmf_common.v1_5_0.hdmf_common_table import DynamicTable, ElementIdentifiers, VectorData
from ...hdmf_common.v1_5_0.hdmf_common_table import (
DynamicTable,
ElementIdentifiers,
VectorData,
VectorIndex,
)
metamodel_version = "None"
@ -36,7 +41,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -42,7 +42,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,
@ -224,6 +224,20 @@ class PatchClampSeriesData(ConfiguredBaseModel):
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
continuity: Optional[str] = Field(
None,
description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""",
)
conversion: Optional[float] = Field(
1.0,
description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(1.0)"}},
)
resolution: Optional[float] = Field(
-1.0,
description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(-1.0)"}},
)
unit: str = Field(
...,
description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""",
@ -243,12 +257,12 @@ class CurrentClampSeries(PatchClampSeries):
)
name: str = Field(...)
data: CurrentClampSeriesData = Field(..., description="""Recorded voltage.""")
bias_current: Optional[float] = Field(None, description="""Bias current, in amps.""")
bridge_balance: Optional[float] = Field(None, description="""Bridge balance, in ohms.""")
capacitance_compensation: Optional[float] = Field(
None, description="""Capacitance compensation, in farads."""
)
data: CurrentClampSeriesData = Field(..., description="""Recorded voltage.""")
stimulus_description: str = Field(
..., description="""Protocol/stimulus name for this patch-clamp dataset."""
)
@ -316,12 +330,28 @@ class CurrentClampSeriesData(ConfiguredBaseModel):
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
continuity: Optional[str] = Field(
None,
description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""",
)
conversion: Optional[float] = Field(
1.0,
description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(1.0)"}},
)
resolution: Optional[float] = Field(
-1.0,
description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(-1.0)"}},
)
unit: Literal["volts"] = Field(
"volts",
description="""Base unit of measurement for working with the data. which is fixed to 'volts'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""",
json_schema_extra={"linkml_meta": {"equals_string": "volts", "ifabsent": "string(volts)"}},
)
value: Any = Field(...)
value: Optional[NDArray[Shape["* num_times"], float]] = Field(
None, json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}
)
class IZeroClampSeries(CurrentClampSeries):
@ -476,6 +506,20 @@ class CurrentClampStimulusSeriesData(ConfiguredBaseModel):
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
continuity: Optional[str] = Field(
None,
description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""",
)
conversion: Optional[float] = Field(
1.0,
description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(1.0)"}},
)
resolution: Optional[float] = Field(
-1.0,
description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(-1.0)"}},
)
unit: Literal["amperes"] = Field(
"amperes",
description="""Base unit of measurement for working with the data. which is fixed to 'amperes'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""",
@ -483,7 +527,9 @@ class CurrentClampStimulusSeriesData(ConfiguredBaseModel):
"linkml_meta": {"equals_string": "amperes", "ifabsent": "string(amperes)"}
},
)
value: Any = Field(...)
value: Optional[NDArray[Shape["* num_times"], float]] = Field(
None, json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}
)
class VoltageClampSeries(PatchClampSeries):
@ -496,13 +542,13 @@ class VoltageClampSeries(PatchClampSeries):
)
name: str = Field(...)
data: VoltageClampSeriesData = Field(..., description="""Recorded current.""")
capacitance_fast: Optional[VoltageClampSeriesCapacitanceFast] = Field(
None, description="""Fast capacitance, in farads."""
)
capacitance_slow: Optional[VoltageClampSeriesCapacitanceSlow] = Field(
None, description="""Slow capacitance, in farads."""
)
data: VoltageClampSeriesData = Field(..., description="""Recorded current.""")
resistance_comp_bandwidth: Optional[VoltageClampSeriesResistanceCompBandwidth] = Field(
None, description="""Resistance compensation bandwidth, in hertz."""
)
@ -574,27 +620,6 @@ class VoltageClampSeries(PatchClampSeries):
)
class VoltageClampSeriesData(ConfiguredBaseModel):
"""
Recorded current.
"""
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)"}},
)
unit: Literal["amperes"] = Field(
"amperes",
description="""Base unit of measurement for working with the data. which is fixed to 'amperes'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""",
json_schema_extra={
"linkml_meta": {"equals_string": "amperes", "ifabsent": "string(amperes)"}
},
)
value: Any = Field(...)
class VoltageClampSeriesCapacitanceFast(ConfiguredBaseModel):
"""
Fast capacitance, in farads.
@ -647,6 +672,43 @@ class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel):
value: float = Field(...)
class VoltageClampSeriesData(ConfiguredBaseModel):
"""
Recorded current.
"""
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)"}},
)
continuity: Optional[str] = Field(
None,
description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""",
)
conversion: Optional[float] = Field(
1.0,
description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(1.0)"}},
)
resolution: Optional[float] = Field(
-1.0,
description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(-1.0)"}},
)
unit: Literal["amperes"] = Field(
"amperes",
description="""Base unit of measurement for working with the data. which is fixed to 'amperes'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""",
json_schema_extra={
"linkml_meta": {"equals_string": "amperes", "ifabsent": "string(amperes)"}
},
)
value: Optional[NDArray[Shape["* num_times"], float]] = Field(
None, json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}
)
class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel):
"""
Resistance compensation bandwidth, in hertz.
@ -851,12 +913,28 @@ class VoltageClampStimulusSeriesData(ConfiguredBaseModel):
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
continuity: Optional[str] = Field(
None,
description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""",
)
conversion: Optional[float] = Field(
1.0,
description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(1.0)"}},
)
resolution: Optional[float] = Field(
-1.0,
description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(-1.0)"}},
)
unit: Literal["volts"] = Field(
"volts",
description="""Base unit of measurement for working with the data. which is fixed to 'volts'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""",
json_schema_extra={"linkml_meta": {"equals_string": "volts", "ifabsent": "string(volts)"}},
)
value: Any = Field(...)
value: Optional[NDArray[Shape["* num_times"], float]] = Field(
None, json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}
)
class IntracellularElectrode(NWBContainer):
@ -906,15 +984,6 @@ class SweepTable(DynamicTable):
)
name: str = Field(...)
sweep_number: VectorData[NDArray[Any, int]] = Field(
...,
description="""Sweep number of the PatchClampSeries in that row.""",
json_schema_extra={
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
series: VectorData[NDArray[Any, PatchClampSeries]] = Field(
...,
description="""The PatchClampSeries with the sweep number in that row.""",
@ -936,6 +1005,15 @@ class SweepTable(DynamicTable):
}
},
)
sweep_number: VectorData[NDArray[Any, int]] = Field(
...,
description="""Sweep number of the PatchClampSeries in that row.""",
json_schema_extra={
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
colnames: List[str] = Field(
...,
description="""The names of the columns in this table. This should be used to specify an order to the columns.""",
@ -958,9 +1036,9 @@ IZeroClampSeries.model_rebuild()
CurrentClampStimulusSeries.model_rebuild()
CurrentClampStimulusSeriesData.model_rebuild()
VoltageClampSeries.model_rebuild()
VoltageClampSeriesData.model_rebuild()
VoltageClampSeriesCapacitanceFast.model_rebuild()
VoltageClampSeriesCapacitanceSlow.model_rebuild()
VoltageClampSeriesData.model_rebuild()
VoltageClampSeriesResistanceCompBandwidth.model_rebuild()
VoltageClampSeriesResistanceCompCorrection.model_rebuild()
VoltageClampSeriesResistanceCompPrediction.model_rebuild()

View file

@ -23,7 +23,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,
@ -198,12 +198,9 @@ class ImageSeries(TimeSeries):
)
name: str = Field(...)
data: Optional[
Union[
NDArray[Shape["* frame, * x, * y"], float],
NDArray[Shape["* frame, * x, * y, * z"], float],
]
] = Field(None, description="""Binary data representing images across frames.""")
data: Optional[ImageSeriesData] = Field(
None, description="""Binary data representing images across frames."""
)
dimension: Optional[NDArray[Shape["* rank"], int]] = Field(
None,
description="""Number of pixels on x, y, (and z) axes.""",
@ -214,8 +211,9 @@ class ImageSeries(TimeSeries):
description="""Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.""",
)
format: Optional[str] = Field(
None,
"raw",
description="""Format of image. If this is 'external', then the attribute 'external_file' contains the path information to the image files. If this is 'raw', then the raw (single-channel) binary data is stored in the 'data' dataset. If this attribute is not present, then the default format='raw' case is assumed.""",
json_schema_extra={"linkml_meta": {"ifabsent": "string(raw)"}},
)
device: Optional[Union[Device, str]] = Field(
None,
@ -263,6 +261,43 @@ class ImageSeries(TimeSeries):
)
class ImageSeriesData(ConfiguredBaseModel):
"""
Binary data representing images across frames.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image"})
name: Literal["data"] = Field(
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
conversion: Optional[float] = Field(
1.0,
description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(1.0)"}},
)
resolution: Optional[float] = Field(
-1.0,
description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(-1.0)"}},
)
unit: str = Field(
...,
description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""",
)
continuity: Optional[str] = Field(
None,
description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""",
)
value: Optional[
Union[
NDArray[Shape["* frame, * x, * y"], float],
NDArray[Shape["* frame, * x, * y, * z"], float],
]
] = Field(None)
class ImageSeriesExternalFile(ConfiguredBaseModel):
"""
Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.
@ -304,12 +339,9 @@ class ImageMaskSeries(ImageSeries):
}
},
)
data: Optional[
Union[
NDArray[Shape["* frame, * x, * y"], float],
NDArray[Shape["* frame, * x, * y, * z"], float],
]
] = Field(None, description="""Binary data representing images across frames.""")
data: Optional[ImageSeriesData] = Field(
None, description="""Binary data representing images across frames."""
)
dimension: Optional[NDArray[Shape["* rank"], int]] = Field(
None,
description="""Number of pixels on x, y, (and z) axes.""",
@ -320,8 +352,9 @@ class ImageMaskSeries(ImageSeries):
description="""Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.""",
)
format: Optional[str] = Field(
None,
"raw",
description="""Format of image. If this is 'external', then the attribute 'external_file' contains the path information to the image files. If this is 'raw', then the raw (single-channel) binary data is stored in the 'data' dataset. If this attribute is not present, then the default format='raw' case is assumed.""",
json_schema_extra={"linkml_meta": {"ifabsent": "string(raw)"}},
)
device: Optional[Union[Device, str]] = Field(
None,
@ -379,6 +412,9 @@ class OpticalSeries(ImageSeries):
)
name: str = Field(...)
data: OpticalSeriesData = Field(
..., description="""Images presented to subject, either grayscale or RGB"""
)
distance: Optional[float] = Field(
None, description="""Distance from camera/monitor to target/eye."""
)
@ -387,10 +423,6 @@ class OpticalSeries(ImageSeries):
NDArray[Shape["2 width_height"], float], NDArray[Shape["3 width_height_depth"], float]
]
] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""")
data: Union[
NDArray[Shape["* frame, * x, * y"], float],
NDArray[Shape["* frame, * x, * y, 3 r_g_b"], float],
] = Field(..., description="""Images presented to subject, either grayscale or RGB""")
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.""",
@ -405,8 +437,9 @@ class OpticalSeries(ImageSeries):
description="""Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.""",
)
format: Optional[str] = Field(
None,
"raw",
description="""Format of image. If this is 'external', then the attribute 'external_file' contains the path information to the image files. If this is 'raw', then the raw (single-channel) binary data is stored in the 'data' dataset. If this attribute is not present, then the default format='raw' case is assumed.""",
json_schema_extra={"linkml_meta": {"ifabsent": "string(raw)"}},
)
device: Optional[Union[Device, str]] = Field(
None,
@ -454,6 +487,43 @@ class OpticalSeries(ImageSeries):
)
class OpticalSeriesData(ConfiguredBaseModel):
"""
Images presented to subject, either grayscale or RGB
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image"})
name: Literal["data"] = Field(
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
continuity: Optional[str] = Field(
None,
description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""",
)
conversion: Optional[float] = Field(
1.0,
description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(1.0)"}},
)
resolution: Optional[float] = Field(
-1.0,
description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(-1.0)"}},
)
unit: str = Field(
...,
description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""",
)
value: Optional[
Union[
NDArray[Shape["* frame, * x, * y"], float],
NDArray[Shape["* frame, * x, * y, 3 r_g_b"], float],
]
] = Field(None)
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.
@ -464,10 +534,8 @@ class IndexSeries(TimeSeries):
)
name: str = Field(...)
data: NDArray[Shape["* num_times"], int] = Field(
...,
description="""Index of the frame in the referenced ImageSeries.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}},
data: IndexSeriesData = Field(
..., description="""Index of the frame in the referenced ImageSeries."""
)
indexed_timeseries: Union[ImageSeries, str] = Field(
...,
@ -515,13 +583,50 @@ class IndexSeries(TimeSeries):
)
class IndexSeriesData(ConfiguredBaseModel):
"""
Index of the frame in the referenced ImageSeries.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image"})
name: Literal["data"] = Field(
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
conversion: Optional[float] = Field(
1.0,
description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(1.0)"}},
)
resolution: Optional[float] = Field(
-1.0,
description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(-1.0)"}},
)
unit: str = Field(
...,
description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""",
)
continuity: Optional[str] = Field(
None,
description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""",
)
value: Optional[NDArray[Shape["* num_times"], int]] = Field(
None, json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}
)
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
GrayscaleImage.model_rebuild()
RGBImage.model_rebuild()
RGBAImage.model_rebuild()
ImageSeries.model_rebuild()
ImageSeriesData.model_rebuild()
ImageSeriesExternalFile.model_rebuild()
ImageMaskSeries.model_rebuild()
OpticalSeries.model_rebuild()
OpticalSeriesData.model_rebuild()
IndexSeries.model_rebuild()
IndexSeriesData.model_rebuild()

View file

@ -38,7 +38,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,
@ -213,6 +213,20 @@ class AbstractFeatureSeriesData(ConfiguredBaseModel):
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
continuity: Optional[str] = Field(
None,
description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""",
)
conversion: Optional[float] = Field(
1.0,
description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(1.0)"}},
)
resolution: Optional[float] = Field(
-1.0,
description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(-1.0)"}},
)
unit: Optional[str] = Field(
"see ",
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'\".""",
@ -236,10 +250,8 @@ class AnnotationSeries(TimeSeries):
)
name: str = Field(...)
data: NDArray[Shape["* num_times"], str] = Field(
...,
description="""Annotations made during an experiment.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}},
data: AnnotationSeriesData = Field(
..., description="""Annotations made during an experiment."""
)
description: Optional[str] = Field(
"no description",
@ -278,6 +290,43 @@ class AnnotationSeries(TimeSeries):
)
class AnnotationSeriesData(ConfiguredBaseModel):
"""
Annotations made during an experiment.
"""
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)"}},
)
continuity: Optional[str] = Field(
None,
description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""",
)
conversion: Optional[float] = Field(
1.0,
description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(1.0)"}},
)
resolution: float = Field(
-1.0,
description="""Smallest meaningful difference between values in data. Annotations have no units, so the value is fixed to -1.0.""",
le=-1,
ge=-1,
json_schema_extra={"linkml_meta": {"ifabsent": "float(-1.0)"}},
)
unit: Literal["n/a"] = Field(
"n/a",
description="""Base unit of measurement for working with the data. Annotations have no units, so the value is fixed to 'n/a'.""",
json_schema_extra={"linkml_meta": {"equals_string": "n/a", "ifabsent": "string(n/a)"}},
)
value: Optional[NDArray[Shape["* num_times"], str]] = Field(
None, json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}
)
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.
@ -288,10 +337,8 @@ class IntervalSeries(TimeSeries):
)
name: str = Field(...)
data: NDArray[Shape["* num_times"], int] = Field(
...,
description="""Use values >0 if interval started, <0 if interval ended.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}},
data: IntervalSeriesData = Field(
..., description="""Use values >0 if interval started, <0 if interval ended."""
)
description: Optional[str] = Field(
"no description",
@ -330,6 +377,43 @@ class IntervalSeries(TimeSeries):
)
class IntervalSeriesData(ConfiguredBaseModel):
"""
Use values >0 if interval started, <0 if interval ended.
"""
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)"}},
)
continuity: Optional[str] = Field(
None,
description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""",
)
conversion: Optional[float] = Field(
1.0,
description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(1.0)"}},
)
resolution: float = Field(
-1.0,
description="""Smallest meaningful difference between values in data. Annotations have no units, so the value is fixed to -1.0.""",
le=-1,
ge=-1,
json_schema_extra={"linkml_meta": {"ifabsent": "float(-1.0)"}},
)
unit: Literal["n/a"] = Field(
"n/a",
description="""Base unit of measurement for working with the data. Annotations have no units, so the value is fixed to 'n/a'.""",
json_schema_extra={"linkml_meta": {"equals_string": "n/a", "ifabsent": "string(n/a)"}},
)
value: Optional[NDArray[Shape["* num_times"], int]] = Field(
None, json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}
)
class DecompositionSeries(TimeSeries):
"""
Spectral analysis of a time series, e.g. of an LFP or a speech signal.
@ -417,6 +501,20 @@ class DecompositionSeriesData(ConfiguredBaseModel):
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
continuity: Optional[str] = Field(
None,
description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""",
)
conversion: Optional[float] = Field(
1.0,
description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(1.0)"}},
)
resolution: Optional[float] = Field(
-1.0,
description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(-1.0)"}},
)
unit: str = Field(
"no unit",
description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""",
@ -504,9 +602,18 @@ class Units(DynamicTable):
)
name: str = Field("Units", json_schema_extra={"linkml_meta": {"ifabsent": "string(Units)"}})
spike_times_index: Optional[Named[VectorIndex]] = Field(
electrode_group: Optional[VectorData[NDArray[Any, ElectrodeGroup]]] = Field(
None,
description="""Index into the spike_times dataset.""",
description="""Electrode group that each spike unit came from.""",
json_schema_extra={
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
electrodes: Optional[Named[DynamicTableRegion]] = Field(
None,
description="""Electrode that each spike unit came from, specified using a DynamicTableRegion.""",
json_schema_extra={
"linkml_meta": {
"annotations": {
@ -516,12 +623,9 @@ class Units(DynamicTable):
}
},
)
spike_times: Optional[UnitsSpikeTimes] = Field(
None, description="""Spike times for each unit."""
)
obs_intervals_index: Optional[Named[VectorIndex]] = Field(
electrodes_index: Optional[Named[VectorIndex]] = Field(
None,
description="""Index into the obs_intervals dataset.""",
description="""Index into electrodes.""",
json_schema_extra={
"linkml_meta": {
"annotations": {
@ -547,9 +651,9 @@ class Units(DynamicTable):
},
)
)
electrodes_index: Optional[Named[VectorIndex]] = Field(
obs_intervals_index: Optional[Named[VectorIndex]] = Field(
None,
description="""Index into electrodes.""",
description="""Index into the obs_intervals dataset.""",
json_schema_extra={
"linkml_meta": {
"annotations": {
@ -559,9 +663,12 @@ class Units(DynamicTable):
}
},
)
electrodes: Optional[Named[DynamicTableRegion]] = Field(
spike_times: Optional[UnitsSpikeTimes] = Field(
None, description="""Spike times for each unit."""
)
spike_times_index: Optional[Named[VectorIndex]] = Field(
None,
description="""Electrode that each spike unit came from, specified using a DynamicTableRegion.""",
description="""Index into the spike_times dataset.""",
json_schema_extra={
"linkml_meta": {
"annotations": {
@ -571,41 +678,15 @@ class Units(DynamicTable):
}
},
)
electrode_group: Optional[VectorData[NDArray[Any, ElectrodeGroup]]] = Field(
None,
description="""Electrode group that each spike unit came from.""",
json_schema_extra={
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
waveform_mean: Optional[UnitsWaveformMean] = Field(
None, description="""Spike waveform mean for each spike unit."""
)
waveform_mean: Optional[
VectorData[
Union[
NDArray[Shape["* num_units, * num_samples"], float],
NDArray[Shape["* num_units, * num_samples, * num_electrodes"], float],
]
]
] = Field(None, description="""Spike waveform mean for each spike unit.""")
waveform_sd: Optional[
VectorData[
Union[
NDArray[Shape["* num_units, * num_samples"], float],
NDArray[Shape["* num_units, * num_samples, * num_electrodes"], float],
]
]
] = Field(None, description="""Spike waveform standard deviation for each spike unit.""")
waveforms: Optional[VectorData[NDArray[Shape["* num_waveforms, * num_samples"], float]]] = (
Field(
None,
description="""Individual waveforms for each spike on each electrode. This is a doubly indexed column. The 'waveforms_index' column indexes which waveforms in this column belong to the same spike event for a given unit, where each waveform was recorded from a different electrode. The 'waveforms_index_index' column indexes the 'waveforms_index' column to indicate which spike events belong to a given unit. For example, if the 'waveforms_index_index' column has values [2, 5, 6], then the first 2 elements of the 'waveforms_index' column correspond to the 2 spike events of the first unit, the next 3 elements of the 'waveforms_index' column correspond to the 3 spike events of the second unit, and the next 1 element of the 'waveforms_index' column corresponds to the 1 spike event of the third unit. If the 'waveforms_index' column has values [3, 6, 8, 10, 12, 13], then the first 3 elements of the 'waveforms' column contain the 3 spike waveforms that were recorded from 3 different electrodes for the first spike time of the first unit. See https://nwb-schema.readthedocs.io/en/stable/format_description.html#doubly-ragged-arrays for a graphical representation of this example. When there is only one electrode for each unit (i.e., each spike time is associated with a single waveform), then the 'waveforms_index' column will have values 1, 2, ..., N, where N is the number of spike events. The number of electrodes for each spike event should be the same within a given unit. The 'electrodes' column should be used to indicate which electrodes are associated with each unit, and the order of the waveforms within a given unit x spike event should be in the same order as the electrodes referenced in the 'electrodes' column of this table. The number of samples for each waveform must be the same.""",
json_schema_extra={
"linkml_meta": {
"array": {"dimensions": [{"alias": "num_waveforms"}, {"alias": "num_samples"}]}
}
},
)
waveform_sd: Optional[UnitsWaveformSd] = Field(
None, description="""Spike waveform standard deviation for each spike unit."""
)
waveforms: Optional[UnitsWaveforms] = Field(
None,
description="""Individual waveforms for each spike on each electrode. This is a doubly indexed column. The 'waveforms_index' column indexes which waveforms in this column belong to the same spike event for a given unit, where each waveform was recorded from a different electrode. The 'waveforms_index_index' column indexes the 'waveforms_index' column to indicate which spike events belong to a given unit. For example, if the 'waveforms_index_index' column has values [2, 5, 6], then the first 2 elements of the 'waveforms_index' column correspond to the 2 spike events of the first unit, the next 3 elements of the 'waveforms_index' column correspond to the 3 spike events of the second unit, and the next 1 element of the 'waveforms_index' column corresponds to the 1 spike event of the third unit. If the 'waveforms_index' column has values [3, 6, 8, 10, 12, 13], then the first 3 elements of the 'waveforms' column contain the 3 spike waveforms that were recorded from 3 different electrodes for the first spike time of the first unit. See https://nwb-schema.readthedocs.io/en/stable/format_description.html#doubly-ragged-arrays for a graphical representation of this example. When there is only one electrode for each unit (i.e., each spike time is associated with a single waveform), then the 'waveforms_index' column will have values 1, 2, ..., N, where N is the number of spike events. The number of electrodes for each spike event should be the same within a given unit. The 'electrodes' column should be used to indicate which electrodes are associated with each unit, and the order of the waveforms within a given unit x spike event should be in the same order as the electrodes referenced in the 'electrodes' column of this table. The number of samples for each waveform must be the same.""",
)
waveforms_index: Optional[Named[VectorIndex]] = Field(
None,
@ -671,14 +752,109 @@ class UnitsSpikeTimes(VectorData):
] = Field(None)
class UnitsWaveformMean(VectorData):
"""
Spike waveform mean for each spike unit.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"})
name: Literal["waveform_mean"] = Field(
"waveform_mean",
json_schema_extra={
"linkml_meta": {"equals_string": "waveform_mean", "ifabsent": "string(waveform_mean)"}
},
)
sampling_rate: Optional[float] = Field(None, description="""Sampling rate, in hertz.""")
unit: Optional[Literal["volts"]] = Field(
"volts",
description="""Unit of measurement. This value is fixed to 'volts'.""",
json_schema_extra={"linkml_meta": {"equals_string": "volts", "ifabsent": "string(volts)"}},
)
description: str = Field(..., description="""Description of what these vectors represent.""")
value: Optional[
Union[
NDArray[Shape["* dim0"], Any],
NDArray[Shape["* dim0, * dim1"], Any],
NDArray[Shape["* dim0, * dim1, * dim2"], Any],
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any],
]
] = Field(None)
class UnitsWaveformSd(VectorData):
"""
Spike waveform standard deviation for each spike unit.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"})
name: Literal["waveform_sd"] = Field(
"waveform_sd",
json_schema_extra={
"linkml_meta": {"equals_string": "waveform_sd", "ifabsent": "string(waveform_sd)"}
},
)
sampling_rate: Optional[float] = Field(None, description="""Sampling rate, in hertz.""")
unit: Optional[Literal["volts"]] = Field(
"volts",
description="""Unit of measurement. This value is fixed to 'volts'.""",
json_schema_extra={"linkml_meta": {"equals_string": "volts", "ifabsent": "string(volts)"}},
)
description: str = Field(..., description="""Description of what these vectors represent.""")
value: Optional[
Union[
NDArray[Shape["* dim0"], Any],
NDArray[Shape["* dim0, * dim1"], Any],
NDArray[Shape["* dim0, * dim1, * dim2"], Any],
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any],
]
] = Field(None)
class UnitsWaveforms(VectorData):
"""
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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"})
name: Literal["waveforms"] = Field(
"waveforms",
json_schema_extra={
"linkml_meta": {"equals_string": "waveforms", "ifabsent": "string(waveforms)"}
},
)
sampling_rate: Optional[float] = Field(None, description="""Sampling rate, in hertz.""")
unit: Optional[Literal["volts"]] = Field(
"volts",
description="""Unit of measurement. This value is fixed to 'volts'.""",
json_schema_extra={"linkml_meta": {"equals_string": "volts", "ifabsent": "string(volts)"}},
)
description: str = Field(..., description="""Description of what these vectors represent.""")
value: Optional[
Union[
NDArray[Shape["* dim0"], Any],
NDArray[Shape["* dim0, * dim1"], Any],
NDArray[Shape["* dim0, * dim1, * dim2"], Any],
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any],
]
] = Field(None)
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
AbstractFeatureSeries.model_rebuild()
AbstractFeatureSeriesData.model_rebuild()
AnnotationSeries.model_rebuild()
AnnotationSeriesData.model_rebuild()
IntervalSeries.model_rebuild()
IntervalSeriesData.model_rebuild()
DecompositionSeries.model_rebuild()
DecompositionSeriesData.model_rebuild()
DecompositionSeriesBands.model_rebuild()
Units.model_rebuild()
UnitsSpikeTimes.model_rebuild()
UnitsWaveformMean.model_rebuild()
UnitsWaveformSd.model_rebuild()
UnitsWaveforms.model_rebuild()

View file

@ -28,7 +28,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,
@ -121,10 +121,8 @@ class OptogeneticSeries(TimeSeries):
)
name: str = Field(...)
data: NDArray[Shape["* num_times"], float] = Field(
...,
description="""Applied power for optogenetic stimulus, in watts.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}},
data: OptogeneticSeriesData = Field(
..., description="""Applied power for optogenetic stimulus, in watts."""
)
site: Union[OptogeneticStimulusSite, str] = Field(
...,
@ -172,6 +170,41 @@ class OptogeneticSeries(TimeSeries):
)
class OptogeneticSeriesData(ConfiguredBaseModel):
"""
Applied power for optogenetic stimulus, in watts.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ogen"})
name: Literal["data"] = Field(
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
continuity: Optional[str] = Field(
None,
description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""",
)
conversion: Optional[float] = Field(
1.0,
description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(1.0)"}},
)
resolution: Optional[float] = Field(
-1.0,
description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(-1.0)"}},
)
unit: Literal["watts"] = Field(
"watts",
description="""Unit of measurement for data, which is fixed to 'watts'.""",
json_schema_extra={"linkml_meta": {"equals_string": "watts", "ifabsent": "string(watts)"}},
)
value: Optional[NDArray[Shape["* num_times"], float]] = Field(
None, json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}
)
class OptogeneticStimulusSite(NWBContainer):
"""
A site of optogenetic stimulation.
@ -202,4 +235,5 @@ class OptogeneticStimulusSite(NWBContainer):
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
OptogeneticSeries.model_rebuild()
OptogeneticSeriesData.model_rebuild()
OptogeneticStimulusSite.model_rebuild()

View file

@ -27,7 +27,7 @@ from ...core.v2_3_0.core_nwb_base import (
TimeSeriesSync,
)
from ...core.v2_3_0.core_nwb_device import Device
from ...core.v2_3_0.core_nwb_image import ImageSeries, ImageSeriesExternalFile
from ...core.v2_3_0.core_nwb_image import ImageSeries, ImageSeriesData, ImageSeriesExternalFile
from ...hdmf_common.v1_5_0.hdmf_common_table import (
DynamicTable,
DynamicTableRegion,
@ -45,7 +45,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,
@ -179,12 +179,9 @@ class TwoPhotonSeries(ImageSeries):
}
},
)
data: Optional[
Union[
NDArray[Shape["* frame, * x, * y"], float],
NDArray[Shape["* frame, * x, * y, * z"], float],
]
] = Field(None, description="""Binary data representing images across frames.""")
data: Optional[ImageSeriesData] = Field(
None, description="""Binary data representing images across frames."""
)
dimension: Optional[NDArray[Shape["* rank"], int]] = Field(
None,
description="""Number of pixels on x, y, (and z) axes.""",
@ -195,8 +192,9 @@ class TwoPhotonSeries(ImageSeries):
description="""Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.""",
)
format: Optional[str] = Field(
None,
"raw",
description="""Format of image. If this is 'external', then the attribute 'external_file' contains the path information to the image files. If this is 'raw', then the raw (single-channel) binary data is stored in the 'data' dataset. If this attribute is not present, then the default format='raw' case is assumed.""",
json_schema_extra={"linkml_meta": {"ifabsent": "string(raw)"}},
)
device: Optional[Union[Device, str]] = Field(
None,
@ -254,9 +252,7 @@ class RoiResponseSeries(TimeSeries):
)
name: str = Field(...)
data: Union[
NDArray[Shape["* num_times"], float], NDArray[Shape["* num_times, * num_rois"], float]
] = Field(..., description="""Signals from ROIs.""")
data: RoiResponseSeriesData = Field(..., description="""Signals from ROIs.""")
rois: Named[DynamicTableRegion] = Field(
...,
description="""DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries.""",
@ -306,6 +302,42 @@ class RoiResponseSeries(TimeSeries):
)
class RoiResponseSeriesData(ConfiguredBaseModel):
"""
Signals from ROIs.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys"})
name: Literal["data"] = Field(
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
conversion: Optional[float] = Field(
1.0,
description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(1.0)"}},
)
resolution: Optional[float] = Field(
-1.0,
description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(-1.0)"}},
)
unit: str = Field(
...,
description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""",
)
continuity: Optional[str] = Field(
None,
description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""",
)
value: Optional[
Union[
NDArray[Shape["* num_times"], float], NDArray[Shape["* num_times, * num_rois"], float]
]
] = Field(None)
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).
@ -372,6 +404,10 @@ class PlaneSegmentation(DynamicTable):
None,
description="""ROI masks for each ROI. Each image mask is the size of the original imaging plane (or volume) and members of the ROI are finite non-zero.""",
)
pixel_mask: Optional[PlaneSegmentationPixelMask] = Field(
None,
description="""Pixel masks for each ROI: a list of indices and weights for the ROI. Pixel masks are concatenated and parsing of this dataset is maintained by the PlaneSegmentation""",
)
pixel_mask_index: Optional[Named[VectorIndex]] = Field(
None,
description="""Index into pixel_mask.""",
@ -384,9 +420,9 @@ class PlaneSegmentation(DynamicTable):
}
},
)
pixel_mask: Optional[PlaneSegmentationPixelMask] = Field(
voxel_mask: Optional[PlaneSegmentationVoxelMask] = Field(
None,
description="""Pixel masks for each ROI: a list of indices and weights for the ROI. Pixel masks are concatenated and parsing of this dataset is maintained by the PlaneSegmentation""",
description="""Voxel masks for each ROI: a list of indices and weights for the ROI. Voxel masks are concatenated and parsing of this dataset is maintained by the PlaneSegmentation""",
)
voxel_mask_index: Optional[Named[VectorIndex]] = Field(
None,
@ -400,10 +436,6 @@ class PlaneSegmentation(DynamicTable):
}
},
)
voxel_mask: Optional[PlaneSegmentationVoxelMask] = Field(
None,
description="""Voxel masks for each ROI: a list of indices and weights for the ROI. Voxel masks are concatenated and parsing of this dataset is maintained by the PlaneSegmentation""",
)
reference_images: Optional[Dict[str, ImageSeries]] = Field(
None,
description="""Image stacks that the segmentation masks apply to.""",
@ -702,6 +734,7 @@ class CorrectedImageStack(NWBDataInterface):
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
TwoPhotonSeries.model_rebuild()
RoiResponseSeries.model_rebuild()
RoiResponseSeriesData.model_rebuild()
DfOverF.model_rebuild()
Fluorescence.model_rebuild()
ImageSegmentation.model_rebuild()

View file

@ -22,7 +22,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -38,6 +38,7 @@ from ...core.v2_3_0.core_nwb_ecephys import (
ClusterWaveforms,
Clustering,
ElectricalSeries,
ElectricalSeriesData,
ElectrodeGroup,
ElectrodeGroupPosition,
EventDetection,
@ -46,6 +47,7 @@ from ...core.v2_3_0.core_nwb_ecephys import (
FilteredEphys,
LFP,
SpikeEventSeries,
SpikeEventSeriesData,
)
from ...core.v2_3_0.core_nwb_epoch import TimeIntervals, TimeIntervalsTimeseries
from ...core.v2_3_0.core_nwb_file import (
@ -87,9 +89,12 @@ from ...core.v2_3_0.core_nwb_image import (
GrayscaleImage,
ImageMaskSeries,
ImageSeries,
ImageSeriesData,
ImageSeriesExternalFile,
IndexSeries,
IndexSeriesData,
OpticalSeries,
OpticalSeriesData,
RGBAImage,
RGBImage,
)
@ -97,14 +102,23 @@ from ...core.v2_3_0.core_nwb_misc import (
AbstractFeatureSeries,
AbstractFeatureSeriesData,
AnnotationSeries,
AnnotationSeriesData,
DecompositionSeries,
DecompositionSeriesBands,
DecompositionSeriesData,
IntervalSeries,
IntervalSeriesData,
Units,
UnitsSpikeTimes,
UnitsWaveformMean,
UnitsWaveformSd,
UnitsWaveforms,
)
from ...core.v2_3_0.core_nwb_ogen import (
OptogeneticSeries,
OptogeneticSeriesData,
OptogeneticStimulusSite,
)
from ...core.v2_3_0.core_nwb_ogen import OptogeneticSeries, OptogeneticStimulusSite
from ...core.v2_3_0.core_nwb_ophys import (
CorrectedImageStack,
DfOverF,
@ -120,6 +134,7 @@ from ...core.v2_3_0.core_nwb_ophys import (
PlaneSegmentationPixelMask,
PlaneSegmentationVoxelMask,
RoiResponseSeries,
RoiResponseSeriesData,
TwoPhotonSeries,
)
from ...core.v2_3_0.core_nwb_retinotopy import (
@ -161,7 +176,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -36,7 +36,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -28,7 +28,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,
@ -176,6 +176,20 @@ class SpatialSeriesData(ConfiguredBaseModel):
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
continuity: Optional[str] = Field(
None,
description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""",
)
conversion: Optional[float] = Field(
1.0,
description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(1.0)"}},
)
resolution: Optional[float] = Field(
-1.0,
description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(-1.0)"}},
)
unit: Optional[str] = Field(
"meters",
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'.""",

View file

@ -21,7 +21,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -38,7 +38,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,
@ -156,11 +156,12 @@ class ElectricalSeries(TimeSeries):
None,
description="""Filtering applied to all channels of the data. For example, if this ElectricalSeries represents high-pass-filtered data (also known as AP Band), then this value could be \"High-pass 4-pole Bessel filter at 500 Hz\". If this ElectricalSeries represents low-pass-filtered LFP data and the type of filter is unknown, then this value could be \"Low-pass filter at 300 Hz\". If a non-standard filter type is used, provide as much detail about the filter properties as possible.""",
)
data: Union[
NDArray[Shape["* num_times"], float],
NDArray[Shape["* num_times, * num_channels"], float],
NDArray[Shape["* num_times, * num_channels, * num_samples"], float],
] = Field(..., description="""Recorded voltage data.""")
channel_conversion: Optional[NDArray[Shape["* num_channels"], float]] = Field(
None,
description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_channels"}]}}},
)
data: ElectricalSeriesData = Field(..., description="""Recorded voltage data.""")
electrodes: Named[DynamicTableRegion] = Field(
...,
description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""",
@ -173,11 +174,6 @@ class ElectricalSeries(TimeSeries):
}
},
)
channel_conversion: Optional[NDArray[Shape["* num_channels"], float]] = Field(
None,
description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_channels"}]}}},
)
description: Optional[str] = Field(
"no description",
description="""Description of the time series.""",
@ -215,6 +211,45 @@ class ElectricalSeries(TimeSeries):
)
class ElectricalSeriesData(ConfiguredBaseModel):
"""
Recorded voltage data.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys"})
name: Literal["data"] = Field(
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
continuity: Optional[str] = Field(
None,
description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""",
)
conversion: Optional[float] = Field(
1.0,
description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(1.0)"}},
)
resolution: Optional[float] = Field(
-1.0,
description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(-1.0)"}},
)
unit: Literal["volts"] = Field(
"volts",
description="""Base unit of measurement for working with the data. This value is fixed to 'volts'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion' and 'channel_conversion' (if present).""",
json_schema_extra={"linkml_meta": {"equals_string": "volts", "ifabsent": "string(volts)"}},
)
value: Optional[
Union[
NDArray[Shape["* num_times"], float],
NDArray[Shape["* num_times, * num_channels"], float],
NDArray[Shape["* num_times, * num_channels, * num_samples"], float],
]
] = Field(None)
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).
@ -225,10 +260,7 @@ class SpikeEventSeries(ElectricalSeries):
)
name: str = Field(...)
data: Union[
NDArray[Shape["* num_events, * num_samples"], float],
NDArray[Shape["* num_events, * num_channels, * num_samples"], float],
] = Field(..., description="""Spike waveforms.""")
data: SpikeEventSeriesData = Field(..., description="""Spike waveforms.""")
timestamps: NDArray[Shape["* num_times"], float] = Field(
...,
description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time. Timestamps are required for the events. Unlike for TimeSeries, timestamps are required for SpikeEventSeries and are thus re-specified here.""",
@ -238,6 +270,11 @@ class SpikeEventSeries(ElectricalSeries):
None,
description="""Filtering applied to all channels of the data. For example, if this ElectricalSeries represents high-pass-filtered data (also known as AP Band), then this value could be \"High-pass 4-pole Bessel filter at 500 Hz\". If this ElectricalSeries represents low-pass-filtered LFP data and the type of filter is unknown, then this value could be \"Low-pass filter at 300 Hz\". If a non-standard filter type is used, provide as much detail about the filter properties as possible.""",
)
channel_conversion: Optional[NDArray[Shape["* num_channels"], float]] = Field(
None,
description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_channels"}]}}},
)
electrodes: Named[DynamicTableRegion] = Field(
...,
description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""",
@ -250,11 +287,6 @@ class SpikeEventSeries(ElectricalSeries):
}
},
)
channel_conversion: Optional[NDArray[Shape["* num_channels"], float]] = Field(
None,
description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_channels"}]}}},
)
description: Optional[str] = Field(
"no description",
description="""Description of the time series.""",
@ -287,6 +319,44 @@ class SpikeEventSeries(ElectricalSeries):
)
class SpikeEventSeriesData(ConfiguredBaseModel):
"""
Spike waveforms.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys"})
name: Literal["data"] = Field(
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
continuity: Optional[str] = Field(
None,
description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""",
)
conversion: Optional[float] = Field(
1.0,
description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(1.0)"}},
)
resolution: Optional[float] = Field(
-1.0,
description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(-1.0)"}},
)
unit: Literal["volts"] = Field(
"volts",
description="""Unit of measurement for waveforms, which is fixed to 'volts'.""",
json_schema_extra={"linkml_meta": {"equals_string": "volts", "ifabsent": "string(volts)"}},
)
value: Optional[
Union[
NDArray[Shape["* num_events, * num_samples"], float],
NDArray[Shape["* num_events, * num_channels, * num_samples"], float],
]
] = Field(None)
class FeatureExtraction(NWBDataInterface):
"""
Features, such as PC1 and PC2, that are extracted from signals stored in a SpikeEventSeries or other source.
@ -561,7 +631,9 @@ class Clustering(NWBDataInterface):
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
ElectricalSeries.model_rebuild()
ElectricalSeriesData.model_rebuild()
SpikeEventSeries.model_rebuild()
SpikeEventSeriesData.model_rebuild()
FeatureExtraction.model_rebuild()
EventDetection.model_rebuild()
EventWaveform.model_rebuild()

View file

@ -36,7 +36,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -33,7 +33,12 @@ from ...core.v2_4_0.core_nwb_icephys import (
from ...core.v2_4_0.core_nwb_misc import Units
from ...core.v2_4_0.core_nwb_ogen import OptogeneticStimulusSite
from ...core.v2_4_0.core_nwb_ophys import ImagingPlane
from ...hdmf_common.v1_5_0.hdmf_common_table import DynamicTable, ElementIdentifiers, VectorData
from ...hdmf_common.v1_5_0.hdmf_common_table import (
DynamicTable,
ElementIdentifiers,
VectorData,
VectorIndex,
)
metamodel_version = "None"
@ -44,7 +49,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -45,7 +45,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,
@ -227,6 +227,20 @@ class PatchClampSeriesData(ConfiguredBaseModel):
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
continuity: Optional[str] = Field(
None,
description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""",
)
conversion: Optional[float] = Field(
1.0,
description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(1.0)"}},
)
resolution: Optional[float] = Field(
-1.0,
description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(-1.0)"}},
)
unit: str = Field(
...,
description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""",
@ -246,12 +260,12 @@ class CurrentClampSeries(PatchClampSeries):
)
name: str = Field(...)
data: CurrentClampSeriesData = Field(..., description="""Recorded voltage.""")
bias_current: Optional[float] = Field(None, description="""Bias current, in amps.""")
bridge_balance: Optional[float] = Field(None, description="""Bridge balance, in ohms.""")
capacitance_compensation: Optional[float] = Field(
None, description="""Capacitance compensation, in farads."""
)
data: CurrentClampSeriesData = Field(..., description="""Recorded voltage.""")
stimulus_description: str = Field(
..., description="""Protocol/stimulus name for this patch-clamp dataset."""
)
@ -319,12 +333,28 @@ class CurrentClampSeriesData(ConfiguredBaseModel):
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
continuity: Optional[str] = Field(
None,
description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""",
)
conversion: Optional[float] = Field(
1.0,
description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(1.0)"}},
)
resolution: Optional[float] = Field(
-1.0,
description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(-1.0)"}},
)
unit: Literal["volts"] = Field(
"volts",
description="""Base unit of measurement for working with the data. which is fixed to 'volts'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""",
json_schema_extra={"linkml_meta": {"equals_string": "volts", "ifabsent": "string(volts)"}},
)
value: Any = Field(...)
value: Optional[NDArray[Shape["* num_times"], float]] = Field(
None, json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}
)
class IZeroClampSeries(CurrentClampSeries):
@ -479,6 +509,20 @@ class CurrentClampStimulusSeriesData(ConfiguredBaseModel):
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
continuity: Optional[str] = Field(
None,
description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""",
)
conversion: Optional[float] = Field(
1.0,
description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(1.0)"}},
)
resolution: Optional[float] = Field(
-1.0,
description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(-1.0)"}},
)
unit: Literal["amperes"] = Field(
"amperes",
description="""Base unit of measurement for working with the data. which is fixed to 'amperes'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""",
@ -486,7 +530,9 @@ class CurrentClampStimulusSeriesData(ConfiguredBaseModel):
"linkml_meta": {"equals_string": "amperes", "ifabsent": "string(amperes)"}
},
)
value: Any = Field(...)
value: Optional[NDArray[Shape["* num_times"], float]] = Field(
None, json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}
)
class VoltageClampSeries(PatchClampSeries):
@ -499,13 +545,13 @@ class VoltageClampSeries(PatchClampSeries):
)
name: str = Field(...)
data: VoltageClampSeriesData = Field(..., description="""Recorded current.""")
capacitance_fast: Optional[VoltageClampSeriesCapacitanceFast] = Field(
None, description="""Fast capacitance, in farads."""
)
capacitance_slow: Optional[VoltageClampSeriesCapacitanceSlow] = Field(
None, description="""Slow capacitance, in farads."""
)
data: VoltageClampSeriesData = Field(..., description="""Recorded current.""")
resistance_comp_bandwidth: Optional[VoltageClampSeriesResistanceCompBandwidth] = Field(
None, description="""Resistance compensation bandwidth, in hertz."""
)
@ -577,27 +623,6 @@ class VoltageClampSeries(PatchClampSeries):
)
class VoltageClampSeriesData(ConfiguredBaseModel):
"""
Recorded current.
"""
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)"}},
)
unit: Literal["amperes"] = Field(
"amperes",
description="""Base unit of measurement for working with the data. which is fixed to 'amperes'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""",
json_schema_extra={
"linkml_meta": {"equals_string": "amperes", "ifabsent": "string(amperes)"}
},
)
value: Any = Field(...)
class VoltageClampSeriesCapacitanceFast(ConfiguredBaseModel):
"""
Fast capacitance, in farads.
@ -650,6 +675,43 @@ class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel):
value: float = Field(...)
class VoltageClampSeriesData(ConfiguredBaseModel):
"""
Recorded current.
"""
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)"}},
)
continuity: Optional[str] = Field(
None,
description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""",
)
conversion: Optional[float] = Field(
1.0,
description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(1.0)"}},
)
resolution: Optional[float] = Field(
-1.0,
description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(-1.0)"}},
)
unit: Literal["amperes"] = Field(
"amperes",
description="""Base unit of measurement for working with the data. which is fixed to 'amperes'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""",
json_schema_extra={
"linkml_meta": {"equals_string": "amperes", "ifabsent": "string(amperes)"}
},
)
value: Optional[NDArray[Shape["* num_times"], float]] = Field(
None, json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}
)
class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel):
"""
Resistance compensation bandwidth, in hertz.
@ -854,12 +916,28 @@ class VoltageClampStimulusSeriesData(ConfiguredBaseModel):
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
continuity: Optional[str] = Field(
None,
description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""",
)
conversion: Optional[float] = Field(
1.0,
description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(1.0)"}},
)
resolution: Optional[float] = Field(
-1.0,
description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(-1.0)"}},
)
unit: Literal["volts"] = Field(
"volts",
description="""Base unit of measurement for working with the data. which is fixed to 'volts'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""",
json_schema_extra={"linkml_meta": {"equals_string": "volts", "ifabsent": "string(volts)"}},
)
value: Any = Field(...)
value: Optional[NDArray[Shape["* num_times"], float]] = Field(
None, json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}
)
class IntracellularElectrode(NWBContainer):
@ -909,15 +987,6 @@ class SweepTable(DynamicTable):
)
name: str = Field(...)
sweep_number: VectorData[NDArray[Any, int]] = Field(
...,
description="""Sweep number of the PatchClampSeries in that row.""",
json_schema_extra={
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
series: VectorData[NDArray[Any, PatchClampSeries]] = Field(
...,
description="""The PatchClampSeries with the sweep number in that row.""",
@ -939,6 +1008,15 @@ class SweepTable(DynamicTable):
}
},
)
sweep_number: VectorData[NDArray[Any, int]] = Field(
...,
description="""Sweep number of the PatchClampSeries in that row.""",
json_schema_extra={
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
colnames: List[str] = Field(
...,
description="""The names of the columns in this table. This should be used to specify an order to the columns.""",
@ -1120,12 +1198,12 @@ class IntracellularRecordingsTable(AlignedDynamicTable):
electrodes: IntracellularElectrodesTable = Field(
..., description="""Table for storing intracellular electrode related metadata."""
)
stimuli: IntracellularStimuliTable = Field(
..., description="""Table for storing intracellular stimulus related metadata."""
)
responses: IntracellularResponsesTable = Field(
..., description="""Table for storing intracellular response related metadata."""
)
stimuli: IntracellularStimuliTable = Field(
..., description="""Table for storing intracellular stimulus related metadata."""
)
value: Optional[Dict[str, DynamicTable]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "DynamicTable"}]}}
)
@ -1465,9 +1543,9 @@ IZeroClampSeries.model_rebuild()
CurrentClampStimulusSeries.model_rebuild()
CurrentClampStimulusSeriesData.model_rebuild()
VoltageClampSeries.model_rebuild()
VoltageClampSeriesData.model_rebuild()
VoltageClampSeriesCapacitanceFast.model_rebuild()
VoltageClampSeriesCapacitanceSlow.model_rebuild()
VoltageClampSeriesData.model_rebuild()
VoltageClampSeriesResistanceCompBandwidth.model_rebuild()
VoltageClampSeriesResistanceCompCorrection.model_rebuild()
VoltageClampSeriesResistanceCompPrediction.model_rebuild()

View file

@ -23,7 +23,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,
@ -198,9 +198,7 @@ class ImageSeries(TimeSeries):
)
name: str = Field(...)
data: Union[
NDArray[Shape["* frame, * x, * y"], float], NDArray[Shape["* frame, * x, * y, * z"], float]
] = Field(
data: ImageSeriesData = Field(
...,
description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""",
)
@ -214,8 +212,9 @@ class ImageSeries(TimeSeries):
description="""Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.""",
)
format: Optional[str] = Field(
None,
"raw",
description="""Format of image. If this is 'external', then the attribute 'external_file' contains the path information to the image files. If this is 'raw', then the raw (single-channel) binary data is stored in the 'data' dataset. If this attribute is not present, then the default format='raw' case is assumed.""",
json_schema_extra={"linkml_meta": {"ifabsent": "string(raw)"}},
)
device: Optional[Union[Device, str]] = Field(
None,
@ -263,6 +262,43 @@ class ImageSeries(TimeSeries):
)
class ImageSeriesData(ConfiguredBaseModel):
"""
Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image"})
name: Literal["data"] = Field(
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
conversion: Optional[float] = Field(
1.0,
description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(1.0)"}},
)
resolution: Optional[float] = Field(
-1.0,
description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(-1.0)"}},
)
unit: str = Field(
...,
description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""",
)
continuity: Optional[str] = Field(
None,
description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""",
)
value: Optional[
Union[
NDArray[Shape["* frame, * x, * y"], float],
NDArray[Shape["* frame, * x, * y, * z"], float],
]
] = Field(None)
class ImageSeriesExternalFile(ConfiguredBaseModel):
"""
Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.
@ -304,9 +340,7 @@ class ImageMaskSeries(ImageSeries):
}
},
)
data: Union[
NDArray[Shape["* frame, * x, * y"], float], NDArray[Shape["* frame, * x, * y, * z"], float]
] = Field(
data: ImageSeriesData = Field(
...,
description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""",
)
@ -320,8 +354,9 @@ class ImageMaskSeries(ImageSeries):
description="""Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.""",
)
format: Optional[str] = Field(
None,
"raw",
description="""Format of image. If this is 'external', then the attribute 'external_file' contains the path information to the image files. If this is 'raw', then the raw (single-channel) binary data is stored in the 'data' dataset. If this attribute is not present, then the default format='raw' case is assumed.""",
json_schema_extra={"linkml_meta": {"ifabsent": "string(raw)"}},
)
device: Optional[Union[Device, str]] = Field(
None,
@ -379,6 +414,9 @@ class OpticalSeries(ImageSeries):
)
name: str = Field(...)
data: OpticalSeriesData = Field(
..., description="""Images presented to subject, either grayscale or RGB"""
)
distance: Optional[float] = Field(
None, description="""Distance from camera/monitor to target/eye."""
)
@ -387,10 +425,6 @@ class OpticalSeries(ImageSeries):
NDArray[Shape["2 width_height"], float], NDArray[Shape["3 width_height_depth"], float]
]
] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""")
data: Union[
NDArray[Shape["* frame, * x, * y"], float],
NDArray[Shape["* frame, * x, * y, 3 r_g_b"], float],
] = Field(..., description="""Images presented to subject, either grayscale or RGB""")
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.""",
@ -405,8 +439,9 @@ class OpticalSeries(ImageSeries):
description="""Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.""",
)
format: Optional[str] = Field(
None,
"raw",
description="""Format of image. If this is 'external', then the attribute 'external_file' contains the path information to the image files. If this is 'raw', then the raw (single-channel) binary data is stored in the 'data' dataset. If this attribute is not present, then the default format='raw' case is assumed.""",
json_schema_extra={"linkml_meta": {"ifabsent": "string(raw)"}},
)
device: Optional[Union[Device, str]] = Field(
None,
@ -454,6 +489,43 @@ class OpticalSeries(ImageSeries):
)
class OpticalSeriesData(ConfiguredBaseModel):
"""
Images presented to subject, either grayscale or RGB
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image"})
name: Literal["data"] = Field(
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
continuity: Optional[str] = Field(
None,
description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""",
)
conversion: Optional[float] = Field(
1.0,
description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(1.0)"}},
)
resolution: Optional[float] = Field(
-1.0,
description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(-1.0)"}},
)
unit: str = Field(
...,
description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""",
)
value: Optional[
Union[
NDArray[Shape["* frame, * x, * y"], float],
NDArray[Shape["* frame, * x, * y, 3 r_g_b"], float],
]
] = Field(None)
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.
@ -464,10 +536,8 @@ class IndexSeries(TimeSeries):
)
name: str = Field(...)
data: NDArray[Shape["* num_times"], int] = Field(
...,
description="""Index of the frame in the referenced ImageSeries.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}},
data: IndexSeriesData = Field(
..., description="""Index of the frame in the referenced ImageSeries."""
)
indexed_timeseries: Union[ImageSeries, str] = Field(
...,
@ -515,13 +585,50 @@ class IndexSeries(TimeSeries):
)
class IndexSeriesData(ConfiguredBaseModel):
"""
Index of the frame in the referenced ImageSeries.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image"})
name: Literal["data"] = Field(
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
conversion: Optional[float] = Field(
1.0,
description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(1.0)"}},
)
resolution: Optional[float] = Field(
-1.0,
description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(-1.0)"}},
)
unit: str = Field(
...,
description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""",
)
continuity: Optional[str] = Field(
None,
description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""",
)
value: Optional[NDArray[Shape["* num_times"], int]] = Field(
None, json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}
)
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
GrayscaleImage.model_rebuild()
RGBImage.model_rebuild()
RGBAImage.model_rebuild()
ImageSeries.model_rebuild()
ImageSeriesData.model_rebuild()
ImageSeriesExternalFile.model_rebuild()
ImageMaskSeries.model_rebuild()
OpticalSeries.model_rebuild()
OpticalSeriesData.model_rebuild()
IndexSeries.model_rebuild()
IndexSeriesData.model_rebuild()

View file

@ -38,7 +38,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,
@ -213,6 +213,20 @@ class AbstractFeatureSeriesData(ConfiguredBaseModel):
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
continuity: Optional[str] = Field(
None,
description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""",
)
conversion: Optional[float] = Field(
1.0,
description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(1.0)"}},
)
resolution: Optional[float] = Field(
-1.0,
description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(-1.0)"}},
)
unit: Optional[str] = Field(
"see ",
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'\".""",
@ -236,10 +250,8 @@ class AnnotationSeries(TimeSeries):
)
name: str = Field(...)
data: NDArray[Shape["* num_times"], str] = Field(
...,
description="""Annotations made during an experiment.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}},
data: AnnotationSeriesData = Field(
..., description="""Annotations made during an experiment."""
)
description: Optional[str] = Field(
"no description",
@ -278,6 +290,43 @@ class AnnotationSeries(TimeSeries):
)
class AnnotationSeriesData(ConfiguredBaseModel):
"""
Annotations made during an experiment.
"""
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)"}},
)
continuity: Optional[str] = Field(
None,
description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""",
)
conversion: Optional[float] = Field(
1.0,
description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(1.0)"}},
)
resolution: float = Field(
-1.0,
description="""Smallest meaningful difference between values in data. Annotations have no units, so the value is fixed to -1.0.""",
le=-1,
ge=-1,
json_schema_extra={"linkml_meta": {"ifabsent": "float(-1.0)"}},
)
unit: Literal["n/a"] = Field(
"n/a",
description="""Base unit of measurement for working with the data. Annotations have no units, so the value is fixed to 'n/a'.""",
json_schema_extra={"linkml_meta": {"equals_string": "n/a", "ifabsent": "string(n/a)"}},
)
value: Optional[NDArray[Shape["* num_times"], str]] = Field(
None, json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}
)
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.
@ -288,10 +337,8 @@ class IntervalSeries(TimeSeries):
)
name: str = Field(...)
data: NDArray[Shape["* num_times"], int] = Field(
...,
description="""Use values >0 if interval started, <0 if interval ended.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}},
data: IntervalSeriesData = Field(
..., description="""Use values >0 if interval started, <0 if interval ended."""
)
description: Optional[str] = Field(
"no description",
@ -330,6 +377,43 @@ class IntervalSeries(TimeSeries):
)
class IntervalSeriesData(ConfiguredBaseModel):
"""
Use values >0 if interval started, <0 if interval ended.
"""
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)"}},
)
continuity: Optional[str] = Field(
None,
description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""",
)
conversion: Optional[float] = Field(
1.0,
description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(1.0)"}},
)
resolution: float = Field(
-1.0,
description="""Smallest meaningful difference between values in data. Annotations have no units, so the value is fixed to -1.0.""",
le=-1,
ge=-1,
json_schema_extra={"linkml_meta": {"ifabsent": "float(-1.0)"}},
)
unit: Literal["n/a"] = Field(
"n/a",
description="""Base unit of measurement for working with the data. Annotations have no units, so the value is fixed to 'n/a'.""",
json_schema_extra={"linkml_meta": {"equals_string": "n/a", "ifabsent": "string(n/a)"}},
)
value: Optional[NDArray[Shape["* num_times"], int]] = Field(
None, json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}
)
class DecompositionSeries(TimeSeries):
"""
Spectral analysis of a time series, e.g. of an LFP or a speech signal.
@ -417,6 +501,20 @@ class DecompositionSeriesData(ConfiguredBaseModel):
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
continuity: Optional[str] = Field(
None,
description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""",
)
conversion: Optional[float] = Field(
1.0,
description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(1.0)"}},
)
resolution: Optional[float] = Field(
-1.0,
description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(-1.0)"}},
)
unit: str = Field(
"no unit",
description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""",
@ -504,9 +602,18 @@ class Units(DynamicTable):
)
name: str = Field("Units", json_schema_extra={"linkml_meta": {"ifabsent": "string(Units)"}})
spike_times_index: Optional[Named[VectorIndex]] = Field(
electrode_group: Optional[VectorData[NDArray[Any, ElectrodeGroup]]] = Field(
None,
description="""Index into the spike_times dataset.""",
description="""Electrode group that each spike unit came from.""",
json_schema_extra={
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
electrodes: Optional[Named[DynamicTableRegion]] = Field(
None,
description="""Electrode that each spike unit came from, specified using a DynamicTableRegion.""",
json_schema_extra={
"linkml_meta": {
"annotations": {
@ -516,12 +623,9 @@ class Units(DynamicTable):
}
},
)
spike_times: Optional[UnitsSpikeTimes] = Field(
None, description="""Spike times for each unit."""
)
obs_intervals_index: Optional[Named[VectorIndex]] = Field(
electrodes_index: Optional[Named[VectorIndex]] = Field(
None,
description="""Index into the obs_intervals dataset.""",
description="""Index into electrodes.""",
json_schema_extra={
"linkml_meta": {
"annotations": {
@ -547,9 +651,9 @@ class Units(DynamicTable):
},
)
)
electrodes_index: Optional[Named[VectorIndex]] = Field(
obs_intervals_index: Optional[Named[VectorIndex]] = Field(
None,
description="""Index into electrodes.""",
description="""Index into the obs_intervals dataset.""",
json_schema_extra={
"linkml_meta": {
"annotations": {
@ -559,9 +663,12 @@ class Units(DynamicTable):
}
},
)
electrodes: Optional[Named[DynamicTableRegion]] = Field(
spike_times: Optional[UnitsSpikeTimes] = Field(
None, description="""Spike times for each unit."""
)
spike_times_index: Optional[Named[VectorIndex]] = Field(
None,
description="""Electrode that each spike unit came from, specified using a DynamicTableRegion.""",
description="""Index into the spike_times dataset.""",
json_schema_extra={
"linkml_meta": {
"annotations": {
@ -571,41 +678,15 @@ class Units(DynamicTable):
}
},
)
electrode_group: Optional[VectorData[NDArray[Any, ElectrodeGroup]]] = Field(
None,
description="""Electrode group that each spike unit came from.""",
json_schema_extra={
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
waveform_mean: Optional[UnitsWaveformMean] = Field(
None, description="""Spike waveform mean for each spike unit."""
)
waveform_mean: Optional[
VectorData[
Union[
NDArray[Shape["* num_units, * num_samples"], float],
NDArray[Shape["* num_units, * num_samples, * num_electrodes"], float],
]
]
] = Field(None, description="""Spike waveform mean for each spike unit.""")
waveform_sd: Optional[
VectorData[
Union[
NDArray[Shape["* num_units, * num_samples"], float],
NDArray[Shape["* num_units, * num_samples, * num_electrodes"], float],
]
]
] = Field(None, description="""Spike waveform standard deviation for each spike unit.""")
waveforms: Optional[VectorData[NDArray[Shape["* num_waveforms, * num_samples"], float]]] = (
Field(
None,
description="""Individual waveforms for each spike on each electrode. This is a doubly indexed column. The 'waveforms_index' column indexes which waveforms in this column belong to the same spike event for a given unit, where each waveform was recorded from a different electrode. The 'waveforms_index_index' column indexes the 'waveforms_index' column to indicate which spike events belong to a given unit. For example, if the 'waveforms_index_index' column has values [2, 5, 6], then the first 2 elements of the 'waveforms_index' column correspond to the 2 spike events of the first unit, the next 3 elements of the 'waveforms_index' column correspond to the 3 spike events of the second unit, and the next 1 element of the 'waveforms_index' column corresponds to the 1 spike event of the third unit. If the 'waveforms_index' column has values [3, 6, 8, 10, 12, 13], then the first 3 elements of the 'waveforms' column contain the 3 spike waveforms that were recorded from 3 different electrodes for the first spike time of the first unit. See https://nwb-schema.readthedocs.io/en/stable/format_description.html#doubly-ragged-arrays for a graphical representation of this example. When there is only one electrode for each unit (i.e., each spike time is associated with a single waveform), then the 'waveforms_index' column will have values 1, 2, ..., N, where N is the number of spike events. The number of electrodes for each spike event should be the same within a given unit. The 'electrodes' column should be used to indicate which electrodes are associated with each unit, and the order of the waveforms within a given unit x spike event should be in the same order as the electrodes referenced in the 'electrodes' column of this table. The number of samples for each waveform must be the same.""",
json_schema_extra={
"linkml_meta": {
"array": {"dimensions": [{"alias": "num_waveforms"}, {"alias": "num_samples"}]}
}
},
)
waveform_sd: Optional[UnitsWaveformSd] = Field(
None, description="""Spike waveform standard deviation for each spike unit."""
)
waveforms: Optional[UnitsWaveforms] = Field(
None,
description="""Individual waveforms for each spike on each electrode. This is a doubly indexed column. The 'waveforms_index' column indexes which waveforms in this column belong to the same spike event for a given unit, where each waveform was recorded from a different electrode. The 'waveforms_index_index' column indexes the 'waveforms_index' column to indicate which spike events belong to a given unit. For example, if the 'waveforms_index_index' column has values [2, 5, 6], then the first 2 elements of the 'waveforms_index' column correspond to the 2 spike events of the first unit, the next 3 elements of the 'waveforms_index' column correspond to the 3 spike events of the second unit, and the next 1 element of the 'waveforms_index' column corresponds to the 1 spike event of the third unit. If the 'waveforms_index' column has values [3, 6, 8, 10, 12, 13], then the first 3 elements of the 'waveforms' column contain the 3 spike waveforms that were recorded from 3 different electrodes for the first spike time of the first unit. See https://nwb-schema.readthedocs.io/en/stable/format_description.html#doubly-ragged-arrays for a graphical representation of this example. When there is only one electrode for each unit (i.e., each spike time is associated with a single waveform), then the 'waveforms_index' column will have values 1, 2, ..., N, where N is the number of spike events. The number of electrodes for each spike event should be the same within a given unit. The 'electrodes' column should be used to indicate which electrodes are associated with each unit, and the order of the waveforms within a given unit x spike event should be in the same order as the electrodes referenced in the 'electrodes' column of this table. The number of samples for each waveform must be the same.""",
)
waveforms_index: Optional[Named[VectorIndex]] = Field(
None,
@ -671,14 +752,109 @@ class UnitsSpikeTimes(VectorData):
] = Field(None)
class UnitsWaveformMean(VectorData):
"""
Spike waveform mean for each spike unit.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"})
name: Literal["waveform_mean"] = Field(
"waveform_mean",
json_schema_extra={
"linkml_meta": {"equals_string": "waveform_mean", "ifabsent": "string(waveform_mean)"}
},
)
sampling_rate: Optional[float] = Field(None, description="""Sampling rate, in hertz.""")
unit: Optional[Literal["volts"]] = Field(
"volts",
description="""Unit of measurement. This value is fixed to 'volts'.""",
json_schema_extra={"linkml_meta": {"equals_string": "volts", "ifabsent": "string(volts)"}},
)
description: str = Field(..., description="""Description of what these vectors represent.""")
value: Optional[
Union[
NDArray[Shape["* dim0"], Any],
NDArray[Shape["* dim0, * dim1"], Any],
NDArray[Shape["* dim0, * dim1, * dim2"], Any],
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any],
]
] = Field(None)
class UnitsWaveformSd(VectorData):
"""
Spike waveform standard deviation for each spike unit.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"})
name: Literal["waveform_sd"] = Field(
"waveform_sd",
json_schema_extra={
"linkml_meta": {"equals_string": "waveform_sd", "ifabsent": "string(waveform_sd)"}
},
)
sampling_rate: Optional[float] = Field(None, description="""Sampling rate, in hertz.""")
unit: Optional[Literal["volts"]] = Field(
"volts",
description="""Unit of measurement. This value is fixed to 'volts'.""",
json_schema_extra={"linkml_meta": {"equals_string": "volts", "ifabsent": "string(volts)"}},
)
description: str = Field(..., description="""Description of what these vectors represent.""")
value: Optional[
Union[
NDArray[Shape["* dim0"], Any],
NDArray[Shape["* dim0, * dim1"], Any],
NDArray[Shape["* dim0, * dim1, * dim2"], Any],
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any],
]
] = Field(None)
class UnitsWaveforms(VectorData):
"""
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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"})
name: Literal["waveforms"] = Field(
"waveforms",
json_schema_extra={
"linkml_meta": {"equals_string": "waveforms", "ifabsent": "string(waveforms)"}
},
)
sampling_rate: Optional[float] = Field(None, description="""Sampling rate, in hertz.""")
unit: Optional[Literal["volts"]] = Field(
"volts",
description="""Unit of measurement. This value is fixed to 'volts'.""",
json_schema_extra={"linkml_meta": {"equals_string": "volts", "ifabsent": "string(volts)"}},
)
description: str = Field(..., description="""Description of what these vectors represent.""")
value: Optional[
Union[
NDArray[Shape["* dim0"], Any],
NDArray[Shape["* dim0, * dim1"], Any],
NDArray[Shape["* dim0, * dim1, * dim2"], Any],
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any],
]
] = Field(None)
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
AbstractFeatureSeries.model_rebuild()
AbstractFeatureSeriesData.model_rebuild()
AnnotationSeries.model_rebuild()
AnnotationSeriesData.model_rebuild()
IntervalSeries.model_rebuild()
IntervalSeriesData.model_rebuild()
DecompositionSeries.model_rebuild()
DecompositionSeriesData.model_rebuild()
DecompositionSeriesBands.model_rebuild()
Units.model_rebuild()
UnitsSpikeTimes.model_rebuild()
UnitsWaveformMean.model_rebuild()
UnitsWaveformSd.model_rebuild()
UnitsWaveforms.model_rebuild()

View file

@ -28,7 +28,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,
@ -121,10 +121,8 @@ class OptogeneticSeries(TimeSeries):
)
name: str = Field(...)
data: NDArray[Shape["* num_times"], float] = Field(
...,
description="""Applied power for optogenetic stimulus, in watts.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}},
data: OptogeneticSeriesData = Field(
..., description="""Applied power for optogenetic stimulus, in watts."""
)
site: Union[OptogeneticStimulusSite, str] = Field(
...,
@ -172,6 +170,41 @@ class OptogeneticSeries(TimeSeries):
)
class OptogeneticSeriesData(ConfiguredBaseModel):
"""
Applied power for optogenetic stimulus, in watts.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ogen"})
name: Literal["data"] = Field(
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
continuity: Optional[str] = Field(
None,
description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""",
)
conversion: Optional[float] = Field(
1.0,
description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(1.0)"}},
)
resolution: Optional[float] = Field(
-1.0,
description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(-1.0)"}},
)
unit: Literal["watts"] = Field(
"watts",
description="""Unit of measurement for data, which is fixed to 'watts'.""",
json_schema_extra={"linkml_meta": {"equals_string": "watts", "ifabsent": "string(watts)"}},
)
value: Optional[NDArray[Shape["* num_times"], float]] = Field(
None, json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}
)
class OptogeneticStimulusSite(NWBContainer):
"""
A site of optogenetic stimulation.
@ -202,4 +235,5 @@ class OptogeneticStimulusSite(NWBContainer):
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
OptogeneticSeries.model_rebuild()
OptogeneticSeriesData.model_rebuild()
OptogeneticStimulusSite.model_rebuild()

View file

@ -27,7 +27,7 @@ from ...core.v2_4_0.core_nwb_base import (
TimeSeriesSync,
)
from ...core.v2_4_0.core_nwb_device import Device
from ...core.v2_4_0.core_nwb_image import ImageSeries, ImageSeriesExternalFile
from ...core.v2_4_0.core_nwb_image import ImageSeries, ImageSeriesData, ImageSeriesExternalFile
from ...hdmf_common.v1_5_0.hdmf_common_table import (
DynamicTable,
DynamicTableRegion,
@ -45,7 +45,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,
@ -179,9 +179,7 @@ class TwoPhotonSeries(ImageSeries):
}
},
)
data: Union[
NDArray[Shape["* frame, * x, * y"], float], NDArray[Shape["* frame, * x, * y, * z"], float]
] = Field(
data: ImageSeriesData = Field(
...,
description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""",
)
@ -195,8 +193,9 @@ class TwoPhotonSeries(ImageSeries):
description="""Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.""",
)
format: Optional[str] = Field(
None,
"raw",
description="""Format of image. If this is 'external', then the attribute 'external_file' contains the path information to the image files. If this is 'raw', then the raw (single-channel) binary data is stored in the 'data' dataset. If this attribute is not present, then the default format='raw' case is assumed.""",
json_schema_extra={"linkml_meta": {"ifabsent": "string(raw)"}},
)
device: Optional[Union[Device, str]] = Field(
None,
@ -254,9 +253,7 @@ class RoiResponseSeries(TimeSeries):
)
name: str = Field(...)
data: Union[
NDArray[Shape["* num_times"], float], NDArray[Shape["* num_times, * num_rois"], float]
] = Field(..., description="""Signals from ROIs.""")
data: RoiResponseSeriesData = Field(..., description="""Signals from ROIs.""")
rois: Named[DynamicTableRegion] = Field(
...,
description="""DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries.""",
@ -306,6 +303,42 @@ class RoiResponseSeries(TimeSeries):
)
class RoiResponseSeriesData(ConfiguredBaseModel):
"""
Signals from ROIs.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ophys"})
name: Literal["data"] = Field(
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
conversion: Optional[float] = Field(
1.0,
description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(1.0)"}},
)
resolution: Optional[float] = Field(
-1.0,
description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(-1.0)"}},
)
unit: str = Field(
...,
description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""",
)
continuity: Optional[str] = Field(
None,
description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""",
)
value: Optional[
Union[
NDArray[Shape["* num_times"], float], NDArray[Shape["* num_times, * num_rois"], float]
]
] = Field(None)
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).
@ -372,6 +405,10 @@ class PlaneSegmentation(DynamicTable):
None,
description="""ROI masks for each ROI. Each image mask is the size of the original imaging plane (or volume) and members of the ROI are finite non-zero.""",
)
pixel_mask: Optional[PlaneSegmentationPixelMask] = Field(
None,
description="""Pixel masks for each ROI: a list of indices and weights for the ROI. Pixel masks are concatenated and parsing of this dataset is maintained by the PlaneSegmentation""",
)
pixel_mask_index: Optional[Named[VectorIndex]] = Field(
None,
description="""Index into pixel_mask.""",
@ -384,9 +421,9 @@ class PlaneSegmentation(DynamicTable):
}
},
)
pixel_mask: Optional[PlaneSegmentationPixelMask] = Field(
voxel_mask: Optional[PlaneSegmentationVoxelMask] = Field(
None,
description="""Pixel masks for each ROI: a list of indices and weights for the ROI. Pixel masks are concatenated and parsing of this dataset is maintained by the PlaneSegmentation""",
description="""Voxel masks for each ROI: a list of indices and weights for the ROI. Voxel masks are concatenated and parsing of this dataset is maintained by the PlaneSegmentation""",
)
voxel_mask_index: Optional[Named[VectorIndex]] = Field(
None,
@ -400,10 +437,6 @@ class PlaneSegmentation(DynamicTable):
}
},
)
voxel_mask: Optional[PlaneSegmentationVoxelMask] = Field(
None,
description="""Voxel masks for each ROI: a list of indices and weights for the ROI. Voxel masks are concatenated and parsing of this dataset is maintained by the PlaneSegmentation""",
)
reference_images: Optional[Dict[str, ImageSeries]] = Field(
None,
description="""Image stacks that the segmentation masks apply to.""",
@ -702,6 +735,7 @@ class CorrectedImageStack(NWBDataInterface):
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
TwoPhotonSeries.model_rebuild()
RoiResponseSeries.model_rebuild()
RoiResponseSeriesData.model_rebuild()
DfOverF.model_rebuild()
Fluorescence.model_rebuild()
ImageSegmentation.model_rebuild()

View file

@ -22,7 +22,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -39,6 +39,7 @@ from ...core.v2_4_0.core_nwb_ecephys import (
ClusterWaveforms,
Clustering,
ElectricalSeries,
ElectricalSeriesData,
ElectrodeGroup,
ElectrodeGroupPosition,
EventDetection,
@ -47,6 +48,7 @@ from ...core.v2_4_0.core_nwb_ecephys import (
FilteredEphys,
LFP,
SpikeEventSeries,
SpikeEventSeriesData,
)
from ...core.v2_4_0.core_nwb_epoch import TimeIntervals, TimeIntervalsTimeseries
from ...core.v2_4_0.core_nwb_file import (
@ -100,9 +102,12 @@ from ...core.v2_4_0.core_nwb_image import (
GrayscaleImage,
ImageMaskSeries,
ImageSeries,
ImageSeriesData,
ImageSeriesExternalFile,
IndexSeries,
IndexSeriesData,
OpticalSeries,
OpticalSeriesData,
RGBAImage,
RGBImage,
)
@ -110,14 +115,23 @@ from ...core.v2_4_0.core_nwb_misc import (
AbstractFeatureSeries,
AbstractFeatureSeriesData,
AnnotationSeries,
AnnotationSeriesData,
DecompositionSeries,
DecompositionSeriesBands,
DecompositionSeriesData,
IntervalSeries,
IntervalSeriesData,
Units,
UnitsSpikeTimes,
UnitsWaveformMean,
UnitsWaveformSd,
UnitsWaveforms,
)
from ...core.v2_4_0.core_nwb_ogen import (
OptogeneticSeries,
OptogeneticSeriesData,
OptogeneticStimulusSite,
)
from ...core.v2_4_0.core_nwb_ogen import OptogeneticSeries, OptogeneticStimulusSite
from ...core.v2_4_0.core_nwb_ophys import (
CorrectedImageStack,
DfOverF,
@ -133,6 +147,7 @@ from ...core.v2_4_0.core_nwb_ophys import (
PlaneSegmentationPixelMask,
PlaneSegmentationVoxelMask,
RoiResponseSeries,
RoiResponseSeriesData,
TwoPhotonSeries,
)
from ...core.v2_4_0.core_nwb_retinotopy import (
@ -174,7 +189,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -47,7 +47,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -28,7 +28,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,
@ -176,6 +176,24 @@ class SpatialSeriesData(ConfiguredBaseModel):
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
continuity: Optional[str] = Field(
None,
description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""",
)
conversion: Optional[float] = Field(
1.0,
description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(1.0)"}},
)
offset: Optional[float] = Field(
None,
description="""Scalar to add to the data after scaling by 'conversion' to finalize its coercion to the specified 'unit'. Two common examples of this include (a) data stored in an unsigned type that requires a shift after scaling to re-center the data, and (b) specialized recording devices that naturally cause a scalar offset with respect to the true units.""",
)
resolution: Optional[float] = Field(
-1.0,
description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(-1.0)"}},
)
unit: Optional[str] = Field(
"meters",
description="""Base unit of measurement for working with the data. The default value is 'meters'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion' and add 'offset'.""",

View file

@ -21,7 +21,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -38,7 +38,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,
@ -156,11 +156,12 @@ class ElectricalSeries(TimeSeries):
None,
description="""Filtering applied to all channels of the data. For example, if this ElectricalSeries represents high-pass-filtered data (also known as AP Band), then this value could be \"High-pass 4-pole Bessel filter at 500 Hz\". If this ElectricalSeries represents low-pass-filtered LFP data and the type of filter is unknown, then this value could be \"Low-pass filter at 300 Hz\". If a non-standard filter type is used, provide as much detail about the filter properties as possible.""",
)
data: Union[
NDArray[Shape["* num_times"], float],
NDArray[Shape["* num_times, * num_channels"], float],
NDArray[Shape["* num_times, * num_channels, * num_samples"], float],
] = Field(..., description="""Recorded voltage data.""")
channel_conversion: Optional[NDArray[Shape["* num_channels"], float]] = Field(
None,
description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_channels"}]}}},
)
data: ElectricalSeriesData = Field(..., description="""Recorded voltage data.""")
electrodes: Named[DynamicTableRegion] = Field(
...,
description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""",
@ -173,11 +174,6 @@ class ElectricalSeries(TimeSeries):
}
},
)
channel_conversion: Optional[NDArray[Shape["* num_channels"], float]] = Field(
None,
description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_channels"}]}}},
)
description: Optional[str] = Field(
"no description",
description="""Description of the time series.""",
@ -215,6 +211,49 @@ class ElectricalSeries(TimeSeries):
)
class ElectricalSeriesData(ConfiguredBaseModel):
"""
Recorded voltage data.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys"})
name: Literal["data"] = Field(
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
continuity: Optional[str] = Field(
None,
description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""",
)
conversion: Optional[float] = Field(
1.0,
description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(1.0)"}},
)
offset: Optional[float] = Field(
None,
description="""Scalar to add to the data after scaling by 'conversion' to finalize its coercion to the specified 'unit'. Two common examples of this include (a) data stored in an unsigned type that requires a shift after scaling to re-center the data, and (b) specialized recording devices that naturally cause a scalar offset with respect to the true units.""",
)
resolution: Optional[float] = Field(
-1.0,
description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(-1.0)"}},
)
unit: Literal["volts"] = Field(
"volts",
description="""Base unit of measurement for working with the data. This value is fixed to 'volts'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion', followed by 'channel_conversion' (if present), and then add 'offset'.""",
json_schema_extra={"linkml_meta": {"equals_string": "volts", "ifabsent": "string(volts)"}},
)
value: Optional[
Union[
NDArray[Shape["* num_times"], float],
NDArray[Shape["* num_times, * num_channels"], float],
NDArray[Shape["* num_times, * num_channels, * num_samples"], float],
]
] = Field(None)
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).
@ -225,10 +264,7 @@ class SpikeEventSeries(ElectricalSeries):
)
name: str = Field(...)
data: Union[
NDArray[Shape["* num_events, * num_samples"], float],
NDArray[Shape["* num_events, * num_channels, * num_samples"], float],
] = Field(..., description="""Spike waveforms.""")
data: SpikeEventSeriesData = Field(..., description="""Spike waveforms.""")
timestamps: NDArray[Shape["* num_times"], float] = Field(
...,
description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time. Timestamps are required for the events. Unlike for TimeSeries, timestamps are required for SpikeEventSeries and are thus re-specified here.""",
@ -238,6 +274,11 @@ class SpikeEventSeries(ElectricalSeries):
None,
description="""Filtering applied to all channels of the data. For example, if this ElectricalSeries represents high-pass-filtered data (also known as AP Band), then this value could be \"High-pass 4-pole Bessel filter at 500 Hz\". If this ElectricalSeries represents low-pass-filtered LFP data and the type of filter is unknown, then this value could be \"Low-pass filter at 300 Hz\". If a non-standard filter type is used, provide as much detail about the filter properties as possible.""",
)
channel_conversion: Optional[NDArray[Shape["* num_channels"], float]] = Field(
None,
description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_channels"}]}}},
)
electrodes: Named[DynamicTableRegion] = Field(
...,
description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""",
@ -250,11 +291,6 @@ class SpikeEventSeries(ElectricalSeries):
}
},
)
channel_conversion: Optional[NDArray[Shape["* num_channels"], float]] = Field(
None,
description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_channels"}]}}},
)
description: Optional[str] = Field(
"no description",
description="""Description of the time series.""",
@ -287,6 +323,48 @@ class SpikeEventSeries(ElectricalSeries):
)
class SpikeEventSeriesData(ConfiguredBaseModel):
"""
Spike waveforms.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.ecephys"})
name: Literal["data"] = Field(
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
continuity: Optional[str] = Field(
None,
description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""",
)
conversion: Optional[float] = Field(
1.0,
description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(1.0)"}},
)
offset: Optional[float] = Field(
None,
description="""Scalar to add to the data after scaling by 'conversion' to finalize its coercion to the specified 'unit'. Two common examples of this include (a) data stored in an unsigned type that requires a shift after scaling to re-center the data, and (b) specialized recording devices that naturally cause a scalar offset with respect to the true units.""",
)
resolution: Optional[float] = Field(
-1.0,
description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(-1.0)"}},
)
unit: Literal["volts"] = Field(
"volts",
description="""Unit of measurement for waveforms, which is fixed to 'volts'.""",
json_schema_extra={"linkml_meta": {"equals_string": "volts", "ifabsent": "string(volts)"}},
)
value: Optional[
Union[
NDArray[Shape["* num_events, * num_samples"], float],
NDArray[Shape["* num_events, * num_channels, * num_samples"], float],
]
] = Field(None)
class FeatureExtraction(NWBDataInterface):
"""
Features, such as PC1 and PC2, that are extracted from signals stored in a SpikeEventSeries or other source.
@ -561,7 +639,9 @@ class Clustering(NWBDataInterface):
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
ElectricalSeries.model_rebuild()
ElectricalSeriesData.model_rebuild()
SpikeEventSeries.model_rebuild()
SpikeEventSeriesData.model_rebuild()
FeatureExtraction.model_rebuild()
EventDetection.model_rebuild()
EventWaveform.model_rebuild()

View file

@ -36,7 +36,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -34,7 +34,12 @@ from ...core.v2_5_0.core_nwb_icephys import (
from ...core.v2_5_0.core_nwb_misc import Units
from ...core.v2_5_0.core_nwb_ogen import OptogeneticStimulusSite
from ...core.v2_5_0.core_nwb_ophys import ImagingPlane
from ...hdmf_common.v1_5_0.hdmf_common_table import DynamicTable, ElementIdentifiers, VectorData
from ...hdmf_common.v1_5_0.hdmf_common_table import (
DynamicTable,
ElementIdentifiers,
VectorData,
VectorIndex,
)
metamodel_version = "None"
@ -45,7 +50,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,

View file

@ -45,7 +45,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,
@ -227,6 +227,24 @@ class PatchClampSeriesData(ConfiguredBaseModel):
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
continuity: Optional[str] = Field(
None,
description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""",
)
conversion: Optional[float] = Field(
1.0,
description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(1.0)"}},
)
offset: Optional[float] = Field(
None,
description="""Scalar to add to the data after scaling by 'conversion' to finalize its coercion to the specified 'unit'. Two common examples of this include (a) data stored in an unsigned type that requires a shift after scaling to re-center the data, and (b) specialized recording devices that naturally cause a scalar offset with respect to the true units.""",
)
resolution: Optional[float] = Field(
-1.0,
description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(-1.0)"}},
)
unit: str = Field(
...,
description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion' and add 'offset'.""",
@ -246,12 +264,12 @@ class CurrentClampSeries(PatchClampSeries):
)
name: str = Field(...)
data: CurrentClampSeriesData = Field(..., description="""Recorded voltage.""")
bias_current: Optional[float] = Field(None, description="""Bias current, in amps.""")
bridge_balance: Optional[float] = Field(None, description="""Bridge balance, in ohms.""")
capacitance_compensation: Optional[float] = Field(
None, description="""Capacitance compensation, in farads."""
)
data: CurrentClampSeriesData = Field(..., description="""Recorded voltage.""")
stimulus_description: str = Field(
..., description="""Protocol/stimulus name for this patch-clamp dataset."""
)
@ -319,12 +337,32 @@ class CurrentClampSeriesData(ConfiguredBaseModel):
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
continuity: Optional[str] = Field(
None,
description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""",
)
conversion: Optional[float] = Field(
1.0,
description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(1.0)"}},
)
offset: Optional[float] = Field(
None,
description="""Scalar to add to the data after scaling by 'conversion' to finalize its coercion to the specified 'unit'. Two common examples of this include (a) data stored in an unsigned type that requires a shift after scaling to re-center the data, and (b) specialized recording devices that naturally cause a scalar offset with respect to the true units.""",
)
resolution: Optional[float] = Field(
-1.0,
description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(-1.0)"}},
)
unit: Literal["volts"] = Field(
"volts",
description="""Base unit of measurement for working with the data. which is fixed to 'volts'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion' and add 'offset'.""",
json_schema_extra={"linkml_meta": {"equals_string": "volts", "ifabsent": "string(volts)"}},
)
value: Any = Field(...)
value: Optional[NDArray[Shape["* num_times"], float]] = Field(
None, json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}
)
class IZeroClampSeries(CurrentClampSeries):
@ -479,6 +517,24 @@ class CurrentClampStimulusSeriesData(ConfiguredBaseModel):
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
continuity: Optional[str] = Field(
None,
description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""",
)
conversion: Optional[float] = Field(
1.0,
description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(1.0)"}},
)
offset: Optional[float] = Field(
None,
description="""Scalar to add to the data after scaling by 'conversion' to finalize its coercion to the specified 'unit'. Two common examples of this include (a) data stored in an unsigned type that requires a shift after scaling to re-center the data, and (b) specialized recording devices that naturally cause a scalar offset with respect to the true units.""",
)
resolution: Optional[float] = Field(
-1.0,
description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(-1.0)"}},
)
unit: Literal["amperes"] = Field(
"amperes",
description="""Base unit of measurement for working with the data. which is fixed to 'amperes'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion' and add 'offset'.""",
@ -486,7 +542,9 @@ class CurrentClampStimulusSeriesData(ConfiguredBaseModel):
"linkml_meta": {"equals_string": "amperes", "ifabsent": "string(amperes)"}
},
)
value: Any = Field(...)
value: Optional[NDArray[Shape["* num_times"], float]] = Field(
None, json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}
)
class VoltageClampSeries(PatchClampSeries):
@ -499,13 +557,13 @@ class VoltageClampSeries(PatchClampSeries):
)
name: str = Field(...)
data: VoltageClampSeriesData = Field(..., description="""Recorded current.""")
capacitance_fast: Optional[VoltageClampSeriesCapacitanceFast] = Field(
None, description="""Fast capacitance, in farads."""
)
capacitance_slow: Optional[VoltageClampSeriesCapacitanceSlow] = Field(
None, description="""Slow capacitance, in farads."""
)
data: VoltageClampSeriesData = Field(..., description="""Recorded current.""")
resistance_comp_bandwidth: Optional[VoltageClampSeriesResistanceCompBandwidth] = Field(
None, description="""Resistance compensation bandwidth, in hertz."""
)
@ -577,27 +635,6 @@ class VoltageClampSeries(PatchClampSeries):
)
class VoltageClampSeriesData(ConfiguredBaseModel):
"""
Recorded current.
"""
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)"}},
)
unit: Literal["amperes"] = Field(
"amperes",
description="""Base unit of measurement for working with the data. which is fixed to 'amperes'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion' and add 'offset'.""",
json_schema_extra={
"linkml_meta": {"equals_string": "amperes", "ifabsent": "string(amperes)"}
},
)
value: Any = Field(...)
class VoltageClampSeriesCapacitanceFast(ConfiguredBaseModel):
"""
Fast capacitance, in farads.
@ -650,6 +687,47 @@ class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel):
value: float = Field(...)
class VoltageClampSeriesData(ConfiguredBaseModel):
"""
Recorded current.
"""
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)"}},
)
continuity: Optional[str] = Field(
None,
description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""",
)
conversion: Optional[float] = Field(
1.0,
description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(1.0)"}},
)
offset: Optional[float] = Field(
None,
description="""Scalar to add to the data after scaling by 'conversion' to finalize its coercion to the specified 'unit'. Two common examples of this include (a) data stored in an unsigned type that requires a shift after scaling to re-center the data, and (b) specialized recording devices that naturally cause a scalar offset with respect to the true units.""",
)
resolution: Optional[float] = Field(
-1.0,
description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(-1.0)"}},
)
unit: Literal["amperes"] = Field(
"amperes",
description="""Base unit of measurement for working with the data. which is fixed to 'amperes'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion' and add 'offset'.""",
json_schema_extra={
"linkml_meta": {"equals_string": "amperes", "ifabsent": "string(amperes)"}
},
)
value: Optional[NDArray[Shape["* num_times"], float]] = Field(
None, json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}
)
class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel):
"""
Resistance compensation bandwidth, in hertz.
@ -854,12 +932,32 @@ class VoltageClampStimulusSeriesData(ConfiguredBaseModel):
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
continuity: Optional[str] = Field(
None,
description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""",
)
conversion: Optional[float] = Field(
1.0,
description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(1.0)"}},
)
offset: Optional[float] = Field(
None,
description="""Scalar to add to the data after scaling by 'conversion' to finalize its coercion to the specified 'unit'. Two common examples of this include (a) data stored in an unsigned type that requires a shift after scaling to re-center the data, and (b) specialized recording devices that naturally cause a scalar offset with respect to the true units.""",
)
resolution: Optional[float] = Field(
-1.0,
description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(-1.0)"}},
)
unit: Literal["volts"] = Field(
"volts",
description="""Base unit of measurement for working with the data. which is fixed to 'volts'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion' and add 'offset'.""",
json_schema_extra={"linkml_meta": {"equals_string": "volts", "ifabsent": "string(volts)"}},
)
value: Any = Field(...)
value: Optional[NDArray[Shape["* num_times"], float]] = Field(
None, json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}
)
class IntracellularElectrode(NWBContainer):
@ -910,15 +1008,6 @@ class SweepTable(DynamicTable):
)
name: str = Field(...)
sweep_number: VectorData[NDArray[Any, int]] = Field(
...,
description="""Sweep number of the PatchClampSeries in that row.""",
json_schema_extra={
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
series: VectorData[NDArray[Any, PatchClampSeries]] = Field(
...,
description="""The PatchClampSeries with the sweep number in that row.""",
@ -940,6 +1029,15 @@ class SweepTable(DynamicTable):
}
},
)
sweep_number: VectorData[NDArray[Any, int]] = Field(
...,
description="""Sweep number of the PatchClampSeries in that row.""",
json_schema_extra={
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
colnames: List[str] = Field(
...,
description="""The names of the columns in this table. This should be used to specify an order to the columns.""",
@ -1121,12 +1219,12 @@ class IntracellularRecordingsTable(AlignedDynamicTable):
electrodes: IntracellularElectrodesTable = Field(
..., description="""Table for storing intracellular electrode related metadata."""
)
stimuli: IntracellularStimuliTable = Field(
..., description="""Table for storing intracellular stimulus related metadata."""
)
responses: IntracellularResponsesTable = Field(
..., description="""Table for storing intracellular response related metadata."""
)
stimuli: IntracellularStimuliTable = Field(
..., description="""Table for storing intracellular stimulus related metadata."""
)
value: Optional[Dict[str, DynamicTable]] = Field(
None, json_schema_extra={"linkml_meta": {"any_of": [{"range": "DynamicTable"}]}}
)
@ -1466,9 +1564,9 @@ IZeroClampSeries.model_rebuild()
CurrentClampStimulusSeries.model_rebuild()
CurrentClampStimulusSeriesData.model_rebuild()
VoltageClampSeries.model_rebuild()
VoltageClampSeriesData.model_rebuild()
VoltageClampSeriesCapacitanceFast.model_rebuild()
VoltageClampSeriesCapacitanceSlow.model_rebuild()
VoltageClampSeriesData.model_rebuild()
VoltageClampSeriesResistanceCompBandwidth.model_rebuild()
VoltageClampSeriesResistanceCompCorrection.model_rebuild()
VoltageClampSeriesResistanceCompPrediction.model_rebuild()

View file

@ -29,7 +29,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,
@ -204,9 +204,7 @@ class ImageSeries(TimeSeries):
)
name: str = Field(...)
data: Union[
NDArray[Shape["* frame, * x, * y"], float], NDArray[Shape["* frame, * x, * y, * z"], float]
] = Field(
data: ImageSeriesData = Field(
...,
description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""",
)
@ -220,8 +218,9 @@ class ImageSeries(TimeSeries):
description="""Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.""",
)
format: Optional[str] = Field(
None,
"raw",
description="""Format of image. If this is 'external', then the attribute 'external_file' contains the path information to the image files. If this is 'raw', then the raw (single-channel) binary data is stored in the 'data' dataset. If this attribute is not present, then the default format='raw' case is assumed.""",
json_schema_extra={"linkml_meta": {"ifabsent": "string(raw)"}},
)
device: Optional[Union[Device, str]] = Field(
None,
@ -269,6 +268,47 @@ class ImageSeries(TimeSeries):
)
class ImageSeriesData(ConfiguredBaseModel):
"""
Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image"})
name: Literal["data"] = Field(
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
conversion: Optional[float] = Field(
1.0,
description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(1.0)"}},
)
offset: Optional[float] = Field(
None,
description="""Scalar to add to the data after scaling by 'conversion' to finalize its coercion to the specified 'unit'. Two common examples of this include (a) data stored in an unsigned type that requires a shift after scaling to re-center the data, and (b) specialized recording devices that naturally cause a scalar offset with respect to the true units.""",
)
resolution: Optional[float] = Field(
-1.0,
description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(-1.0)"}},
)
unit: str = Field(
...,
description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion' and add 'offset'.""",
)
continuity: Optional[str] = Field(
None,
description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""",
)
value: Optional[
Union[
NDArray[Shape["* frame, * x, * y"], float],
NDArray[Shape["* frame, * x, * y, * z"], float],
]
] = Field(None)
class ImageSeriesExternalFile(ConfiguredBaseModel):
"""
Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.
@ -310,9 +350,7 @@ class ImageMaskSeries(ImageSeries):
}
},
)
data: Union[
NDArray[Shape["* frame, * x, * y"], float], NDArray[Shape["* frame, * x, * y, * z"], float]
] = Field(
data: ImageSeriesData = Field(
...,
description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""",
)
@ -326,8 +364,9 @@ class ImageMaskSeries(ImageSeries):
description="""Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.""",
)
format: Optional[str] = Field(
None,
"raw",
description="""Format of image. If this is 'external', then the attribute 'external_file' contains the path information to the image files. If this is 'raw', then the raw (single-channel) binary data is stored in the 'data' dataset. If this attribute is not present, then the default format='raw' case is assumed.""",
json_schema_extra={"linkml_meta": {"ifabsent": "string(raw)"}},
)
device: Optional[Union[Device, str]] = Field(
None,
@ -385,6 +424,9 @@ class OpticalSeries(ImageSeries):
)
name: str = Field(...)
data: OpticalSeriesData = Field(
..., description="""Images presented to subject, either grayscale or RGB"""
)
distance: Optional[float] = Field(
None, description="""Distance from camera/monitor to target/eye."""
)
@ -393,10 +435,6 @@ class OpticalSeries(ImageSeries):
NDArray[Shape["2 width_height"], float], NDArray[Shape["3 width_height_depth"], float]
]
] = Field(None, description="""Width, height and depth of image, or imaged area, in meters.""")
data: Union[
NDArray[Shape["* frame, * x, * y"], float],
NDArray[Shape["* frame, * x, * y, 3 r_g_b"], float],
] = Field(..., description="""Images presented to subject, either grayscale or RGB""")
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.""",
@ -411,8 +449,9 @@ class OpticalSeries(ImageSeries):
description="""Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.""",
)
format: Optional[str] = Field(
None,
"raw",
description="""Format of image. If this is 'external', then the attribute 'external_file' contains the path information to the image files. If this is 'raw', then the raw (single-channel) binary data is stored in the 'data' dataset. If this attribute is not present, then the default format='raw' case is assumed.""",
json_schema_extra={"linkml_meta": {"ifabsent": "string(raw)"}},
)
device: Optional[Union[Device, str]] = Field(
None,
@ -460,6 +499,47 @@ class OpticalSeries(ImageSeries):
)
class OpticalSeriesData(ConfiguredBaseModel):
"""
Images presented to subject, either grayscale or RGB
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image"})
name: Literal["data"] = Field(
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
continuity: Optional[str] = Field(
None,
description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""",
)
conversion: Optional[float] = Field(
1.0,
description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(1.0)"}},
)
offset: Optional[float] = Field(
None,
description="""Scalar to add to the data after scaling by 'conversion' to finalize its coercion to the specified 'unit'. Two common examples of this include (a) data stored in an unsigned type that requires a shift after scaling to re-center the data, and (b) specialized recording devices that naturally cause a scalar offset with respect to the true units.""",
)
resolution: Optional[float] = Field(
-1.0,
description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(-1.0)"}},
)
unit: str = Field(
...,
description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion' and add 'offset'.""",
)
value: Optional[
Union[
NDArray[Shape["* frame, * x, * y"], float],
NDArray[Shape["* frame, * x, * y, 3 r_g_b"], float],
]
] = Field(None)
class IndexSeries(TimeSeries):
"""
Stores indices to image frames stored in an ImageSeries. The purpose of the IndexSeries is to allow a static image stack to be stored in an Images object, and the images in the stack to be referenced out-of-order. This can be for the display of individual images, or of movie segments (as a movie is simply a series of images). The data field stores the index of the frame in the referenced Images object, and the timestamps array indicates when that image was displayed.
@ -470,10 +550,8 @@ class IndexSeries(TimeSeries):
)
name: str = Field(...)
data: NDArray[Shape["* num_times"], int] = Field(
...,
description="""Index of the image (using zero-indexing) in the linked Images object.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}},
data: IndexSeriesData = Field(
..., description="""Index of the image (using zero-indexing) in the linked Images object."""
)
indexed_timeseries: Optional[Union[ImageSeries, str]] = Field(
None,
@ -530,13 +608,52 @@ class IndexSeries(TimeSeries):
)
class IndexSeriesData(ConfiguredBaseModel):
"""
Index of the image (using zero-indexing) in the linked Images object.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.image"})
name: Literal["data"] = Field(
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
continuity: Optional[str] = Field(
None,
description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""",
)
conversion: Optional[float] = Field(
1.0,
description="""This field is unused by IndexSeries.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(1.0)"}},
)
offset: Optional[float] = Field(None, description="""This field is unused by IndexSeries.""")
resolution: Optional[float] = Field(
-1.0,
description="""This field is unused by IndexSeries.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(-1.0)"}},
)
unit: Literal["N/A"] = Field(
"N/A",
description="""This field is unused by IndexSeries and has the value N/A.""",
json_schema_extra={"linkml_meta": {"equals_string": "N/A", "ifabsent": "string(N/A)"}},
)
value: Optional[NDArray[Shape["* num_times"], int]] = Field(
None, json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}
)
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
GrayscaleImage.model_rebuild()
RGBImage.model_rebuild()
RGBAImage.model_rebuild()
ImageSeries.model_rebuild()
ImageSeriesData.model_rebuild()
ImageSeriesExternalFile.model_rebuild()
ImageMaskSeries.model_rebuild()
OpticalSeries.model_rebuild()
OpticalSeriesData.model_rebuild()
IndexSeries.model_rebuild()
IndexSeriesData.model_rebuild()

View file

@ -38,7 +38,7 @@ class ConfiguredBaseModel(BaseModel):
model_config = ConfigDict(
validate_assignment=True,
validate_default=True,
extra="allow",
extra="forbid",
arbitrary_types_allowed=True,
use_enum_values=True,
strict=False,
@ -213,6 +213,24 @@ class AbstractFeatureSeriesData(ConfiguredBaseModel):
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
continuity: Optional[str] = Field(
None,
description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""",
)
conversion: Optional[float] = Field(
1.0,
description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(1.0)"}},
)
offset: Optional[float] = Field(
None,
description="""Scalar to add to the data after scaling by 'conversion' to finalize its coercion to the specified 'unit'. Two common examples of this include (a) data stored in an unsigned type that requires a shift after scaling to re-center the data, and (b) specialized recording devices that naturally cause a scalar offset with respect to the true units.""",
)
resolution: Optional[float] = Field(
-1.0,
description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(-1.0)"}},
)
unit: Optional[str] = Field(
"see ",
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'\".""",
@ -236,10 +254,8 @@ class AnnotationSeries(TimeSeries):
)
name: str = Field(...)
data: NDArray[Shape["* num_times"], str] = Field(
...,
description="""Annotations made during an experiment.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}},
data: AnnotationSeriesData = Field(
..., description="""Annotations made during an experiment."""
)
description: Optional[str] = Field(
"no description",
@ -278,6 +294,47 @@ class AnnotationSeries(TimeSeries):
)
class AnnotationSeriesData(ConfiguredBaseModel):
"""
Annotations made during an experiment.
"""
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)"}},
)
continuity: Optional[str] = Field(
None,
description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""",
)
conversion: Optional[float] = Field(
1.0,
description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(1.0)"}},
)
offset: Optional[float] = Field(
None,
description="""Scalar to add to the data after scaling by 'conversion' to finalize its coercion to the specified 'unit'. Two common examples of this include (a) data stored in an unsigned type that requires a shift after scaling to re-center the data, and (b) specialized recording devices that naturally cause a scalar offset with respect to the true units.""",
)
resolution: float = Field(
-1.0,
description="""Smallest meaningful difference between values in data. Annotations have no units, so the value is fixed to -1.0.""",
le=-1,
ge=-1,
json_schema_extra={"linkml_meta": {"ifabsent": "float(-1.0)"}},
)
unit: Literal["n/a"] = Field(
"n/a",
description="""Base unit of measurement for working with the data. Annotations have no units, so the value is fixed to 'n/a'.""",
json_schema_extra={"linkml_meta": {"equals_string": "n/a", "ifabsent": "string(n/a)"}},
)
value: Optional[NDArray[Shape["* num_times"], str]] = Field(
None, json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}
)
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.
@ -288,10 +345,8 @@ class IntervalSeries(TimeSeries):
)
name: str = Field(...)
data: NDArray[Shape["* num_times"], int] = Field(
...,
description="""Use values >0 if interval started, <0 if interval ended.""",
json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}},
data: IntervalSeriesData = Field(
..., description="""Use values >0 if interval started, <0 if interval ended."""
)
description: Optional[str] = Field(
"no description",
@ -330,6 +385,47 @@ class IntervalSeries(TimeSeries):
)
class IntervalSeriesData(ConfiguredBaseModel):
"""
Use values >0 if interval started, <0 if interval ended.
"""
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)"}},
)
continuity: Optional[str] = Field(
None,
description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""",
)
conversion: Optional[float] = Field(
1.0,
description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(1.0)"}},
)
offset: Optional[float] = Field(
None,
description="""Scalar to add to the data after scaling by 'conversion' to finalize its coercion to the specified 'unit'. Two common examples of this include (a) data stored in an unsigned type that requires a shift after scaling to re-center the data, and (b) specialized recording devices that naturally cause a scalar offset with respect to the true units.""",
)
resolution: float = Field(
-1.0,
description="""Smallest meaningful difference between values in data. Annotations have no units, so the value is fixed to -1.0.""",
le=-1,
ge=-1,
json_schema_extra={"linkml_meta": {"ifabsent": "float(-1.0)"}},
)
unit: Literal["n/a"] = Field(
"n/a",
description="""Base unit of measurement for working with the data. Annotations have no units, so the value is fixed to 'n/a'.""",
json_schema_extra={"linkml_meta": {"equals_string": "n/a", "ifabsent": "string(n/a)"}},
)
value: Optional[NDArray[Shape["* num_times"], int]] = Field(
None, json_schema_extra={"linkml_meta": {"array": {"dimensions": [{"alias": "num_times"}]}}}
)
class DecompositionSeries(TimeSeries):
"""
Spectral analysis of a time series, e.g. of an LFP or a speech signal.
@ -417,6 +513,24 @@ class DecompositionSeriesData(ConfiguredBaseModel):
"data",
json_schema_extra={"linkml_meta": {"equals_string": "data", "ifabsent": "string(data)"}},
)
continuity: Optional[str] = Field(
None,
description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""",
)
conversion: Optional[float] = Field(
1.0,
description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(1.0)"}},
)
offset: Optional[float] = Field(
None,
description="""Scalar to add to the data after scaling by 'conversion' to finalize its coercion to the specified 'unit'. Two common examples of this include (a) data stored in an unsigned type that requires a shift after scaling to re-center the data, and (b) specialized recording devices that naturally cause a scalar offset with respect to the true units.""",
)
resolution: Optional[float] = Field(
-1.0,
description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""",
json_schema_extra={"linkml_meta": {"ifabsent": "float(-1.0)"}},
)
unit: str = Field(
"no unit",
description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""",
@ -504,9 +618,18 @@ class Units(DynamicTable):
)
name: str = Field("Units", json_schema_extra={"linkml_meta": {"ifabsent": "string(Units)"}})
spike_times_index: Optional[Named[VectorIndex]] = Field(
electrode_group: Optional[VectorData[NDArray[Any, ElectrodeGroup]]] = Field(
None,
description="""Index into the spike_times dataset.""",
description="""Electrode group that each spike unit came from.""",
json_schema_extra={
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
)
electrodes: Optional[Named[DynamicTableRegion]] = Field(
None,
description="""Electrode that each spike unit came from, specified using a DynamicTableRegion.""",
json_schema_extra={
"linkml_meta": {
"annotations": {
@ -516,12 +639,9 @@ class Units(DynamicTable):
}
},
)
spike_times: Optional[UnitsSpikeTimes] = Field(
None, description="""Spike times for each unit."""
)
obs_intervals_index: Optional[Named[VectorIndex]] = Field(
electrodes_index: Optional[Named[VectorIndex]] = Field(
None,
description="""Index into the obs_intervals dataset.""",
description="""Index into electrodes.""",
json_schema_extra={
"linkml_meta": {
"annotations": {
@ -547,9 +667,9 @@ class Units(DynamicTable):
},
)
)
electrodes_index: Optional[Named[VectorIndex]] = Field(
obs_intervals_index: Optional[Named[VectorIndex]] = Field(
None,
description="""Index into electrodes.""",
description="""Index into the obs_intervals dataset.""",
json_schema_extra={
"linkml_meta": {
"annotations": {
@ -559,9 +679,12 @@ class Units(DynamicTable):
}
},
)
electrodes: Optional[Named[DynamicTableRegion]] = Field(
spike_times: Optional[UnitsSpikeTimes] = Field(
None, description="""Spike times for each unit."""
)
spike_times_index: Optional[Named[VectorIndex]] = Field(
None,
description="""Electrode that each spike unit came from, specified using a DynamicTableRegion.""",
description="""Index into the spike_times dataset.""",
json_schema_extra={
"linkml_meta": {
"annotations": {
@ -571,41 +694,15 @@ class Units(DynamicTable):
}
},
)
electrode_group: Optional[VectorData[NDArray[Any, ElectrodeGroup]]] = Field(
None,
description="""Electrode group that each spike unit came from.""",
json_schema_extra={
"linkml_meta": {
"array": {"maximum_number_dimensions": False, "minimum_number_dimensions": 1}
}
},
waveform_mean: Optional[UnitsWaveformMean] = Field(
None, description="""Spike waveform mean for each spike unit."""
)
waveform_mean: Optional[
VectorData[
Union[
NDArray[Shape["* num_units, * num_samples"], float],
NDArray[Shape["* num_units, * num_samples, * num_electrodes"], float],
]
]
] = Field(None, description="""Spike waveform mean for each spike unit.""")
waveform_sd: Optional[
VectorData[
Union[
NDArray[Shape["* num_units, * num_samples"], float],
NDArray[Shape["* num_units, * num_samples, * num_electrodes"], float],
]
]
] = Field(None, description="""Spike waveform standard deviation for each spike unit.""")
waveforms: Optional[VectorData[NDArray[Shape["* num_waveforms, * num_samples"], float]]] = (
Field(
None,
description="""Individual waveforms for each spike on each electrode. This is a doubly indexed column. The 'waveforms_index' column indexes which waveforms in this column belong to the same spike event for a given unit, where each waveform was recorded from a different electrode. The 'waveforms_index_index' column indexes the 'waveforms_index' column to indicate which spike events belong to a given unit. For example, if the 'waveforms_index_index' column has values [2, 5, 6], then the first 2 elements of the 'waveforms_index' column correspond to the 2 spike events of the first unit, the next 3 elements of the 'waveforms_index' column correspond to the 3 spike events of the second unit, and the next 1 element of the 'waveforms_index' column corresponds to the 1 spike event of the third unit. If the 'waveforms_index' column has values [3, 6, 8, 10, 12, 13], then the first 3 elements of the 'waveforms' column contain the 3 spike waveforms that were recorded from 3 different electrodes for the first spike time of the first unit. See https://nwb-schema.readthedocs.io/en/stable/format_description.html#doubly-ragged-arrays for a graphical representation of this example. When there is only one electrode for each unit (i.e., each spike time is associated with a single waveform), then the 'waveforms_index' column will have values 1, 2, ..., N, where N is the number of spike events. The number of electrodes for each spike event should be the same within a given unit. The 'electrodes' column should be used to indicate which electrodes are associated with each unit, and the order of the waveforms within a given unit x spike event should be in the same order as the electrodes referenced in the 'electrodes' column of this table. The number of samples for each waveform must be the same.""",
json_schema_extra={
"linkml_meta": {
"array": {"dimensions": [{"alias": "num_waveforms"}, {"alias": "num_samples"}]}
}
},
)
waveform_sd: Optional[UnitsWaveformSd] = Field(
None, description="""Spike waveform standard deviation for each spike unit."""
)
waveforms: Optional[UnitsWaveforms] = Field(
None,
description="""Individual waveforms for each spike on each electrode. This is a doubly indexed column. The 'waveforms_index' column indexes which waveforms in this column belong to the same spike event for a given unit, where each waveform was recorded from a different electrode. The 'waveforms_index_index' column indexes the 'waveforms_index' column to indicate which spike events belong to a given unit. For example, if the 'waveforms_index_index' column has values [2, 5, 6], then the first 2 elements of the 'waveforms_index' column correspond to the 2 spike events of the first unit, the next 3 elements of the 'waveforms_index' column correspond to the 3 spike events of the second unit, and the next 1 element of the 'waveforms_index' column corresponds to the 1 spike event of the third unit. If the 'waveforms_index' column has values [3, 6, 8, 10, 12, 13], then the first 3 elements of the 'waveforms' column contain the 3 spike waveforms that were recorded from 3 different electrodes for the first spike time of the first unit. See https://nwb-schema.readthedocs.io/en/stable/format_description.html#doubly-ragged-arrays for a graphical representation of this example. When there is only one electrode for each unit (i.e., each spike time is associated with a single waveform), then the 'waveforms_index' column will have values 1, 2, ..., N, where N is the number of spike events. The number of electrodes for each spike event should be the same within a given unit. The 'electrodes' column should be used to indicate which electrodes are associated with each unit, and the order of the waveforms within a given unit x spike event should be in the same order as the electrodes referenced in the 'electrodes' column of this table. The number of samples for each waveform must be the same.""",
)
waveforms_index: Optional[Named[VectorIndex]] = Field(
None,
@ -671,14 +768,109 @@ class UnitsSpikeTimes(VectorData):
] = Field(None)
class UnitsWaveformMean(VectorData):
"""
Spike waveform mean for each spike unit.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"})
name: Literal["waveform_mean"] = Field(
"waveform_mean",
json_schema_extra={
"linkml_meta": {"equals_string": "waveform_mean", "ifabsent": "string(waveform_mean)"}
},
)
sampling_rate: Optional[float] = Field(None, description="""Sampling rate, in hertz.""")
unit: Optional[Literal["volts"]] = Field(
"volts",
description="""Unit of measurement. This value is fixed to 'volts'.""",
json_schema_extra={"linkml_meta": {"equals_string": "volts", "ifabsent": "string(volts)"}},
)
description: str = Field(..., description="""Description of what these vectors represent.""")
value: Optional[
Union[
NDArray[Shape["* dim0"], Any],
NDArray[Shape["* dim0, * dim1"], Any],
NDArray[Shape["* dim0, * dim1, * dim2"], Any],
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any],
]
] = Field(None)
class UnitsWaveformSd(VectorData):
"""
Spike waveform standard deviation for each spike unit.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"})
name: Literal["waveform_sd"] = Field(
"waveform_sd",
json_schema_extra={
"linkml_meta": {"equals_string": "waveform_sd", "ifabsent": "string(waveform_sd)"}
},
)
sampling_rate: Optional[float] = Field(None, description="""Sampling rate, in hertz.""")
unit: Optional[Literal["volts"]] = Field(
"volts",
description="""Unit of measurement. This value is fixed to 'volts'.""",
json_schema_extra={"linkml_meta": {"equals_string": "volts", "ifabsent": "string(volts)"}},
)
description: str = Field(..., description="""Description of what these vectors represent.""")
value: Optional[
Union[
NDArray[Shape["* dim0"], Any],
NDArray[Shape["* dim0, * dim1"], Any],
NDArray[Shape["* dim0, * dim1, * dim2"], Any],
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any],
]
] = Field(None)
class UnitsWaveforms(VectorData):
"""
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.
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({"from_schema": "core.nwb.misc"})
name: Literal["waveforms"] = Field(
"waveforms",
json_schema_extra={
"linkml_meta": {"equals_string": "waveforms", "ifabsent": "string(waveforms)"}
},
)
sampling_rate: Optional[float] = Field(None, description="""Sampling rate, in hertz.""")
unit: Optional[Literal["volts"]] = Field(
"volts",
description="""Unit of measurement. This value is fixed to 'volts'.""",
json_schema_extra={"linkml_meta": {"equals_string": "volts", "ifabsent": "string(volts)"}},
)
description: str = Field(..., description="""Description of what these vectors represent.""")
value: Optional[
Union[
NDArray[Shape["* dim0"], Any],
NDArray[Shape["* dim0, * dim1"], Any],
NDArray[Shape["* dim0, * dim1, * dim2"], Any],
NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any],
]
] = Field(None)
# Model rebuild
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
AbstractFeatureSeries.model_rebuild()
AbstractFeatureSeriesData.model_rebuild()
AnnotationSeries.model_rebuild()
AnnotationSeriesData.model_rebuild()
IntervalSeries.model_rebuild()
IntervalSeriesData.model_rebuild()
DecompositionSeries.model_rebuild()
DecompositionSeriesData.model_rebuild()
DecompositionSeriesBands.model_rebuild()
Units.model_rebuild()
UnitsSpikeTimes.model_rebuild()
UnitsWaveformMean.model_rebuild()
UnitsWaveformSd.model_rebuild()
UnitsWaveforms.model_rebuild()

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