Skip to main content

a service for storing arbitrary annotation data on EM volumes stored in a cloud volume

Project description

Actions Status codecov

EMAnnotationSchemas

Repository to hold schemas for annotations of volumetric imaging data focused on EM

How to add a new annotation type

In order to add a new annotation type to this repository you must do the following steps.

  1. Create a new schema for your annotation. This schema needs to follow a few guidelines.
  • This schema should extend the class emannotationschemas.schemas.base.AnnotationSchema.
  • The central tenant of annotations, is that you should mark spatial locations that should be linked to agglomerated objects in the segmented EM volume with a emannotationschemas.schemas.base.BoundSpatialPoint nested schema. This will announce to the AnnotationEngine and the MaterializationEngine that the associated root_ids (neurons/glia/axon fragment/etc) should be "bound" to these locations and easily referenced (along with the nearest skeleton node and mesh node). You may also include points which do not need to be linked to root_ids, as emannotationschemas.schemas.base.SpatialPoint (of which BoundSpatialPoint is a subclass). All Nested SpatialPoint fields can include an 'order' keyword, which will be used by UI elements to determine whether, and in what order to draw lines between these points to represent an annotation.
  • If your annotation needs to reference another annotation. For example, if you want to be able to annotate that a certain synapse is of a certain type, or that a spine head is dually innervated, then you should subclass a emannotationschemas.schemas.base.ReferenceAnnotation, so the system knows to link that annotation to its reference annotation.
  • You should add a mm.post_load validation methods to the schema that ensure everything is what you would expect. For example that the type field is what you want it to be, and that any reference_annotation_type are what they should be. It should set the 'valid' flag of the annotation when the necessary information to validation the annotation is present, and remove that key from the dictionary when the information is not yet present. For example, upon posting new annotations to the annotationengine, root_id's are not available, and so synapses cannot be 'valid' based upon their having different pre/post IDs, but later, when materialized, they should have those IDs.
  1. Import this schema into init.py, and add the schema to the type_mapping dictionary, giving it a string based key. This will be the annotation_type of your new class of annotation.

  2. You should add a test to the testing suite that uses this schema, and checks that you can correctly detect potential problems with annotation data that is sent into the system.

An example of a proper schema is emannotationschemas.schemas.synapse.SynapseSchema.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

emannotationschemas-5.12.0.tar.gz (35.5 kB view details)

Uploaded Source

Built Distribution

emannotationschemas-5.12.0-py3-none-any.whl (50.4 kB view details)

Uploaded Python 3

File details

Details for the file emannotationschemas-5.12.0.tar.gz.

File metadata

  • Download URL: emannotationschemas-5.12.0.tar.gz
  • Upload date:
  • Size: 35.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for emannotationschemas-5.12.0.tar.gz
Algorithm Hash digest
SHA256 159332bffb368942ba57a1321134a8f02377a3f180ffdf55bc6624491cdaeaae
MD5 8f0620bbc4962f37325815059c985dd7
BLAKE2b-256 ac1381111b66484be106a42cebca48e8e3001e05b06b0ee4929993f92b8b17db

See more details on using hashes here.

File details

Details for the file emannotationschemas-5.12.0-py3-none-any.whl.

File metadata

File hashes

Hashes for emannotationschemas-5.12.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b14980297ac1380a3eadcf35b1f35c35a948663568b91fb65758e1e986d138db
MD5 39a00deb30fa8e6fbc9513c512655c1e
BLAKE2b-256 2b57c40d18baa098c3b461a9fa833420aa62325a25c4a1c7dbed0f09c54297dc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page