HUB
Sign inSign up
labels-server logo

imfusion/labels-server

By imfusion

•Updated 3 months ago

Project database server for the ImFusion Labels image annotation software.

Image
Web servers
0

3.5K

imfusion/labels-server repository overview

⁠ImFusion Labels Server

The ImFusion Labels Server provides a project database for the ImFusion Labels⁠ image annotation software. The server stores and serves projects, datasets and segmentations through a RESTful API.

⁠Setup

  1. Inside an empty folder, create folders for persistent data that will later be mapped as volumes inside the container
    mkdir -p storage
    
  2. Adjust folder permissions so that the container can access them
    chown -R 2000:2000 storage
    
  3. Start the container.
    # If openssl is not available, any sufficiently random text can be used
    export SECRET_KEY=$(openssl rand -hex 32)
    # Change this to the URL your server will be available at
    export SITE_URL='http://localhost:8000'
    sudo docker run --rm -e LABELS_SECURITY_SECRET_KEY="$SECRET_KEY" -e LABELS_SERVER_SITE_URL="$SITE_URL" -e LABELS_SECURITY_USE_HTTPS=0 -v ./storage:/labels-server/storage -p 8000:8000 imfusion/labels-server
    
  4. Visit http://localhost:8000 in your browser and create an initial admin user

⁠Configuration

To list all configuration options together with a description, run:

sudo docker run --rm -e LABELS_SECURITY_SECRET_KEY="" --entrypoint=python imfusion/labels-server -m labels_server --print-config

⁠Changelog

⁠1.2.1

See 1.1.4

⁠1.2.0

No changes and identical to the previous version. Only exists to have the same version number as the client.

⁠1.1.4

Fixed broken migration that used "IO.LocalFileIo" instead of "IO.ImFusionFileIo" and prevented loading of datasets.

⁠1.1.3

Fixed CVEs in dependencies

⁠1.1.2

Fixed "Internal Server Error (500)" when downloading labelmaps after adding a new label to a project.

⁠1.1.1

Fixed CVEs in dependencies

⁠1.1.0

⁠New & Improved
  • Added support for PostgreSQL as a database. This can be configured in the config.ini under Database.Url. Migrating an existing database from SQLite to PostgreSQL is not supported yet.
  • Added data_source property to Dataset. This property specifies how a dataset can be loaded as an image and where it is stored. It is therefore now possible to upload images with a different format than ImFusionFile.
  • Projects can specify where datasets should be stored. By default, datasets will be stored internally on the server and can be directly downloaded. Additionally, datasets can now also be stored externally, in which case the server will treat them as an opaque reference and will never directly access them. The client will need to download the dataset directly from the external storage.
  • Fixed labelmap thumbnails not getting deleted when a dataset is deleted.
⁠Deprecations
  • The config.ini file has been replaced by environment variables. The old config.ini values are named LABELS_{section}_{key_with_underscores}. For example, the SecretKey value in the Security section can be set with the environment variable LABELS_SECURITY_SECRET_KEY. The server prints all variables on startup so that they can be copied and used as environment variables. The configuration of the logging has been moved to the config/logging.ini file.
  • The /keycloak and /keycloak_callback endpoints have been deprecated in favor of the /oidc and /oauth_callback endpoints. The /oidc endpoint only provides the authority_url of the identity provider and clients are expected to retrieve endpoints via {authority_url}/.well-known/openid-configuration.

⁠1.0.2

Fixed CVE in cryptography dependency

⁠1.0.1

Fixed CVEs in base images

⁠1.0.0

⁠Breaking Changes
  • The LayerTypes Landmark and BoundingBox have been replaced with a GeometricAnnotation type. This layer can contain both landmark and bounding box labels. Existing layers are migrated to GeometricAnnotation automatically. Multiple layers are not merged into one. E.g. if there was a Landmark layer and a BoundingBox layer, there will be two GeometricAnnotation layers after the migration.
⁠New & Improved
  • Added HEALTHCHECK to Docker image
  • Upgraded to Python 3.12 and updated dependencies

⁠0.6.5

⁠New & Improved
  • Usernames can contain letters, digits, @, -, . and _ now. For example, most email addresses can be used as usernames.
  • Package dependencies have been updated.

⁠0.6.4

⁠New & Improved
  • Added GET /api/v1/users to list all registered users, POST /api/v1/users to create new users and DELETE /api/v1/users to delete existing users. Only allowed for admins for the moment.
  • /api/v1/event_log now includes the id of the user that triggered the event
  • Datasets can be made read-only. In a read-only dataset neither tags, layers or meta-data can be changed. Changing the read-only flag requires can_edit_config permission.
  • Extended /metrics endpoint with additional metrics.
  • GET /api/v1/version can check via a client_version query whether a Labels client is compatible with the server. If not, the response includes a version_warnings list of features that won't work.
  • POST /api/v1/projects/{project_id}/datasets/{dataset_id}/lock/{token} returns when the token will expire.
  • The links that are part of the header bar in the web frontend can be configured. With an existing config.ini, the API link will be missing now though. To get it back, copy the following section:
    [Frontend.Links.API]
    name=API
    href=/docs
    

⁠0.6.3

⁠New & Improved
  • GET /api/v1/projects/{project_id}/meta_data to only retrieve meta data of a project.

  • Tags can be defined as readonly in a project. A readonly tag can not be changed for all dataset.

  • The /api/v1/projects/{project_id}/events endpoint now times out after 10 seconds and returns an empty list. This prevents connections remaining open indefinitely when a client was terminated without closing the connection.

  • Replaced unmaintained python-jose dependency with jwcrypto

  • Extended permission system: User can be assigned fine-grained permissions on individual projects, like the permission to add datasets to a projects or edited the project definitions. Permissions can be set in the web frontend for the project.

    Important: Fine-grained permissions are not directly supported in the Labels Client version <= 0.25! Permissions apply, but the client won't display an appropriate error message. If you are still using this client version, we recommend to always give each user all permissions to avoid issues.

  • The /api/v1/event_log endpoint provides a log of all events and changes on the server. It can for example be used to track how a tag has been changed over time.

  • The /docs and /redoc endpoints do not load resources from external servers anymore.

⁠0.6.2

⁠New & Improved
  • The docker image can be started without mounting the storage and logs folders. In this case, all changes to the server will be lost when the container is stopped. This is practical for temporary testing servers.
  • Package dependencies have been updated.
  • Due to the FastAPI update, the grant_type in /api/v1/token does not accept an empty string anymore, but must be either password or missing.
  • New ServerShutdown event to notify applications that the server is shutting down.
  • Improved shutdown handling. Remaining tasks are finished and the server shuts down gracefully.

⁠0.6.1

⁠New & Improved
  • PUT /api/v1/projects/{project_id}/meta_data allows to only update the meta data of a project. The previous approach of first getting the project, modifying the meta data and updating the project can lead to a race-condition if the project is changed inbetween.

⁠0.6.0

⁠Breaking Changes
  • In PUT /api/v1/projects/{project_id}, the meta_data is no longer completely overwritten. Instead, only the provided values are updated, all others are left unchanged. To completely overwrite the meta_data, the ?overwrite_meta_data=true query has to be used. This prevents meta_data from accidentally being dropped.
  • The overwrite_meta_data value of PUT /api/v1/projects/{project_id}/datasets/{dataset_id} has been converted to a query to make it consistent with PUT /api/v1/projects/{project_id}.
⁠New & Improved
  • Projects can be deleted with the DELETE /api/v1/projects/{project_id} endpoint. The name of the project has to be specified to prevent deleting the wrong project.
  • A project can specify whether adding the same DICOM dataset multiple times is allowed (by default it is allowed). If this option is disabled, adding a dataset with the same Study Instance UID and Series Instance UID as an existing dataset will fail. Disabling this option on an existing dataset does not remove duplicated datasets from the project. This feature only works with DICOM files.
  • GET /api/v1/projects/{project_id}/datasets supports optional study_instance_uid and series_instance_uid queries.

Tag summary

Content type

Image

Digest

sha256:28ee4d622…

Size

119.2 MB

Last updated

3 months ago

docker pull imfusion/labels-server