Skip to main content

Tools for handling whole slide image

Project description

Project Fake Doctors

Simple Deep learning tools for Bio-informatics & Digital Pathology.

  • Due to the compatibility issue of the Openslide library, only installation in Ubuntu environment is now supported. We promise to support you on all platforms as soon as possible.

It is not a stable project yet, so there maybe some minor|majgor bugs. We will provide a complete product in the near future, so we ask for your patience.

Installation

python3 -m pip install fake-doctors -U

Download Datasets

Now support only Camelyon16 whole slide image dataset(train/test).

  • Warning: There is an issue related to the wget library, so debugging is in progress. If it is confirmed that a problem with wget lib itself, we will migrate to a more stable library such as requests.

※ 800GB+ or free storage is required.

In the near future, we will provide a lightweight benchmark dataset of dozens of gigabytes for computer vision research in the field of digital pathology.

from fake_doctors.dataset import Camelyon16

downloader = Camelyon16(urls_dir_in=/path/to/cache/download/urls,
                        wsi_dir_out=/path/to/save/dataset,
                        annots_dir_out=/path/to/save/annotations)

# Download training data
downloader.download_trainset()
# Split training/validation data
downloader.split_train_valid(ratio=0.2)

# Download test data
downloader.download_testset()

Convert XML annotation to JSON

from fake_doctors.annotation import xml_to_json

xml_to_json(xml_path_in=/path/to/xml/annotations,
            json_path_out=/path/to/save/json/annotations)

Extract ROI from whole slide image(convert to binary mask)

from fake_doctors.mask import generate_roi_mask

generate_roi_mask(wsi_path_in=/path/to/dataset,
                  mask_path_out=/path/to/save/mask)

Filter tumor coordinates from whole slide image

from fake_doctors.annotation import LesionAnnotations

lesion_annots = LesionAnnotations(annot_path=/path/to/annotation)
tumor_coords = lesion_annots.filter_tumor_coords(save_dir='/path/to/save/tumor/coords/list,
                                                 points=coordinates,
                                                 is_pos=True)

Sample train/valid patch images

from fake_doctors.sampling import 

num_train_patches = 2000000
num_valid_patches = 20000

train_patch_sampler = PatchSampler(wsi_dir_in=/path/to/dataset/dir
                                   masks_dir_in=/path/to/dataset/masks/dir,
                                   annots_dir_in=/path/to/annotations/dir,
                                   tumor_coords_dir_in=/path/to/tumor/coordinates/cache,
                                   normal_coords_dir_in=/path/to/normal/coordinates/cache,
                                   patches_dir_out=/path/to/save/sampled/patches)

valid_patch_sampler = PatchSampler(wsi_dir_in=/path/to/dataset/dir
                                   masks_dir_in=/path/to/dataset/masks/dir,
                                   annots_dir_in=/path/to/annotations/dir,
                                   tumor_coords_dir_in=/path/to/tumor/coordinates/cache,
                                   normal_coords_dir_in=/path/to/normal/coordinates/cache,
                                   patches_dir_out=/path/to/save/sampled/patches)

train_patch_sampler.sample_patches(num_patches=num_train_patches)
valid_patch_sampler.sample_patches(num_patches=num_valid_patches)

Prototyping metastasis classifier model and training

  • Working in progress:
    The model used in our project is still being trained. After the model has completely converged, it will be released as soon as the stability of the model is proven, because otherwise, it can confuse users or learners. Since transfer learning cannot be used and the computer power is insufficient, the model is expected to be released in January 2021.

Load checkpoints

  • Working in progress:
    The model used in our project is still being trained. After the model has completely converged, it will be released as soon as the stability of the model is proven. Since transfer learning cannot be used and the computer power is insufficient, the model is expected to be released in January 2021.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fake-doctors-0.0.5.2.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fake_doctors-0.0.5.2-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

Details for the file fake-doctors-0.0.5.2.tar.gz.

File metadata

  • Download URL: fake-doctors-0.0.5.2.tar.gz
  • Upload date:
  • Size: 12.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.8.5

File hashes

Hashes for fake-doctors-0.0.5.2.tar.gz
Algorithm Hash digest
SHA256 068fc565193109fc3f1a074ea31b1ccfa234d62c41181c479880f81816a5956d
MD5 b46ce197d0293f8c2396feb30ad91634
BLAKE2b-256 8e850e679ee19e79f3e9673afe70592e65da8c060ceca1eb226fb21e9b072b72

See more details on using hashes here.

File details

Details for the file fake_doctors-0.0.5.2-py3-none-any.whl.

File metadata

  • Download URL: fake_doctors-0.0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 13.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.8.5

File hashes

Hashes for fake_doctors-0.0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 56e65946238a2707608058ffa75038f46933db4994d6cb7da5db1eed22a160ed
MD5 a60064f44498effb81a4adc3d9ac6f3d
BLAKE2b-256 ead74261e46a5c8c2ef790a4260d518b7bb677719bc1474907e1539ad02e859e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page