pysimplemask 0.3.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pysimplemask-0.3.1/.editorconfig +21 -0
- pysimplemask-0.3.1/.github/ISSUE_TEMPLATE.md +15 -0
- pysimplemask-0.3.1/.github/workflows/publish.yml +37 -0
- pysimplemask-0.3.1/.gitignore +110 -0
- pysimplemask-0.3.1/LICENSE +42 -0
- pysimplemask-0.3.1/PKG-INFO +156 -0
- pysimplemask-0.3.1/README.md +78 -0
- pysimplemask-0.3.1/docs/Makefile +20 -0
- pysimplemask-0.3.1/docs/authors.rst +1 -0
- pysimplemask-0.3.1/docs/conf.py +162 -0
- pysimplemask-0.3.1/docs/contributing.rst +1 -0
- pysimplemask-0.3.1/docs/history.rst +1 -0
- pysimplemask-0.3.1/docs/index.rst +20 -0
- pysimplemask-0.3.1/docs/installation.rst +51 -0
- pysimplemask-0.3.1/docs/make.bat +36 -0
- pysimplemask-0.3.1/docs/readme.rst +24 -0
- pysimplemask-0.3.1/docs/usage.rst +11 -0
- pysimplemask-0.3.1/pyproject.toml +76 -0
- pysimplemask-0.3.1/setup.cfg +4 -0
- pysimplemask-0.3.1/src/pysimplemask/__init__.py +11 -0
- pysimplemask-0.3.1/src/pysimplemask/area_mask.py +305 -0
- pysimplemask-0.3.1/src/pysimplemask/cli.py +19 -0
- pysimplemask-0.3.1/src/pysimplemask/file_handler.py +22 -0
- pysimplemask-0.3.1/src/pysimplemask/find_center.py +196 -0
- pysimplemask-0.3.1/src/pysimplemask/outlier_removal.py +182 -0
- pysimplemask-0.3.1/src/pysimplemask/pyqtgraph_mod.py +145 -0
- pysimplemask-0.3.1/src/pysimplemask/qmap.py +186 -0
- pysimplemask-0.3.1/src/pysimplemask/reader/APS_8IDI/__init__.py +6 -0
- pysimplemask-0.3.1/src/pysimplemask/reader/APS_8IDI/aps_8idi_reader.py +149 -0
- pysimplemask-0.3.1/src/pysimplemask/reader/APS_8IDI/hdf_handler.py +128 -0
- pysimplemask-0.3.1/src/pysimplemask/reader/APS_8IDI/imm_handler.py +191 -0
- pysimplemask-0.3.1/src/pysimplemask/reader/APS_8IDI/rigaku_3M_handler.py +152 -0
- pysimplemask-0.3.1/src/pysimplemask/reader/APS_8IDI/rigaku_handler.py +95 -0
- pysimplemask-0.3.1/src/pysimplemask/reader/APS_8IDI/rigaku_six_handler.py +75 -0
- pysimplemask-0.3.1/src/pysimplemask/reader/APS_8IDI/test_rigaku3m.py +9 -0
- pysimplemask-0.3.1/src/pysimplemask/reader/APS_8IDI/xpcs_dataset.py +222 -0
- pysimplemask-0.3.1/src/pysimplemask/reader/APS_9IDD/aps_9idd_reader.py +131 -0
- pysimplemask-0.3.1/src/pysimplemask/reader/__init__.py +0 -0
- pysimplemask-0.3.1/src/pysimplemask/reader/base_reader.py +277 -0
- pysimplemask-0.3.1/src/pysimplemask/reader/esrf_id02/esrf_hdf_handler.py +108 -0
- pysimplemask-0.3.1/src/pysimplemask/reader/timepix_reader.py +128 -0
- pysimplemask-0.3.1/src/pysimplemask/reader/utils.py +230 -0
- pysimplemask-0.3.1/src/pysimplemask/resources/logo.svg +42 -0
- pysimplemask-0.3.1/src/pysimplemask/simplemask_kernel.py +454 -0
- pysimplemask-0.3.1/src/pysimplemask/simplemask_main.py +847 -0
- pysimplemask-0.3.1/src/pysimplemask/simplemask_ui.py +1583 -0
- pysimplemask-0.3.1/src/pysimplemask/table_model.py +79 -0
- pysimplemask-0.3.1/src/pysimplemask/ui/mask.ui +2541 -0
- pysimplemask-0.3.1/src/pysimplemask/utils.py +294 -0
- pysimplemask-0.3.1/src/pysimplemask.egg-info/PKG-INFO +156 -0
- pysimplemask-0.3.1/src/pysimplemask.egg-info/SOURCES.txt +55 -0
- pysimplemask-0.3.1/src/pysimplemask.egg-info/dependency_links.txt +1 -0
- pysimplemask-0.3.1/src/pysimplemask.egg-info/entry_points.txt +2 -0
- pysimplemask-0.3.1/src/pysimplemask.egg-info/requires.txt +17 -0
- pysimplemask-0.3.1/src/pysimplemask.egg-info/top_level.txt +1 -0
- pysimplemask-0.3.1/tests/__init__.py +1 -0
- pysimplemask-0.3.1/tests/test_pysimplemask.py +21 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# http://editorconfig.org
|
|
2
|
+
|
|
3
|
+
root = true
|
|
4
|
+
|
|
5
|
+
[*]
|
|
6
|
+
indent_style = space
|
|
7
|
+
indent_size = 4
|
|
8
|
+
trim_trailing_whitespace = true
|
|
9
|
+
insert_final_newline = true
|
|
10
|
+
charset = utf-8
|
|
11
|
+
end_of_line = lf
|
|
12
|
+
|
|
13
|
+
[*.bat]
|
|
14
|
+
indent_style = tab
|
|
15
|
+
end_of_line = crlf
|
|
16
|
+
|
|
17
|
+
[LICENSE]
|
|
18
|
+
insert_final_newline = false
|
|
19
|
+
|
|
20
|
+
[Makefile]
|
|
21
|
+
indent_style = tab
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
* pySimpleMask version:
|
|
2
|
+
* Python version:
|
|
3
|
+
* Operating System:
|
|
4
|
+
|
|
5
|
+
### Description
|
|
6
|
+
|
|
7
|
+
Describe what you were trying to get done.
|
|
8
|
+
Tell us what happened, what went wrong, and what you expected to happen.
|
|
9
|
+
|
|
10
|
+
### What I Did
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
Paste the command(s) you ran and the output.
|
|
14
|
+
If there was a crash, please include the traceback here.
|
|
15
|
+
```
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- '*'
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
pypi-publish:
|
|
10
|
+
name: Upload release to PyPI
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
environment:
|
|
13
|
+
name: pypi
|
|
14
|
+
url: https://pypi.org/p/pysimplemask
|
|
15
|
+
permissions:
|
|
16
|
+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
|
|
17
|
+
contents: read
|
|
18
|
+
steps:
|
|
19
|
+
- name: Checkout code
|
|
20
|
+
uses: actions/checkout@v4
|
|
21
|
+
|
|
22
|
+
- name: Set up Python
|
|
23
|
+
uses: actions/setup-python@v5
|
|
24
|
+
with:
|
|
25
|
+
python-version: '3.12'
|
|
26
|
+
|
|
27
|
+
- name: Install dependencies
|
|
28
|
+
run: |
|
|
29
|
+
python -m pip install --upgrade pip
|
|
30
|
+
pip install build twine
|
|
31
|
+
|
|
32
|
+
- name: Build package
|
|
33
|
+
run: |
|
|
34
|
+
python -m build
|
|
35
|
+
|
|
36
|
+
- name: Publish package distributions to PyPI
|
|
37
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
env/
|
|
12
|
+
build/
|
|
13
|
+
develop-eggs/
|
|
14
|
+
dist/
|
|
15
|
+
downloads/
|
|
16
|
+
eggs/
|
|
17
|
+
.eggs/
|
|
18
|
+
lib/
|
|
19
|
+
lib64/
|
|
20
|
+
parts/
|
|
21
|
+
sdist/
|
|
22
|
+
var/
|
|
23
|
+
wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
|
|
28
|
+
# PyInstaller
|
|
29
|
+
# Usually these files are written by a python script from a template
|
|
30
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
31
|
+
*.manifest
|
|
32
|
+
*.spec
|
|
33
|
+
|
|
34
|
+
# Installer logs
|
|
35
|
+
pip-log.txt
|
|
36
|
+
pip-delete-this-directory.txt
|
|
37
|
+
|
|
38
|
+
# Unit test / coverage reports
|
|
39
|
+
htmlcov/
|
|
40
|
+
.tox/
|
|
41
|
+
.coverage
|
|
42
|
+
.coverage.*
|
|
43
|
+
.cache
|
|
44
|
+
nosetests.xml
|
|
45
|
+
coverage.xml
|
|
46
|
+
*.cover
|
|
47
|
+
.hypothesis/
|
|
48
|
+
.pytest_cache/
|
|
49
|
+
|
|
50
|
+
# Translations
|
|
51
|
+
*.mo
|
|
52
|
+
*.pot
|
|
53
|
+
|
|
54
|
+
# Django stuff:
|
|
55
|
+
*.log
|
|
56
|
+
local_settings.py
|
|
57
|
+
|
|
58
|
+
# Flask stuff:
|
|
59
|
+
instance/
|
|
60
|
+
.webassets-cache
|
|
61
|
+
|
|
62
|
+
# Scrapy stuff:
|
|
63
|
+
.scrapy
|
|
64
|
+
|
|
65
|
+
# Sphinx documentation
|
|
66
|
+
docs/_build/
|
|
67
|
+
|
|
68
|
+
# PyBuilder
|
|
69
|
+
target/
|
|
70
|
+
|
|
71
|
+
# Jupyter Notebook
|
|
72
|
+
.ipynb_checkpoints
|
|
73
|
+
|
|
74
|
+
# Dask worker cache
|
|
75
|
+
dask-worker-space/
|
|
76
|
+
|
|
77
|
+
# pyenv
|
|
78
|
+
.python-version
|
|
79
|
+
|
|
80
|
+
# celery beat schedule file
|
|
81
|
+
celerybeat-schedule
|
|
82
|
+
|
|
83
|
+
# SageMath parsed files
|
|
84
|
+
*.sage.py
|
|
85
|
+
|
|
86
|
+
# dotenv
|
|
87
|
+
.env
|
|
88
|
+
|
|
89
|
+
# virtualenv
|
|
90
|
+
.venv
|
|
91
|
+
venv/
|
|
92
|
+
ENV/
|
|
93
|
+
|
|
94
|
+
# Spyder project settings
|
|
95
|
+
.spyderproject
|
|
96
|
+
.spyproject
|
|
97
|
+
|
|
98
|
+
# Rope project settings
|
|
99
|
+
.ropeproject
|
|
100
|
+
|
|
101
|
+
# mkdocs documentation
|
|
102
|
+
/site
|
|
103
|
+
|
|
104
|
+
# mypy
|
|
105
|
+
.mypy_cache/
|
|
106
|
+
|
|
107
|
+
# IDE settings
|
|
108
|
+
.vscode/
|
|
109
|
+
.idea/
|
|
110
|
+
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
Copyright (c) 2026, UChicago Argonne, LLC. All rights reserved.
|
|
2
|
+
|
|
3
|
+
Copyright 2026. UChicago Argonne, LLC. This software was produced
|
|
4
|
+
under U.S. Government contract DE-AC02-06CH11357 for Argonne National
|
|
5
|
+
Laboratory (ANL), which is operated by UChicago Argonne, LLC for the
|
|
6
|
+
U.S. Department of Energy. The U.S. Government has rights to use,
|
|
7
|
+
reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR
|
|
8
|
+
UChicago Argonne, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR
|
|
9
|
+
ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is
|
|
10
|
+
modified to produce derivative works, such modified software should
|
|
11
|
+
be clearly marked, so as not to confuse it with the version available
|
|
12
|
+
from ANL.
|
|
13
|
+
|
|
14
|
+
Additionally, redistribution and use in source and binary forms, with
|
|
15
|
+
or without modification, are permitted provided that the following
|
|
16
|
+
conditions are met:
|
|
17
|
+
|
|
18
|
+
* Redistributions of source code must retain the above copyright
|
|
19
|
+
notice, this list of conditions and the following disclaimer.
|
|
20
|
+
|
|
21
|
+
* Redistributions in binary form must reproduce the above copyright
|
|
22
|
+
notice, this list of conditions and the following disclaimer in
|
|
23
|
+
the documentation and/or other materials provided with the
|
|
24
|
+
distribution.
|
|
25
|
+
|
|
26
|
+
* Neither the name of UChicago Argonne, LLC, Argonne National
|
|
27
|
+
Laboratory, ANL, the U.S. Government, nor the names of its
|
|
28
|
+
contributors may be used to endorse or promote products derived
|
|
29
|
+
from this software without specific prior written permission.
|
|
30
|
+
|
|
31
|
+
THIS SOFTWARE IS PROVIDED BY UChicago Argonne, LLC AND CONTRIBUTORS
|
|
32
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
33
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
|
34
|
+
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL UChicago
|
|
35
|
+
Argonne, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
36
|
+
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
37
|
+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
38
|
+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
39
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
40
|
+
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
|
41
|
+
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
42
|
+
POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pysimplemask
|
|
3
|
+
Version: 0.3.1
|
|
4
|
+
Summary: A GUI for creating mask and q-partition maps for scattering patterns in preparation for SAXS/WAXS/XPCS data reduction
|
|
5
|
+
Author-email: Miaoqi Chu <mqichu@anl.gov>
|
|
6
|
+
Maintainer-email: Miaoqi Chu <mqichu@anl.gov>
|
|
7
|
+
License: Copyright (c) 2026, UChicago Argonne, LLC. All rights reserved.
|
|
8
|
+
|
|
9
|
+
Copyright 2026. UChicago Argonne, LLC. This software was produced
|
|
10
|
+
under U.S. Government contract DE-AC02-06CH11357 for Argonne National
|
|
11
|
+
Laboratory (ANL), which is operated by UChicago Argonne, LLC for the
|
|
12
|
+
U.S. Department of Energy. The U.S. Government has rights to use,
|
|
13
|
+
reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR
|
|
14
|
+
UChicago Argonne, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR
|
|
15
|
+
ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is
|
|
16
|
+
modified to produce derivative works, such modified software should
|
|
17
|
+
be clearly marked, so as not to confuse it with the version available
|
|
18
|
+
from ANL.
|
|
19
|
+
|
|
20
|
+
Additionally, redistribution and use in source and binary forms, with
|
|
21
|
+
or without modification, are permitted provided that the following
|
|
22
|
+
conditions are met:
|
|
23
|
+
|
|
24
|
+
* Redistributions of source code must retain the above copyright
|
|
25
|
+
notice, this list of conditions and the following disclaimer.
|
|
26
|
+
|
|
27
|
+
* Redistributions in binary form must reproduce the above copyright
|
|
28
|
+
notice, this list of conditions and the following disclaimer in
|
|
29
|
+
the documentation and/or other materials provided with the
|
|
30
|
+
distribution.
|
|
31
|
+
|
|
32
|
+
* Neither the name of UChicago Argonne, LLC, Argonne National
|
|
33
|
+
Laboratory, ANL, the U.S. Government, nor the names of its
|
|
34
|
+
contributors may be used to endorse or promote products derived
|
|
35
|
+
from this software without specific prior written permission.
|
|
36
|
+
|
|
37
|
+
THIS SOFTWARE IS PROVIDED BY UChicago Argonne, LLC AND CONTRIBUTORS
|
|
38
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
39
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
|
40
|
+
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL UChicago
|
|
41
|
+
Argonne, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
42
|
+
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
43
|
+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
44
|
+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
45
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
46
|
+
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
|
47
|
+
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
48
|
+
POSSIBILITY OF SUCH DAMAGE.
|
|
49
|
+
Project-URL: bugs, https://github.com/AdvancedPhotonSource/pySimpleMask/issues
|
|
50
|
+
Project-URL: changelog, https://github.com/AdvancedPhotonSource/pySimpleMask/blob/master/changelog.md
|
|
51
|
+
Project-URL: homepage, https://github.com/AdvancedPhotonSource/pySimpleMask
|
|
52
|
+
Classifier: Development Status :: 4 - Beta
|
|
53
|
+
Classifier: Intended Audience :: Science/Research
|
|
54
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
55
|
+
Classifier: Programming Language :: Python :: 3
|
|
56
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
57
|
+
Classifier: Topic :: Scientific/Engineering :: Visualization
|
|
58
|
+
Classifier: Operating System :: OS Independent
|
|
59
|
+
Description-Content-Type: text/markdown
|
|
60
|
+
License-File: LICENSE
|
|
61
|
+
Requires-Dist: numpy
|
|
62
|
+
Requires-Dist: scipy
|
|
63
|
+
Requires-Dist: h5py
|
|
64
|
+
Requires-Dist: hdf5plugin
|
|
65
|
+
Requires-Dist: scikit-image
|
|
66
|
+
Requires-Dist: matplotlib
|
|
67
|
+
Requires-Dist: pyqtgraph
|
|
68
|
+
Requires-Dist: PySide6==6.8.3
|
|
69
|
+
Requires-Dist: astropy
|
|
70
|
+
Requires-Dist: imagecodecs
|
|
71
|
+
Requires-Dist: tifffile
|
|
72
|
+
Provides-Extra: dev
|
|
73
|
+
Requires-Dist: coverage; extra == "dev"
|
|
74
|
+
Requires-Dist: mypy; extra == "dev"
|
|
75
|
+
Requires-Dist: pytest; extra == "dev"
|
|
76
|
+
Requires-Dist: ruff; extra == "dev"
|
|
77
|
+
Dynamic: license-file
|
|
78
|
+
|
|
79
|
+
# pySimpleMask
|
|
80
|
+
|
|
81
|
+
[](https://pypi.python.org/pypi/pysimplemask)
|
|
82
|
+
[](https://travis-ci.com/AdvancedPhotonSource/pySimpleMask)
|
|
83
|
+
[](https://pysimplemask.readthedocs.io/en/latest/?version=latest)
|
|
84
|
+
|
|
85
|
+
**pySimpleMask** is a graphical user interface (GUI) tool designed for creating masks and Q-partition maps for scattering patterns, specifically facilitating SAXS, WAXS, and XPCS data reduction.
|
|
86
|
+
|
|
87
|
+
## Features
|
|
88
|
+
|
|
89
|
+
* **Versatile Data Support**: Load scattering data from various formats including HDF5, IMM, TIFF, and binary files.
|
|
90
|
+
* **Interactive Masking**:
|
|
91
|
+
* **Drawing Tools**: Create masks using polygons, circles, rectangles, and lines.
|
|
92
|
+
* **Thresholding**: Automatically mask pixels based on intensity limits (low/high).
|
|
93
|
+
* **Blemish Maps**: Apply pre-existing blemish (bad pixel) files.
|
|
94
|
+
* **Outlier Removal**: Automatically detect and mask outliers using SAXS 1D azimuthal average comparisons.
|
|
95
|
+
* **Manual Selection**: Click to mask specific pixels or regions.
|
|
96
|
+
* **Partition Generation**:
|
|
97
|
+
* Compute Q-Phi partitions (Dynamic/Static).
|
|
98
|
+
* Generate X-Y partitions.
|
|
99
|
+
* Support for custom mapping modes.
|
|
100
|
+
* **Visualization**: Real-time visualization of scattering patterns, masks, and SAXS 1D profiles.
|
|
101
|
+
* **Output**:
|
|
102
|
+
* Save generated masks as TIFF files.
|
|
103
|
+
* Save full partition maps and metadata in Nexus-compatible HDF5/XPCS formats.
|
|
104
|
+
|
|
105
|
+
## Installation
|
|
106
|
+
|
|
107
|
+
### From PyPI
|
|
108
|
+
```bash
|
|
109
|
+
pip install pysimplemask
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### From Source
|
|
113
|
+
1. Clone the repository:
|
|
114
|
+
```bash
|
|
115
|
+
git clone https://github.com/AdvancedPhotonSource/pySimpleMask.git
|
|
116
|
+
cd pysimplemask
|
|
117
|
+
```
|
|
118
|
+
2. Install the package:
|
|
119
|
+
```bash
|
|
120
|
+
pip install .
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Usage
|
|
124
|
+
|
|
125
|
+
To launch the GUI, simply run the following command in your terminal:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
pysimplemask
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
You can also specify a starting path for data loading:
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
pysimplemask --path /path/to/your/data
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## Workflow
|
|
138
|
+
|
|
139
|
+
1. **Load Data**: Click "Select Raw" or "Load" to open your scattering data file.
|
|
140
|
+
2. **Define Mask**:
|
|
141
|
+
* Use the "Mask" tabs to apply different masking techniques (Draw, Threshold, Blemish, etc.).
|
|
142
|
+
* Combine multiple masking methods as needed.
|
|
143
|
+
* Use "Evaluate" to preview the mask and "Apply" to finalize it.
|
|
144
|
+
3. **Compute Partition**:
|
|
145
|
+
* Go to the "Partition" tab.
|
|
146
|
+
* Select the desired mode (e.g., Q-Phi) and configure parameters (number of bins, symmetry).
|
|
147
|
+
* Click "Compute Partition" to generate the maps.
|
|
148
|
+
4. **Save Results**:
|
|
149
|
+
* Click "Save" to export the mask (TIFF) or the full partition data (HDF5).
|
|
150
|
+
|
|
151
|
+
## Credits
|
|
152
|
+
|
|
153
|
+
This package was created with [Cookiecutter](https://github.com/audreyr/cookiecutter) and the [audreyr/cookiecutter-pypackage](https://github.com/audreyr/cookiecutter-pypackage) project template.
|
|
154
|
+
|
|
155
|
+
* **Author**: Miaoqi Chu (mqichu@anl.gov)
|
|
156
|
+
* **License**: BSD 3-Clause license
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# pySimpleMask
|
|
2
|
+
|
|
3
|
+
[](https://pypi.python.org/pypi/pysimplemask)
|
|
4
|
+
[](https://travis-ci.com/AdvancedPhotonSource/pySimpleMask)
|
|
5
|
+
[](https://pysimplemask.readthedocs.io/en/latest/?version=latest)
|
|
6
|
+
|
|
7
|
+
**pySimpleMask** is a graphical user interface (GUI) tool designed for creating masks and Q-partition maps for scattering patterns, specifically facilitating SAXS, WAXS, and XPCS data reduction.
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
* **Versatile Data Support**: Load scattering data from various formats including HDF5, IMM, TIFF, and binary files.
|
|
12
|
+
* **Interactive Masking**:
|
|
13
|
+
* **Drawing Tools**: Create masks using polygons, circles, rectangles, and lines.
|
|
14
|
+
* **Thresholding**: Automatically mask pixels based on intensity limits (low/high).
|
|
15
|
+
* **Blemish Maps**: Apply pre-existing blemish (bad pixel) files.
|
|
16
|
+
* **Outlier Removal**: Automatically detect and mask outliers using SAXS 1D azimuthal average comparisons.
|
|
17
|
+
* **Manual Selection**: Click to mask specific pixels or regions.
|
|
18
|
+
* **Partition Generation**:
|
|
19
|
+
* Compute Q-Phi partitions (Dynamic/Static).
|
|
20
|
+
* Generate X-Y partitions.
|
|
21
|
+
* Support for custom mapping modes.
|
|
22
|
+
* **Visualization**: Real-time visualization of scattering patterns, masks, and SAXS 1D profiles.
|
|
23
|
+
* **Output**:
|
|
24
|
+
* Save generated masks as TIFF files.
|
|
25
|
+
* Save full partition maps and metadata in Nexus-compatible HDF5/XPCS formats.
|
|
26
|
+
|
|
27
|
+
## Installation
|
|
28
|
+
|
|
29
|
+
### From PyPI
|
|
30
|
+
```bash
|
|
31
|
+
pip install pysimplemask
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### From Source
|
|
35
|
+
1. Clone the repository:
|
|
36
|
+
```bash
|
|
37
|
+
git clone https://github.com/AdvancedPhotonSource/pySimpleMask.git
|
|
38
|
+
cd pysimplemask
|
|
39
|
+
```
|
|
40
|
+
2. Install the package:
|
|
41
|
+
```bash
|
|
42
|
+
pip install .
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Usage
|
|
46
|
+
|
|
47
|
+
To launch the GUI, simply run the following command in your terminal:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
pysimplemask
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
You can also specify a starting path for data loading:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
pysimplemask --path /path/to/your/data
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Workflow
|
|
60
|
+
|
|
61
|
+
1. **Load Data**: Click "Select Raw" or "Load" to open your scattering data file.
|
|
62
|
+
2. **Define Mask**:
|
|
63
|
+
* Use the "Mask" tabs to apply different masking techniques (Draw, Threshold, Blemish, etc.).
|
|
64
|
+
* Combine multiple masking methods as needed.
|
|
65
|
+
* Use "Evaluate" to preview the mask and "Apply" to finalize it.
|
|
66
|
+
3. **Compute Partition**:
|
|
67
|
+
* Go to the "Partition" tab.
|
|
68
|
+
* Select the desired mode (e.g., Q-Phi) and configure parameters (number of bins, symmetry).
|
|
69
|
+
* Click "Compute Partition" to generate the maps.
|
|
70
|
+
4. **Save Results**:
|
|
71
|
+
* Click "Save" to export the mask (TIFF) or the full partition data (HDF5).
|
|
72
|
+
|
|
73
|
+
## Credits
|
|
74
|
+
|
|
75
|
+
This package was created with [Cookiecutter](https://github.com/audreyr/cookiecutter) and the [audreyr/cookiecutter-pypackage](https://github.com/audreyr/cookiecutter-pypackage) project template.
|
|
76
|
+
|
|
77
|
+
* **Author**: Miaoqi Chu (mqichu@anl.gov)
|
|
78
|
+
* **License**: BSD 3-Clause license
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Minimal makefile for Sphinx documentation
|
|
2
|
+
#
|
|
3
|
+
|
|
4
|
+
# You can set these variables from the command line.
|
|
5
|
+
SPHINXOPTS =
|
|
6
|
+
SPHINXBUILD = python -msphinx
|
|
7
|
+
SPHINXPROJ = pysimplemask
|
|
8
|
+
SOURCEDIR = .
|
|
9
|
+
BUILDDIR = _build
|
|
10
|
+
|
|
11
|
+
# Put it first so that "make" without argument is like "make help".
|
|
12
|
+
help:
|
|
13
|
+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
14
|
+
|
|
15
|
+
.PHONY: help Makefile
|
|
16
|
+
|
|
17
|
+
# Catch-all target: route all unknown targets to Sphinx using the new
|
|
18
|
+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
|
19
|
+
%: Makefile
|
|
20
|
+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.. include:: ../AUTHORS.rst
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
#
|
|
3
|
+
# pysimplemask documentation build configuration file, created by
|
|
4
|
+
# sphinx-quickstart on Fri Jun 9 13:47:02 2017.
|
|
5
|
+
#
|
|
6
|
+
# This file is execfile()d with the current directory set to its
|
|
7
|
+
# containing dir.
|
|
8
|
+
#
|
|
9
|
+
# Note that not all possible configuration values are present in this
|
|
10
|
+
# autogenerated file.
|
|
11
|
+
#
|
|
12
|
+
# All configuration values have a default; values that are commented out
|
|
13
|
+
# serve to show the default.
|
|
14
|
+
|
|
15
|
+
# If extensions (or modules to document with autodoc) are in another
|
|
16
|
+
# directory, add these directories to sys.path here. If the directory is
|
|
17
|
+
# relative to the documentation root, use os.path.abspath to make it
|
|
18
|
+
# absolute, like shown here.
|
|
19
|
+
#
|
|
20
|
+
import os
|
|
21
|
+
import sys
|
|
22
|
+
sys.path.insert(0, os.path.abspath('..'))
|
|
23
|
+
|
|
24
|
+
import pysimplemask
|
|
25
|
+
|
|
26
|
+
# -- General configuration ---------------------------------------------
|
|
27
|
+
|
|
28
|
+
# If your documentation needs a minimal Sphinx version, state it here.
|
|
29
|
+
#
|
|
30
|
+
# needs_sphinx = '1.0'
|
|
31
|
+
|
|
32
|
+
# Add any Sphinx extension module names here, as strings. They can be
|
|
33
|
+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
|
|
34
|
+
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode']
|
|
35
|
+
|
|
36
|
+
# Add any paths that contain templates here, relative to this directory.
|
|
37
|
+
templates_path = ['_templates']
|
|
38
|
+
|
|
39
|
+
# The suffix(es) of source filenames.
|
|
40
|
+
# You can specify multiple suffix as a list of string:
|
|
41
|
+
#
|
|
42
|
+
# source_suffix = ['.rst', '.md']
|
|
43
|
+
source_suffix = '.rst'
|
|
44
|
+
|
|
45
|
+
# The master toctree document.
|
|
46
|
+
master_doc = 'index'
|
|
47
|
+
|
|
48
|
+
# General information about the project.
|
|
49
|
+
project = 'pySimpleMask'
|
|
50
|
+
copyright = "2024, Miaoqi Chu"
|
|
51
|
+
author = "Miaoqi Chu"
|
|
52
|
+
|
|
53
|
+
# The version info for the project you're documenting, acts as replacement
|
|
54
|
+
# for |version| and |release|, also used in various other places throughout
|
|
55
|
+
# the built documents.
|
|
56
|
+
#
|
|
57
|
+
# The short X.Y version.
|
|
58
|
+
version = pysimplemask.__version__
|
|
59
|
+
# The full version, including alpha/beta/rc tags.
|
|
60
|
+
release = pysimplemask.__version__
|
|
61
|
+
|
|
62
|
+
# The language for content autogenerated by Sphinx. Refer to documentation
|
|
63
|
+
# for a list of supported languages.
|
|
64
|
+
#
|
|
65
|
+
# This is also used if you do content translation via gettext catalogs.
|
|
66
|
+
# Usually you set "language" from the command line for these cases.
|
|
67
|
+
language = None
|
|
68
|
+
|
|
69
|
+
# List of patterns, relative to source directory, that match files and
|
|
70
|
+
# directories to ignore when looking for source files.
|
|
71
|
+
# This patterns also effect to html_static_path and html_extra_path
|
|
72
|
+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
|
|
73
|
+
|
|
74
|
+
# The name of the Pygments (syntax highlighting) style to use.
|
|
75
|
+
pygments_style = 'sphinx'
|
|
76
|
+
|
|
77
|
+
# If true, `todo` and `todoList` produce output, else they produce nothing.
|
|
78
|
+
todo_include_todos = False
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
# -- Options for HTML output -------------------------------------------
|
|
82
|
+
|
|
83
|
+
# The theme to use for HTML and HTML Help pages. See the documentation for
|
|
84
|
+
# a list of builtin themes.
|
|
85
|
+
#
|
|
86
|
+
html_theme = 'alabaster'
|
|
87
|
+
|
|
88
|
+
# Theme options are theme-specific and customize the look and feel of a
|
|
89
|
+
# theme further. For a list of options available for each theme, see the
|
|
90
|
+
# documentation.
|
|
91
|
+
#
|
|
92
|
+
# html_theme_options = {}
|
|
93
|
+
|
|
94
|
+
# Add any paths that contain custom static files (such as style sheets) here,
|
|
95
|
+
# relative to this directory. They are copied after the builtin static files,
|
|
96
|
+
# so a file named "default.css" will overwrite the builtin "default.css".
|
|
97
|
+
html_static_path = ['_static']
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
# -- Options for HTMLHelp output ---------------------------------------
|
|
101
|
+
|
|
102
|
+
# Output file base name for HTML help builder.
|
|
103
|
+
htmlhelp_basename = 'pysimplemaskdoc'
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
# -- Options for LaTeX output ------------------------------------------
|
|
107
|
+
|
|
108
|
+
latex_elements = {
|
|
109
|
+
# The paper size ('letterpaper' or 'a4paper').
|
|
110
|
+
#
|
|
111
|
+
# 'papersize': 'letterpaper',
|
|
112
|
+
|
|
113
|
+
# The font size ('10pt', '11pt' or '12pt').
|
|
114
|
+
#
|
|
115
|
+
# 'pointsize': '10pt',
|
|
116
|
+
|
|
117
|
+
# Additional stuff for the LaTeX preamble.
|
|
118
|
+
#
|
|
119
|
+
# 'preamble': '',
|
|
120
|
+
|
|
121
|
+
# Latex figure (float) alignment
|
|
122
|
+
#
|
|
123
|
+
# 'figure_align': 'htbp',
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
# Grouping the document tree into LaTeX files. List of tuples
|
|
127
|
+
# (source start file, target name, title, author, documentclass
|
|
128
|
+
# [howto, manual, or own class]).
|
|
129
|
+
latex_documents = [
|
|
130
|
+
(master_doc, 'pysimplemask.tex',
|
|
131
|
+
'pySimpleMask Documentation',
|
|
132
|
+
'Miaoqi Chu', 'manual'),
|
|
133
|
+
]
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
# -- Options for manual page output ------------------------------------
|
|
137
|
+
|
|
138
|
+
# One entry per manual page. List of tuples
|
|
139
|
+
# (source start file, name, description, authors, manual section).
|
|
140
|
+
man_pages = [
|
|
141
|
+
(master_doc, 'pysimplemask',
|
|
142
|
+
'pySimpleMask Documentation',
|
|
143
|
+
[author], 1)
|
|
144
|
+
]
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
# -- Options for Texinfo output ----------------------------------------
|
|
148
|
+
|
|
149
|
+
# Grouping the document tree into Texinfo files. List of tuples
|
|
150
|
+
# (source start file, target name, title, author,
|
|
151
|
+
# dir menu entry, description, category)
|
|
152
|
+
texinfo_documents = [
|
|
153
|
+
(master_doc, 'pysimplemask',
|
|
154
|
+
'pySimpleMask Documentation',
|
|
155
|
+
author,
|
|
156
|
+
'pysimplemask',
|
|
157
|
+
'One line description of project.',
|
|
158
|
+
'Miscellaneous'),
|
|
159
|
+
]
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.. include:: ../CONTRIBUTING.rst
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.. include:: ../HISTORY.rst
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Welcome to pySimpleMask's documentation!
|
|
2
|
+
======================================
|
|
3
|
+
|
|
4
|
+
.. toctree::
|
|
5
|
+
:maxdepth: 2
|
|
6
|
+
:caption: Contents:
|
|
7
|
+
|
|
8
|
+
readme
|
|
9
|
+
installation
|
|
10
|
+
usage
|
|
11
|
+
modules
|
|
12
|
+
contributing
|
|
13
|
+
authors
|
|
14
|
+
history
|
|
15
|
+
|
|
16
|
+
Indices and tables
|
|
17
|
+
==================
|
|
18
|
+
* :ref:`genindex`
|
|
19
|
+
* :ref:`modindex`
|
|
20
|
+
* :ref:`search`
|