Code Monkey home page Code Monkey logo

re-stained_wsis_registration's Introduction

Re-stained whole slide image registration

This is a repo about whole slide image(WSI) registration for re-stained slides.
In clinical practice, we occasionally use different chemicals (such as H&E and IHC) to stain and re-stain to identify particular cells in the same tissue. To enable cell level analysis, WSIs should be aligned. However, traditional methods (such as SIFT[1], ECC[2] and FFT[3]) may fail due to the drastic discrepancy in two WSIs,as showing below. alt text

Our method provide a way to integrate these methods into a simple but effective framework, and help these methods perform more robust. If you find this repo is helpful for your project, please cite our paper:

@article{jiang2019robust,
  title={Robust Hierarchical Density Estimation and Regression for Re-stained Histological Whole Slide Image Co-registration},
  author={Jiang, Jun and Larson, Nicholas and Prodduturi, Naresh and Flotte, Thomas and Hart, Steven},
  journal={BioRxiv},
  pages={565564},
  year={2019},
  publisher={Cold Spring Harbor Laboratory}
}

Quick Start

  • install dependent python packages
conda install -c conda-forge scipy scikit-learn scikit-image opencv openslide

You may need to install OpenSlide library other than python interface.

  • Copy our src folder to local, use the following code to calculate shifting offset.
from wsi_registration import TissueDetector, MatcherParameters, WSI_Matcher
import logging
fixed_wsi = "/fixed_file_name"  # file name of your fixed (template) whole slide image
float_wsi = "/float_file_name"  # file name of your float (moving) whole slide image
# define the tissue detector, so the patches can be sampled
tissue_detector = TissueDetector("LAB_Threshold", threshold=80) # option 1
# tissue_detector = TissueDetector("GNB", threshold=0.5)    # option 2
matcher_parameters = MatcherParameters()  # use the default parameters
matcher = WSI_Matcher(tissue_detector, matcher_parameters)
offset = matcher.match(fixed_wsi, float_wsi)
logging.debug("Shifting offset: %d %d" % offset)
print("Shifting offset: %d %d" % offset)

We use OpenSlide to parse WSI pairs, please make sure your file format is supported by this API.

Update log

09/30/2019

  1. upload an easy to use version. Previous code contains lots of bulky parts for methods comparison/evaluation, now the code has been dramatically simplified.
    Code and example can be find in ./src/wsi_registration.py.
    You just need to copy tsv file ./src/tissue_detection/tissue_others.tsv and ./src/wsi_registration.py to your project, and it's ready to run.

Description of directories

  1. tools: WSI matching tools for manually registration and validation
  2. src: implementation of method presented in the paper, you can have more details in the readme.md in this folder. You can see how to use this method in ./src/wsi_registration.py The old src code will not be maintained.
  3. data: data for replicating the figures in the paper.
    Because each WSI takes up more than 4GB, we are not able to upload the original WSIs for demonstration. Some intermediate data in our experiments are provided to replicate our results.

Reference

  1. Lowe, David G. "Object recognition from local scale-invariant features." In iccv, vol. 99, no. 2, pp. 1150-1157. 1999.
  2. Kim, Jeongtae, and Jeffrey A. Fessler. "Intensity-based image registration using robust correlation coefficients." IEEE transactions on medical imaging 23, no. 11 (2004): 1430-1444.
  3. Reddy, B. Srinivasa, and Biswanath N. Chatterji. "An FFT-based technique for translation, rotation, and scale-invariant image registration." IEEE transactions on image processing 5, no. 8 (1996): 1266-1271.

re-stained_wsis_registration's People

Contributors

smujiang avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

re-stained_wsis_registration's Issues

Dataset of WSIs

Hi,
thanks for sharing your extraordinary work. I was inspired a lot by your nice work. I am a student at TU Darmstadt in Germany and currently working on whole slide image registration as my master project. But I only have a very limited amount of raw WSI for registration which is obviously not enough for optimizing and validating my algorithm. I would like to ask is it possible to share your dataset with me, not necessarily all of them? It would be nice that you can share it with me via google drive or any other online cloud which you are more comfortable with. I can pay for the costs incurred in the process, if necessary. I know that my request is a bit abrupt and rude, but I don't want to give up any possibility that you might agree to it. Anyway, I wish you all the best sincerely. Thanks in advance!
Best,
JJ

Aligning Consecutive Cuts

Hello,
I have found your code while researching the best way to align re-stained WSIs and how to align hematoxylin WSIs from adjacent tissue cuts.

In my workflow, I have four adjacent tissue cuts with hematoxylin staining, and typical registration pipelines fail to align them, as the features from cut to cut vary more than the typical differences seen in re-stained slides.

Do you have any thoughts on how to implement or adapt this pipeline to align adjacent tissue cuts?

Thank you for any help or tips that you can provide!

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.