Coder Social home page Coder Social logo

uw-loci / collagen-fiber-metrics Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 1.0 35.74 MB

Deep generative models for collagen fiber centerline segmentation and extraction in cancer tissue

Jupyter Notebook 99.41% Python 0.59%
collagen-fibers computational-pathology deep-learning generative-adversarial-network histopathology image-segmentation variational-autoencoder

collagen-fiber-metrics's Introduction

Collagen fiber extraction and analysis in cancer tissue microenvironment

This repository is part of the paper

Collagen Fiber Centerline Tracking in Fibrotic Tissue via Deep Neural Networks with Variational Autoencoder-based Synthetic Training Data Generation,
Hyojoon Park*, Bin Li*, Yuming Liu, Michael S. Nelson, Helen M. Wilson, Eftychios Sifakis, Kevin W. Eliceiri,
Medical Image Analysis 2023.

Related repositories:

Installation

Install anaconda/miniconda

  $ conda env create --name collagen --file env.yml
  $ conda activate collagen

If there are issues with OpenCV

  $ pip install opencv-contrib-python

Install ridge-detection package

  $ pip install ridge-detection

Install PyTorch

CenterLine class

This class handles the conversion between a centerline mask and a dictionary that contains the coordinates of individual centerlines, as well as the fiber property computation.
For example, create a CenterLine object using a binary centerline mask:

    from centerline import CenterLine
    centerline = CenterLine(centerline_image=io.imread("examples/example_centerline.png"), associate_image=io.imread("examples/example_image.tif"))

centerline_image is a binary centerline mask, associate_image is an optional image of collagen fiber to which the binary mask corresponds.
Compute the fiber properties:

    centerline.compute_fiber_feats() 
    print(dict(list(centerline.feats.items())[:-1]))

Create a colorized overlay of fiber centerline instances on the collagen fiber image:

    centerline_res.create_overlay()

Other ways to create a CenterLine object, check notebook centerline-basics.ipynb.

Read CT-FIRE results or use ridge detection

Check notebook centerline-baselines.ipynb

FiberExtractor class

This class handles the computation of a fiber centerline mask from a neural network.
Process a collagen fiber image:

    from fiber_extraction import FiberExtractor, UNet
    from skimage import io, img_as_uint
    net = UNet(1, 1, 16, True).eval()
    net.load_state_dict(torch.load('weights/netG.pt'))
    fiber_extractor = FiberExtractor(net)
    im_arr = img_as_uint(io.imread('examples/test_input.png'))
    result = fiber_extractor.compute(im_arr)

Compute the normalization range for 16-bit images. file_list is a list of directories to the image files.

    fiber_extractor.normalization_range(file_list=file_list)

This function computes the range in the 16-bit image set to be stretched to the range of (0, 65535).

Citation

@article{park2023collagen,
         title={Collagen fiber centerline tracking in fibrotic tissue via deep neural networks with variational autoencoder-based synthetic training data generation},
         author={Park, Hyojoon and Li, Bin and Liu, Yuming and Nelson, Michael S and Wilson, Helen M and Sifakis, Eftychios and Eliceiri, Kevin W},
         journal={Medical Image Analysis},
         volume={90},
         pages={102961},
         year={2023},
         publisher={Elsevier}
}

collagen-fiber-metrics's People

Contributors

binli123 avatar hjoonpark avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

peterzs

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.