Skip to content

QueirosJustin/qc_codebase

Repository files navigation

Practical Part for HPCQC Seminar | Justin Oliveira

Overview

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.

Adding and Preparing New Simulation Data

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 .png format.
  • 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.

Important:

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.

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

For each method:

Set the exposure time in the configuration at the top of each script; this will automatically select the correct folder for computation.

After running each method:

  • Neural Network Deconvolution: Prints the accuracy automatically after computation.
  • Richardson-Lucy, Wiener Filter, ROI Thresholding:
    • The script loads train_split.csv and val_split.csv to 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 .csv file within each method’s subdirectory.

Summary

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.

About

Code for my HPQC Seminar

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages