Skip to main content

This package contains methods for medical image segmentation.

Project description

Dissector

(Badges to be updated soon.)

fair-software.eu recommendations
code repository github repo badge
license github license badge
community registry RSD workflow pypi badge
citation DOI
howfairis fair-software badge
Other best practices  
Documentation Documentation Status
Build build
Citation data consistency cffconvert
Link checker link-check

How to use dissector

Dissector is is an open-source python library which contains methods for medical image segmentation and the evaluation of medical image segmentation. The module for evaluation contains methods to compare a segmentation to a 'ground truth' segmentation. This module should be run in it's own dedicated environment, which can be made in conda (see yaml environment_evaluation), pip or uv. Currently it has only been tested in conda, but the requirements are loose.
The metrics beyond the expected (hausdorf, jaccard, fp, fn, dice) implemented are : boundary intersection over union, binary cross entropy (for comparing two binary segmentation masks). Please note at present a much more robust group of metrics can be created with libraries like MONAI (metrics doc link). Metrics here are implemented for convenience i.e. no need to load pytorch, have lot of GPU space or cry as dependancies clash. Images can be extracted from DICOM files or used directly (nifti or arrays). The long term goal of the dissector project is to compare existing segmentation methods to a to be released state of the art method currently being built but not publicly released yet. This new method exploits the various types of noise in different MRI sequences...so computer science enthousiasts can probably guess the kind of model on the way. The primary authors are Candace Makeda H. Moore and Morris Alper.

At current we are testing all kinds of models. This included adapting one model:

A MedSegDiff adaptation (medsegdiff/)

The medsegdiff/ directory contains an adaptation of MedSegDiff — a denoising diffusion probabilistic model (DDPM) for medical image segmentation — applied to Dixon MRI thigh muscle segmentation on the myosegmenTUM dataset.

The original MedSegDiff algorithm was developed by:

Wu, J., Fu, R., Fang, H., Zhang, Y., Yang, Y., Xiong, H., Liu, H., & Xu, Y. (2024). MedSegDiff-V2: Diffusion-Based Medical Image Segmentation with Transformer. Proceedings of the AAAI Conference on Artificial Intelligence.

Wu, J., Fu, R., Fang, H., Zhang, Y., & Xu, Y. (2023). MedSegDiff: Medical Image Segmentation with Diffusion Probabilistic Model. Medical Imaging with Deep Learning (MIDL).

The original code is available at https://github.com/WuJunde/MedSegDiff under its respective licence. The implementation in this repository is an independent re-implementation that adapts the core DDPM ε-prediction paradigm to two-channel Dixon (water + fat-fraction) conditioning with four binary per-muscle models.

Note: medsegdiff/ is a standalone training and inference tool directory — it is intentionally kept outside src/ and is not part of the installable dissector Python package. The scripts (train.py, predict.py) are meant to be run directly (e.g. python medsegdiff/train.py --muscle R_gracilis) and are not importable as dissector library code.

The project setup is documented in project_setup.md. Feel free to remove this document (and/or the link to this document) if you don't need it.

Installation

To install dissector from GitHub repository, do:

git clone git@github.com:drcandacemakedamoore/dissector.git
cd dissector
python -m pip install .

Instructions for uv and conda soon to come...

Documentation

One source should be https://drcandacemakedamoore.github.io/dissector/. Pypi and build the docs may take longer. Until then it should be online and buid in your docs/_build folder.

Contributing

If you want to contribute to the development of dissector, have a look at the contribution guidelines.

Credits

This package was created with Copier and the NLeSC/python-template.

Acknowledgements

This package supports scientific research which was supported in part by Lambda, Inc.

Generative AI disclosure

This package has some code created with the aid of generative AI. All code on the main branch and in releases is human author written and/or reviewed.

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

dissector-0.0.5.tar.gz (524.5 kB view details)

Uploaded Source

Built Distribution

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

dissector-0.0.5-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

File details

Details for the file dissector-0.0.5.tar.gz.

File metadata

  • Download URL: dissector-0.0.5.tar.gz
  • Upload date:
  • Size: 524.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for dissector-0.0.5.tar.gz
Algorithm Hash digest
SHA256 b468c43ad0ba035dc5d057749c3faf7aecd9c973d3b01b13c6d81707b8fea405
MD5 492aeac18c3f3556f1316a9005423011
BLAKE2b-256 1aba6f1f8ead8640f7743b3cd8374041f80fc72de493ba57b8573b33942452e1

See more details on using hashes here.

File details

Details for the file dissector-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: dissector-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 20.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for dissector-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 e11065e2caa9882dc75d6a9ad7e64e7ce6e9163663eebb1e9e517502834df149
MD5 e37d266a6244c98762732534b2cd02df
BLAKE2b-256 60ed1fedb17266ef4f5e16829ed3b1d640266671f96d5ad2ac07be49dde731e8

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