diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..38ad172 --- /dev/null +++ b/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [2019] [HES-SO Valais] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md index abc17f1..49c53bf 100755 --- a/README.md +++ b/README.md @@ -1,196 +1,218 @@ # Desuto & ParaDISE -This Docker Compose configuration allows building and running a functional Desuto Web Viewer and Retrieval Interface (including the ParaDISE retrieval engine) from scratch on any Docker-enabled host. +This Docker Compose configuration allows building and running a functional Desuto Web Viewer and Retrieval Interface (including the ParaDISE retrieval engine, see http://paradise.khresmoi.eu for more information) from scratch on any Docker-enabled host. This README file aims to describe the structure of the containers and any possible configuration changes that may be required when setting up the system on a new host. +## Screenshot +![screenshot](http://fast.hevs.ch/temp/desuto-overview.png "Screenshot of the Interface") + + ## Prerequisites To run the platform, you will need to install at least: * A recent version of Docker CE : https://docs.docker.com/install/linux/docker-ce/ubuntu/ * A recent version of Docker Compose : https://docs.docker.com/compose/install/ * Preferably a machine with a minimum of **10GB of available RAM** to store the visual indices in-memory ## Containers The ``docker-compose.yml`` file is made up of the following containers: 1. **proxy** : Proxy facade for all services based on nginx 2. **mysql** : MySQL server for storing image metadata (URLs, modalities, captions, etc.) 3. **couchdb** : CouchDgiggingver for storing image annotation data from the Web Viewer 4. **uploads** : Basic nginx instance for serving uploaded images 5. **images** : Basic nginx instance for serving images of the datasets used for retrieval 6. **paradise-gf** : Glassfish Java application server instance hosting the ParaDISE engine 7. **retrieval** : Apache instance hosting the Shambala-based retrieval interface 8. **webviewer** : Node.js server for the Web Viewer / Annotation tool 9. **iipsrv** : IIPImage server for generating the image tiles for the Web Viewer 10. **slideprops** : Python Web Service for extracting slide properties (using Openslide) ## Volumes The following shared volumes are declared: 1. **upload-volume** : Shared volume for uploaded images (served by the **uploads** container) ## Ports The following ports need to be open on the host machine to run all services correctly: 1. **80** : Port 80 is used by the proxy facade to expose all underlying services ## Environment variables The following default environment variables are declared in the ``.env.template`` file. All current values assume that the server runs on ``localhost`` and all services are behind the **proxy** container. All these variables are injected in various configuration files required by Javascript, Java and Node.js applications. If no special setup is required on the test host, this file does not need to be modified (apart from the last 2 values) and can directly be copied/renamed to `.env`. 1. **COUCHDB_ADMIN_USER** : Username of the CouchDB administrator 1. **COUCHDB_ADMIN_PASS** : Password for the CouchDB administrator 1. **COUCHDB_DB_NAME** : Name of the database created for the Web Viewer annotation data 1. **COUCHDB_PROTOCOL** : Protocol used by CouchDB (http by default, https can be managed by the proxy) 1. **COUCHDB_PORT** : Default port to reach the CouchDB container (not exposed, but can be used internally by the other Docker containers) 1. **COUCHDB_HOST** : Hostname of the CouchDB server (public-facing, localhost by default) 1. **COUCHDB_ROOT_URL** : Public-facing URL of the CouchDB database 1. **COUCHDB_BACKEND_ROOT_URL** : Backend URL for the CouchDB database 1. **PARADISE_ROOT_URL** : Default URL of the ParaDISE engine 1. **RETRIEVAL_ROOT_URL** : Default URL of the Retrieval Interface 1. **IIP_ROOT_URL** : Default URL of the IIP server 1. **VIEWER_ROOT_URL** : Default URL of the Web Viewer 1. **SLIDEPROPS_ROOT_URL** : Default URL of the Slide Properties Web Service 1. **SLIDEVIEWERDATA_LOCAL_PATH** : Default path of the data for the Web Viewer (uploaded images, converted images, overlays, etc.) 1. **PARADISE_LOCAL_PATH**: Default path of the data for the ParaDISE retrieval system ## Running the platform ### Set up the data folders Before running the platform, you should set up the folder structure for the Web Viewer data, as well as the retrieval system data. #### Web Viewer data The Web Viewer data is organised with the following hierarchy: ``` root |-- converted |-- Files converted automatically by the Web Viewer into the pyramidal, -- Deep-Zoom-compatible TIFF format |-- overlays |-- NAME_OF_UPLOADED_IMAGE.tif |-- feature-name.png |-- uploaded |-- WSI files uploaded via the Web Viewer interface ``` The structure is fairly simple, only the "overlays" directory is a bit special. This folder must contain a subfolder for each WSI uploaded to the platform. Each of these subfolders may contain one or more PNG files representing an overlay for the WSI of that subfolder. #### Retrieval system data The Retrieval system data is organised with the following hierarchy: ``` root |-- all-dmli-pubmed-info.sql This file is an SQL script containing all the info of a figure dataset with captions and modalities, such as the PubMedCentral dataset. The columns are the following: ------------------------------------------------------------- | id | url | thumbnailURL | articleURL | caption | modality | ------------------------------------------------------------- |-- images This folder contains all the patches and images that can be retrieved by the system, organized by dataset and split into several subfolders (by magnification, or other arbitrary levels) Example shown below: |-- Dataset1 (WSI for example) |-- 5X |-- XYZ.tif_idx_0__lvl_3__x2688_y2240.png |-- ... |-- 10X |-- ... |-- Dataset2 (PubMedCentral for example) |-- Subfolder1 |-- Sub-subfolder1 |-- 12-0309-F-3.jpg |-- ... |-- Sub-subfolder2 |-- ... |-- ... |-- paradise-files This folder contains all the files necessary for the ParaDISE backend to function, both for image as well as text retrieval. Details shown below: |-- conf This folder contains configuration files for all the visual indices available in the system, describing the used parameters for indexation, storing mechanism, retrieval settings, etc. Refer to the ParaDISE website (http://paradise.khresmoi.eu/) for more details. |-- pubmedcentral-config.json |-- ... |-- gt This folder contains the ground truth file for the classification algorithm used to automatically compute the image modality of a given image in a dataset. |-- train20XXGT.csv |-- image-lists This folder contains the lists of URLs/paths of images to index. |-- pubmedcentral-dmli.csv |-- ... |-- indices This folder contains CSV files with the features extracted from the images in each dataset |-- wsi-dataset-5x.csv |-- wsi-dataset-10x.csv |-- ... |-- lucene This folder contains the Lucene indices containing the caption and fulltext information for datasets such as PubMedCentral. |-- pubmedcentral-captions-2016-dmli |-- pubmedcentral-fulltext-2016 |-- ... |-- vocabularies This folder contains vocabularies for "Bag-of-Words"-based visual feature extraction. |-- vocabulary_238.csv |-- ... ``` ### Define the path in the ".env" file Whether you created the folder structure above manually or received a sample ZIP file with some images, you need to map some data folders into the Docker containers by setting the `SLIDEVIEWERDATA_LOCAL_PATH` and `PARADISE_LOCAL_PATH` variables in your ".env" file. Copy or rename the `.env.template` file to `.env` and modify the last 2 variables. Simply set them to the paths of the folders you created: ``` # Linux example SLIDEVIEWERDATA_LOCAL_PATH=/home/slideviewer/slideviewerdata/ PARADISE_LOCAL_PATH=/home/slideviewer/paradise-data/ # Windows example SLIDEVIEWERDATA_LOCAL_PATH=C:/SlideViewerData/ PARADISE_LOCAL_PATH=C:/ParaDISEData/ ``` Once these variables are defined, you should be able to correctly build and start all the containers. ### Starting the containers To create/start/restart all containers (in background mode), type the following command in the terminal **from the folder containing the docker-compose.yml file**: ``` docker-compose -f docker-compose.yml up -d ``` To stop the containers, type: ``` docker-compose stop ``` To remove all the containers (clean-up), type: ``` docker-compose down ``` ### Accessing the Web Viewer Wait for about 4-5 minutes to allow all services to load correctly, then access your browser at ``http://localhost`` to access the Web Viewer. (**NOTE**: Using Google Chrome is recommended). You can then log in with one of the following default user accounts defined in the ``docker-entrypoint.sh`` file in the ``desuto-couchdb`` directory: * User : ``user``, Password : ``userpass`` (Read-only access) * User : ``pathologist1``, Password : ``pathologistpass`` * User : ``pathologist2``, Password : ``pathologistpass`` + +## Limitations +The current repository contains all necessary parts for getting up and running +with the viewer, annotation tool and retrieval system, but lacks some of the required +data (images, indices, etc.) for a completely working system. + +It also doesn't include the Deep Learning Python services for computing and extracting +DL features from images, this is something that will be added in the future. + +If you would like to receive some sample data for quickly exploring the features +of the platform, don't hesitate to contact the authors for help. + +## Meta +Available under the Apache License 2.0, See ``LICENSE`` for more information. + +## Contributing + +Please contact the authors to ask about adding new contributions to the platform.