Skip to main content

Medical imaging utilities based on SimpleITK

Project description

medcore

Medical imaging utilities for DICOM / NIfTI workflows based on SimpleITK.

Features

  • IO
    • DICOM / NIfTI reading (ImageReader)
  • Image utils
    • intensity array conversion / normalization
    • resampling / transform helpers
    • NIfTI write and label merge utilities
  • Detection
    • coronal angle estimation
    • umbilicus detection helpers
  • Segmentation
    • torso and abdomen segmentation classes
  • Feature extraction
    • label area/volume summary
    • patch extraction around landmark points

Installation

From source

git clone https://github.com/yhchoi-data/medcore.git
cd medcore
pip install .

From source (developer mode)

git clone https://github.com/yhchoi-data/medcore.git
cd medcore
pip install -e ".[dev]"

From pypi [to be updated]

pip install medcore

Optional: DICOM to NIfTI conversion with dcm2niix

medcore.io.convert_dicom_to_nifti uses the external dcm2niix executable. Install it separately when you need dcm2niix-based DICOM to NIfTI conversion:

conda install -c conda-forge dcm2niix

After installation, make sure the executable is available in your shell or notebook kernel:

dcm2niix -h

Quick start

from medcore.io import ImageReader, convert_dicom_to_nifti
from medcore.utils import (
    sitk_get_array,
    sitk_write_nii,
    sitk_read_labelfiles,
)

from medcore.detect import UmbilicusPredictor, UmbilicusDetector
from medcore.segment import TorsoSegmenter, AbdomenSegmenter
from medcore.feature import compute_label_volumes, extract_patches_from_image

Package usage

# IO
from medcore.io import ImageReader

# Utility functions
from medcore.utils import sitk_resampler, figure_overlay_label_on_slices

# Detection / segmentation
from medcore.detect import UmbilicusPredictor
from medcore.segment import TorsoSegmenter

# Feature extraction
from medcore.feature import compute_label_areas, compute_label_volumes

Documentation

Detailed examples are in USAGE.md.

Developer workflow

pre-commit run --all-files

On the first run, some hooks may show Failed because they automatically fix files such as trailing whitespace or formatting. That is normal. Run pre-commit run --all-files once more and it should pass after the auto-fixes are applied.

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

medcore-1.5.0.tar.gz (63.1 kB view details)

Uploaded Source

Built Distribution

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

medcore-1.5.0-py3-none-any.whl (61.4 kB view details)

Uploaded Python 3

File details

Details for the file medcore-1.5.0.tar.gz.

File metadata

  • Download URL: medcore-1.5.0.tar.gz
  • Upload date:
  • Size: 63.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for medcore-1.5.0.tar.gz
Algorithm Hash digest
SHA256 e8ab969e899c71c0d43c36a2eb05d5c1ca7f37bfd50e5d030e1f9cc527d4e09c
MD5 2fc7ef3f0be81c0106b36f3bc51ff4b7
BLAKE2b-256 43d8161d8e80cac0949f69544b95bbd35fcf960836efaad507a1c06e7a4b6545

See more details on using hashes here.

File details

Details for the file medcore-1.5.0-py3-none-any.whl.

File metadata

  • Download URL: medcore-1.5.0-py3-none-any.whl
  • Upload date:
  • Size: 61.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for medcore-1.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a7eeaf3812d6bb0cc3557ee7335b4e31da992d6ac93977a1c8b5d0839300210d
MD5 b16d1542b21660eb292b83ae4fe76c2b
BLAKE2b-256 cd640c76d5b206d4bcc93e78a46ee07f1fef87df791ab347f8784244bd92262a

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