Semapp 1.0.5__py3-none-any.whl

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.
semapp/__init__.py ADDED
@@ -0,0 +1,10 @@
1
+ """
2
+ SEMapp - SEM Data Visualization Application
3
+
4
+ A PyQt5-based application for visualizing and analyzing Scanning Electron Microscope (SEM) data.
5
+ Supports both standard and COMPLUS4T KLARF file formats.
6
+ """
7
+
8
+ __version__ = "1.0.2"
9
+ __author__ = "Your Name"
10
+
semapp/asset/icon.png ADDED
Binary file
semapp/main.py ADDED
@@ -0,0 +1,103 @@
1
+ """
2
+ GUI for data visualization.
3
+
4
+ This module implements the main window and core functionality
5
+ for the SEM data visualization application.
6
+ """
7
+
8
+ import sys
9
+ import os
10
+ from PyQt5.QtCore import QTimer
11
+ from PyQt5.QtWidgets import QApplication, QWidget, QGridLayout
12
+ from PyQt5.QtGui import QIcon
13
+
14
+ # Add parent directory to path to allow imports
15
+ sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
16
+
17
+ from semapp.Layout.main_window_att import LayoutFrame
18
+ from semapp.Layout.create_button import ButtonFrame
19
+ from semapp.Plot.frame_attributes import PlotFrame
20
+
21
+ # Constants
22
+ TIMER_INTERVAL = 200 # Milliseconds
23
+ BACKGROUND_COLOR = "#F5F5F5"
24
+
25
+
26
+ class MainWindow(QWidget): # pylint: disable=R0903
27
+ """
28
+ Main window for data visualization.
29
+
30
+ This class handles the main application window and initializes all UI components.
31
+ It manages the layout, plotting area, and button controls for the application.
32
+
33
+ Attributes:
34
+ canvas_widget (QWidget): The main widget container
35
+ canvas_layout (QGridLayout): The main layout manager
36
+ layout_frame (LayoutFrame): Handles layout configuration
37
+ button_frame (ButtonFrame): Contains all button controls
38
+ plot_frame (PlotFrame): Manages the plotting area
39
+ timer (QTimer): Updates the scroll area size
40
+ """
41
+
42
+ def __init__(self):
43
+ """Initialize the main window and UI components."""
44
+ super().__init__()
45
+ self.canvas_widget = None
46
+ self.canvas_layout = None
47
+ self.layout_frame = None
48
+ self.button_frame = None
49
+ self.plot_frame = None
50
+ self.timer = None
51
+ self.init_ui()
52
+
53
+ def init_ui(self):
54
+ """
55
+ Initialize the user interface.
56
+
57
+ Sets up the window properties, layouts, and all UI components.
58
+ Configures the main layout, creates frames for different sections,
59
+ and initializes the update timer.
60
+ """
61
+ self.setWindowTitle("SEMapp")
62
+ self.setStyleSheet(f"background-color: {BACKGROUND_COLOR};")
63
+
64
+ # Set window icon
65
+ icon_path = os.path.join(os.path.dirname(__file__), 'asset', 'icon.png')
66
+ if os.path.exists(icon_path):
67
+ self.setWindowIcon(QIcon(icon_path))
68
+ else:
69
+ print(f"[WARNING] Icon not found at: {icon_path}")
70
+
71
+ # Create the main layout (canvas_layout)
72
+ self.canvas_widget = QWidget(self)
73
+ self.canvas_layout = QGridLayout(self.canvas_widget)
74
+
75
+ # Use LayoutFrame for layout configuration
76
+ self.layout_frame = LayoutFrame(self)
77
+ self.layout_frame.setup_layout(self.canvas_widget, self.canvas_layout)
78
+
79
+ self.button_frame = ButtonFrame(self.canvas_layout)
80
+ self.plot_frame = PlotFrame(self.canvas_layout, self.button_frame)
81
+
82
+ # Set/adapt the maximum window size
83
+ self.layout_frame.set_max_window_size()
84
+ self.layout_frame.position_window_top_left()
85
+
86
+ self.timer = QTimer(self)
87
+ self.timer.timeout.connect(self.layout_frame.adjust_scroll_area_size)
88
+ self.timer.start(TIMER_INTERVAL)
89
+
90
+
91
+ def main():
92
+ """
93
+ Main entry point for the SEMapp application.
94
+
95
+ Creates and displays the main window, then starts the Qt event loop.
96
+ """
97
+ app = QApplication(sys.argv)
98
+ window = MainWindow()
99
+ window.show()
100
+ sys.exit(app.exec_())
101
+
102
+ if __name__ == "__main__":
103
+ main()
@@ -0,0 +1,300 @@
1
+ Metadata-Version: 2.4
2
+ Name: Semapp
3
+ Version: 1.0.5
4
+ Summary: Package for SEM visualization
5
+ Author-email: Thibaut Meyer <thibaut.meyer3@gmail.com>
6
+ License-Expression: GPL-3.0-or-later
7
+ Project-URL: Homepage, https://github.com/thi-mey/SEMapp
8
+ Keywords: SEM,GUI
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.9
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+ Requires-Dist: matplotlib==3.10.7
15
+ Requires-Dist: numpy==2.3.5
16
+ Requires-Dist: opencv-python==4.12.0.88
17
+ Requires-Dist: pandas==2.3.3
18
+ Requires-Dist: Pillow==12.0.0
19
+ Requires-Dist: PyQt5==5.15.11
20
+ Requires-Dist: PyQt5_sip==12.17.0
21
+ Requires-Dist: pytesseract==0.3.13
22
+ Requires-Dist: scipy==1.16.3
23
+ Dynamic: license-file
24
+
25
+ # SEMapp - SEM Data Visualization Application
26
+
27
+ A comprehensive PyQt5-based desktop application for visualizing and analyzing Scanning Electron Microscope (SEM) data. SEMapp supports multiple KLARF file formats (Standard, COMPLUS4T, and KRONOS), providing an intuitive interface for defect mapping, image analysis, and batch processing.
28
+
29
+ ## Features
30
+
31
+ ### Core Functionality
32
+ - **Multi-Format KLARF Support**: Parse and extract defect data from `.001` (KLARF) files
33
+ - Standard mode: Traditional KLARF format
34
+ - COMPLUS4T mode: Multi-wafer KLARF files with automatic wafer detection
35
+ - KRONOS mode: Special format with OCR-based number detection
36
+ - **Interactive Wafer Mapping**: Visual representation of defect positions on wafer surface
37
+ - **Image Visualization**: Display TIFF images corresponding to defect locations
38
+ - **Dynamic Defect Filtering**: Real-time defect filtering based on size threshold
39
+ - **Overview Window**: Full-screen mapping with image thumbnails
40
+
41
+ ### Data Processing
42
+ - **Automatic File Organization**: Organize TIFF files into wafer-specific subfolders
43
+ - **Coordinate Extraction**: Extract and convert defect coordinates from KLARF format
44
+ - **TIFF Splitting**: Split multi-page TIFF files into individual images
45
+ - **File Renaming**: Automatic renaming based on coordinates and settings
46
+ - **CSV Export**: Save defect mapping data for external analysis
47
+ - **Batch Processing**: Process multiple wafers in a single session
48
+
49
+ ### Image Processing
50
+ - **Threshold Processing**: Detect and analyze particles in SEM images
51
+ - **Particle Detection**: Configurable threshold and minimum size parameters
52
+ - **Mapping Generation**: Create interpolated maps of particle density and statistics
53
+ - **OCR Detection**: Automatic number detection in KRONOS mode using Tesseract
54
+
55
+ ### User Interface
56
+ - **Wafer Selection**: Grid-based wafer slot selection (1-26)
57
+ - **Image Type Selection**: Choose from different image scales and types
58
+ - **Defect Size Slider**: Dynamic threshold control for defect visualization
59
+ - **Interactive Plot**: Click on defect positions to view corresponding images
60
+ - **Settings Configuration**: Customize image types and processing parameters
61
+ - **Toast Notifications**: Non-intrusive feedback for operations
62
+ - **Progress Dialogs**: Visual feedback during long operations
63
+
64
+ ## Installation
65
+
66
+ ### Prerequisites
67
+ - Python 3.9 or higher
68
+ - pip package manager
69
+ - Tesseract OCR (optional, for KRONOS mode number detection)
70
+ - Windows: Download from [UB-Mannheim Tesseract](https://github.com/UB-Mannheim/tesseract/wiki)
71
+ - Linux: `sudo apt-get install tesseract-ocr`
72
+ - macOS: `brew install tesseract`
73
+
74
+ ### Install from PyPI
75
+ ```bash
76
+ pip install semapp
77
+ ```
78
+
79
+ ### Install from Source
80
+ ```bash
81
+ git clone https://github.com/thi-mey/SEMapp.git
82
+ cd SEM_VF
83
+ pip install -e .
84
+ ```
85
+
86
+ ### Dependencies
87
+ All dependencies are automatically installed:
88
+ - PyQt5 >= 5.15.11
89
+ - matplotlib >= 3.10.3
90
+ - pandas >= 2.2.3
91
+ - Pillow >= 11.2.1
92
+ - numpy >= 2.2.5
93
+ - pytesseract (optional, for OCR features)
94
+
95
+ ## Quick Start
96
+
97
+ ### Launching the Application
98
+ ```bash
99
+ # From command line after installation
100
+ semapp
101
+
102
+ # Or run directly from source
103
+ python -m semapp.main
104
+ ```
105
+
106
+ ### Basic Workflow
107
+
108
+ 1. **Select a Directory**
109
+ - Click "Select Folder" to choose your data directory
110
+ - Application automatically detects standard, COMPLUS4T, or KRONOS mode
111
+
112
+ 2. **Choose a Wafer**
113
+ - Select a wafer slot from the grid (1-26)
114
+ - Available wafers are highlighted in green
115
+
116
+ 3. **Configure Settings** (Optional)
117
+ - Click "Settings" to configure image types and scales
118
+ - Define scale and image type combinations
119
+
120
+ 4. **Open TIFF Data**
121
+ - Click "Open TIFF" to load defect data and images
122
+ - Wafer mapping is displayed automatically
123
+
124
+ 5. **Analyze Defects**
125
+ - Click on defect points in the map to view corresponding images
126
+ - Use the defect size slider to filter by threshold
127
+ - Adjust threshold and min size sliders for particle detection
128
+
129
+ 6. **View Overview**
130
+ - Click "Overview" to see full-screen mapping with image thumbnails
131
+ - Save the overview as PNG, PDF, or SVG
132
+
133
+ ## File Structure
134
+
135
+ ### Standard Mode
136
+ ```
137
+ project_directory/
138
+ ├── 1/ # Wafer slot 1
139
+ │ ├── data.tif # TIFF image file
140
+ │ ├── recipe_file.001 # KLARF defect file
141
+ │ └── mapping.csv # Generated coordinate mapping
142
+ ├── 2/ # Wafer slot 2
143
+ │ ├── data.tif
144
+ │ ├── recipe_file.001
145
+ │ └── mapping.csv
146
+ └── ...
147
+ ```
148
+
149
+ ### COMPLUS4T Mode
150
+ ```
151
+ project_directory/
152
+ ├── data.tiff # Single TIFF file with all defects
153
+ ├── recipe_file.001 # KLARF file containing multiple wafer IDs
154
+ ├── 16/ # Subfolder created for wafer ID 16
155
+ │ ├── data_page_331.tiff # Split TIFF pages
156
+ │ ├── -9.1_1.1.tif # Renamed files
157
+ │ └── mapping.csv # Wafer-specific mapping
158
+ ├── 21/ # Subfolder created for wafer ID 21
159
+ │ └── mapping.csv
160
+ └── ...
161
+ ```
162
+
163
+ ### KRONOS Mode
164
+ ```
165
+ project_directory/
166
+ ├── 11/ # Wafer ID 11
167
+ │ ├── data.tiff # Multi-page TIFF
168
+ │ ├── recipe_file.001 # KLARF file
169
+ │ ├── detection_results.csv # OCR detection results
170
+ │ ├── mapping.csv # Filtered defect mapping
171
+ │ └── data_page_10.tiff # Split pages
172
+ └── ...
173
+ ```
174
+
175
+ ## KLARF File Format
176
+
177
+ SEMapp parses KLARF (`.001`) files to extract:
178
+ - **Wafer IDs**:
179
+ - `WaferID "@16";` (COMPLUS4T mode)
180
+ - `WaferID "Read Failed.11";` (KRONOS mode)
181
+ - **Sample Size**: Total number of defects
182
+ - **Die Pitch**: X and Y pitch values
183
+ - **Die Origin**: Origin coordinates
184
+ - **Sample Center Location**: Center coordinates
185
+ - **Defect List**: Individual defect positions and sizes
186
+
187
+ ## Processing Operations
188
+
189
+ ### Split and Rename
190
+ - **Split TIFF**: Split multi-page TIFF files into individual pages
191
+ - **Rename Files**: Rename files based on coordinates and settings
192
+ - **Batch Processing**: Process all wafers at once
193
+
194
+ ### Threshold Processing
195
+ - **Particle Detection**: Detect particles using configurable threshold
196
+ - **Statistics**: Calculate density, area, and particle counts
197
+ - **CSV Export**: Save results for analysis
198
+
199
+ ### Mapping
200
+ - **Interpolated Maps**: Generate interpolated maps of particle statistics
201
+ - **Multiple Metrics**: Density, average area, total area percentage
202
+ - **Visualization**: Save maps as PNG files
203
+
204
+ ### Clean Operations
205
+ - **Remove Non-Conforming Files**: Clean up files that don't match naming conventions
206
+ - **Organize Structure**: Create proper directory structure
207
+
208
+ ## Configuration
209
+
210
+ ### Settings File
211
+ The application uses a JSON settings file to define image types and scales:
212
+ ```json
213
+ [
214
+ {
215
+ "Scale": "5x5",
216
+ "Image Type": "SE"
217
+ },
218
+ {
219
+ "Scale": "10x10",
220
+ "Image Type": "BSE"
221
+ }
222
+ ]
223
+ ```
224
+
225
+ ### Detection Configuration (KRONOS)
226
+ - **ROI**: Region of Interest for number detection (default: X: 1100, Y: 0, W: 250, H: 35)
227
+ - **CPU Cores**: Configurable number of CPU cores for multiprocessing
228
+ - **Resize Factor**: Optional image resizing for faster processing
229
+
230
+ ## Keyboard Shortcuts
231
+
232
+ - **Escape**: Close overview window
233
+ - **Ctrl+T**: Toggle theme (if enabled)
234
+
235
+ ## Troubleshooting
236
+
237
+ ### Tesseract Not Found
238
+ If you encounter Tesseract errors in KRONOS mode:
239
+ 1. Install Tesseract OCR (see Prerequisites)
240
+ 2. On Windows, ensure it's installed in the default path or update the path in `detection.py`
241
+
242
+ ### No Images Displayed
243
+ - Verify TIFF files are in the correct location
244
+ - Check that KLARF files contain valid defect data
245
+ - Ensure coordinates are correctly extracted (check `mapping.csv`)
246
+
247
+ ### Processing Errors
248
+ - Verify file permissions
249
+ - Check that all required files exist
250
+ - Review console output for detailed error messages
251
+
252
+ ## Development
253
+
254
+ ### Project Structure
255
+ ```
256
+ semapp/
257
+ ├── main.py # Main application entry point
258
+ ├── Layout/ # UI layout components
259
+ │ ├── create_button.py # Button and control creation
260
+ │ ├── main_window_att.py # Window layout management
261
+ │ ├── settings.py # Settings window
262
+ │ └── styles.py # UI styles
263
+ ├── Plot/ # Plotting and visualization
264
+ │ ├── frame_attributes.py # Main plot frame
265
+ │ ├── overview_window.py # Overview window
266
+ │ └── utils.py # Plot utilities
267
+ └── Processing/ # Data processing modules
268
+ ├── klarf_reader.py # KLARF file parsing
269
+ ├── processing.py # Main processing class
270
+ ├── rename_tif.py # File renaming
271
+ ├── split_tif.py # TIFF splitting
272
+ ├── threshold.py # Threshold processing
273
+ └── detection.py # OCR detection
274
+ ```
275
+
276
+ ### Running Tests
277
+ ```bash
278
+ # Run from project root
279
+ python -m semapp.main
280
+ ```
281
+
282
+ ## License
283
+
284
+ This project is licensed under the GPL-3.0-or-later License - see the LICENSE file for details.
285
+
286
+ ## Author
287
+
288
+ **Thibaut Meyer**
289
+ - Email: thibaut.meyer3@gmail.com
290
+ - GitHub: [@thi-mey](https://github.com/thi-mey)
291
+
292
+ ## Contributing
293
+
294
+ Contributions are welcome! Please feel free to submit a Pull Request.
295
+
296
+ ## Acknowledgments
297
+
298
+ - PyQt5 community for the excellent GUI framework
299
+ - Tesseract OCR for number detection capabilities
300
+ - All contributors and users of SEMapp
@@ -0,0 +1,27 @@
1
+ semapp/__init__.py,sha256=b2lUJO2caElUIkLLSy7q7fIA2xgXbxZsaTL6LdvtoU0,266
2
+ semapp/main.py,sha256=uu7W5uOaIArHTkQHH-8R8KkHPCYvqq6-i9f-elitV_0,3491
3
+ semapp/Layout/__init__.py,sha256=Y60dNC2iCpGv7t9DkGZs1zqKCr1FfaZQ90fINmI1KMA,603
4
+ semapp/Layout/create_button.py,sha256=6RL4pb6fzUnRv6NwFjzofQk_TTerRekc15Tcr5Z_x-M,51875
5
+ semapp/Layout/main_window_att.py,sha256=bxefkRFZ9iUo-3Xy11rPEywKCAfZcNDrLPhCQxXoxUk,2249
6
+ semapp/Layout/settings.py,sha256=Mrt88HSnKmPqMQP_k1cMsfrRJgfSjC1nIzpzWMO9eO0,6355
7
+ semapp/Layout/styles.py,sha256=sjCcQItzBVkLLogCQlCWN7hfroUC4u_ou3GAk3qpiHI,3447
8
+ semapp/Layout/toast.py,sha256=mJGRe6M0_XET-HtV76paBGRoi3Djetsn2VWhFKhzcZs,5048
9
+ semapp/Plot/__init__.py,sha256=skjYnE2J9W9RVwHqJfCNDhJTniQDAzGlzVp94OFpC5A,144
10
+ semapp/Plot/frame_attributes.py,sha256=FSe843sSuNW324jacFZkt8yQaQGgc9epIIhhlWWtSR8,29363
11
+ semapp/Plot/overview_window.py,sha256=vUX0ALVS5s5g-XxyW4QzAaGHPdv4NfiOjNWGzW8gsCA,14290
12
+ semapp/Plot/styles.py,sha256=191DG0n1KGx7NMg8CAzcQTXJ_USvWUsYCTSH0HL95-k,1197
13
+ semapp/Plot/utils.py,sha256=mxk_VA7eZ76EYiKpXKD7D3Pu1kEUISG3IHX-vOhQUY0,11574
14
+ semapp/Processing/__init__.py,sha256=BZOqbkPq0GpUcScdQ2H5K-9lC9__ACSemfM4I7NuhGU,97
15
+ semapp/Processing/detection.py,sha256=Ko9CKD6PdnkRP-VLEI7B6FsePntfUaF5-sJF5iiBBnA,21564
16
+ semapp/Processing/klarf_reader.py,sha256=IHue_TP_Wl2LRUJ4h8aw0-spHRQtdP4ZYo5J9ydZC5g,18395
17
+ semapp/Processing/processing.py,sha256=Y6pSUf4j2MqIyigFube-NsylP1zqVgjzTTV0-HNQ9wI,28715
18
+ semapp/Processing/rename_tif.py,sha256=1hYdB3SV7CKISrmSt9YXjcNkOsabMl-297KIiS-IHf4,17399
19
+ semapp/Processing/split_tif.py,sha256=_U0ANmBLbDo0rUhEbAd1F_ZlrWCHz0kRD__qaSG81E8,10585
20
+ semapp/Processing/threshold.py,sha256=bmubYUibJs5tZZNay5fIg5FZM9S87nM3eyF1x9cp3Xs,34969
21
+ semapp/asset/icon.png,sha256=UHPUodH4NPedJKqvuyOUL-10LqWYOjBd4rzkuGwJ-8Y,236849
22
+ semapp-1.0.5.dist-info/licenses/LICENSE,sha256=LoV48WtuomVBIWbotLHaBF_MEfKNsD1mSQhBASSi8B4,35801
23
+ semapp-1.0.5.dist-info/METADATA,sha256=zk0Varqtj33LqwmHTU9zQuHPQ-6ed-0nQxpL5NVe_3g,10457
24
+ semapp-1.0.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
25
+ semapp-1.0.5.dist-info/entry_points.txt,sha256=_rXPJS9aPfI3F8wcCv1PllnnDpvz3Mpd8FRL6Xivhwc,40
26
+ semapp-1.0.5.dist-info/top_level.txt,sha256=jMlqZoYXBSCF-JQJ-vLlIYIFJurj438WgMBUMvoZtJo,7
27
+ semapp-1.0.5.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.9.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [gui_scripts]
2
+ Semapp = semapp.main:main