emannotationschemas


Nameemannotationschemas JSON
Version 5.12.0 PyPI version JSON
download
home_pagehttps://github.com/fcollman/EMAnnotationSchemas
Summarya service for storing arbitrary annotation data on EM volumes stored in a cloud volume
upload_time2024-04-05 21:04:19
maintainerNone
docs_urlNone
authorForrest Collman
requires_python>=3.8
licenseNone
keywords
VCS
bugtrack_url
requirements marshmallow marshmallow-jsonschema numpy jsonschema SQLAlchemy shapely geoalchemy2 flask-cors
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![Actions Status](https://github.com/seung-lab/EMAnnotationSchemas/workflows/EMAnnotationSchemas/badge.svg)](https://github.com/seung-lab/EMAnnotationSchemas/actions)
[![codecov](https://codecov.io/gh/seung-lab/EMAnnotationSchemas/branch/master/graph/badge.svg)](https://codecov.io/gh/seung-lab/EMAnnotationSchemas)

# 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](emannotationschemas/schemas/base.py).
  * 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](emannotationschemas/schemas/base.py) nested schema.  This will announce to the [AnnotationEngine](http://www.github.com/fcollman/AnnotationEngine) and the [MaterializationEngine](http://www.github.com/seung-lab/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](emannotationschemas/schemas/base.py) (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](emannotationschemas/schemas/base.py), 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.
2. Import this schema into [__init__.py](emannotationschemas/__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. 

3. You should add a test to the [testing suite](tests/) 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](emannotationschemas/schemas/synapse.py).

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/fcollman/EMAnnotationSchemas",
    "name": "emannotationschemas",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": "Forrest Collman",
    "author_email": "forrestc@alleninstitute.org",
    "download_url": "https://files.pythonhosted.org/packages/ac/13/81111b66484be106a42cebca48e8e3001e05b06b0ee4929993f92b8b17db/emannotationschemas-5.12.0.tar.gz",
    "platform": null,
    "description": "[![Actions Status](https://github.com/seung-lab/EMAnnotationSchemas/workflows/EMAnnotationSchemas/badge.svg)](https://github.com/seung-lab/EMAnnotationSchemas/actions)\n[![codecov](https://codecov.io/gh/seung-lab/EMAnnotationSchemas/branch/master/graph/badge.svg)](https://codecov.io/gh/seung-lab/EMAnnotationSchemas)\n\n# EMAnnotationSchemas\nRepository to hold schemas for annotations of volumetric imaging data focused on EM\n\n# How to add a new annotation type\nIn order to add a new annotation type to this repository you must do the following steps.\n\n1. Create a new schema for your annotation.    This schema needs to follow a few guidelines.\n  * This schema should extend the class [emannotationschemas.schemas.base.AnnotationSchema](emannotationschemas/schemas/base.py).\n  * 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](emannotationschemas/schemas/base.py) nested schema.  This will announce to the [AnnotationEngine](http://www.github.com/fcollman/AnnotationEngine) and the [MaterializationEngine](http://www.github.com/seung-lab/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](emannotationschemas/schemas/base.py) (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. \n   * 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](emannotationschemas/schemas/base.py), so the system knows to link that annotation to its reference annotation.\n   * 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.\n2. Import this schema into [__init__.py](emannotationschemas/__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. \n\n3. You should add a test to the [testing suite](tests/) that uses this schema, and checks that you can correctly detect potential problems with annotation data that is sent into the system. \n\nAn example of a proper schema is [emannotationschemas.schemas.synapse.SynapseSchema](emannotationschemas/schemas/synapse.py).\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "a service for storing arbitrary annotation data on EM volumes stored in a cloud volume",
    "version": "5.12.0",
    "project_urls": {
        "Homepage": "https://github.com/fcollman/EMAnnotationSchemas"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2b57c40d18baa098c3b461a9fa833420aa62325a25c4a1c7dbed0f09c54297dc",
                "md5": "39a00deb30fa8e6fbc9513c512655c1e",
                "sha256": "b14980297ac1380a3eadcf35b1f35c35a948663568b91fb65758e1e986d138db"
            },
            "downloads": -1,
            "filename": "emannotationschemas-5.12.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "39a00deb30fa8e6fbc9513c512655c1e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 50353,
            "upload_time": "2024-04-05T21:04:15",
            "upload_time_iso_8601": "2024-04-05T21:04:15.524979Z",
            "url": "https://files.pythonhosted.org/packages/2b/57/c40d18baa098c3b461a9fa833420aa62325a25c4a1c7dbed0f09c54297dc/emannotationschemas-5.12.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ac1381111b66484be106a42cebca48e8e3001e05b06b0ee4929993f92b8b17db",
                "md5": "8f0620bbc4962f37325815059c985dd7",
                "sha256": "159332bffb368942ba57a1321134a8f02377a3f180ffdf55bc6624491cdaeaae"
            },
            "downloads": -1,
            "filename": "emannotationschemas-5.12.0.tar.gz",
            "has_sig": false,
            "md5_digest": "8f0620bbc4962f37325815059c985dd7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 35505,
            "upload_time": "2024-04-05T21:04:19",
            "upload_time_iso_8601": "2024-04-05T21:04:19.779167Z",
            "url": "https://files.pythonhosted.org/packages/ac/13/81111b66484be106a42cebca48e8e3001e05b06b0ee4929993f92b8b17db/emannotationschemas-5.12.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-05 21:04:19",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "fcollman",
    "github_project": "EMAnnotationSchemas",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "marshmallow",
            "specs": [
                [
                    "==",
                    "3.5.1"
                ]
            ]
        },
        {
            "name": "marshmallow-jsonschema",
            "specs": [
                [
                    "==",
                    "0.10.0"
                ]
            ]
        },
        {
            "name": "numpy",
            "specs": [
                [
                    ">=",
                    "1.18.4"
                ]
            ]
        },
        {
            "name": "jsonschema",
            "specs": [
                [
                    "<",
                    "4.0"
                ]
            ]
        },
        {
            "name": "SQLAlchemy",
            "specs": [
                [
                    "<",
                    "1.4"
                ]
            ]
        },
        {
            "name": "shapely",
            "specs": [
                [
                    "==",
                    "2.0.3"
                ]
            ]
        },
        {
            "name": "geoalchemy2",
            "specs": [
                [
                    "<",
                    "0.12.0"
                ],
                [
                    ">=",
                    "0.11.1"
                ]
            ]
        },
        {
            "name": "flask-cors",
            "specs": [
                [
                    "==",
                    "3.0.10"
                ]
            ]
        }
    ],
    "test_requirements": [
        {
            "name": "pytest",
            "specs": [
                [
                    ">=",
                    "3.0.5"
                ]
            ]
        },
        {
            "name": "pytest-cov",
            "specs": [
                [
                    ">=",
                    "2.2.1"
                ]
            ]
        },
        {
            "name": "pytest-env",
            "specs": []
        }
    ],
    "lcname": "emannotationschemas"
}
        
Elapsed time: 0.22716s