Skip to content

Commit

Permalink
adding schemas for bound points (#79)
Browse files Browse the repository at this point in the history
Adds 3 schemas for bound spatial points: boolean tag; boolean tag with valid reference id; string tag with valid reference id. Related to Vortex myelin annotations
  • Loading branch information
bpdanskin committed Mar 6, 2024
1 parent d21b2ca commit 426d8a9
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
9 changes: 8 additions & 1 deletion emannotationschemas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@
from emannotationschemas.schemas.braincircuits import (
BrainCircuitsBoundTagAnnotationUser,
)
from emannotationschemas.schemas.bound_bool_tag import (
BoundBoolAnnotation,
BoundBoolWithValid,
BoundTagWithValid,
)

from emannotationschemas.errors import UnknownAnnotationTypeException
from emannotationschemas.flatten import create_flattened_schema
Expand Down Expand Up @@ -94,9 +99,11 @@
"fly_cell_type": FlyCellType,
"fly_cell_type_ext": FlyCellTypeExt,
"braincircuits_annotation_user": BrainCircuitsBoundTagAnnotationUser,
"bound_tag_bool": BoundBoolAnnotation,
"bound_tag_bool_valid": BoundBoolWithValid,
"bound_tag_valid": BoundTagWithValid,
}


def get_types():
return [k for k in type_mapping.keys()]

Expand Down
23 changes: 23 additions & 0 deletions emannotationschemas/schemas/bound_bool_tag.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import marshmallow as mm
from emannotationschemas.schemas.base import AnnotationSchema, BoundSpatialPoint, NumericField
from emannotationschemas.schemas.bound_text_tag import BoundTagAnnotation

class BoundBoolAnnotation(AnnotationSchema):
pt = mm.fields.Nested(
BoundSpatialPoint,
required=True,
description="Location associated with the tag"
)
tag = mm.fields.Bool(required=True, description="Boolean at location")

class BoundBoolWithValid(BoundBoolAnnotation):
valid_id = NumericField(
required=True,
description="Root id of the object when location was assessed. If the pt_root_id has changed, the associated segment has undergone proofreading.",
)

class BoundTagWithValid(BoundTagAnnotation):
valid_id = NumericField(
required=True,
description="Root id of the object when location was assessed. If the pt_root_id has changed, the associated segment has undergone proofreading.",
)

0 comments on commit 426d8a9

Please sign in to comment.