diff --git a/emannotationschemas/__init__.py b/emannotationschemas/__init__.py index 65186cb..c7bb98c 100644 --- a/emannotationschemas/__init__.py +++ b/emannotationschemas/__init__.py @@ -7,7 +7,11 @@ from emannotationschemas.schemas.synapse import NoCleftSynapse from emannotationschemas.schemas.bouton_shape import BoutonShape from emannotationschemas.schemas.presynaptic_bouton_type import PresynapticBoutonType -from emannotationschemas.schemas.base import ReferenceAnnotation, ReferenceTagAnnotation +from emannotationschemas.schemas.base import ( + ReferenceAnnotation, + ReferenceTagAnnotation, + ReferenceInteger, +) from emannotationschemas.schemas.functional_coregistration import ( FunctionalCoregistration, FunctionalUnitCoregistration, @@ -106,6 +110,7 @@ "bound_tag_bool": BoundBoolAnnotation, "bound_tag_bool_valid": BoundBoolWithValid, "bound_tag_valid": BoundTagWithValid, + "reference_integer": ReferenceInteger, } diff --git a/emannotationschemas/schemas/base.py b/emannotationschemas/schemas/base.py index dae92c1..6487ebb 100644 --- a/emannotationschemas/schemas/base.py +++ b/emannotationschemas/schemas/base.py @@ -134,9 +134,9 @@ class SpatialPoint(mm.Schema): @mm.post_load def transform_position(self, data, **kwargs): if self.context.get("postgis", False): - data[ - "position" - ] = f'POINTZ({data["position"][0]} {data["position"][1]} {data["position"][2]})' + data["position"] = ( + f'POINTZ({data["position"][0]} {data["position"][1]} {data["position"][2]})' + ) return data @@ -190,3 +190,12 @@ class RepresentativePoint(AnnotationSchema): required=True, description="the point to be used for attaching objects to the dynamic segmentation", ) + + +class ReferenceInteger(ReferenceAnnotation): + """Reference annotation with an integer value""" + + value = mm.fields.Int( + required=True, + description="Integer value to be attached to the annotation", + )