Skip to main content

Point Cloud Alignment with PCA

Project description

PCA2

Point Cloud Alignment with PCA

Install

Create conda environment (Recommended)

git pull https://github.com/lukemshepherd/PCA_2.git

conda env create -f environment.yml

conda activate PCA2

With pip

pip install PCA2

Editable install

git pull https://github.com/lukemshepherd/PCA_2.git

pip install -e .

How to use

from PCA2.core import *
from mayavi import mlab # for calling the plots

Set custom filter level (optional)

bone.filter_level = 0.2

Load the data that you want to use

tibia_f2 = bone.from_matlab_path(matlab_file='data/tibia_f2.mat')
tibia_f1 = bone.from_matlab_path(matlab_file='data/phantom_tibia_f1.mat')

Set custom colour for bone (optional)

tibia_f1.default_color = (0.8, 0.3, 0)

Rotate the bone

rotate(tibia_f1, tibia_f2)
0.17458532149354633 no invert
0.5815521223920518 no invert
1.9141791241147516e-16 no invert

Plotting the rotation

Plotting with mayavi is very similar to matplotplib where you build a scene and call it with show()

You can plot bones by calling the .plot() method and then mlab.show()

# tibia_f1.plot()
# tibia_f2.plot()
# mlab.show()

Table of angles

df_angles(tibia_f1, tibia_f2, name='tibia')
1.6184142622847344e-16 no invert
1.2412670766236368e-16 no invert
1.9141791241147516e-16 no invert
<style scoped> .dataframe tbody tr th:only-of-type { vertical-align: middle; }
.dataframe tbody tr th {
    vertical-align: top;
}

.dataframe thead th {
    text-align: right;
}
</style>
tibia f2: pc1 tibia f2: pc2 tibia f2: pc3
tibia f1: pc1 1.618414e-16 NaN NaN
tibia f1: pc2 NaN 1.241267e-16 NaN
tibia f1: pc3 NaN NaN 1.914179e-16

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

PCA2-0.0.3.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

PCA2-0.0.3-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file PCA2-0.0.3.tar.gz.

File metadata

  • Download URL: PCA2-0.0.3.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.22.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for PCA2-0.0.3.tar.gz
Algorithm Hash digest
SHA256 4dcc84cebfb3c348d406ba3020ef6d8b4fd22a95b31057dfe52990731c6db768
MD5 6316562ba260b70b39cde3559148e5d9
BLAKE2b-256 36d75a9bf5deebaad8d63b5ca8cec2090fa8e911433e7ae236a8bd5ed9165227

See more details on using hashes here.

File details

Details for the file PCA2-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: PCA2-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.22.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for PCA2-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c1f588ab43d7ab940dd5284f0dede3f56e336931e493844500e1afb14609ef7c
MD5 e32dc6696ad76b766ccfda4d30379cc8
BLAKE2b-256 346e9bfcc971d613908f501b1ea04d567fc054bfee4801167a7797d83696e025

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page