Skip to main content

STIFMaps predicts the local stiffness of breast tissue using the morphology of collagen

Project description

image

Spatially Transformed Inferential Force Maps (STIFMaps)

STIFMaps predict the stiffness of breast tissue using the morphology of collagen fibers and nuclei.

Graphical Abstract

Shown is a triple negative breast tumor. Scale bar, 50 microns

Code from the manuscript: "STIFMap employs a convolutional neural network to reveal spatial mechanical heterogeneity and tension-dependent activation of an epithelial to mesenchymal transition within human breast cancers"

Contents

-Repo Contents
-System Requirements
-Installation Guide
-Getting Started
-Reproducing Manuscript Results
-License
-Acknowledgements
-Contact

Repo Contents

-network_training.ipynb: Jupyter notebook for reproducing the trained models presented in the manuscript
-STIFMaps.ipynb: Jupyter notebook for creating STIFMaps out of input DAPI and collagen images using trained networks
-tests: Contains test code and example image fixtures (e.g., fixtures/no_stain, fixtures/with_stain) used to validate and demonstrate the STIFMap generation pipeline in STIFMaps.ipynb

System Requirements

STIFMaps should run on any standard computer capable of running Jupyter and PyTorch, though 16 GB of RAM is required to enable CUDA optimization. Note that the computer must have enough RAM to support in-memory operations and the extent of memory usage depends on the size of the image that the user is trying to characterize using STIFMaps. Within STIFMaps.ipynb, the user may downsample the image prior to stiffness predictions to reduce memory consumption.

Running STIFMaps.ipynb on the example images provided should only take a few minutes (on a computer with 16 GB of RAM, 12 cores@1.10 GHz, and running Ubuntu 18.04). The runtime to reproduce training for one network should take about 45 minutes to an hour (using a computer with 64 GB of RAM, 16 cores@3.60 GHz, and running Ubuntu 18.04).

Installation Guide

It's recommended to run STIFMaps in a designated virtual environment. Create a virtual environment in Python 3.7 or later that includes pip using the following:

conda create -n STIFMaps python=3.10
conda install -n STIFMaps pip

Then enter the virtual environment and install the STIFMaps PyPI package:

conda activate STIFMaps
python3 -m pip install STIFMaps

Getting Started

Once the STIFMaps package has been installed, run the STIFMaps.ipynb notebook using paired collagen and DAPI images. Example images are available within the fixtures directory. Trained models are available at https://data.mendeley.com/datasets/vw2bb5jy99/2

(Optional) A mask image of zeros and ones may be used to indicate which regions of an image should be excluded from analysis

(Optional) An additional staining image may be used to compute colocalization between the stain and collagen, DAPI, and predicted stiffness

Reproducing Manuscript Results

Data for reproducing manuscript results is available via https://data.mendeley.com/datasets/vw2bb5jy99/2

-raw_squares: The images used for training the neural networks
-stiffnesses.csv: The table of ground truth stiffness values for each square used for model training. Note that stiffness values are natural-log transformed to limit the influence of ourliers
-trained_models: 25 completed, trained models for use with STIFMaps.ipynb to predict elasticity values on an unknown tissue
-output: Statistics regarding the training and accuracy for the trained models

To reproduce manuscript results, the Jupyter notebook used for building and training the neural networks is available via network_training.ipynb. As inputs, the Jupyter notebook needs the elasticity values contained in 'stiffnesses.csv' as well as the image files from 'raw_squares'.

License

This project is covered under the MIT License.

Acknowledgements

Code for visualizing activation and saliency maps was modified from https://github.com/utkuozbulak/pytorch-cnn-visualizations, as credited within the publication.

Contact

Please direct any questions to cstashko@hmc.edu

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

stifmaps-0.0.8.tar.gz (66.8 MB view details)

Uploaded Source

Built Distribution

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

stifmaps-0.0.8-py3-none-any.whl (19.5 kB view details)

Uploaded Python 3

File details

Details for the file stifmaps-0.0.8.tar.gz.

File metadata

  • Download URL: stifmaps-0.0.8.tar.gz
  • Upload date:
  • Size: 66.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for stifmaps-0.0.8.tar.gz
Algorithm Hash digest
SHA256 c32c3b871ffcc5bfce919ee553ff686c7e2df4152971b7e0e7792983acc99254
MD5 c9eea37f7635db63c8c62ea379295953
BLAKE2b-256 131cc1e13261a2a6693054289156f07d26c7686988a2878bd66518d884ed3d35

See more details on using hashes here.

File details

Details for the file stifmaps-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: stifmaps-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 19.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for stifmaps-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 0848dcf88d9b08239993ade67e53223f79981f1d76b131f934e3f9a73033232e
MD5 5007460e393185811a2459e279197835
BLAKE2b-256 dfa1b920458d916b299646dc38a53344c3837dfbd8a4aca60cbae0d59bd11328

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