Skip to main content

An automated deep learning pipeline for segmentation of the scapula, humerus, and their respective subregions in CT scans.

Project description

armcortnet

Armcortnet provides automatic segmentation of the humerus and scapula from CT scans. The deep learning model is trained to also segment out the cortical and trabecular subregions from each bone as well.

The deep learning pipeple consists of using armcrop to crop to an oriented bounding box around each humerus or scapula in the image and then a neural network based traine from the nnUNet framework segments that cropped volume. The segmetnation is then transformed back to the original coordinate system, post-processed and finally saved as a .seg.nrrd file.

Installation

Please install pytorch first before installing armcortnet. You can learn about installing pytorch from the official website here.

Then install armcortnet using pip:

pip install armcortnet

For faster oriented bounding box cropping you can replace onnxruntime with onnxruntime-gpu.

Usage

from armcortnet import Net
import SimpleITK as sitk

# initialize the segmentation model
model = Net(bone_type="scapula")  # or "humerus"

# perform segmentation prediction on a CT volume
pred_segmentations = model.predict(
    vol_path="path/to/input/ct.nrrd",
)
# output is a list of SimpleITK images, one for each bone_type detected in the CT
for i, pred_seg in enumerate(pred_segmentations):
    # write each of the segmentations to the disk
    sitk.WriteImage(pred_seg, f"scapula-{i}.seg.nrrd")

Output Labels

The segmentation output contains the following labels:

  • 0: Background
  • 1: Other adjacent bones ("i.e clavicle, radius, ulna, etc.")
  • 2: Cortical region of bone of interest
  • 3: Trabecular region of bone of interest

Models

Trained models are automatically downloaded from HuggingFace Hub (gregspangenberg/armcortnet) on first use.

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

armcortnet-0.2.6.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

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

armcortnet-0.2.6-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file armcortnet-0.2.6.tar.gz.

File metadata

  • Download URL: armcortnet-0.2.6.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.12.3 Linux/6.8.0-53-generic

File hashes

Hashes for armcortnet-0.2.6.tar.gz
Algorithm Hash digest
SHA256 76c292b99128df47ae14d74cc8798e4871da5834720f30026bfc472fafcafdf1
MD5 c3bc6ab03d43fb9db79ba8c05436cee9
BLAKE2b-256 b07e36a4276d5c9c2c6289bcc1553d7709ee25be5828075201f7457922ebb913

See more details on using hashes here.

File details

Details for the file armcortnet-0.2.6-py3-none-any.whl.

File metadata

  • Download URL: armcortnet-0.2.6-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.12.3 Linux/6.8.0-53-generic

File hashes

Hashes for armcortnet-0.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 bd4e818b002d25fc3967f6a8bc19e28ca88ed4910fedf8bfe4b051f31a5fdc31
MD5 f44a651971cd988142a742c0e0ecf21f
BLAKE2b-256 aadc612fc59950426e178f18b3232d0c38d17046f60c206fd8de22ee071ea957

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