pyfigures 0.1.0__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.
Files changed (36) hide show
  1. pyfigures-0.1.0/LICENSE +24 -0
  2. pyfigures-0.1.0/PKG-INFO +109 -0
  3. pyfigures-0.1.0/README.md +65 -0
  4. pyfigures-0.1.0/pyfigures/__init__.py +0 -0
  5. pyfigures-0.1.0/pyfigures/__main__.py +53 -0
  6. pyfigures-0.1.0/pyfigures/gui/__init__.py +0 -0
  7. pyfigures-0.1.0/pyfigures/gui/about_dialog_pzf.py +68 -0
  8. pyfigures-0.1.0/pyfigures/gui/annotation_editor_former_000_TOP_vectorial2.py +2698 -0
  9. pyfigures-0.1.0/pyfigures/gui/autolettering_widget.py +271 -0
  10. pyfigures-0.1.0/pyfigures/gui/bg_color_selection.py +92 -0
  11. pyfigures-0.1.0/pyfigures/gui/colorassistant.py +128 -0
  12. pyfigures-0.1.0/pyfigures/gui/customdialog.py +136 -0
  13. pyfigures-0.1.0/pyfigures/gui/emptyimagedialog.py +51 -0
  14. pyfigures-0.1.0/pyfigures/gui/ezfig.py +4978 -0
  15. pyfigures-0.1.0/pyfigures/gui/fontselectorgui.py +59 -0
  16. pyfigures-0.1.0/pyfigures/gui/group_builder_GUI.py +65 -0
  17. pyfigures-0.1.0/pyfigures/gui/keep_tst_images_for_pzf.py +1241 -0
  18. pyfigures-0.1.0/pyfigures/gui/lutmultiselector.py +154 -0
  19. pyfigures-0.1.0/pyfigures/gui/pagelimitswidget.py +87 -0
  20. pyfigures-0.1.0/pyfigures/gui/panelcreationwidget.py +123 -0
  21. pyfigures-0.1.0/pyfigures/gui/pfgui.py +2052 -0
  22. pyfigures-0.1.0/pyfigures/gui/scalebareditor.py +172 -0
  23. pyfigures-0.1.0/pyfigures/gui/scrollableEZFIG.py +558 -0
  24. pyfigures-0.1.0/pyfigures/gui/simple_text_editor.py +1169 -0
  25. pyfigures-0.1.0/pyfigures/gui/textEditWatcher.py +105 -0
  26. pyfigures-0.1.0/pyfigures/gui/tipdialog.py +99 -0
  27. pyfigures-0.1.0/pyfigures/gui/user_extra_translation.py +52 -0
  28. pyfigures-0.1.0/pyfigures/gui/widget_for_inset.py +134 -0
  29. pyfigures-0.1.0/pyfigures/version.py +10 -0
  30. pyfigures-0.1.0/pyfigures.egg-info/PKG-INFO +109 -0
  31. pyfigures-0.1.0/pyfigures.egg-info/SOURCES.txt +34 -0
  32. pyfigures-0.1.0/pyfigures.egg-info/dependency_links.txt +1 -0
  33. pyfigures-0.1.0/pyfigures.egg-info/requires.txt +29 -0
  34. pyfigures-0.1.0/pyfigures.egg-info/top_level.txt +1 -0
  35. pyfigures-0.1.0/setup.cfg +4 -0
  36. pyfigures-0.1.0/setup.py +66 -0
@@ -0,0 +1,24 @@
1
+ BSD 2-Clause License
2
+
3
+ Copyright (c) 2024, baigouy
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
19
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
22
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,109 @@
1
+ Metadata-Version: 2.1
2
+ Name: pyfigures
3
+ Version: 0.1.0
4
+ Summary: PyFigures will assist you assemble publication ready scientific figures in no time.
5
+ Home-page: https://github.com/baigouy/PyFigures
6
+ Author: Benoit Aigouy
7
+ Author-email: benoit.aigouy@gmail.com
8
+ License: BSD
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: License :: OSI Approved :: BSD License
11
+ Classifier: Operating System :: OS Independent
12
+ Requires-Python: >=3.7, <3.11
13
+ Description-Content-Type: text/markdown
14
+ License-File: LICENSE
15
+ Requires-Dist: czifile
16
+ Requires-Dist: Markdown
17
+ Requires-Dist: matplotlib>=3.5.2
18
+ Requires-Dist: numpy
19
+ Requires-Dist: Pillow>=8.1.2
20
+ Requires-Dist: PyQt6
21
+ Requires-Dist: read-lif
22
+ Requires-Dist: scikit-image>=0.19.3
23
+ Requires-Dist: scipy>=1.7.3
24
+ Requires-Dist: scikit-learn>=1.0.2
25
+ Requires-Dist: tifffile>=2021.11.2
26
+ Requires-Dist: tqdm
27
+ Requires-Dist: natsort
28
+ Requires-Dist: numexpr
29
+ Requires-Dist: urllib3
30
+ Requires-Dist: qtawesome
31
+ Requires-Dist: pandas
32
+ Requires-Dist: numba
33
+ Requires-Dist: elasticdeform
34
+ Requires-Dist: roifile
35
+ Requires-Dist: prettytable
36
+ Requires-Dist: pyperclip
37
+ Requires-Dist: QtPy>=2.1.0
38
+ Requires-Dist: Deprecated
39
+ Requires-Dist: Requests
40
+ Requires-Dist: batoolset
41
+ Requires-Dist: python-bioformats
42
+ Requires-Dist: python-javabridge
43
+ Requires-Dist: pyautogui
44
+
45
+ # PyFigures
46
+
47
+ Effortless creation of high-quality scientific figures in Python.
48
+
49
+ [![Watch the video](./images/PyFigures.png)](https://youtu.be/HSdCu-CW8eI)
50
+
51
+ Since a video is better than a thousand (click on the image above to view the demo).
52
+
53
+ # Install
54
+
55
+ 1. Install [Miniconda](https://docs.anaconda.com/miniconda/) (if not already present on your system)
56
+
57
+ 2. Then in a command prompt type:
58
+
59
+ ```
60
+ conda create -y -n PyFigures python==3.10.12
61
+ conda activate PyFigures
62
+ pip install -U pip
63
+ pip install -U pyfigures
64
+ python -m pyfigures
65
+ ```
66
+
67
+ **NB**:
68
+ - To open a **command prompt** on **Windows** press **Windows+R** then type **cmd**
69
+ - To open a **command prompt** on **MacOS** press **Command+Space** then type **Terminal**
70
+ - To open a **command prompt** on **Ubuntu** press **Ctrl+Alt+T**
71
+
72
+ # Run
73
+
74
+ To open the graphical user interface, type the following in a command:
75
+
76
+ ```
77
+ conda activate PyFigures
78
+ python -m pyfigures
79
+ ```
80
+
81
+ # Third party libraries
82
+
83
+ Below is a list of the 3<sup>rd</sup> party libraries used by PyFigures.<br><br> <font color='red'>**IMPORTANTLY: if you disagree with any license below, <u>please uninstall PyFigures</u>**.<br></font>
84
+
85
+ | Library name | Use | Link | License |
86
+ |-------------------------|-------------------------------------------------------------|-----------------------------------------------|--------------------|
87
+ | **Markdown** | Python implementation of Markdown | https://pypi.org/project/Markdown/ | BSD |
88
+ | **matplotlib** | Plots images and graphs | https://pypi.org/project/matplotlib/ | PSF |
89
+ | **numpy** | Array/Image computing | https://pypi.org/project/numpy/ | BSD |
90
+ | **Pillow** | Reads 'basic' images (.bmp, .png, .pnm, ...) | https://pypi.org/project/Pillow/ | HPND |
91
+ | **PyQt6** | Graphical user interface (GUI) | https://pypi.org/project/PyQt6/ | GPL v3 |
92
+ | **QtPy** | An abstraction layer for PyQt and PySide | https://pypi.org/project/QtPy/ | MIT |
93
+ | **read-lif** | Reads Leica .lif files | https://pypi.org/project/read-lif/ | GPL v3 |
94
+ | **czifile** | Reads Zeiss .czi files | https://pypi.org/project/czifile/ | BSD (BSD-3-Clause) |
95
+ | **tifffile** | Reads .tiff files (also reads Zeiss .lsm files) | https://pypi.org/project/tifffile/ | BSD |
96
+ | **python-bioformats** | A library to open scientific images | https://pypi.org/project/python-bioformats/ | GPLv2 |
97
+ | **python-javabridge** | A library to run java executables (required for bioformats) | https://pypi.org/project/python-javabridge/ | BSD |
98
+ | **scikit-image** | Image processing | https://pypi.org/project/scikit-image/ | BSD (Modified BSD) |
99
+ | **scipy** | Great library to work with numpy arrays | https://pypi.org/project/scipy/ | BSD |
100
+ | **scikit-learn** | Great library for machine learning | https://pypi.org/project/scikit-learn/ | BSD |
101
+ | **tqdm** | Command line progress | https://pypi.org/project/tqdm/ | MIT, MPL 2.0 |
102
+ | **natsort** | 'Human' like sorting of strings | https://pypi.org/project/natsort/ | MIT |
103
+ | **numexpr** | Speeds up image math | https://pypi.org/project/numexpr/ | MIT |
104
+ | **urllib3** | Model architecture and trained models download | https://pypi.org/project/urllib3/ | MIT |
105
+ | **qtawesome** | Elegant icons for PyQT/PySide | https://pypi.org/project/QtAwesome/ | MIT |
106
+ | **pandas** | Data analysis toolkit | https://pypi.org/project/pandas/ | BSD (BSD-3-Clause) |
107
+ | **numba** | GPU acceleration of numpy ops | https://pypi.org/project/numba/ | BSD |
108
+ | **roifile** | A library to read ImageJ ROIs | https://pypi.org/project/roifile/ | BSD 3-Clause |
109
+
@@ -0,0 +1,65 @@
1
+ # PyFigures
2
+
3
+ Effortless creation of high-quality scientific figures in Python.
4
+
5
+ [![Watch the video](./images/PyFigures.png)](https://youtu.be/HSdCu-CW8eI)
6
+
7
+ Since a video is better than a thousand (click on the image above to view the demo).
8
+
9
+ # Install
10
+
11
+ 1. Install [Miniconda](https://docs.anaconda.com/miniconda/) (if not already present on your system)
12
+
13
+ 2. Then in a command prompt type:
14
+
15
+ ```
16
+ conda create -y -n PyFigures python==3.10.12
17
+ conda activate PyFigures
18
+ pip install -U pip
19
+ pip install -U pyfigures
20
+ python -m pyfigures
21
+ ```
22
+
23
+ **NB**:
24
+ - To open a **command prompt** on **Windows** press **Windows+R** then type **cmd**
25
+ - To open a **command prompt** on **MacOS** press **Command+Space** then type **Terminal**
26
+ - To open a **command prompt** on **Ubuntu** press **Ctrl+Alt+T**
27
+
28
+ # Run
29
+
30
+ To open the graphical user interface, type the following in a command:
31
+
32
+ ```
33
+ conda activate PyFigures
34
+ python -m pyfigures
35
+ ```
36
+
37
+ # Third party libraries
38
+
39
+ Below is a list of the 3<sup>rd</sup> party libraries used by PyFigures.<br><br> <font color='red'>**IMPORTANTLY: if you disagree with any license below, <u>please uninstall PyFigures</u>**.<br></font>
40
+
41
+ | Library name | Use | Link | License |
42
+ |-------------------------|-------------------------------------------------------------|-----------------------------------------------|--------------------|
43
+ | **Markdown** | Python implementation of Markdown | https://pypi.org/project/Markdown/ | BSD |
44
+ | **matplotlib** | Plots images and graphs | https://pypi.org/project/matplotlib/ | PSF |
45
+ | **numpy** | Array/Image computing | https://pypi.org/project/numpy/ | BSD |
46
+ | **Pillow** | Reads 'basic' images (.bmp, .png, .pnm, ...) | https://pypi.org/project/Pillow/ | HPND |
47
+ | **PyQt6** | Graphical user interface (GUI) | https://pypi.org/project/PyQt6/ | GPL v3 |
48
+ | **QtPy** | An abstraction layer for PyQt and PySide | https://pypi.org/project/QtPy/ | MIT |
49
+ | **read-lif** | Reads Leica .lif files | https://pypi.org/project/read-lif/ | GPL v3 |
50
+ | **czifile** | Reads Zeiss .czi files | https://pypi.org/project/czifile/ | BSD (BSD-3-Clause) |
51
+ | **tifffile** | Reads .tiff files (also reads Zeiss .lsm files) | https://pypi.org/project/tifffile/ | BSD |
52
+ | **python-bioformats** | A library to open scientific images | https://pypi.org/project/python-bioformats/ | GPLv2 |
53
+ | **python-javabridge** | A library to run java executables (required for bioformats) | https://pypi.org/project/python-javabridge/ | BSD |
54
+ | **scikit-image** | Image processing | https://pypi.org/project/scikit-image/ | BSD (Modified BSD) |
55
+ | **scipy** | Great library to work with numpy arrays | https://pypi.org/project/scipy/ | BSD |
56
+ | **scikit-learn** | Great library for machine learning | https://pypi.org/project/scikit-learn/ | BSD |
57
+ | **tqdm** | Command line progress | https://pypi.org/project/tqdm/ | MIT, MPL 2.0 |
58
+ | **natsort** | 'Human' like sorting of strings | https://pypi.org/project/natsort/ | MIT |
59
+ | **numexpr** | Speeds up image math | https://pypi.org/project/numexpr/ | MIT |
60
+ | **urllib3** | Model architecture and trained models download | https://pypi.org/project/urllib3/ | MIT |
61
+ | **qtawesome** | Elegant icons for PyQT/PySide | https://pypi.org/project/QtAwesome/ | MIT |
62
+ | **pandas** | Data analysis toolkit | https://pypi.org/project/pandas/ | BSD (BSD-3-Clause) |
63
+ | **numba** | GPU acceleration of numpy ops | https://pypi.org/project/numba/ | BSD |
64
+ | **roifile** | A library to read ImageJ ROIs | https://pypi.org/project/roifile/ | BSD 3-Clause |
65
+
File without changes
@@ -0,0 +1,53 @@
1
+ from batoolset.settings.global_settings import set_UI
2
+ set_UI()
3
+ from qtpy.QtWidgets import QApplication
4
+ from batoolset.img import start_JVM
5
+ import sys
6
+ from pyfigures.gui.pfgui import EZFIG_GUI
7
+
8
+
9
+
10
+
11
+
12
+ def run_pyfigures():
13
+ """
14
+ Runs the PyFigures GUI.
15
+
16
+ This function sets the UI and initializes the QApplication.
17
+ The EPySeg PyFigures window is created and shown.
18
+ The application event loop is started and the program exits
19
+ when the GUI window is closed.
20
+
21
+ # Examples:
22
+ # >>> run_pyfigures()
23
+ """
24
+
25
+ # start JVM to enable the bioformat image reader
26
+ start_JVM()
27
+
28
+ # Initialize the QApplication
29
+ app = QApplication(sys.argv)
30
+
31
+ if False:
32
+ # just a trick to override the default cursor...
33
+ from qtpy.QtGui import QCursor, QPixmap
34
+ # Load a custom cursor image
35
+ cursor_image = QPixmap("/home/aigouy/Téléchargements/cursor-mini.png")
36
+
37
+ # Create a custom cursor object with the cursor image
38
+ custom_cursor = QCursor(cursor_image)
39
+
40
+ # Set the custom cursor globally for the application
41
+ QApplication.setOverrideCursor(custom_cursor)
42
+
43
+ # Create and show the PyFigures GUI window
44
+ w = EZFIG_GUI()
45
+ w.show()
46
+
47
+ # Start the application event loop and exit when the GUI window is closed
48
+ sys.exit(app.exec_())
49
+
50
+
51
+ if __name__ == '__main__':
52
+ # Run the PyFigures GUI
53
+ run_pyfigures()
File without changes
@@ -0,0 +1,68 @@
1
+ from batoolset.settings.global_settings import set_UI # set the UI to qtpy
2
+ set_UI()
3
+ from qtpy.QtWidgets import QApplication, QDialog, QVBoxLayout, QLabel, QPushButton
4
+ from qtpy.QtCore import Qt
5
+ import sys
6
+
7
+ class AboutDialog(QDialog):
8
+ def __init__(self, parent=None, title="About My Software", name="My Software", version="Version 1.0.0", description="""
9
+ This is a brief description of My Software.
10
+ You can provide more information about its features and functionality here.
11
+ """, copyright="© 2023 Your Name", email='benoit.aigouy@gmail.com', ok_or_close="Ok"):
12
+ super().__init__(parent)
13
+
14
+ # Set dialog properties
15
+ self.setWindowTitle(title)
16
+ self.setMinimumWidth(400)
17
+
18
+ # Create layout
19
+ layout = QVBoxLayout(self)
20
+ layout.setAlignment(Qt.AlignCenter)
21
+
22
+ # Add application icon (optional)
23
+ # icon_label = QLabel(self)
24
+ # icon_label.setPixmap(QPixmap("path/to/your/icon.png")))
25
+ # layout.addWidget(icon_label)
26
+
27
+ # Add application name and version
28
+ name_label = QLabel(name, self)
29
+ name_label.setStyleSheet("font-size: 24px; font-weight: bold;")
30
+ layout.addWidget(name_label)
31
+
32
+ version_label = QLabel(version, self)
33
+ layout.addWidget(version_label)
34
+
35
+ # Add description
36
+ description_label = QLabel(description, self)
37
+ description_label.setWordWrap(True)
38
+ layout.addWidget(description_label)
39
+
40
+ # Add email label
41
+ email_label = QLabel(email, self)
42
+ email_label.setStyleSheet("font-weight: bold; color: blue;")
43
+ email_label.setOpenExternalLinks(True)
44
+ email_link = f'<a href="mailto:{email}">{email}</a>'
45
+ email_label.setText(email_link)
46
+ layout.addWidget(email_label)
47
+
48
+
49
+ # Add copyright and attribution
50
+ copyright_label = QLabel(copyright, self)
51
+ layout.addWidget(copyright_label)
52
+
53
+ # Add close button
54
+ close_button = QPushButton(ok_or_close, self)
55
+ close_button.clicked.connect(self.close)
56
+ layout.addWidget(close_button)
57
+
58
+ self.adjustSize()
59
+
60
+ def main():
61
+ app = QApplication([])
62
+
63
+ # Show the About dialog
64
+ about_dialog = AboutDialog()
65
+ about_dialog.exec_()
66
+
67
+ if __name__ == '__main__':
68
+ main()