Database Schema

MongoEngine is used to define schema for records stored in mongodb

Images and Views

class slideatlas.models.image.Image(*args, **kwargs)[source]

The model Image record, any methods will go into a mixin

exception DoesNotExist
exception Image.MultipleObjectsReturned
Image.bookmarks

A list field that wraps a standard field, allowing multiple instances of the field to be used as a list in the database.

If using with ReferenceFields see: one-to-many-with-listfields

Note

Required means it cannot be empty - as the default for ListFields is []

Image.bounds

A list field that wraps a standard field, allowing multiple instances of the field to be used as a list in the database.

If using with ReferenceFields see: one-to-many-with-listfields

Note

Required means it cannot be empty - as the default for ListFields is []

Image.components

An 32-bit integer field.

Image.coordinate_system

A unicode string field.

Image.copyright

A unicode string field.

Image.dimensions

A list field that wraps a standard field, allowing multiple instances of the field to be used as a list in the database.

If using with ReferenceFields see: one-to-many-with-listfields

Note

Required means it cannot be empty - as the default for ListFields is []

Image.filename

A unicode string field.

Image.id

A field wrapper around MongoDB’s ObjectIds.

Image.label

A unicode string field.

Image.levels

An 32-bit integer field.

Image.metadataready

A boolean field type.

New in version 0.1.2.

Image.name

A unicode string field.

Image.origin

A list field that wraps a standard field, allowing multiple instances of the field to be used as a list in the database.

If using with ReferenceFields see: one-to-many-with-listfields

Note

Required means it cannot be empty - as the default for ListFields is []

Image.sha512

A unicode string field.

Image.spacing

A list field that wraps a standard field, allowing multiple instances of the field to be used as a list in the database.

If using with ReferenceFields see: one-to-many-with-listfields

Note

Required means it cannot be empty - as the default for ListFields is []

Image.startup_view

An embedded document field - with a declared document_type. Only valid values are subclasses of EmbeddedDocument.

Image.thumb

A binary data field.

Image.tile_size

An 32-bit integer field.

Image.type

A unicode string field.

Image.uploaded_at

A datetime field.

Uses the python-dateutil library if available alternatively use time.strptime to parse the dates. Note: python-dateutil’s parser is fully featured and when installed you can utilise it to convert varing types of date formats into valid python datetime objects.

Note: Microseconds are rounded to the nearest millisecond.
Pre UTC microsecond support is effecively broken. Use ComplexDateTimeField if you need accurate microsecond support.
class slideatlas.models.view.View(*args, **values)[source]
exception DoesNotExist
exception View.MultipleObjectsReturned
View.ViewerRecords

A list field that wraps a standard field, allowing multiple instances of the field to be used as a list in the database.

If using with ReferenceFields see: one-to-many-with-listfields

Note

Required means it cannot be empty - as the default for ListFields is []

View.center

A list field that wraps a standard field, allowing multiple instances of the field to be used as a list in the database.

If using with ReferenceFields see: one-to-many-with-listfields

Note

Required means it cannot be empty - as the default for ListFields is []

View.children

A list field that wraps a standard field, allowing multiple instances of the field to be used as a list in the database.

If using with ReferenceFields see: one-to-many-with-listfields

Note

Required means it cannot be empty - as the default for ListFields is []

View.children_visibility

A boolean field type.

New in version 0.1.2.

View.coordinate_system

A unicode string field.

View.date

An 64-bit integer field.

View.get_thumb(which='macro', force=False)[source]

Helper method to return thumbnail from the view. fetches the thumbnail from image_store if requied

View.height

An 32-bit integer field.

View.hidden_label

A unicode string field.

View.hide

A boolean field type.

New in version 0.1.2.

View.id

A field wrapper around MongoDB’s ObjectIds.

View.label

A unicode string field.

View.options

A list field that wraps a standard field, allowing multiple instances of the field to be used as a list in the database.

If using with ReferenceFields see: one-to-many-with-listfields

Note

Required means it cannot be empty - as the default for ListFields is []

View.parent_id

A field wrapper around MongoDB’s ObjectIds.

View.text

A unicode string field.

View.thumbs

A dictionary field that wraps a standard Python dictionary. This is similar to an embedded document, but the structure is not defined.

Note

Required means it cannot be empty - as the default for ListFields is []

New in version 0.3.

Changed in version 0.5: - Can now handle complex / varying types of data

View.title

A unicode string field.

View.type

A unicode string field.

View.type2

A unicode string field.

View.user

A field wrapper around MongoDB’s ObjectIds.

View.user2

A unicode string field.

Asset Stores

class slideatlas.models.image_store.image_store.ImageStore(*args, **values)[source]

An ImageStore holds image metadata and tiles.

exception DoesNotExist
exception ImageStore.MultipleObjectsReturned
ImageStore.get_image_metadata(image_id)[source]
ImageStore.get_thumb(image)[source]
ImageStore.get_tile(image_id, tile_name)[source]
ImageStore.get_tile_at(image_id, x, y)[source]
ImageStore.id

A field wrapper around MongoDB’s ObjectIds.

ImageStore.label

A unicode string field.

ImageStore.remove_image(image_id)[source]
class slideatlas.models.image_store.image_store.MultipleDatabaseImageStore(*args, **values)[source]

This contains all fields and logic for any ImageStore with some or all of its data stored in a separate Mongo database.

Other future types of ImageStore may have all data stored in another system, and would not inherit from this class.

exception DoesNotExist
exception MultipleDatabaseImageStore.MultipleObjectsReturned
MultipleDatabaseImageStore.auth_db

A unicode string field.

MultipleDatabaseImageStore.connection_alias[source]
MultipleDatabaseImageStore.dbname

A unicode string field.

MultipleDatabaseImageStore.get_image_metadata(image_id)[source]

Returns the image object as registered in the slideatlas

MultipleDatabaseImageStore.host

A unicode string field.

MultipleDatabaseImageStore.make_thumb(image, max_depth=3, height=100)[source]

Makes thumb by requesting tiles. Will not make

MultipleDatabaseImageStore.password

A unicode string field.

MultipleDatabaseImageStore.register()[source]
MultipleDatabaseImageStore.replica_set

A unicode string field.

MultipleDatabaseImageStore.to_pymongo(raw_object=False)[source]

” [deprecated] This is for temporary convenience, as all database access is migrated to models.

This will be removed once the migration is complete, so please don’t rely more than necessary upon it.

Parameters:raw_object – return a raw database object, which does not handle

AutoReconnect exceptions, but is required for GridFS

MultipleDatabaseImageStore.username

A unicode string field.

class slideatlas.models.image_store.mongo_image_store.MongoImageStore(*args, **values)[source]
exception DoesNotExist
exception MongoImageStore.MultipleObjectsReturned
MongoImageStore.get_thumb(image)[source]
MongoImageStore.get_tile(image_id, tile_name)[source]
MongoImageStore.get_tile_at(image_id, x, y, z, tilesize=256)[source]

Returns tile at the given location in the pyramid need to divide by the tilesize

MongoImageStore.remove_image(image_id)[source]

Removes the image record and corresponding image collection TODO: decide the strategy for orphaned views

class slideatlas.models.image_store.ptiff_image_store.PtiffImageStore(*args, **values)[source]

The data model for PtiffStore

Equivalent to images collections Should encapsulate entire assetstore, and this being tile specific version of it.

This generalizes “databases” collection which should ultimately point to asses collection with each asset object will have a type = MongoAssetStore if not specified

All sessions are stored in admindb in ptiffsessions and images are stored in ptiffimages expects the model to have

exception DoesNotExist
exception PtiffImageStore.MultipleObjectsReturned
PtiffImageStore.default_session_label[source]
PtiffImageStore.deliver()[source]
PtiffImageStore.get_thumb(image)[source]
PtiffImageStore.get_tile(image_id, tile_name, safe=False, raw=False)[source]

Returns an image tile as a binary JPEG string.

Raises:DoesNotExist
PtiffImageStore.get_tile_at(image_id, x, y, z, tilesize=256)[source]

Gets tile name and sends out the image in raw

PtiffImageStore.host_name

A unicode string field.

PtiffImageStore.image_file_path(image)[source]
PtiffImageStore.import_dir_path[source]
PtiffImageStore.import_images()[source]
PtiffImageStore.is_local()[source]
PtiffImageStore.last_sync

A datetime field.

Uses the python-dateutil library if available alternatively use time.strptime to parse the dates. Note: python-dateutil’s parser is fully featured and when installed you can utilise it to convert varing types of date formats into valid python datetime objects.

Note: Microseconds are rounded to the nearest millisecond.
Pre UTC microsecond support is effecively broken. Use ComplexDateTimeField if you need accurate microsecond support.
PtiffImageStore.make_thumb_from_embedded_images(image)[source]

Returns a thumbnail with a label as a binary JPEG string.

Organization and Access Control

class slideatlas.models.user.User(*args, **values)[source]
exception DoesNotExist
exception User.MultipleObjectsReturned
User.active[source]

This is used by Flask-Security to determine if a login is allowed at all.

User.confirmed_at[source]

This is required by Flask-Security for all users.

Return None, so that non-password users will not be considered ‘confirmed’ upon an attempt as a password login, which will prevent login.

User.created_at

A datetime field.

Uses the python-dateutil library if available alternatively use time.strptime to parse the dates. Note: python-dateutil’s parser is fully featured and when installed you can utilise it to convert varing types of date formats into valid python datetime objects.

Note: Microseconds are rounded to the nearest millisecond.
Pre UTC microsecond support is effecively broken. Use ComplexDateTimeField if you need accurate microsecond support.
User.current_login_at

A datetime field.

Uses the python-dateutil library if available alternatively use time.strptime to parse the dates. Note: python-dateutil’s parser is fully featured and when installed you can utilise it to convert varing types of date formats into valid python datetime objects.

Note: Microseconds are rounded to the nearest millisecond.
Pre UTC microsecond support is effecively broken. Use ComplexDateTimeField if you need accurate microsecond support.
User.current_login_ip

A unicode string field.

User.effective_permissions[source]

Provides both the user’s permissions and the transitive group permissions, as Permission objects (named tuples).

User.email

A unicode string field.

User.full_name

A unicode string field.

User.groups

A list field that wraps a standard field, allowing multiple instances of the field to be used as a list in the database.

If using with ReferenceFields see: one-to-many-with-listfields

Note

Required means it cannot be empty - as the default for ListFields is []

User.id

A field wrapper around MongoDB’s ObjectIds.

User.label[source]
User.last_login_at

A datetime field.

Uses the python-dateutil library if available alternatively use time.strptime to parse the dates. Note: python-dateutil’s parser is fully featured and when installed you can utilise it to convert varing types of date formats into valid python datetime objects.

Note: Microseconds are rounded to the nearest millisecond.
Pre UTC microsecond support is effecively broken. Use ComplexDateTimeField if you need accurate microsecond support.
User.last_login_ip

A unicode string field.

User.login_count

An 32-bit integer field.

User.password[source]

This is required by Flask-Security for all users.

Non-password users still require a password, to generate their secret auth token.

User.permissions

A list field that wraps a standard field, allowing multiple instances of the field to be used as a list in the database.

If using with ReferenceFields see: one-to-many-with-listfields

Note

Required means it cannot be empty - as the default for ListFields is []

class slideatlas.models.user.PasswordUser(*args, **values)[source]
exception DoesNotExist
exception PasswordUser.MultipleObjectsReturned
PasswordUser.confirmed_at

A datetime field.

Uses the python-dateutil library if available alternatively use time.strptime to parse the dates. Note: python-dateutil’s parser is fully featured and when installed you can utilise it to convert varing types of date formats into valid python datetime objects.

Note: Microseconds are rounded to the nearest millisecond.
Pre UTC microsecond support is effecively broken. Use ComplexDateTimeField if you need accurate microsecond support.
PasswordUser.password

A unicode string field.

class slideatlas.models.user.GoogleUser(*args, **values)[source]
exception DoesNotExist
exception GoogleUser.MultipleObjectsReturned
GoogleUser.external_id

A unicode string field.

class slideatlas.models.user.FacebookUser(*args, **values)[source]
exception DoesNotExist
exception FacebookUser.MultipleObjectsReturned
FacebookUser.external_id

A unicode string field.

class slideatlas.models.user.LinkedinUser(*args, **values)[source]
exception DoesNotExist
exception LinkedinUser.MultipleObjectsReturned
LinkedinUser.external_id

A unicode string field.

class slideatlas.models.user.ShibbolethUser(*args, **values)[source]
exception DoesNotExist
exception ShibbolethUser.MultipleObjectsReturned
ShibbolethUser.external_id

A field that validates input as an E-Mail-Address.

New in version 0.4.

class slideatlas.models.group.Group(*args, **values)[source]
exception DoesNotExist
exception Group.MultipleObjectsReturned
Group.facebook_id

A unicode string field.

Group.label

A unicode string field.

class slideatlas.models.group.PublicGroup(*args, **values)[source]
exception DoesNotExist
exception PublicGroup.MultipleObjectsReturned
PublicGroup.label[source]
class slideatlas.models.group.UnlistedGroup(*args, **values)[source]
exception DoesNotExist
exception UnlistedGroup.MultipleObjectsReturned
UnlistedGroup.label[source]
class slideatlas.models.session.Session(*args, **values)[source]
exception DoesNotExist
exception Session.MultipleObjectsReturned
Session.annotations

A list field that wraps a standard field, allowing multiple instances of the field to be used as a list in the database.

If using with ReferenceFields see: one-to-many-with-listfields

Note

Required means it cannot be empty - as the default for ListFields is []

Session.attachments
Session.collection

A reference to a document that will be automatically dereferenced on access (lazily).

Use the reverse_delete_rule to handle what should happen if the document the field is referencing is deleted. EmbeddedDocuments, DictFields and MapFields do not support reverse_delete_rules and an InvalidDocumentError will be raised if trying to set on one of these Document / Field types.

The options are:

  • DO_NOTHING - don’t do anything (default).

  • NULLIFY - Updates the reference to null.

  • CASCADE - Deletes the documents associated with the reference.

  • DENY - Prevent the deletion of the reference object.

  • PULL - Pull the reference from a ListField

    of references

Alternative syntax for registering delete rules (useful when implementing bi-directional delete rules)

class Bar(Document):
    content = StringField()
    foo = ReferenceField('Foo')

Bar.register_delete_rule(Foo, 'bar', NULLIFY)

Note

reverse_delete_rules do not trigger pre / post delete signals to be triggered.

Changed in version 0.5: added reverse_delete_rule

Session.get_imagefiles()[source]
Session.hide_annotations

A boolean field type.

New in version 0.1.2.

Session.hide_labels

A boolean field type.

New in version 0.1.2.

Session.id

A field wrapper around MongoDB’s ObjectIds.

Session.image_store

A reference to a document that will be automatically dereferenced on access (lazily).

Use the reverse_delete_rule to handle what should happen if the document the field is referencing is deleted. EmbeddedDocuments, DictFields and MapFields do not support reverse_delete_rules and an InvalidDocumentError will be raised if trying to set on one of these Document / Field types.

The options are:

  • DO_NOTHING - don’t do anything (default).

  • NULLIFY - Updates the reference to null.

  • CASCADE - Deletes the documents associated with the reference.

  • DENY - Prevent the deletion of the reference object.

  • PULL - Pull the reference from a ListField

    of references

Alternative syntax for registering delete rules (useful when implementing bi-directional delete rules)

class Bar(Document):
    content = StringField()
    foo = ReferenceField('Foo')

Bar.register_delete_rule(Foo, 'bar', NULLIFY)

Note

reverse_delete_rules do not trigger pre / post delete signals to be triggered.

Changed in version 0.5: added reverse_delete_rule

Session.imagefiles
Session.label

A unicode string field.

Session.transformations

A list field that wraps a standard field, allowing multiple instances of the field to be used as a list in the database.

If using with ReferenceFields see: one-to-many-with-listfields

Note

Required means it cannot be empty - as the default for ListFields is []

Session.type

A unicode string field.

Session.views

A list field that wraps a standard field, allowing multiple instances of the field to be used as a list in the database.

If using with ReferenceFields see: one-to-many-with-listfields

Note

Required means it cannot be empty - as the default for ListFields is []

class slideatlas.models.session.RefItem(*args, **kwargs)[source]
db

A field wrapper around MongoDB’s ObjectIds.

ref

A field wrapper around MongoDB’s ObjectIds.

class slideatlas.models.collection.Collection(*args, **values)[source]

An ImageStore holds image metadata and tiles.

exception DoesNotExist
exception Collection.MultipleObjectsReturned
Collection.copyright

A unicode string field.

Collection.creator_codes

A list field that wraps a standard field, allowing multiple instances of the field to be used as a list in the database.

If using with ReferenceFields see: one-to-many-with-listfields

Note

Required means it cannot be empty - as the default for ListFields is []

Collection.id

A field wrapper around MongoDB’s ObjectIds.

Collection.image_store

A reference to a document that will be automatically dereferenced on access (lazily).

Use the reverse_delete_rule to handle what should happen if the document the field is referencing is deleted. EmbeddedDocuments, DictFields and MapFields do not support reverse_delete_rules and an InvalidDocumentError will be raised if trying to set on one of these Document / Field types.

The options are:

  • DO_NOTHING - don’t do anything (default).

  • NULLIFY - Updates the reference to null.

  • CASCADE - Deletes the documents associated with the reference.

  • DENY - Prevent the deletion of the reference object.

  • PULL - Pull the reference from a ListField

    of references

Alternative syntax for registering delete rules (useful when implementing bi-directional delete rules)

class Bar(Document):
    content = StringField()
    foo = ReferenceField('Foo')

Bar.register_delete_rule(Foo, 'bar', NULLIFY)

Note

reverse_delete_rules do not trigger pre / post delete signals to be triggered.

Changed in version 0.5: added reverse_delete_rule

Collection.label

A unicode string field.

CODE_LENGTH = 6
exception DoesNotExist
exception Permalink.MultipleObjectsReturned
Permalink.code

A unicode string field.

Permalink.created_at

A datetime field.

Uses the python-dateutil library if available alternatively use time.strptime to parse the dates. Note: python-dateutil’s parser is fully featured and when installed you can utilise it to convert varing types of date formats into valid python datetime objects.

Note: Microseconds are rounded to the nearest millisecond.
Pre UTC microsecond support is effecively broken. Use ComplexDateTimeField if you need accurate microsecond support.
Permalink.created_by

A reference to a document that will be automatically dereferenced on access (lazily).

Use the reverse_delete_rule to handle what should happen if the document the field is referencing is deleted. EmbeddedDocuments, DictFields and MapFields do not support reverse_delete_rules and an InvalidDocumentError will be raised if trying to set on one of these Document / Field types.

The options are:

  • DO_NOTHING - don’t do anything (default).

  • NULLIFY - Updates the reference to null.

  • CASCADE - Deletes the documents associated with the reference.

  • DENY - Prevent the deletion of the reference object.

  • PULL - Pull the reference from a ListField

    of references

Alternative syntax for registering delete rules (useful when implementing bi-directional delete rules)

class Bar(Document):
    content = StringField()
    foo = ReferenceField('Foo')

Bar.register_delete_rule(Foo, 'bar', NULLIFY)

Note

reverse_delete_rules do not trigger pre / post delete signals to be triggered.

Changed in version 0.5: added reverse_delete_rule

Permalink.destination

A unicode string field.

classmethod Permalink.generate_code()[source]
Permalink.id

A field wrapper around MongoDB’s ObjectIds.

Permalink.label[source]
Permalink.view

A field wrapper around MongoDB’s ObjectIds.

Legacy Schema is as follows

Note

Schema defined in models always overrides, but for some objects, the schema is formalized, and therefore that specification is manually maintained

Warning

Legacy schema is not maintained and should be revied and removed

version s0.3 corresponds to v2.0rc2

Todo

Complete the color coding

Color codes

  • optional field
  • indexed field
  • optional sparse indexed field

Administrative database (always named “slideatlas”)

‘users’ collection

  • ‘_id’: ObjectId

  • ‘type’: indexed[2] str (“passwd”, “facebook”, “google”)

  • ‘name’: indexed[2] unique str Email

  • ‘label’: :str: Name

  • ‘passwd’: str (required if ‘type’ == “passwd”)

  • ‘rules’: array[n]

    • ObjectId (pointer to ‘rules’ document)
  • ‘last_login’: DateTime

  • ‘first_login’: DateTime

‘rules’ collection

  • ‘_id’: ObjectId

  • ‘label’: str

  • ‘db’: ObjectId (pointer to ‘databases’ document)

  • ‘facebook_id’: sparse unique indexed str

  • ‘db_admin’: bool

  • ‘can_see’: array[n]

    • ObjectId (pointer to ‘sessions’ document, within a data database)
  • ‘can_see_all’: bool (effectively populates ‘can_see’ with all available sessions)

  • site_admin’ : tag for super administrator if true

‘databases’ collection

  • ‘_id’: ObjectId

  • ‘label’: str

  • ‘host’: str (hostname or hostname:port)

  • ‘dbname’: str (name of a data database)

  • ‘copyright’: str

  • ‘users’: (Proposed for admin interface) List of the following structure

    • ‘created_by’: ObjectId(pointer to users database)
    • ‘created_at’: Time
    • ‘valid_until’: Time

‘meta’ collection

A location to store confidential configuration parameters in database, so config file can be obsolete, the run can optionally request parameters for config database.

Storing

  • ‘_id’: ObjectId
  • ‘key’: str
  • ‘value’: BSON object

Suggested variables for now

# Guest user id # Guest rules that need to be applied to # Facebook key for localhost and facebook key for servers etc

Data database (“bev1”, etc.)

image data/pyramid collection (named ObjectId)

  • ‘_id’: ObjectId
  • ‘name’: indexed unique str (‘tt.jpg’, etc.)
  • ‘level’: int (“0” is lowest-resolution / “t.jpg”)
  • ‘file’: binary

‘images’ metadata collection

  • ‘_id’: ObjectId (has a collection named the same)

  • ‘type’: If this is not set, then assume pyramid2. ‘stack’ is a simple array of images named 1.png, 2.png ...

  • ‘filename’: str file name of uploaded image

  • ‘origin’: array[3] (necessary to import NDPA annotations)

    • int/float (x / y / z world coords)
  • ‘spacing’: array[3]

    • float (x / y / z nanometers/pixel or “1.0” if unknown)
  • ‘bounds’: array[4]
    • float (xMin / xMax / yMin / yMax nanometers or “Units” if unknown)
  • ‘dimension’: array[3] (size of non-padded region of base layer. Z dimensions is 1 for pyramid2 and stack size for pyramid3 and stack types)

    • int (x / y / z pixel coords)
  • ‘levels’: int (specific to pyramid2 and pyrmid3 types)

  • ‘label’: str

  • ‘copyright’: str

  • ‘extents’: array[6] (deprecated)

    • int (x / y / z start / end pixel coords)
  • ‘hide’: null (depricated; field exists if image is hidden)

‘views’ metadata collection

  • ‘_id’: ObjectId

  • ‘img’: ObjectId (pointer to document in ‘images’ collection)

  • ‘imgdb’: Optional: For when the image is not in the same database as the view

  • ‘label’: str

  • ‘startup_view’: ObjectId

  • ‘bookmarks’: array[n]

    • ObjectId (pointer to ‘bookmarks’ document)

Note (a recursive structure, which replaces view): - User : who created this view / note (email) - Date : When this view was created (javascript Date.getTime();) (Optional) - Type : To find out scheme. Currently set to “Note”. - Title : The short label used in note list or session list of views. - HiddenTitle : Coded title for students. (Optional) - Text : More descriptive and longer text. (Optional) - ViewerRecords: An array of objects defining views. The client currently supports an array of up to two views for the dual viewer. - Children: An array of notes objects that replaces bookmarks. (Optional)

  • ChildrenVisibility: A boolean indicating whether the children will be displayed and traversed by default. (Optional)
  • ParentId: Object id of parent note. Used when a student makes a comment note which is saved in the Notes collection. (Optional)
  • SessionId: If this note belongs to a session, this is the session id (Optional)

ViewerRecord (Contains one slide image, camera and annotation).

  • Database : String name of the database containing the image.

  • Image : ObjectId(imageId),

  • Camera : a camera object (optional)

    • FocalPoint : [x, y]
    • Height : Height of the view in world coordinates
    • Width : (Optional)
    • Rotation : Rotation of the view in Radians.
  • Annotations: An array of annotation objects. (Optional)

    • type : one of “circle”, “pencil”, “text” or “polyline”
    • color : [r,g,b]
    • (creation camera)
    • ...

‘bookmarks’ collection

  • ‘_id’: ObjectId

  • ‘img’: ObjectId (pointer to document in ‘images’ collection)

  • ‘title’: str

  • ‘details’: str

  • ‘center’: array[3]

    • float (x / y / z pixel coords)
  • ‘zoom’: int (“0” is lowest-resolution)

  • ‘rotation’: float (right-handed in degrees)

  • ‘lens’: float (not used, but comes from NDPA annotations)

  • ‘annotation’: object

    • ‘type’: str

    • ‘displayname’: str (not used, but comes from NDPA annotations)

    • ‘color’: str (6 digit hex)

    • ‘radius’: float (exists if ‘type’ == “circle”)

    • ‘measuretype’: int (exists if ‘type’ == “freehand”; not used, but comes from NDPA annotations)

    • ‘closed’: int (exists if ‘type’ == “freehand”; not used, but comes from NDPA annotations)

    • ‘specialtype’: str (exists if ‘type’ == “freehand”; not used, but comes from NDPA annotations)

    • ‘points’: array[n] (n == 2 if ‘type’ == ‘pointer’; n == 1 if ‘type’ == ‘circle’) array[3]

      • float (x / y / z pixel coords)

‘attachments’ GridFS

  • ‘_id’: ObjectId
  • ‘filename’: str other required GridFS fields...

‘sessions’ collection

  • ‘_id’: ObjectId

  • ‘label’: str

  • ‘views’: array[n]

    • object

      • ‘ref’: ObjectId (pointer to document in ‘views’ collection)
      • ‘pos’: int
      • ‘hide’: bool
  • ‘attachments’: array[n]

    • object

      • ‘ref’: ObjectId (pointer to file in ‘attachments’ GridFS)
      • ‘pos’: int
      • ‘hide’: bool
      • ‘label’: str

‘log’ collection

  • ‘_id’: ObjectId

  • time : ISODate(“2013-01-07T22:18:07.222Z”),

  • time_str : str “Mon, 7 Jan 2013 17:18:07”,

  • db_id : ObjectId,

  • db_name : str “bev1”,

  • sess_id : ObjectId,

  • view_id : ObjectId,

  • img_id : ObjectId,

  • image_label : str,

  • ip:str (“127.0.0.1” etc)

  • user : Object

    • _id : ObjectId,
    • label : str
    • auth : str(“admin”, “student” etc)