Convert Velox generated EMD data into images.
Project description
Convert-EMD
Convert-EMD exports images and spectrum data from Velox generated EMD files.
This project is based on RosettaSciIO and emd-converter
Install
Environment requirements: Python >= 3.8
With pip:
pip install convert-emd
Usage
cemd [-h] FILENAME [-o TYPE] [-ns] [-sc COLOR] [-s FLOAT FLOAT FLOAT] [-e ELEMENT COLOR [ELEMENT COLOR ...]] [-oe ELEMENT [ELEMENT ...]] [-oa FLOAT] [-sa FLOAT] [-c FLOAT FLOAT]
Basic Usage
cemd INPUT_FILE
Run cemd -h for more information.
Output Type
The -o/--out option allows users to choose the output image type (default: tif).
cemd INPUT_FILE -o png ## For PNG type
cemd INPUT_FILE -o tif ## For TIF type
...
Scale Bar
Remove Scale Bar
The -ns/--no_scale option can be used to remove the scale bar in images.
cemd INPUT_FILE -ns ## No scale bar will be shown
Color of Scale Bar
The -sc/--scale_color option can be used to choose the color of the scale bar (default: white).
cemd INPUT_FILE -sc black ## Black scale bar
cemd INPUT_FILE -sc "#000000" ## Hex code can also be used
Position and Width of Scale Bar
The -s/--scale option can be used to adjust the postion and width of scale bar (default: x: 0.75, y: 0.9167, width-factor: 150)
cemd INPUT_FILE -s X Y WIDTH
NOTICE: Three arguments are required to specify the position and width of scale bar.
X and Y should be in float type and between 0 and 1. They decide the position of scale bar at (X, Y).
WIDTH should be a number more than 1. The width of scale bar is given by this factor as h/f (where h is the height of the image, f is the given WIDTH factor).
Elemental Mapping
Color of Elements
Default colors of elemental mapppings are corresponding to the following list in sequnce (Matplotlib default colors):
#1f77b4, #ff7f0e, #2ca02c, #d62728, #9467bd, #8c564b, #e377c2, #7f7f7f, #bcbd22, #17becf
Convert-EMD provides -e/--eds option for users to customize the color of elemental mappings.
cemd INPUT_FILE -e ELEMENT_1 COLOR_1 ELEMENT_2 COLOR_2 ELEMENT_3 COLOR_3 ...
# For example: cemd test.emd -e C "#fff000"
NOTICE: You don't need to specify all elemental colors, those undefined ones will be set according to the default color list.
Overlayed Mapping
The -oe/--overlay option decides which elements are overlyed (default: all).
cemd INPUT_FILE -oe ELEMENT_1 ElEMENT_2 ...
Moreover, -oa/--overlay_alpha and -sa/--substrate_alpha options are provided to adjust the transparency of elemental layers (default: 1.0) and the HAADF layer (default: 0.5) respectively. The argument should be a float number between 0 and 1, 0 means totally transparent.
Contrast (Histogram Equalization)
To improve the contrast (especially for HR-TEM), the -c/--contrast option is provided to introduce the scikit-image histogram equalization method with contrast stretching.
With this method, the image is rescaled to include all intensities that fall within the given percentiles (default: min = 1, max = 99).
cemd INPUT_FILE -c MIN MAX
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file convert_emd-1.0.2.tar.gz.
File metadata
- Download URL: convert_emd-1.0.2.tar.gz
- Upload date:
- Size: 9.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
54ff74a6fd87a201785313a42afbc99a3c5cedbaf5e956f6883f7caacffdbaf5
|
|
| MD5 |
ffb6572fcaf22e755026a7c9599a6f7f
|
|
| BLAKE2b-256 |
c5ae89a99184097705f74de8a29156b9f32492f319c226d83a3dc63bb7060e2d
|
File details
Details for the file convert_emd-1.0.2-py3-none-any.whl.
File metadata
- Download URL: convert_emd-1.0.2-py3-none-any.whl
- Upload date:
- Size: 9.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc9ca0da7d3a88fcad28fee1284d4c74a79750fc11a1fdc7258b2594a7ebff16
|
|
| MD5 |
01b9b275df08c2f7ded68a1bc8aa3a6d
|
|
| BLAKE2b-256 |
d14bd0b8f141e25f67ec5a0df35000408b0794a9bec77330a1f19b4f4aa9c783
|