This repository provides a structured pipeline to prepare and process simulated neutral atom images for deconvolution and analysis using four methods:
- Neural Network Deconvolution (
machine_learning.py) - Richardson-Lucy Deconvolution (
richardson_lucy.py) - Wiener Filtering (
wiener_filter.py) - ROI Mean Thresholding (
roi_thresholding.py)
Each script now performs all steps — including threshold optimization (where applicable) — in one go. There is no need to run a separate script to compute the best threshold.
Users can quickly add new simulation data in .npy format and prepare it for analysis using the provided helper scripts.
If you have a folder with .npy files containing images and ground truth arrays, use the scripts in help_scripts in the following order to prepare your dataset:
divide_sim_truth.py: Divides images and ground truth arrays into separate folders.convert_png.py: Converts images in the simulation folder into.pngformat.cut_grid.py: Cuts out the grid from the actual images.prepare_csv.py: Cuts the grid into single neutral atom images and creates a CSV where each atom image is listed with its ground truth label.
Before running each script, configure the grid size and the path to your directory at the top of each script. These variables are clearly marked for ease of modification.
Once processed, the prepared data will be added automatically to the different_exposures folder, ready for deconvolution and analysis.
Once your data is prepared, you can use the following methods:
- Neural Network Deconvolution:
machine_learning/machine_learning.py - Richardson-Lucy Deconvolution:
richardson_lucy/richardson_lucy.py - Wiener Filtering:
wiener_filter/wiener_filter.py - ROI Mean Thresholding:
roi_thresholding/roi_thresholding.py
Set the exposure time in the configuration at the top of each script; this will automatically select the correct folder for computation.
- Neural Network Deconvolution: Prints the accuracy automatically after computation.
- Richardson-Lucy, Wiener Filter, ROI Thresholding:
- The script loads
train_split.csvandval_split.csvto compute the optimal threshold. - It then applies this threshold to the
test_split.csv. - Accuracy is printed and plots (Accuracy vs Threshold, ROC Curve) are automatically shown.
- Per-image results (mean value, prediction, ground truth, and processing time) are saved in a
.csvfile within each method’s subdirectory.
- The script loads
There is no longer a need to run an additional *_best_th.py script. All threshold optimization is now integrated directly into each method's main script.
This update streamlines the workflow and ensures consistent evaluation across all classical methods.