Coder Social home page Coder Social logo

wsi-sdk's Introduction

WSI-SDK

WSI(Whole slide image)-SDK on Linux 顾名思义,先挖个坑以后再填。

Content

Introduction(2019/7/4)

       先做一个简单的科普, 这一部分太长只写中文。 You could read introduction by Google Translate.
WSI常作为医疗病理切片图像的保存载体,通常大小在几百MB到十几GB不等。WSI保存的是一个不同尺度下的图像序列,可以理解为用不同放大倍数的显微镜扫描了同时刻下的同一目标,更加直观的可根据下图所示的金字塔结构来理解。

       由于设备厂商不同,WSI存在多种格式,常见的SVS和TIF为 Aperio的格式,另外本项目还涉及一种KFB格式是由江丰生物的扫描设备生成的私有格式。本项目处理的主要就是svs和kfb格式的数据。
       在进行读取的过程中,主要用到的是Openslide库,我把Openslide的python库都封装在一起,为了较为规范的读取数据,wsi图像被分为header和image两个部分。header中包含wsi的层次结构、尺度以及标签等信息,image为最大分辨率图像,也就是level0图像。一般level0的图像会非常大,尺度常在10000*10000像素以上,长宽超过65000像素的图像,就无法用OpenCV导出为jpg格式了,同理Pillow也是没有办法处理的,而png与tiff格式则没有这一限制。
       为了直观的查看图像,可以通过特定的查看器如Image Scope, kfb格式可以通过KViewer打开。

Install on Linux(2019/7/2)

Please see the requirements.txt

Usage (2019/7/9)

Read SVS/TIFF File

You can read svs/tiff file by below codes:

from wsi import WSI
wsifile = WSI('your file path')
image = wsifile.read()

Then you get image as np.ndarry format, you can save it by cv2.imwrite if image scale under 65000 pixels.

Read KFB File

Codes as below:

import kfb
KFB = kfb.kfb('your file path')
image = KFB.read()
header = KFB.header()

There are some relate information contained by header, formated as a python dictionary.
Notice: If you use "Mask label method" to extract image, please remember your mask's axises are reversed for wsi image.

Cancer Detect (2019/7/19)

       最近做了一个基于深度学习的癌细胞检测模型,不过苦于门外汉出身,且没有数据标签,所以一直在忙数据清洗和打标签的工作(老大说的是最好不要做人工标注,用颜色来区分,但是光凭HE染色结果怎么可能分得出来)。模型用的是预训练的SqueezeNet,反而没有花费我太多的时间,短短几天我也从小白变成了一个能看懂胃癌切片的专业人士了(加班时长决定成败与否)。经过多次测试,发现数据标注越好,模型拟合也越顺利。这个项目我打算周末整合一下再放出来,不过出于商业原因数据不会公开的,也敬请原谅。
       这部分的代码已经完成了,详情请见tumor-annotation,有什么问题的话欢迎添加issue.

wsi-sdk's People

Contributors

jimmy-tsai avatar yasohasakii avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

wsi-sdk's Issues

kfb库导入失败

image
请问您能否提供下kfb的原生C++代码,或者提供下Python3的编译版本?

roi.py的问题

大佬你好:
我想问一下roi.py这个是根据注释文件去提取tiles吗,这个脚本所需的文件类型长啥样,是xml的那种带有坐标的文件么,不知道大佬还玩不玩github,刚入门wsi的小白,还望多多指教

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.