Fiberorient
Python package for extracting and visualizing the orientations of local structures in 3D image data using structure tensor analysis
Install / Use
/learn @scott-trinkle/FiberorientREADME
fiberorient

fiberorient is a package for performing structure tensor analysis and calculating orientation distribution functions from 3D imaging data.
Code and methodology stem from work published as:
Trinkle, S., Foxley, S., Kasthuri, N., La Rivière, P., “Synchrotron x-ray micro-CT as a validation dataset for diffusion mri in whole mouse brain,” Magnetic Resonance in Medicine, vol. 86, no. 2, pp. 1067–1076, 2021.
For more information, see my blog post.
Installation
fiberorient can be installed with pip:
pip install fiberorient
For local installation, first clone the repo:
git clone https://github.com/scott-trinkle/fiberorient.git
cd into the directory:
cd fiberorient
and run (preferably in a virtual environment):
pip install -e .
Usage
The primary utility of fiberorient is estimating the orientation of local structures in 3D imaging data using structure tensor analysis:
from fiberorient import StructureTensor
img = np.load('img_data') # some 3D image data
st = StructureTensor(d_sigma=1, n_sigma=3)
st.fit(img)
vectors = st.get_vectors(img)
fiberorient is also used to express groups of vectors as orientation distribution functions (ODFs) on a basis of real, even spherical harmonic functions:
from fiberorient.odf import ODF
from fiberorient.util import make_sphere
odf = ODF(degree=8)
odf.fit(vectors)
sphere = make_sphere(3000)
odf_on_sphere = odf.to_sphere(sphere)
The package also includes a number of utilities in the vis module for generating
useful data visualizations, as well as metrics for comparing arrays of vectors
and ODFs in the metrics module.
Further examples are available as Jupyter notebooks in examples/
Related Skills
node-connect
354.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
112.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
354.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
354.5kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
