Code Monkey home page Code Monkey logo

shoulder's Introduction

shoulder

PyPI Latest Release Code style: black

This package uses a collection of machine learning models to detect anatomic landmarks on 3d models of shoulder bones and also generates patient specific coordinate systems. An stl of the shoulder bone of interest is all that is needed to get started. Currently only implemented for the humerus, with expansion to the scapula in the future. Landmarks that shoulder can currently identify on the humerus are:

  • canal
  • transepicondylar axis
  • bicipital groove
  • anatomic neck

Installation

compatible with python 3.10 and 3.11

pip install shoulder

Example

Start by using the example bone stl's located in "tests/test_bones"

# pass stl into Humerus
hum = shoulder.Humerus("tests/test_bones/humerus_left.stl")

# apply coordinate sysytem
hum.apply_csys_canal_transepiconylar()

# calculate landmarks
hum.canal.axis()
hum.trans_epiconylar.axis()
hum.anatomic_neck.points()
hum.bicipital_groove.axis()

# calculate metrics
hum.radius_curvature()
hum.neckshaft()
hum.retroversion()

# construct plot from above humeral bone with landmarks and coordinate system
plot = shoulder.Plot(hum)
plot.figure.show()

The output of the plot will appear as shown below with landmarks included and transformed from the original CT coordinate system to a coordainte system defined by the canal and transepicondylar axis.

Plot of Example code above

Contributing

Clone the repo, open the cloned folder containing the poetry.lock file, then install the development dependencies using poetry.

poetry install --with dev

shoulder's People

Contributors

gregspangenberg avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

dcunni9

shoulder's Issues

Apply CSYS

Applying a coordinate system retroactively changes all points, but when calculating new points they are not in the newly applied coordinate system. C

Currently the user must do the following to get all their calculated points in the same coordinate system:

h = shoulder.Humerus(stl_bone) 
h.canal.axis([0.5, 0.8]) #csys applied
h.trans_epiconylar.axis() #csys applied
h.bicipital_groove.axis() #csys applied
h.apply_csys_canal_transepiconylar() 

If the user then the csys doesn't apply to all landmarks

h = shoulder.Humerus(stl_bone) 
h.canal.axis([0.5, 0.8]) #csys applied
h.trans_epiconylar.axis() #csys applied
h.apply_csys_canal_transepiconylar() 
h.bicipital_groove.axis() #csys NOT applied

Consistent naming scheme for calculating the landmarks

Each landmark is a class that contains a function that calculates what points make up the landmark.
To do this calculation there are multiple names for this calculating function

h = shoulder.Humerus(stl_bone)
h.trans_epiconylar.axis()
h.bicipital_groove.axis()
h.anatomic_neck.points() #different name for calculating the landmark

Perhaps renaming all calculation methods to .points() and then creating new methods that calculate derivatives of .points() such as .axis(), and .plane(), etc.

If a user calls one of the derivatives it should check if .points() has calculated already and if not call it to get the inputs it needs.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.