shapelets.docs.example_3
Example 3 - Local Pattern Orientation
See here for files and code related to this example.
This example demonstrates the local pattern orientation method (M.P. Tino (2024)) implemented in shapelets.self_assembly.quant.orientation
for a square self-assembled nanostructure image (C. Tang (2008))
Overview
Local pattern orientation is concerned with relative nanostructure orientation along grain boundaries and between grains. The details of this method can be found here.
It is also important to note that this method is only applicable to images with one dominant pattern type. Images with mixed patterns are not allowed.
Configuration File
Setup
The example config contains the following:
[general]
image_name = sqrAFM2.png
method = orientation
[orientation]
pattern_order = square
where image_name and method are required parameters that specify the image filename and method used for analysis, respectively.
The orientation method requires one parameter.
pattern_order str
(required)
- The pattern order (symmetry) observed in the image.
- Example values:
stripe
,square
,hexagonal
Run Example
Ensure shapelets
is installed before proceeding.
See here for installation instructions.
This example assumes the working directory has a sub-directory analysis
containing the necessary files: analysis/config
and analysis/images/sqrAFM2.png
.
To run the example, execute shapelets-run ./analysis/config
in the command line.
Depending on your computer hardware, the iterative convergence scheme may take a couple of minutes.
The output (shown below) will then be available in ./analysis/output
containing the mask (top left), dilated feature orientation (top right), smoothed orientation result, and the smoothed orientation result superimposed onto the original pattern (shown below, respectively).
Additional Notes
For users who do not wish to use configuration files and would prefer to interact with shapelets via standard python programming, please see the example_3.py
script here.
You can use this script as a template to conduct your own analyses.
1######################################################################################################################## 2# Copyright 2023 the authors (see AUTHORS file for full list). # 3# # 4# This file is part of shapelets. # 5# # 6# Shapelets is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General # 7# Public License as published by the Free Software Foundation, either version 2.1 of the License, or (at your option) # 8# any later version. # 9# # 10# Shapelets is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied # 11# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more # 12# details. # 13# # 14# You should have received a copy of the GNU Lesser General Public License along with shapelets. If not, see # 15# <https://www.gnu.org/licenses/>. # 16######################################################################################################################## 17 18r""" 19 20.. include:: ../../examples/example_3/example_3.md 21 22"""