Skip to main content

StereoFractAnalyzer

StereoFractAnalyzer is a Python package designed for analyzing the fractal dimension of 3D surfaces and 2D images. It finds applications across various fields such as material science, geology, and computer graphics. Utilizing the capabilities of Open3D, NumPy, Matplotlib, and PIL, it offers a robust suite of tools for comprehensive fractal geometry analysis.

Features

  • 3D Model Analysis: Load and analyze 3D models from STL files to study their surface complexity.
  • Voxel Grid Conversion: Convert 3D models into voxel grids to facilitate volumetric analysis.
  • Fractal Dimension Calculation: Determine the fractal dimension of both 3D surfaces and 2D binary images to quantify their complexity.
  • Visualization Tools: Utilize visualization capabilities to inspect 3D models, voxel grids, and contour slices of your analytical models.
  • Contour Drawing: Generate and visualize contours of 3D meshes at specified z-heights, aiding in the understanding of surface features.
  • Surface and Image Complexity Estimation: Estimate the roughness or complexity of surfaces and images through detailed fractal analysis.

Installation

Ensure you have Python 3.6 or higher installed on your system. Install StereoFractAnalyzer using pip:

pip install StereoFractAnalyzer

Dependencies

StereoFractAnalyzer requires the following libraries:

  • open3d
  • numpy
  • matplotlib
  • Pillow

Install these dependencies directly using pip if not already installed:

pip install open3d numpy matplotlib Pillow

Usage

Analyzing a 3D Model

To compute the fractal dimension of a 3D surface:

from StereoFractAnalyzer import StereoFractAnalyzer

analyzer = StereoFractAnalyzer(stl_path="path/to/your/model.stl")
surface_fractal_dimension = analyzer.get_surface_fractal_dimension()
print(f"Surface fractal dimension: {surface_fractal_dimension}")

Analyzing a 2D Image

For fractal dimension analysis of a 2D binary image:

from StereoFractAnalyzer import StereoFractAnalyzer

analyzer = StereoFractAnalyzer(img_path="path/to/your/image.png")
fractal_dimension = analyzer.get_image_fractal_dimension(plot=1)
print(f"The fractal dimension of the image is: {fractal_dimension}")

Command Line Interface

StereoFractAnalyzer's CLI allows for direct terminal-based operations for both 3D and 2D analyses.

3D Model Analysis

Analyze a 3D model from an STL file:

StereoFractAnalyzer --stl path/to/your/model.stl

2D Image Analysis

Calculate the fractal dimension of a 2D binary image:

StereoFractAnalyzer --img path/to/your/image.png

Combined Analysis

Conduct analyses on both a 3D model and a 2D image in one command:

StereoFractAnalyzer --stl path/to/your/model.stl --img path/to/your/image.png

Help and Options

For a detailed list of options and help:

StereoFractAnalyzer --help

This displays all command-line options available, providing guidance on how to use the CLI effectively.

Contributing

Contributions are welcome! If you have suggestions for improvements or bug fixes, feel free to fork the repository and submit a pull request.

License

StereoFractAnalyzer is open-source software licensed under the MIT License. See the LICENSE file for more details.


Metadata

Release files for StereoFractAnalyzer 1.0.0

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

Source distribution (sdist)

Source distribution for StereoFractAnalyzer 1.0.0
File Size Uploaded
StereoFractAnalyzer-1.0.0.tar.gz 15.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for StereoFractAnalyzer 1.0.0
File Interpreter ABI Platform
StereoFractAnalyzer-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 31.2 kB

Release files / StereoFractAnalyzer-1.0.0.tar.gz

Download URL StereoFractAnalyzer-1.0.0.tar.gz
Size 15.7 kB
Tags Source
SHA-256 checksum
How to use checksums
467816efd4cf73e1edbb50583f73401a4d2b58f5233cf45bd8f745c50ba1f441
BLAKE2b-256 checksum
How to use checksums
d0027fb635f2b6f815fe81c4134ff29413a7556a53b5d36f22ee9f85a44af7c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.9.18

Release files / StereoFractAnalyzer-1.0.0-py3-none-any.whl

Download URL StereoFractAnalyzer-1.0.0-py3-none-any.whl
Size 15.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8020e19152f979f23e2cfd4a821366cc0482ca764f4716eac0365c4fd723fdf1
BLAKE2b-256 checksum
How to use checksums
9da86fd8fab96a28afb82f1abfc1f41c97edb8ce007d3ca9146a2a100272fdf1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.9.18

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.1

2 release files

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