vedranaa / sphere-colormap

Assigns rgb colors to orientations in 3D.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

scmap

Assigns rgb colors to points on sphere (orientations in 3D).

Installation

Install the module using pip install scmap or clone the repository.

Use

The simplest example involves coloring random 3D vectors.

import scmap
import numpy as np

vectors = np.random.standard_normal(size=(1000,3))
vectors /= np.sqrt((vectors**2).sum(axis=1, keepdims=True))
coloring = scmap.Ico() 
colors = coloring(vectors)

Sphere colormap (scmap) can be oriented by either perumuting vector coordinates, rotating vectors, or defining a z-direction. Check the examples to see how this is accomplished.

Different sphere colormaps

Scmap module includes 4 special spere colormaps. Uno is suitable when orientations are predominantly uindirectional, Duo is suitable when orientations are predominantly in a plane, Tre is suitable when orentations are to be interpeted as being predominantly in x, y or z direction, Ico is suitable when there is no predominant orientation. We also include 2 simpler colormaps: Inc which assigns colors based on inclination, and Azy which colors azymuth.

About

Assigns rgb colors to orientations in 3D.

License:GNU Lesser General Public License v2.1


Languages

Language:Jupyter Notebook 99.9%Language:Python 0.1%