Crate mikan

Source
Expand description

ยงmikan-rs ๐ŸŠ

A medical image kit for segmentation metrics evaluation, native Rust support, and Python bindings for cross-language performance.

ยง๐ŸŽจ Features

  • ๐Ÿš€ Blazingly Fast: Written in Rust with high parallelization; speeds are 10-100x faster than medpy (depends on the number of cores in your CPU), especially for Hausdorff distance calculations.

  • ๐ŸŽฏ Simple: The API is so intuitive that you can start using it immediately while reading the documentation in just one minute!

  • ๐Ÿงฎ Comprehensive Metrics: Easily to compute almost all of segmentation metrics, results are consistent with medpy:

    • Confusion Matrix Based:

      • Dice/IoU
      • TP/TN/FP/FN
      • Sensitivity/Specificity/Precision
      • Accuracy/Balanced Accuracy
      • ARI/FNR/FPR/F-score
      • Volume Similarity
      • MCC/nMCC/aMCC
    • Distance Based:

      • Hausdorff Distance (HD)
      • Hausdorff Distance 95 (HD95)
      • Average Symmetric Surface Distance (ASSD)
      • Mean Average Surface Distance (MASD)

ยง๐Ÿ”จ Install

For Rust projects, add the following to your Cargo.toml:

[dependencies]
mikan-rs = "*"

For Python, install via pip:

pip install mikan-rs

ยง๐Ÿฅ’ Develop

maturin dev

ยง๐Ÿ“˜ Usages

import mikan
import SimpleITK as sitk

gt = sitk.ReadImage("gt.nii.gz", sitk.sitkUInt8)
pred = sitk.ReadImage("pred.nii.gz", sitk.sitkUInt8)

e = mikan.Evaluator(gt, pred)
e.labels([1, 2, 3]).metrics(["dice", "hd", "hd95", "assd"])

For details, please refer to the python examples and rust examples.

  • medpy: A well-known package for calculating segmentation metrics, with excellent documentation and implementation.
  • miseval: A framework capable of calculating a large number of segmentation metrics.
  • seg_metrics: A package for segmentation metrics that supports batch data calculation and CSV output, making it very convenient.
  • MetricsReloaded: A new recommendation framework for biomedical image analysis validation, published in Nature Methods.

ยง๐Ÿ“ƒ Citation

If you use this software, we would appreciate it if you could include an mikan emoji ๐ŸŠ in your paper.

ยง๐Ÿš Q&A

Q: Why are my results different from seg_metrics/miseval/MetricsReloaded?

A: They are wrong. Of course, we might be wrong too. PRs to fix issues are welcome!

ยง๐Ÿ”’ License

Licensed under either of the following licenses, at your choice:

Apache License, Version 2.0 (See LICENSE-APACHE or visit http://www.apache.org/licenses/LICENSE-2.0)

MIT License (See LICENSE-MIT or visit http://opensource.org/licenses/MIT)

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project, as defined by the Apache License 2.0, will be dual-licensed under the above licenses without any additional terms or conditions.

Re-exportsยง

pub use api::all;
pub use api::metrics;
pub use api::Evaluator;

Modulesยง

api
Core APIs. Carefully designed to be simple and easy to use.