Giter Club home page Giter Club logo

pythostitcher's Introduction

PythoStitcher

empty empty

What is PythoStitcher?

Pythostitcher is a tool inspired by AutoStitcher to stitch histopathology images into an artifical whole mount image. These artificial whole-mounts are indispensable for multimodal imaging research, since they greatly improve the ability to relate histopathology information to pre-operative imaging. PythoStitcher works fully automatically and is able to generate very high resolution (0.25 µm/pixel) whole-mounts. For a detailed description check out the official PythoStitcher publication in Nature Scientific Reports.

Does PythoStitcher also work on my data?

If your data consists of either halves or quadrants of a certain type of tissue (i.e. a prostate), PythoStitcher should be able to reconstruct the artificial whole-mount for you. PythoStitcher expects that your data has multiple resolution layers, also known as a pyramidal file, and preferably uses .mrxs or .tiff files. In addition, PythoStitcher requires a tissue mask of said tissue. This tissue mask can be generated by your tissue segmentation algorithm of choice; in the provided sample data we make use of the algorithm from Bándi et al.

How do I run PythoStitcher?

Docker container

It is highly recommended to run PythoStitcher as a Docker container, since PythoStitcher uses some libraries that need to be built from source. The Docker container comes prepackaged with these libraries, as well as with model weights of the involved CNNs, and should run out-of-the-box. You can pull the container with the following command or alternatively build it yourself locally with the provided Dockerfile in /build.

docker pull ghcr.io/computationalpathologygroup/pythostitcher:latest

Data preparation

Your input data should be prepared as follows, where you make a separate raw_images and raw_masks directory for your high resolution image and tissue mask files, respectively. Ensure that the name of the tissue mask is exactly the same as that of the image. If you want to enforce the location of each fragment in the final reconstruction, you can include a force_config.txt file. See the example_force_config.txt file on how to format this. If you leave out this file, PythoStitcher will automatically determine the optimal configuration of the tissue fragments.

data/ 
└── patient_ID
|    └── raw_images
|        ├── image1
|        └── image2
|    └── raw_masks
|        ├── image1
|        └── image2
│    └── force_config.txt [OPTIONAL]

Usage instructions

After preparing the input data in the aforementioned format, you can run PythoStitcher through the command line using:

docker run -v /home/user:/home/user ghcr.io/computationalpathologygroup/pythostitcher --datadir "/home/user/data/patient_x" --savedir "/home/user/results" --resolution x

where datadir refers to the directory with your input data, savedir refers to the location to save the result and resolution refers to the resolution in µm/pixel at which you want to save the final reconstruction. The -v /home/user:/home/user flag is used to create a volume such that the container can access your local data directory. This can be any directory, as long as it is a parent directory for both the data and result directories. To obtain the result for the prostatectomy case with four fragments (figure at the top) you would run:

docker run -v /home/user:/home/user ghcr.io/computationalpathologygroup/pythostitcher --datadir "/home/user/data/prostate_4" --savedir "/home/user/results" --resolution 0.25

Sample data

If you don't have any data available, but are still curious to try PythoStitcher, you can make use of our sample data available from DOI. The sample data includes multiple prostatectomy cases with different sectioning approaches, please see the Zenodo record for more details.

Acknowledgements

The development of PythoStitcher would not have been possible without the open-sourcing of JigsawNet, ASAP and PyVips.

Licensing

The source code of Pythostitcher is licensed under the GNU Lesser General Public License (LGPL). The provided sample data is licensed under the CC Attribution 4.0 International license. Please take these licenses into account when using PythoStitcher.

pythostitcher's People

Contributors

dnschouten avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

pythostitcher's Issues

assert data_dir.is_dir(), "provided patient directory doesn't exist"

Hi,

Followed your instructions but constantly getting the following error (the same folder structure)?

assert data_dir.is_dir(), "provided patient directory doesn't exist"

Also this command doesn't work:

docker run pythostitcher --datadir "~/sample_data/prostate_P000001" --savedir "~/results" --resolution 0.25

I should have called as following:

docker run ghcr.io/computationalpathologygroup/pythostitcher --datadir "~/sample_data/prostate_P000001" --savedir "~/results" --resolution 0.25

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.