Skip to main content

Deep Medical Toolkit (dmt)

This repo consists of a personal code toolkit for the purpose of facilitating medical imaging research. The main components of this library consists of a neural network model zoo, image transformations (for preprocessing & augmentation), common metrics/losses, fast multiprocessed data loading, and data structures for image samples.

Implementation Details

Similarities to Torchio

  • Same design hierarchy where samples (dict subclass) can hold arbitrary attributes, and library-specific data like Images (e.g. ScalarImage3D), Labels (e.g Masks)
  • Transforms take samples (i.e. subjects) as they contain all the abstractions and data format conversions built-in. Also their custom attributes feature allows for easy storage of transformation history.

Improvements Over Torchio

  • Overall objects and shift in design..
    • Introduced data abstractions like samples (i.e. subject in torchio) and examples (elements in a batch). This distinction is important.
    • More extensible to allow custom behavior for data structures.
  • Added general data structures for 2D & 3D images, and labels.
    • 3D: ScalarMask3D, ScalarImage3D
    • 2D: ScalarMask2D, ScalarImage2D, VectorImage2D
    • Classification: CategoricalLabel
  • Extended transformations to both 2D & 3D. Also added some 3D ones as well.
    • Added 3D transforms:
    • All 2D transforms:
  • Improved existing data structures.
    • For labels, added categorical (both multi-class & multi-label).
    • For Images, gives you the option to permanently load data.
    • Extensibility is improved for almost all data structures. For example, in an Image, you can overload how a file is read, what preprocessing you want, how to get an array/tensor from the preprocessed sitk image.
  • Extended multiprocessing data loading for better flexibility, extensibility, and performance.
    • Torchio has a Queue class that loades patches, DMT's equivalent of this is the PatchLoader class.
    • This class continously loads patches rather than waiting for the queue to empty.
    • DMT also has a DaemonLoader class that wraps the PyTorch DataLoader to continuously load samples.
  • Added a model zoo that has both 2D & 3D neural networks.
  • Added losses & metrics common to 2D & 3D computer vision tasks.

Additional Verbose Improvements

  • Universally, numpy.ndarrays are passed around (instad of tensors like torchio)
  • Sample images (one sample = one patient) are lazy-loaded as an sitk object if a path is given.

TODO:

General

  • Add weak references for Samples, Images, and Labels for easy access.
  • Remove printing private attributes in repr for images & others.
  • For samples, and other relevant dict objects, check if reserved_attributes are not being overwritten.

Data

  • Add mask + image overlap plotting for samples
  • Add

Transforms

  • Add image shape tracking to attributes for transforms (sample transform history).
  • Add both 2D & 3D resized crop where you can set the scale.

Metadata

Release files for deep-medical-toolkit 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for deep-medical-toolkit 0.0.4
File Size Uploaded Provenance Actions
deep-medical-toolkit-0.0.4.tar.gz 85.8 kB Without provenance Details for deep-medical-toolkit-0.0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for deep-medical-toolkit 0.0.4
File Interpreter ABI Platform Actions
deep_medical_toolkit-0.0.4-py3-none-any.whl Python 3 none any Details for deep_medical_toolkit-0.0.4-py3-none-any.whl

Total release size: 196.8 kB

Release files / deep-medical-toolkit-0.0.4.tar.gz

Download URL deep-medical-toolkit-0.0.4.tar.gz
Size 85.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b64628f092bb9f3be2953cc92b0f4b1036c95c330806750a885cdc8a8dd1c2fe
BLAKE2b-256 checksum
How to use checksums
246af2a7181f626de89a335381fd6e52a53d578ad72cf153078d714631a52d24
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

Release files / deep_medical_toolkit-0.0.4-py3-none-any.whl

Download URL deep_medical_toolkit-0.0.4-py3-none-any.whl
Size 111.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
05b496e8a3230ea9a75fe57bfa21736745c581ea9d63ed06f41a783fb635daa9
BLAKE2b-256 checksum
How to use checksums
a9214acdbe439994a1a91eaffd7646b38f839aaf954fee2ff303747ad9886052
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

Security for deep-medical-toolkit 0.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page