Skip to main content

armcrop

PyPI Latest Release Code style: black

This package contains a machine learning model that can crop a CT scan to any of the following classes:

  • clavicle
  • scapula
  • humerus
  • radius_ulna
  • hand

It can do both axis aligned cropping and oriented bounding box (obb) cropping. The obb cropping allows for rigid registration of CT scans.

This model was trained on arm only scans and proximal half chest scans. A limitation of this model is that when using a full chest CT where the spine is present the model will struggle to differentiate between it and the scapula.

Installation

To use CPU execution install with:

pip install armcrop

To use CUDA execution you will need to also install torch and onnxruntime-gpu.

Usage

import armcrop
import SimpleITK as sitk

# load CT scan
volume = sitk.ReadImage("path/to/ct_scan.nrrd")

# Oriented Bounding Box Cropping
cropper = armcrop.CropOrientedBoundingBox(volume)
cropped_images = cropper.process(bone="humerus")
for i, img in enumerate(cropped_images):
    sitk.WriteImage(img, f"aligned_humerus-{i}.nrrd")

# Bounding Box Cropping
cropper = armcrop.Crop(volume)
output = cropper.process(bone="scapula")
for i, img in enumerate(output):
    sitk.WriteImage(img, f"cropped_scapula-{i}.nrrd")

Metadata

Release files for armcrop 1.2.1

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

Source distribution (sdist)

Source distribution for armcrop 1.2.1
File Size Uploaded
armcrop-1.2.1.tar.gz 14.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for armcrop 1.2.1
File Interpreter ABI Platform
armcrop-1.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 31.6 kB

Release files / armcrop-1.2.1.tar.gz

Download URL armcrop-1.2.1.tar.gz
Size 14.6 kB
Tags Source
SHA-256 checksum
How to use checksums
49b418d7bccc419b19ce63c48ab0c38e41b48f7bf551d03e46c5115720361944
BLAKE2b-256 checksum
How to use checksums
fa70daf8b9e07983e8cf56103d3f191759b88b062314e50b0fe7c5833d23929c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.1 CPython/3.12.7 Linux/6.11.0-26-generic

Release files / armcrop-1.2.1-py3-none-any.whl

Download URL armcrop-1.2.1-py3-none-any.whl
Size 17.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
76455a365795ad875aa4c7053c2a2725c611c1cef501d4d4d52edb746e6378b6
BLAKE2b-256 checksum
How to use checksums
6a2b0e306f0cd1a3262e841365b70af8ff470053e10fc982fe513b13d4fe13ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.1 CPython/3.12.7 Linux/6.11.0-26-generic

Release history Release notifications | RSS feed

This release

1.2.1 This release

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.8.0

2 release files

0.7.6

2 release files

0.7.5

2 release files

0.7.4

2 release files

0.7.3

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.6

2 release files

0.5.5

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

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