Giter Site home page Giter Site logo

panda_challenge's Introduction

PANDA_Challenge

A repository for collaborating on PANDA challenge.

docker: Contains Dockerfile for code development.

  • Solved tqdm and jupyter notebook dependency issue by(already added to dockerfile)
conda install -c conda-forge ipywidgets
pip install --upgrade jupyter_client
  • Solved skimage open tiff image issue by installing latest tiff package (already added to dockerfile)
pip install tifffile

data:holds data files

preprocessing:

Usage

Generate a set of tiles for a given slide.
Tile generation is computational expensive, so use pre-generated LMDB file for training.

from preprocessing.tile_generation import generate_grid
from preprocessing.normalization import reinhard_bg

test_slides_dir = "/PANDA_Challenge/train_images/"
image_id = "example"
im_size = 512 # Size of tile to be extracted at highest scanning magnification
overlap = 0.25 # Overlap percentage for tiles
ts_thres = 0.6 # Discard tiles with tissue region less that ts_thres
dw_rate = 4 # Tiles downsample rate

# Initialize a tile generator
tile_generator = generate_grid.TileGeneratorGrid(test_slides_dir,
                                                         f"{image_id}.tiff", masks_dir=None, verbose=False)
# Initialize a normalizer
tile_normalizer = reinhard_bg.ReinhardNormalizer()
# use the pre-computed LAB mean and std values
tile_normalizer.fit(None)
# Need to specify masks_dir for tile_generator if you want to generate labeled masks for each tile. 
# Orig_tiles: tiles without normalization; norm_tiles: normalized tiles. 
orig_tiles, norm_tiles, locations, tissue_masks, label_masks \
            = tile_generator.extract_all_tiles(im_size, overlap, ts_thres, dw_rate, tile_normalizer)

An example dataloader can be found in prediction_models/att_mil/datasets/test_slides.py

panda_challenge's People

Contributors

eruditeli avatar wenyuan-vincent-li avatar jiayunli avatar

Watchers

James Cloos avatar

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.