Skip to content

Commit

Permalink
added EMGInsertion
Browse files Browse the repository at this point in the history
  • Loading branch information
saskiad committed Aug 20, 2024
1 parent eeac1e8 commit 60b3c87
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
14 changes: 14 additions & 0 deletions src/aind_data_schema/components/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,13 @@ class LickSensorType(str, Enum):
PIEZOELECTIC = "Piezoelectric"


class MyomatrixArrayType(str, Enum):
"""Type of Myomatrix array"""

INJECTED = "Injected"
SUTURED = "Sutured"


class Device(AindModel):
"""Generic device"""

Expand Down Expand Up @@ -921,4 +928,11 @@ class Scanner(Device):
magnetic_strength_unit: str = Field(default="T", title="Magnetic strength unit")


class MyomatrixArray(Device):
"""Description of a Myomatrix array"""

device_type: Literal["Myomatrix Array"] = "Myomatrix Array"
array_type: MyomatrixArrayType = Field(..., title="Array type")


LIGHT_SOURCES = Annotated[Union[Laser, LightEmittingDiode, Lamp], Field(discriminator="device_type")]
29 changes: 28 additions & 1 deletion src/aind_data_schema/core/procedures.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from enum import Enum
from typing import List, Literal, Optional, Set, Union

from aind_data_schema_models.mouse_anatomy import MouseAnatomicalStructure
from aind_data_schema_models.pid_names import PIDName
from aind_data_schema_models.species import Species
from aind_data_schema_models.specimen_procedure_types import SpecimenProcedureType
Expand All @@ -24,7 +25,7 @@
from typing_extensions import Annotated

from aind_data_schema.base import AindCoreModel, AindModel, AwareDatetimeWithDefault
from aind_data_schema.components.devices import FiberProbe
from aind_data_schema.components.devices import FiberProbe, MyomatrixArray
from aind_data_schema.components.reagent import Reagent


Expand Down Expand Up @@ -555,6 +556,31 @@ class WaterRestriction(AindModel):
end_date: Optional[date] = Field(default=None, title="Water restriction end date")


class MyomatrixContact(AindModel):
""""Description of a contact on a myomatrix thread"""

body_part: MouseAnatomicalStructure.BODY_PARTS._ONE_OF = Field(..., title="Body part of contact insertion")
muscle: MouseAnatomicalStructure.EMG_MUSCLES._ONE_OF = Field(..., title="Muscle of contact insertion")
in_muscle: bool = Field(..., title="In muscle")
notes: Optional[str] = Field(default=None, title="Notes")


class MyomatrixThread(AindModel):
"""Description of a thread of a myomatrix array"""

ground_electrode_location: MouseAnatomicalStructure.BODY_PARTS._ONE_OF = Field(..., title="Location of ground electrode")
contacts: List[MyomatrixContact] = Field(..., title="Contacts")


class EMGInsertion(AindModel):
"""Description of a Myomatrix array insertion for EMG"""

procedure_type: Literal["EMG_Insertion"] = "EMG_Insertion"
protocol_id: str = Field(..., title="Protocol ID", description="DOI for protocols.io")
myomatrix_array: MyomatrixArray = Field(..., title="Myomatrix array")
threads: List[MyomatrixThread] = Field(..., title="Array threads")


class Perfusion(AindModel):
"""Description of a perfusion procedure that creates a specimen"""

Expand Down Expand Up @@ -597,6 +623,7 @@ class Surgery(AindModel):
Annotated[
Union[
Craniotomy,
EMGInsertion,
FiberImplant,
Headframe,
IntraCerebellarVentricleInjection,
Expand Down

0 comments on commit 60b3c87

Please sign in to comment.