-
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 are an EntityTable.
The cli.users interface allow 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.-
user [User]: The modifiedUserobject to save in the database.
-
-
Remove a user from the database. This operation need administrator privilege.
-
user [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.)
The cli.images interface allow to list, upload, modify, download and delete images from the table image of the database.
-
Upload an image (and optionnaly 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']andmetadat['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.-
image [Image]: The modifiedImageobject to save in the database.
-
-
Remove an image from the database. This operation need administrator privilege.
-
image [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.
-
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).
-