Image Server Deployment
The first thing, to have working xOpat instance is to have deployed image server. We will use image server we are maintaining: WSI-Service.
If you already have your own Image Server deployed, you can skip this part.
How to deploy WSI-Service?
-
Download some WSI test slides. It does not matter where the slides come from, but they must be compatible with the image server used. Test data can be found for example on openslide.org
notethe Simple Mapper we will be using needs to have slides in certain hiearchy:
root-folder├── case1│ ├── slide1_1│ └── slide1_2├── case2│ └── slide2_1...tipThe server state cached. If you want to add new slides, you need to go to visit http://localhost:8080/refresh_local_mapper to revalidate the cache.
-
Clone WSI-Service repository (note the
--recursiveflag: there are submodules):git clone --recursive https://github.com/RationAI/WSI-Service.git-
Create .env file in the root folder of repository. Make sure
COMPOSE_DATA_DIRpoints to the folder with downloaded slides,root-folder..env# if true, it will allow logging functionalityWS_DEBUG=False# if true, it will make OpenAPI sites availableWS_DISABLE_OPENAPI=True# url of service which maps slide ids to path. We use build in serviceWS_MAPPER_ADDRESS=http://localhost:8080/slides/storage?slide={slide_id}# How the mapper resolves slide pathsWS_LOCAL_MODE=wsi_service.simple_mapper:SimpleMapper# Auth of a choice, here we request no authWS_API_V3_INTEGRATION=wsi_service.api.v3.integrations.disable_auth:DisableAuth# this variables are configuring docker compose fileCOMPOSE_RESTART=noCOMPOSE_NETWORK=defaultCOMPOSE_WS_PORT=8080# directory where the test slides are savedCOMPOSE_DATA_DIR=path/to/slides# server API configurationWS_CORS_ALLOW_CREDENTIALS=FalseWS_CORS_ALLOW_ORIGINS=["*"]# Timeouts and size settingsWS_INACTIVE_HISTO_IMAGE_TIMEOUT_SECONDS=600WS_MAX_RETURNED_REGION_SIZE=25000000WS_MAX_THUMBNAIL_SIZE=500WS_ENABLE_VIEWER_ROUTES=False
-
-
Make sure that Docker and Docker Compose is installed on your machine.
infoIf you do not have these applications, the easiest way is to use Docker Desktop. The commands can be different based on used docker distribution.
Example of the docker compose yaml used by the environment configuration:
docker-compose.yml
version: "3.8"services:wsi_service:build:context: "."target: wsi_service_productionnetwork: "${COMPOSE_NETWORK}"restart: "${COMPOSE_RESTART}"environment:- WS_CORS_ALLOW_CREDENTIALS=${WS_CORS_ALLOW_CREDENTIALS}- WS_CORS_ALLOW_ORIGINS=${WS_CORS_ALLOW_ORIGINS}- WS_DEBUG=${WS_DEBUG}- WS_DISABLE_OPENAPI=${WS_DISABLE_OPENAPI}- WS_MAPPER_ADDRESS=${WS_MAPPER_ADDRESS}- WS_LOCAL_MODE=${WS_LOCAL_MODE}- WS_ENABLE_VIEWER_ROUTES=${WS_ENABLE_VIEWER_ROUTES}- WS_INACTIVE_HISTO_IMAGE_TIMEOUT_SECONDS=${WS_INACTIVE_HISTO_IMAGE_TIMEOUT_SECONDS}- WS_MAX_RETURNED_REGION_SIZE=${WS_MAX_RETURNED_REGION_SIZE}- WS_API_V3_INTEGRATION=${WS_API_V3_INTEGRATION}volumes:- ${COMPOSE_DATA_DIR}:/dataports:- ${COMPOSE_WS_PORT}:8080 -
Finally run the docker container by:
docker compose uptipyou can add
-dflag, for program to detach from your terminal.
This should make WSI server running on localhost:8080. For more information feel free to check the repository of WSI-Service.