Neuroglancer admin

This page lists the classes and methods used to administer the ‘Neuroglancer’ app in our database portal. This is where the end user can create, retrieve, update and delete (CRUD) metadata associated with the ‘Neuroglancer’ app. It does not list the fields (database columns). Look in the models document for the database table model.

The admin interface to this app allows the user to edit and view all the data that is consumed by the Neuroglancer application.


class neuroglancer.admin.AlignmentScoreAdmin(model, admin_site)

This class provides information for constructing the alignment score graph page.

has_add_permission(request)

Returns false as it is readonly

has_change_permission(request, obj=None)

Returns false as it is readonly

has_delete_permission(request, obj=None)

Returns false as it is readonly

class neuroglancer.admin.AnnotationArchive(id, animal, brain_region, annotator, created, annotation_type, parent, active)
Parameters
  • id (BigAuto) – id

  • animal_id (ForeignKey) – DB column = FK_prep_id

  • brain_region_id (ForeignKey) – DB column = FK_structure_id

  • annotator_id (ForeignKey) – DB column = FK_annotator_id

  • created (DateTime) – created

  • annotation_type (Enum) – annotation type

  • parent (Integer) – DB column = FK_parent

  • active (Integer) – active

exception DoesNotExist
exception MultipleObjectsReturned
class neuroglancer.admin.AnnotationArchiveAdmin(model, admin_site)
get_queryset(request)

Return a QuerySet of all model instances that can be edited by the admin site. This is used by changelist_view.

class neuroglancer.admin.AnnotationSessionAdmin(model, admin_site)

Administer the annotation session data.

get_queryset(request)

Return a QuerySet of all model instances that can be edited by the admin site. This is used by changelist_view.

get_urls()

Shows the HTML of the links to go to the graph, and table data.

show_points(obj)

Shows the HTML for the link to the graph of data.

view_points_in_session(request, id, *args, **kwargs)

Provides the HTML link to the table data

class neuroglancer.admin.BrainRegionAdmin(model, admin_site)

Class that provides admin capability for managing a region of the brain. This was also called a structure.

created_display(obj)

Formats the date nicely.

show_hexadecimal(obj)

Formats the hexadecimal nicely.

class neuroglancer.admin.CellTypeAdmin(model, admin_site)
class neuroglancer.admin.CompletedTaskAdmin(model, admin_site)

This class is used to admin the completed tasks. These are tasks that are long running and take to long for an HTTP request. They get sent to the supervisord daemon to be run outside the scope of the HTTP request.

has_add_permission(request)

Returns false as it is added by another process.

has_change_permission(request, obj=None)

Returns false as it is added by another process.

class neuroglancer.admin.PointsAdmin(model, admin_site)

This class may become deprecated, but for now it gets point data from the actual JSON and not the 3 new tables we have that contain x,y,z data.

created_display(obj)

Returns a nicely formatted creation date.

get_queryset(request)

Returns the query set of points where the layer contains annotations

get_urls()

Shows the HTML of the links to go to the graph, and table data.

has_add_permission(request, obj=None)

Returns false as the data is readonly

has_change_permission(request, obj=None)

Returns false as the data is readonly

has_delete_permission(request, obj=None)

Returns false as the data is readonly

show_points(obj)

Shows the HTML for the link to the graph of data.

view_points_3Dgraph(request, id, *args, **kwargs)

Provides a link to the 3D point graph

Parameters
  • request – http request

  • id – id of url

  • args

  • kwargs

Returns

3dGraph in a django template

view_points_data(request, id, *args, **kwargs)

Provides the HTML link to the table data

class neuroglancer.admin.StructureComAdmin(model, admin_site)

This class provides the ability to manage the data entered through Neuroglancer. These are points are entered by an anatomist and are solely for the center of mass (COM) for a brain region (structure)

get_queryset(request)

Return a QuerySet of all model instances that can be edited by the admin site. This is used by changelist_view.

get_urls()

Shows the HTML of the links to go to the graph, and table data.

show_com(obj)

Shows the HTML for the link to the graph of data.

view_coms(request, id, *args, **kwargs)

Provides the HTML link to the table data

class neuroglancer.admin.TaskAdmin(model, admin_site)

This admin class is for taking care of the tasks associated with the pre-processing pipeline.

has_add_permission(request, obj=None)

Returns false as this data comes in from the pre-processing pipeline.

class neuroglancer.admin.UrlModelAdmin(model, admin_site)

This class provides the admin backend to the JSON data produced by Neuroglancer. In the original version of Neuroglancer, all the data was stored in the URL, hence the name of this class. The name: ‘UrlModel’ will be changed in future versions.

Return a sequence containing the fields to be displayed as links on the changelist. The list_display parameter is the list of fields returned by get_list_display().

pretty_url(instance)

Function to display pretty version of the JSON data. It uses the pygments library to make the JSON readable.

Parameters

instance – admin obj

Returns

nicely formatted JSON data that is viewed in the page.

neuroglancer.admin.restore_archive(modeladmin, request, queryset)

This method will restore data from the annotation_points_archive table to the annotations_points table.

  1. Set existing data to inactive (quick)

  2. Move inactive data to archive (select, insert, slow, use background)

  3. Move archived data to existing (select, insert, slow use background)

Parameters
  • request – the HTTP request

  • queryset – the query set used to fetch data