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)
- DICOM / NIfTI reading (
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file medcore-1.6.0.tar.gz.
File metadata
- Download URL: medcore-1.6.0.tar.gz
- Upload date:
- Size: 68.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd43d53460632bde24efd513cb614f54e89622927006b3484dd187c5d97af072
|
|
| MD5 |
965d24ec7ff130883e35de3796a5fcc1
|
|
| BLAKE2b-256 |
f1ec452a2a5e46830d843cafcb8ac9a4ca1524153ff5b37092e638b73368a996
|
File details
Details for the file medcore-1.6.0-py3-none-any.whl.
File metadata
- Download URL: medcore-1.6.0-py3-none-any.whl
- Upload date:
- Size: 65.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2d3ac99311dd7fbc0b481bf5248c63dc2d6e5b4072322ba5f1024b2c9882b8a
|
|
| MD5 |
60d2429943fcb2b252d711995a2a917d
|
|
| BLAKE2b-256 |
cb2f3d5e95532624b0be1c30c8b03d01ffd4951a727ea340c28524fcac71c4a5
|