Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Quanfima (Quantitative Analysis of Fibrous Materials)

License

NotificationsYou must be signed in to change notification settings

rshkarin/quanfima

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docs/source/_static/logo.png


https://travis-ci.org/rshkarin/quanfima.svg?branch=masterDocumentation Status

Quanfima (quantitativeanalysis offibrousmaterials)is a collection of useful functions for morphological analysis and visualizationof 2D/3D data from various areas of material science. The aim is to simplifythe analysis process by providing functionality for frequently required tasksin 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 inpandas.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 fiberorientation and diameters, and plot the results.

importnumpyasnpfromskimageimportio,filtersfromquanfimaimportmorphologyasmrphfromquanfimaimportvisualizationasvisfromquanfimaimportutilsimg=io.imread('../data/polymer_slice.tif')th_val=filters.threshold_otsu(img)img_seg= (img>th_val).astype(np.uint8)# estimate porositypr=mrph.calc_porosity(img_seg)fork,vinpr.items():print'Porosity ({}): {}'.format(k,v)# prepare data and analyze fibersdata,skeleton,skeleton_thick=utils.prepare_data(img_seg)cskel,fskel,omap,dmap,ovals,dvals= \mrph.estimate_fiber_properties(data,skeleton)# plot resultsvis.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 (Material1):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


[8]ページ先頭

©2009-2025 Movatter.jp