Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

docs/source/_static/logo.png
https://travis-ci.org/rshkarin/quanfima.svg?branch=master Documentation Status https://zenodo.org/badge/127795855.svg

Quanfima (quantitative analysis of fibrous materials) is a collection of useful functions for morphological analysis and visualization of 2D/3D data from various areas of material science. The aim is to simplify the analysis process by providing functionality for frequently required tasks in the same place.

More examples of usage you can find in the documentation.

  • Analysis of fibrous structures by tensor-based method in 2D / 3D datasets.

  • Estimation of structure diameters in 2D / 3D by a ray-casting method.

  • Counting of particles in 2D / 3D datasets and providing a detailed report in pandas.DataFrame format.

  • Calculation of porosity measure for each material in 2D / 3D datasets.

  • Visualization in 2D / 3D using matplotlib, visvis packages.

Installation

The easiest way to install the latest version is by using pip:

$ pip install quanfima

You may also use Git to clone the repository and install it manually:

$ git clone https://github.com/rshkarin/quanfima.git
$ cd quanfima
$ python setup.py install

Usage

Open a grayscale image, perform segmentation, estimate porosity, analyze fiber orientation and diameters, and plot the results.

import numpy as np
from skimage import io, filters
from quanfima import morphology as mrph
from quanfima import visualization as vis
from quanfima import utils

img = io.imread('../data/polymer_slice.tif')

th_val = filters.threshold_otsu(img)
img_seg = (img > th_val).astype(np.uint8)

# estimate porosity
pr = mrph.calc_porosity(img_seg)
for k,v in pr.items():
  print 'Porosity ({}): {}'.format(k, v)

# prepare data and analyze fibers
data, skeleton, skeleton_thick = utils.prepare_data(img_seg)
cskel, fskel, omap, dmap, ovals, dvals = \
                    mrph.estimate_fiber_properties(data, skeleton)

# plot results
vis.plot_orientation_map(omap, fskel, min_label=u'0°', max_label=u'180°',
                         figsize=(10,10),
                         name='2d_polymer',
                         output_dir='/path/to/output/dir')
vis.plot_diameter_map(dmap, cskel, figsize=(10,10), cmap='gist_rainbow',
                      name='2d_polymer',
                      output_dir='/path/to/output/dir')
>> Porosity (Material 1): 0.845488888889
docs/source/_static/2d_polymer_data.png docs/source/_static/2d_polymer_orientation_map_600px.png docs/source/_static/2d_polymer_diameter_map_600px.png

Metadata

Release files for quanfima 0.1a3

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

Built distribution (wheel)

Table of built distributions (wheels) for quanfima 0.1a3
File Interpreter ABI Platform Actions
quanfima-0.1a3-py2-none-any.whl Python 2 none any Details for quanfima-0.1a3-py2-none-any.whl

Release files / quanfima-0.1a3-py2-none-any.whl

Download URL quanfima-0.1a3-py2-none-any.whl
Size 5.0 MB
Tags Python 2
SHA-256 checksum
How to use checksums
5047e4b4abe726ebd05b98fe5cb4132c824265b97b1af37f13dfe58423c47d7c
BLAKE2b-256 checksum
How to use checksums
2fde94930d6ea2922cbabe982764974632ea8e26003e9cbb3d17b9e7ad915e17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for quanfima 0.1a3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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