Skip to main content

lesion-metrics

https://img.shields.io/pypi/v/lesion_metrics.svg https://api.travis-ci.com/jcreinhold/lesion-metrics.svg Documentation Status

Various metrics for evaluating lesion segmentations [1]

Install

The easiest way to install the package is with:

pip install lesion-metrics

To install the dependencies of the CLI, install with:

pip install "lesion-metrics[cli]"

You can also download the source and run:

python setup.py install

Basic Usage

You can generate a report of lesion metrics for a directory of predicted labels and truth labels with the CLI:

lesion-metrics -p predictions/ -t truth/ -o output.csv

Or you can import the metrics and run them on label images:

import nibabel as nib
from lesion_metrics.metrics import dice
pred = nib.load('pred_label.nii.gz').get_fdata()
truth = nib.load('truth_label.nii.gz').get_fdata()
dice_score = dice(pred, truth)

References

[1] Carass, Aaron, et al. “Longitudinal multiple sclerosis lesion segmentation: resource and challenge.” NeuroImage 148 (2017): 77-102.

History

0.1.12 (2022-01-21)

  • Reduce pymedio dependency in volume calculation

0.1.11 (2022-01-13)

  • Use pymedio to open files instead of torchio

  • Refactor for consistency with other projects and code quality

0.1.10 (2021-12-09)

  • Add lesion count to report

  • Add helper metric calculator class

0.1.9 (2021-12-07)

  • Add per lesion metric report CLI for a prediction/truth segmentation pair

0.1.8 (2021-10-28)

  • Add more summary statistics to report

0.1.7 (2021-10-27)

  • Add segmentation volume to report and fix minor bugs

0.1.6 (2021-08-16)

  • Fix minor bug in IoU per lesion computation

0.1.5 (2021-08-16)

  • Make package compliant with mypy

  • Add lesion volume calculation

  • Add support for IoU threshold for LTPR and LFPR

0.1.4 (2021-07-14)

  • Fix type hints in volume correlation

  • Correct name of LFPR (lesion false positive rate) to LFDR (lesion false discovery rate)

0.1.3 (2021-06-07)

  • Fix correlation computation in CLI and other minor typos.

0.1.2 (2021-05-26)

  • Update code style to black and improve docs.

0.1.1 (2021-05-14)

  • Fix repo name.

0.1.0 (2021-05-14)

  • First release on PyPI.

Metadata

Release files for lesion-metrics 0.1.12

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

Source distribution (sdist)

Source distribution for lesion-metrics 0.1.12
File Size Uploaded
lesion-metrics-0.1.12.tar.gz 20.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lesion-metrics 0.1.12
File Interpreter ABI Platform
lesion_metrics-0.1.12-py3-none-any.whl Python 3 none any Details

Total release size: 35.4 kB

Release files / lesion-metrics-0.1.12.tar.gz

Download URL lesion-metrics-0.1.12.tar.gz
Size 20.3 kB
Tags Source
SHA-256 checksum
How to use checksums
7434fc50d1f8416aebca7deae96388966377982f8711147fc9abbddf99ebd1f3
BLAKE2b-256 checksum
How to use checksums
7b919b830d2f4c9a121e1a07804a37fa344e66361d4dc9199fd8d63544f2e976
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

Release files / lesion_metrics-0.1.12-py3-none-any.whl

Download URL lesion_metrics-0.1.12-py3-none-any.whl
Size 15.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7c27d8cfea31b3c14839a13ac70e78530b739f8017f5467a395d793b1c197c1e
BLAKE2b-256 checksum
How to use checksums
72ecf31e03c0f6b26e3d3ce86a1a4c33e800a3cec1c48c6ed125419656aba483
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

Release history Release notifications | RSS feed

This release

0.1.12 This release

2 release files

0.1.11

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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