Neuroglancer serializers

This module defines the serializers for the REST API endpoints for Neuroglancer.

class neuroglancer.serializers.AnnotationSerializer(*args, **kwargs)

This one feeds the data import of annotations.

class neuroglancer.serializers.BrainRegionSerializer(*args, **kwargs)

A serializer class for the brain region model. Not currently used.

class Meta
fields = '__all__'
model

alias of BrainRegion

class neuroglancer.serializers.ComListSerializer(*args, **kwargs)

This one feeds the dropdown in Neuroglancer.

class neuroglancer.serializers.MarkedCellListSerializer(*args, **kwargs)

This one feeds the marked cell dropdown in Neuroglancer.

class neuroglancer.serializers.PolygonListSerializer(*args, **kwargs)

This one feeds the dropdown for importing within Neuroglancer.

class neuroglancer.serializers.PolygonSerializer(*args, **kwargs)

This class serializes the polygons that are created in Neuroglancer.

class neuroglancer.serializers.RotationSerializer(*args, **kwargs)

A serializer class for the rotations/transformations used in the alignment tool in Neuroglancer.

class neuroglancer.serializers.UrlSerializer(*args, **kwargs)

Override method of entering a url into the DB. The url probably can’t be in the UrlModel when it is returned to neuroglancer as it crashes neuroglancer.

class Meta
fields = '__all__'
model

alias of UrlModel

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.