项目作者: steven22tom

项目描述 :
LabelSlide is a slide annotation tool and label object bounding boxes in virtual slides (generally used in pathology)
高级语言: JavaScript
项目地址: git://github.com/steven22tom/LabelSlide.git
创建时间: 2021-02-03T12:17:39Z
项目社区:https://github.com/steven22tom/LabelSlide

开源协议:GNU Lesser General Public License v2.1

下载


LabelSlide

LabelSlide is a slide annotation tool and label object bounding boxes in virtual slides (generally used in pathology)

example

Feature

LabelSlide is based on B/S structure and written in Python.
Using OpenSlide to read the virtual slides and create DeepZoom Image.
Then view the zoomable image in browser by OpenSeadragon.
Adding Fabric.js canvas to draw label box overlaying the OpenSeadragon viewer.
The webpage build with Bootstrap

Installation

Build from source

Python

  1. pip install -r requirements.txt
  2. python label_slide.py

access 127.0.0.1:5000 (as default)

If show error “Could not find module ‘libopenslide-0.dll’”. Please download libvips and unzip to bin folder

Usage

Config

There’s two config file.

app_config.py
Including HOST, PORT for the app and the SLIDE_CONFIG for slide config(the file path of config.yaml).
ps: parameter name must be uppercase

config.yaml
Containing the following parameters
slide_dir: the directory where slides are kept.
label_dir: the directory where the annotation will be saved to.
class: pre-defined classes including id, name and color.

For example:

  1. slide_dir: D:\Dataset\slides
  2. label_dir: D:\Dataset\labels
  3. class:
  4. - id: 0
  5. name: A
  6. color: '#2196f3'
  7. - id: 1
  8. name: B
  9. color: '#0014a8'

ps: the class id must be integer and the color must be hex format.
All content in config.yaml could be modified from webpage

Slide

In theory, the tool can read virtual slides in several formats because using OpenSlide:

But only try MIRAX(.mrxs) under development.
If you want to read slide in other formats, you should modify code in label_tool.py by yourself.

Annotation

Support rectangle box and polygon box currently.

Hotkeys
Key|Function
—|—
q|View Mode
e|Create new rectangle box
r|Create new polygon box
del|Delete the selected rect box

Annotation file
One slide corresponds to one annotation file.
Take annotation for MIRAX (.mrxs) as an example

  1. slide: C20200174
  2. boxes:
  3. - class: 0
  4. type:rect
  5. x: 30749
  6. y: 70121
  7. w: 468
  8. h: 434
  9. - class: 1
  10. type: poly
  11. points:
  12. - x: 33813
  13. y: 62176
  14. - x: 33931
  15. y: 62571
  16. - x: 34099
  17. y: 62308

x,y is the top left pixel and w,h is the region size in the level 0 reference frame(highest resolution)

License

LGPL-2.1 License