Neuroglancer serializers
This module defines the serializers for the REST API endpoints for Neuroglancer.
- class neuroglancer.serializers.AnnotationLabelModelSerializer(*args, **kwargs)
- class Meta
- fields = '__all__'
- model
alias of
AnnotationLabel
- class neuroglancer.serializers.AnnotationModelSerializer(*args, **kwargs)
- class Meta
- fields = '__all__'
- model
alias of
AnnotationSession
- class neuroglancer.serializers.AnnotationSearchSerializer(*args, **kwargs)
This one feeds the data import of annotations.
- class neuroglancer.serializers.AnnotationSessionDataSerializer(*args, **kwargs)
This one feeds the data import of annotations.
- class neuroglancer.serializers.LabelSerializer(*args, **kwargs)
A serializer class for the brain region model.
- class neuroglancer.serializers.NeuroglancerNoStateSerializer(*args, **kwargs)
Override method of entering a url into the DB. This serializer ignores the JSON state as it is a really big field to serialize when unneccessary.
- class Meta
- exclude = ('neuroglancer_state',)
- model
alias of
NeuroglancerState
- ordering = ['-created']
- class neuroglancer.serializers.NeuroglancerStateSerializer(*args, **kwargs)
Override method of entering a url into the DB. The url probably can’t be in the NeuroglancerState when it is returned to neuroglancer as it crashes neuroglancer.
- class Meta
- fields = '__all__'
- model
alias of
NeuroglancerState
- ordering = ['-created']
- create(validated_data)
This method gets called when a user clicks New in Neuroglancer
- save_neuroglancer_state(obj, owner)
This method takes care of tasks that are in both create and update
- Parameters:
obj – the neuroglancerModel object
owner – the owner object from the validated_data
- update(obj, validated_data)
This gets called when a user clicks Save in Neuroglancer This is a very fast method. Even with a large set of polygons, it only took around 0.25 seconds on a home computer.