Skip to main content

No project description provided

Project description


Deep Learning for Higher Harmonic Generation Microscopy

Deep learning utilities for higher harmonic generation microscopy images.

This project is a deep learning application to classify various pediatric brain tumours from higher harmonic generation microscopy images.
Explore the docs »

Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Contributing
  5. License
  6. Contact
  7. Acknowledgments

About The Project

The project aims to do deep learning classification on higher harmonic generation (HHG) microscopy images of pediatric brain tumours.

(back to top)

Built With

Python

(back to top)

Getting Started

This section includes instructions on setting up the project locally.

Prerequisites

Conda

For package management, it is advised to use a conda package manager. The author recommends Miniforge or Mambaforge.

vips

This project depends on dlup (automatically installed), which depends on vips. On Windows, vips needs to be installed locally. Download the latest libvips Windows binary and unzip somewhere.

OpenSlide

Vips comes with OpenSlide. It is not needed to install OpenSlide separately.

(back to top)

Installation

Run the following commands from a conda enabled shell (such as Miniforge Prompt, if Miniforge/Mambaforge is installed).

  1. Clone this repository and change directories
    git clone https://github.com/siemdejong/dpat.git dpat && cd dpat
    
  2. Create a new conda environment and activate it.
    conda create -n <env_name>
    conda activate <env_name>
    
  3. Install dependencies from environment.yml.
    conda env update -f environment.yml
    
  4. Make sure libvips is available, see Prerequisites.
  5. Change PATHS.vips in config.yml to point to vips\bin.
  6. Install dpat in editable mode with
    pip install -e .
    
  7. Verify installation
    python -c "import dpat"
    

(back to top)

Usage

Converting images

To convert all images from directory INPUT_DIR, and output the images as TIFF in OUTPUT_DIR, run

dpat convert bulk -i INPUT_DIR -o OUTPUT_DIR -e tiff

Large images need to be trusted against decompression bomb DOS attack. Use the --trust flag. To skip images that were already converted to the target extension, use --skip-existing.

NOTE: If converting to tiff, the input images are assumed to contain the reference to the scanning program, which must be in {200slow, 300slow, 300fast}.

usage: dpat convert bulk [-h] --input-dir INPUT_DIR [--output-dir OUTPUT_DIR] --output-ext {tiff,tif} [--num-workers NUM_WORKERS] [--chunks CHUNKS] [--trust | --no-trust] [--skip-existing | --no-skip-existing]

optional arguments:
  -h, --help            show this help message and exit
  --input-dir INPUT_DIR, -i INPUT_DIR
                        Input directory where to find the images to be converted.
  --output-dir OUTPUT_DIR, -o OUTPUT_DIR
                        Output directory where place converted files.
  --output-ext {tiff,tif}, -e {tiff,tif}
                        Extension to convert to.
  --num-workers NUM_WORKERS
                        Number of workers that convert the images in parallel.
  --chunks CHUNKS       Number of chunks distributed to every worker.
  --trust, --no-trust   Trust the source of the images.
  --skip-existing, --no-skip-existing
                        Skip existing output files.

Creating splits

To create train-val-test splits linking paths of images to splits with IMAGE_DIR, output the splits to OUTPUT_DIR, with labels PATH_TO_LABELS_FILE, and dataset name NAME run

dpat splits create -i IMAGE_DIR -o OUTPUT_DIR -l PATH_TO_LABELS_FILE -n NAME

To filter diagnoses that exactly match diseases, use e.g. -f medulloblastoma -f "pilocytic astrocytoma".

usage: dpat splits create [-h] --input-dir INPUT_DIR --output-dir OUTPUT_DIR --labels PATH_TO_LABELS_FILE --name DATASET_NAME [--filter FILTER_DIAGNOSIS] [--overwrite | --no-overwrite]

optional arguments:
  -h, --help            show this help message and exit
  --input-dir INPUT_DIR, -i INPUT_DIR
                        Input directory where to find the images.
  --output-dir OUTPUT_DIR, -o OUTPUT_DIR
                        Name of dataset.
  --labels PATH_TO_LABELS_FILE, -l PATH_TO_LABELS_FILE
                        Path to labels file.
  --name DATASET_NAME, -n DATASET_NAME
                        Name of dataset.
  --filter FILTER_DIAGNOSIS, -f FILTER_DIAGNOSIS
                        Filter a diagnosis. For multiple diagnoses, use `-f 1 -f 2`.
  --overwrite, --no-overwrite
                        Overwrite folds in output dir, if available.

(back to top)

Contributing

Contribute using the following steps.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the GNU General Public License v3.0. See LICENSE for more information.

(back to top)

Contact

Siem de Jong - linkedin.com/in/siemdejong - siem.dejong@hotmail.nl

Project Link: https://github.com/siemdejong/dpat

(back to top)

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

dpat-1.1.0.tar.gz (31.2 kB view hashes)

Uploaded Source

Built Distribution

dpat-1.1.0-py3-none-any.whl (29.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page