-
Notifications
You must be signed in to change notification settings - Fork 0
CLI | cli interface
Most functionalities of the CLI are accessible through the cli object and the modules it contains:
Each of this module is an EntityTable.
The cli.users interface (singleton of UserTable) allows to list, create, modify and delete users from the table user of the database.
-
Add a user to the database. This operation needs administrator privilege.
-
firstname [str]: User's first name. -
lastname [str]: User's last name. -
email [str]: User's email. It's also the ID used by the user to authenticate to the server. -
password [str]: User's password. As of now, the CLI doesn't encrypt the password. -
is_admin [bool]: Set the role of the user (deprecated since more role have been added).
The created user as an
Userobject. -
-
Update a user of the database. Alternatively, you may call
user.save(). This operation needs administrator privilege.-
entity [User]: The modifiedUserobject to save in the database.
-
-
Remove a user from the database. This operation need administrator privilege.
-
entities [int|User]: The id or theUserobject describing the user to be deleted.
The deleted user as an
Userobject. -
-
List all users contained in the table
userof the database.The user list as an
EntityList(User)object.
A User object represents a single entity from the user table of the database.
-
id [int]: The index (and primary key) of the user. -
email [str]: The user's email. It's also the id used to authenticate the user. -
firstName [str]: The user's first name. -
lastName [str]: The user's last name. -
isAdmin [bool]: The user's role. (Deprecated since more role have been added.) - Inherited attributes from
Entity
The cli.images interface (singleton of ImageTable) allows to list, upload, modify, download and delete images from the table image of the database.
-
Upload an image (and optionally its preprocessing) and add an
imageentry to the database. This operation needs administrator privilege. This operation may take some time since after the image uploaded, it will be converted to jpeg if needed and a thumbnail will be computed.-
path [str]: Path to the image file to upload. -
type [str]: The acquisition type (fundus, OCT...). -
metadata [dict]: Optional metadata passed along the images. The original name of the image and its preprocessing are automatically stored inmetadata['filename']andmetadata['preprocessingFilename']. -
preprocessing [str]: Path to the preprocessed image to upload. IfNone, no preprocessing is associated with this image.
The created user as an
Imageobject. -
-
Update an image of the database. Alternatively, you may call
image.save(). Uploading a new image or preprocessing is not yet implemented in the CLI. This operation needs administrator privilege.-
entity [Image]: The modifiedImageobject to save in the database.
-
-
Remove an image from the database. This operation need administrator privilege.
-
entities [int|Image]: The id or theImageobject describing the image to be deleted.
The deleted image as an
Imageobject. -
-
List all images contained in the table
imageof the database.The image list as an
EntityList(Image)object.
An Image object represents a single entity from the image table of the database.
-
id [int]: The index (and primary key) of the image. -
preprocessing [bool]:Trueif a preprocessing image is associated with this entity. -
metadata [dict]: The image metadata. -
type [str]: The image acquisition type. - Inherited attributes from
Entity
-
Download the image file.
-
out [str]: Path where the file will be written. (If none is passed the file is not stored on the disk).
The image as an array numpy. (Dimensions are
[height, width, channel], channels are in BGR order). -
-
Download the preprocessed image file.
-
out [str]: Path where the file will be written. (If none is passed the file is not stored on the disk).
The preprocessed image as an array numpy. (Dimensions are
[height, width, channel], channels are in BGR order). -
The cli.annotations interface (singleton of AnnotationTable) allows to add, list, modify, download and delete annotations from the table annotation of the database.
-
Create an annotation.
-
image[int|Image]: Id of the image orImageentity to which the annotation is linked. -
comment[str]: Comment stored along with the annotation. -
data[AnnotationData]: Annotation data. (see AnnotationData)
The created annotation as an
Annotationobject. -
-
Update an image of the database. Alternatively, you may call
image.save(). Uploading a new image or preprocessing is not yet implemented in the CLI. This operation needs administrator privilege.-
entity[Annotation]: The modifiedAnnotationobject to save in the database.
-
-
List all images contained in the
annotationtable of the database.The annotation list as an
EntityList(Annotation)object.
An Annotation object represents a single entity from the annotation table of the database.
-
id[int]: The index (and primary key) of the annotation. -
comment[str]: Comment associated with the annotation. This comment is not visible from the frontend, it should be used as note created by and for the research team. -
image[Image]: The image to which this annotation is linked. Read-only -
submitEvent[SubmissionEvent]: The last submission event. Read-only - Inherited attributes from
Entity
-
Download the annotation data.
The annotation data as an
AnnotationData.