{"id":51834331,"url":"https://github.com/cell-observatory/beads_simulator","last_synced_at":"2026-07-22T19:03:28.613Z","repository":{"id":285658556,"uuid":"939011412","full_name":"cell-observatory/beads_simulator","owner":"cell-observatory","description":"Beads simulator for LLS and other imaging modalities","archived":false,"fork":false,"pushed_at":"2025-06-16T15:34:59.000Z","size":4074,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-16T16:40:01.706Z","etag":null,"topics":["adaptive-optics","lattice-light-sheet","otf","psf","simulation","wavefront"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cell-observatory.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-25T21:09:29.000Z","updated_at":"2025-06-16T15:35:03.000Z","dependencies_parsed_at":"2025-04-02T01:29:49.329Z","dependency_job_id":"aebb1d26-80dc-4c77-816a-76ad2e7522ef","html_url":"https://github.com/cell-observatory/beads_simulator","commit_stats":null,"previous_names":["cell-observatory/beads_simulator"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cell-observatory/beads_simulator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cell-observatory%2Fbeads_simulator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cell-observatory%2Fbeads_simulator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cell-observatory%2Fbeads_simulator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cell-observatory%2Fbeads_simulator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cell-observatory","download_url":"https://codeload.github.com/cell-observatory/beads_simulator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cell-observatory%2Fbeads_simulator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35773465,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-07-20T02:08:10.276Z","status":"online","status_checked_at":"2026-07-22T02:00:06.236Z","response_time":124,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adaptive-optics","lattice-light-sheet","otf","psf","simulation","wavefront"],"created_at":"2026-07-22T19:03:27.848Z","updated_at":"2026-07-22T19:03:28.601Z","avatar_url":"https://github.com/cell-observatory.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\nBeads simulator for AOViFT\n====================================================\n\n[![arXiv](https://img.shields.io/badge/arXiv-2503.12593-b31b1b.svg)](https://arxiv.org/abs/2503.12593)\n[![python](https://img.shields.io/badge/python-3.10+-3776AB.svg?style=flat\u0026logo=python\u0026logoColor=3776AB)](https://www.python.org/)\n[![license](https://img.shields.io/github/license/cell-observatory/beads_simulator.svg?style=flat\u0026logo=git\u0026logoColor=white)](https://opensource.org/license/bsd-2-clause/)\n[![issues](https://img.shields.io/github/issues/cell-observatory/beads_simulator.svg?style=flat\u0026logo=github)](https://github.com/cell-observatory/beads_simulator/issues)\n[![pr](https://img.shields.io/github/issues-pr/cell-observatory/beads_simulator.svg?style=flat\u0026logo=github)](https://github.com/cell-observatory/beads_simulator/pulls)\n\n\u003cdiv style=\"text-align: center; width: 100%; display: inline-block; text-align: center;\" \u003e\n \u003ch2\u003eFourier-Based 3D Multistage Transformer for Aberration Correction in Multicellular Specimens\u003c/h2\u003e\n  \u003cp\u003e\n  Thayer Alshaabi\u003csup\u003e1,2*\u003c/sup\u003e, Daniel E. Milkie\u003csup\u003e1\u003c/sup\u003e, Gaoxiang Liu\u003csup\u003e2\u003c/sup\u003e, Cyna Shirazinejad\u003csup\u003e2\u003c/sup\u003e, Jason L. Hong\u003csup\u003e2\u003c/sup\u003e, Kemal Achour\u003csup\u003e2\u003c/sup\u003e, Frederik Görlitz\u003csup\u003e2\u003c/sup\u003e, Ana Milunovic-Jevtic\u003csup\u003e2\u003c/sup\u003e, Cat Simmons\u003csup\u003e2\u003c/sup\u003e, Ibrahim S. Abuzahriyeh\u003csup\u003e2\u003c/sup\u003e, Erin Hong\u003csup\u003e2\u003c/sup\u003e, Samara Erin Williams\u003csup\u003e2\u003c/sup\u003e, Nathanael Harrison\u003csup\u003e2\u003c/sup\u003e, Evan Huang\u003csup\u003e2\u003c/sup\u003e, Eun Seok Bae\u003csup\u003e2\u003c/sup\u003e, Alison N. Killilea\u003csup\u003e2\u003c/sup\u003e, David G. Drubin\u003csup\u003e2\u003c/sup\u003e, Ian A. Swinburne\u003csup\u003e2\u003c/sup\u003e, Srigokul Upadhyayula\u003csup\u003e2,3,4*\u003c/sup\u003e, Eric Betzig\u003csup\u003e1,2,5*\u003c/sup\u003e\n  \u003c/p\u003e\n  \u003ch5\u003e\n    \u003csup\u003e1\u003c/sup\u003eHHMI, \u003csup\u003e2\u003c/sup\u003eUC Berkeley, \u003csup\u003e3\u003c/sup\u003eLawrence Berkeley National Laboratory, \u003csup\u003e4\u003c/sup\u003eChan Zuckerberg Biohub, \u003csup\u003e5\u003c/sup\u003eHelen Wills Neuroscience Institute\n  \u003c/h5\u003e\n  \u003cdiv align=\"center\"\u003e\n\n  [![arXiv](https://img.shields.io/badge/arXiv-2503.12593-b31b1b.svg?style=for-the-badge\u0026logo=arxiv\u0026logoColor=white)](https://arxiv.org/abs/2503.12593) \u0026nbsp;\n  [![Pytest](https://img.shields.io/badge/pytest-suite-%23ffffff.svg?style=for-the-badge\u0026logo=pytest\u0026logoColor=2f9fe3)](https://github.com/cell-observatory/beads_simulator/tree/main/tests) \u0026nbsp;\n  [![BibTeX](https://img.shields.io/badge/BibTeX-reference-%23008080.svg?style=for-the-badge\u0026logo=latex\u0026logoColor=white)](#bibtex)\n\n  \u003c/div\u003e\n\u003c/div\u003e\n\n\n* [Installation](#installation)\n* [Features](#features)\n  * [Wavefront simulation](#wavefront-simulation)\n  * [Fourier embedding](#fourier-embedding)\n  * [PSF dataset generator](#psf-dataset-generator)\n  * [Beads dataset generator](#beads-dataset-generator)\n  * [Multimodal beads dataset generator](#multimodal-beads-dataset-generator)\n\n\n# Installation\n\n## Dependencies\n\n\u003e [!IMPORTANT] \n\u003e Source code is tested on the following operating systems:\n\u003e - **Ubuntu 22.04** \n\u003e - **Rocky Linux 8.10 \u0026 9.3**\n\u003e - **Windows 11 Pro 22621**\n\n```requirements\nnumpy\npandas\ncupy\ncuda-version==12.8\nastropy\nseaborn\nscikit-image\nscikit-spatial\npytest\npytest-order\nmatplotlib==3.8.4\nujson\nzarr\npycudadecon\ndphtools\ntifffile==2023.9.18\nimagecodecs==2023.9.18\nnvitop\npycuda\npytest\ntqdm\ncachetools\nline_profiler_pycharm\n```\n\n\u003e [!CAUTION] \n\u003e NVIDIA GPU with a driver release **545** or later, and **CUDA 12.8**.\n\n\n## Clone repository to your host system\n```shell\ngit clone --recurse-submodules https://github.com/cell-observatory/beads_simulator.git\n```\n\nTo later update to the latest, greatest\n```shell\ngit pull --recurse-submodules\n```\n\n## Create conda environment\n```shell\nconda/mamba create --name beads --file requirements.txt\n```\nOr use `pip install -r requirements.txt`\n\n\n## Running the simulator\nActivate conda environment\n```shell\nconda activate beads\n```\n\n# Features\n\n* [Wavefront simulation](#wavefront-simulation)\n* [Fourier embedding](#fourier-embedding)\n* [PSF dataset generator](#psf-dataset-generator)\n* [Beads dataset generator](#beads-dataset-generator)\n* [Multimodal beads dataset generator](#multimodal-beads-dataset-generator)\n\n\n## Wavefront simulation\n\n- Simulation of ideal and aberrated wavefronts where the amplitudes of the zernike modes are drawn from a given distribution:\n  - Single\n  - Bimodal\n  - Multinomial\n  - Powerlaw\n  - Dirichlet\n \n\u003e [!TIP]\n\u003e For more options, please refer to [wavefront.py](src/wavefront.py)\n\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg class=\"center\" src=\"https://www.dropbox.com/scl/fi/i5bets9ewgue7sd3n8irl/distributions.png?rlkey=yc8flirdxjx92asbcuk2smuuy\u0026raw=1\" width=\"100%\" /\u003e\n\u003c/div\u003e\n\n\n\n## Fourier embedding\n\n\u003e [!TIP]\n\u003e For more options, please refer to [embedding.py](src/embedding.py)\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg class=\"center\" src=\"https://www.dropbox.com/scl/fi/4miprr445ujle7hu3djei/embedding.png?rlkey=yna1zfy986yr0mehwz1uwpnbn\u0026raw=1\" width=\"100%\" /\u003e\n\u003c/div\u003e\n\n\n### Aberrated PSF \n```shell\npytest -s -v --disable-pytest-warnings --color=yes tests/test_datasets.py -k test_random_aberrated_psf\n```\n\n```shell\n=========================================================== test session starts ===========================================================\nplatform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 -- /home/thayer/miniforge3/envs/beads/bin/python3.12\ncachedir: .pytest_cache\nrootdir: /home/thayer/Github/beads_simulator\nplugins: order-1.3.0\ncollected 9 items / 8 deselected / 1 selected\n\ntests/test_datasets.py::test_random_aberrated_psf Loading cached SyntheticPSF instance from /home/thayer/Github/beads_simulator/SyntheticPSFCache/_home_thayer_Github_beads_simulator_lattice_YuMB_NAlattice0p35_NAAnnulusMax0p40_NAsigma0p1.mat_shape_64-64-64_lam_0.51_na_1.0_ri_1.33_x_0.097_y_0.097_z_0.2_twd_simulator_False\nPASSED\n=============================================== 1 passed, 8 deselected, 1 warning in 7.68s ================================================\n```\n\n\n### LLS defocused PSF \n\n```shell\npytest -s -v --disable-pytest-warnings --color=yes tests/test_datasets.py -k test_random_defocused_psf\n```\n\n```shell\n=========================================================== test session starts ===========================================================\nplatform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 -- /home/thayer/miniforge3/envs/beads/bin/python3.12\ncachedir: .pytest_cache\nrootdir: /home/thayer/Github/beads_simulator\nplugins: order-1.3.0\ncollected 9 items / 8 deselected / 1 selected\n\ntests/test_datasets.py::test_random_defocused_psf Loading cached SyntheticPSF instance from /home/thayer/Github/beads_simulator/SyntheticPSFCache/_home_thayer_Github_beads_simulator_lattice_YuMB_NAlattice0p35_NAAnnulusMax0p40_NAsigma0p1.mat_shape_64-64-64_lam_0.51_na_1.0_ri_1.33_x_0.097_y_0.097_z_0.2_twd_simulator_False\nPASSED\n\n=============================================== 1 passed, 8 deselected, 1 warning in 7.68s ================================================\n```\n\n### Aberrated and LLS defocused PSF \n\n```shell\npytest -s -v --disable-pytest-warnings --color=yes tests/test_datasets.py -k test_random_aberrated_defocused_psf\n```\n\n```shell\n=========================================================== test session starts ===========================================================\nplatform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 -- /home/thayer/miniforge3/envs/beads/bin/python3.12\ncachedir: .pytest_cache\nrootdir: /home/thayer/Github/beads_simulator\nplugins: order-1.3.0\ncollected 9 items / 8 deselected / 1 selected\n\ntests/test_datasets.py::test_random_aberrated_defocused_psf Loading cached SyntheticPSF instance from /home/thayer/Github/beads_simulator/SyntheticPSFCache/_home_thayer_Github_beads_simulator_lattice_YuMB_NAlattice0p35_NAAnnulusMax0p40_NAsigma0p1.mat_shape_64-64-64_lam_0.51_na_1.0_ri_1.33_x_0.097_y_0.097_z_0.2_twd_simulator_False\nPASSED\n=============================================== 1 passed, 8 deselected, 1 warning in 7.71s ================================================\n```\n\n\n## PSF dataset generator\n\n\u003e [!TIP]\n\u003e For more options, please refer to [psf_dataset.py](src/psf_dataset.py)\n\n\n\n```shell\npytest -s -v --disable-pytest-warnings --color=yes tests/test_datasets.py -k test_psf_dataset\n```\n\n```shell\n=========================================================== test session starts ===========================================================\nplatform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 -- /home/thayer/miniforge3/envs/beads/bin/python3.12\ncachedir: .pytest_cache\nrootdir: /home/thayer/Github/beads_simulator\nplugins: order-1.3.0\ncollected 9 items / 8 deselected / 1 selected\n\ntests/test_datasets.py::test_psf_dataset Loading cached SyntheticPSF instance from /home/thayer/Github/beads_simulator/SyntheticPSFCache/_home_thayer_Github_beads_simulator_lattice_YuMB_NAlattice0p35_NAAnnulusMax0p40_NAsigma0p1.mat_shape_64-64-64_lam_0.51_na_1.0_ri_1.33_x_0.097_y_0.097_z_0.2_twd_simulator_False\n100%|██████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:03\u003c00:00,  2.83it/s]\nPASSED\n===================================================== 1 passed, 8 deselected in 5.19s =====================================================\n```\n\n\n\u003e [!TIP]\n\u003e For more options, please refer to `psf_dataset.py --help`\n\n```shell\nusage: psf_dataset.py [-h] [--filename FILENAME] [--outdir OUTDIR] [--emb] [--iters ITERS] [--kernels] [--noise] [--normalize] [--x_voxel_size X_VOXEL_SIZE] [--y_voxel_size Y_VOXEL_SIZE] [--z_voxel_size Z_VOXEL_SIZE] [--input_shape INPUT_SHAPE] [--modes MODES] [--min_photons MIN_PHOTONS] [--max_photons MAX_PHOTONS] [--psf_type PSF_TYPE] [--dist DIST] [--mode_dist MODE_DIST] [--gamma GAMMA] [--signed] [--rotate] [--min_amplitude MIN_AMPLITUDE]\n                      [--max_amplitude MAX_AMPLITUDE] [--min_lls_defocus_offset MIN_LLS_DEFOCUS_OFFSET] [--max_lls_defocus_offset MAX_LLS_DEFOCUS_OFFSET] [--refractive_index REFRACTIVE_INDEX] [--na_detection NA_DETECTION] [--lam_detection LAM_DETECTION] [--cpu_workers CPU_WORKERS] [--use_theoretical_widefield_simulator] [--skip_remove_background]\n\noptions:\n  -h, --help            show this help message and exit\n  --filename FILENAME\n  --outdir OUTDIR\n  --emb                 toggle to save fourier embeddings only\n  --iters ITERS         number of samples (Default: `10`)\n  --kernels             toggle to save raw kernels\n  --noise               toggle to add random background and shot noise to the generated PSFs\n  --normalize           toggle to scale the generated PSFs to 1.0\n  --x_voxel_size X_VOXEL_SIZE\n                        lateral voxel size in microns for X (Default: `0.125`)\n  --y_voxel_size Y_VOXEL_SIZE\n                        lateral voxel size in microns for Y (Default: `0.125`)\n  --z_voxel_size Z_VOXEL_SIZE\n                        axial voxel size in microns for Z (Default: `0.2`)\n  --input_shape INPUT_SHAPE\n                        PSF input shape (Default: `64`)\n  --modes MODES         number of modes to describe aberration (Default: `55`)\n  --min_photons MIN_PHOTONS\n                        minimum photons for training samples (Default: `5000`)\n  --max_photons MAX_PHOTONS\n                        maximum photons for training samples (Default: `10000`)\n  --psf_type PSF_TYPE   widefield, 2photon, confocal, or a path to an LLS excitation profile  (Default: `../lattice/YuMB_NAlattice0p35_NAAnnulusMax0p40_NAsigma0p1.mat`)\n  --dist DIST           distribution of the zernike amplitudes (Default: `single`)\n  --mode_dist MODE_DIST\n                        distribution of the zernike modes (Default: `pyramid`)\n  --gamma GAMMA         exponent for the powerlaw distribution (Default: `0.75`)\n  --signed              optional flag to generate a symmetric (pos/neg) semi-distributions for the given range of amplitudes\n  --rotate              optional flag to introduce a random radial rotation to each zernike mode\n  --min_amplitude MIN_AMPLITUDE\n                        min amplitude for the zernike coefficients (Default: `0`)\n  --max_amplitude MAX_AMPLITUDE\n                        max amplitude for the zernike coefficients (Default: `0.25`)\n  --min_lls_defocus_offset MIN_LLS_DEFOCUS_OFFSET\n                        min value for the offset between the excitation and detection focal plan (microns) (Default: `0`)\n  --max_lls_defocus_offset MAX_LLS_DEFOCUS_OFFSET\n                        max value for the offset between the excitation and detection focal plan (microns) (Default: `0`)\n  --refractive_index REFRACTIVE_INDEX\n                        the quotient of the speed of light as it passes through two media (Default: `1.33`)\n  --na_detection NA_DETECTION\n                        Numerical aperture (Default: `1.0`)\n  --lam_detection LAM_DETECTION\n                        wavelength in microns (Default: `0.51`)\n  --cpu_workers CPU_WORKERS\n                        number of CPU cores to use (Default: `-1`)\n  --use_theoretical_widefield_simulator\n                        optional toggle to use an experimental complex pupil to estimate amplitude attenuation (cosine factor)\n  --skip_remove_background\n                        optional toggle to skip preprocessing input data using the DoG filter\n```\n\n\n## Beads dataset generator\n\nSynthatic samples with 1 up to $n$ beads randomly placed in a given FOV\n\n\n```shell\npytest -s -v --disable-pytest-warnings --color=yes tests/test_datasets.py -k test_multipoint_dataset\n```\n```shell\n=========================================================== test session starts ===========================================================\nplatform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 -- /home/thayer/miniforge3/envs/beads/bin/python3.12\ncachedir: .pytest_cache\nrootdir: /home/thayer/Github/beads_simulator\nplugins: order-1.3.0\ncollected 9 items / 8 deselected / 1 selected\n\ntests/test_datasets.py::test_multipoint_dataset Loading cached SyntheticPSF instance from /home/thayer/Github/beads_simulator/SyntheticPSFCache/_home_thayer_Github_beads_simulator_lattice_YuMB_NAlattice0p35_NAAnnulusMax0p40_NAsigma0p1.mat_shape_64-64-64_lam_0.51_na_1.0_ri_1.33_x_0.097_y_0.097_z_0.2_twd_simulator_False\n100%|██████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:14\u003c00:00,  1.48s/it]\nPASSED\n=============================================== 1 passed, 8 deselected, 1 warning in 16.47s ===============================================\n```\n\n\n\u003e [!TIP]\n\u003e For more options, please refer to [multipoint_dataset.py](src/multipoint_dataset.py)\n\n```shell\nusage: multipoint_dataset.py [-h] [--filename FILENAME] [--npoints NPOINTS] [--outdir OUTDIR] [--emb] [--embedding_option EMBEDDING_OPTION] [--iters ITERS] [--kernels] [--noise] [--normalize] [--x_voxel_size X_VOXEL_SIZE] [--y_voxel_size Y_VOXEL_SIZE] [--z_voxel_size Z_VOXEL_SIZE] [--input_shape INPUT_SHAPE] [--random_crop RANDOM_CROP] [--modes MODES] [--min_photons MIN_PHOTONS] [--max_photons MAX_PHOTONS] [--psf_type PSF_TYPE] [--dist DIST]\n                             [--mode_dist MODE_DIST] [--gamma GAMMA] [--signed] [--rotate] [--randomize_object_size] [--min_amplitude MIN_AMPLITUDE] [--max_amplitude MAX_AMPLITUDE] [--min_lls_defocus_offset MIN_LLS_DEFOCUS_OFFSET] [--max_lls_defocus_offset MAX_LLS_DEFOCUS_OFFSET] [--refractive_index REFRACTIVE_INDEX] [--na_detection NA_DETECTION] [--fill_radius FILL_RADIUS] [--object_size OBJECT_SIZE] [--uniform_background UNIFORM_BACKGROUND]\n                             [--lam_detection LAM_DETECTION] [--alpha_val ALPHA_VAL] [--phi_val PHI_VAL] [--cpu_workers CPU_WORKERS] [--override] [--plot] [--use_theoretical_widefield_simulator] [--skip_remove_background]\n\noptions:\n  -h, --help            show this help message and exit\n  --filename FILENAME\n  --npoints NPOINTS\n  --outdir OUTDIR\n  --emb                 toggle to save fourier embeddings only\n  --embedding_option EMBEDDING_OPTION\n                        type of embedding to use: [\"spatial_planes\", \"principle_planes\", \"rotary_slices\", \"spatial_quadrants\"] (Default: `['spatial_planes']`)\n  --iters ITERS         number of samples (Default: `10`)\n  --kernels             toggle to save raw kernels\n  --noise               toggle to add random background and shot noise to the generated PSFs\n  --normalize           toggle to scale the generated PSFs to 1.0\n  --x_voxel_size X_VOXEL_SIZE\n                        lateral voxel size in microns for X (Default: `0.125`)\n  --y_voxel_size Y_VOXEL_SIZE\n                        lateral voxel size in microns for Y (Default: `0.125`)\n  --z_voxel_size Z_VOXEL_SIZE\n                        axial voxel size in microns for Z (Default: `0.2`)\n  --input_shape INPUT_SHAPE\n                        PSF input shape (Default: `64`)\n  --random_crop RANDOM_CROP\n  --modes MODES         number of modes to describe aberration (Default: `55`)\n  --min_photons MIN_PHOTONS\n                        minimum photons for training samples (Default: `5000`)\n  --max_photons MAX_PHOTONS\n                        maximum photons for training samples (Default: `10000`)\n  --psf_type PSF_TYPE   widefield, 2photon, confocal, or a path to an LLS excitation profile (Default: `['../lattice/YuMB_NAlattice0p35_NAAnnulusMax0p40_NAsigma0p1.mat']`)\n  --dist DIST           distribution of the zernike amplitudes (Default: `single`)\n  --mode_dist MODE_DIST\n                        distribution of the zernike modes (Default: `pyramid`)\n  --gamma GAMMA         exponent for the powerlaw distribution (Default: `0.75`)\n  --signed              optional flag to generate a symmetric (pos/neg) semi-distributions for the given range of amplitudes\n  --rotate              optional flag to introduce a random radial rotation to each zernike mode\n  --randomize_object_size\n                        optional flag to randomize voxel size during training\n  --min_amplitude MIN_AMPLITUDE\n                        min amplitude for the zernike coefficients (Default: `0`)\n  --max_amplitude MAX_AMPLITUDE\n                        max amplitude for the zernike coefficients (Default: `0.25`)\n  --min_lls_defocus_offset MIN_LLS_DEFOCUS_OFFSET\n                        min value for the offset between the excitation and detection focal plan (microns) (Default: `0`)\n  --max_lls_defocus_offset MAX_LLS_DEFOCUS_OFFSET\n                        max value for the offset between the excitation and detection focal plan (microns) (Default: `0`)\n  --refractive_index REFRACTIVE_INDEX\n                        the quotient of the speed of light as it passes through two media (Default: `1.33`)\n  --na_detection NA_DETECTION\n                        Numerical aperture (Default: `1.0`)\n  --fill_radius FILL_RADIUS\n                        Fractional cylinder radius (0-1) that defines where a bead may be placed in X Y Z. (Default: `0.0`)\n  --object_size OBJECT_SIZE\n                        optional bead size (Default: 0 for diffraction-limited beads, -1 for beads with random sizes) (Default: `0.0`)\n  --uniform_background UNIFORM_BACKGROUND\n                        optional uniform background value (Default: `0`)\n  --lam_detection LAM_DETECTION\n                        wavelength in microns (Default: `0.51`)\n  --alpha_val ALPHA_VAL\n                        values to use for the `alpha` embedding [options: real, abs] (Default: `abs`)\n  --phi_val PHI_VAL     values to use for the `phi` embedding [options: angle, imag, abs] (Default: `angle`)\n  --cpu_workers CPU_WORKERS\n                        number of CPU cores to use (Default: `-1`)\n  --override            optional toggle to override existing data\n  --plot                optional toggle to plot preprocessing\n  --use_theoretical_widefield_simulator\n                        optional toggle to use an experimental complex pupil to estimate amplitude attenuation (cosine factor)\n  --skip_remove_background\n                        optional toggle to skip preprocessing input data using the DoG filter\n```\n\n\n\n## Multimodal beads dataset generator\n\nSynthatic samples with 1 up to $n$ beads randomly placed in a given FOV\n\n\u003e [!NOTE]\n\u003e Supported PSFs ([synthatic.py](src/synthatic.py))\n\u003e  - Lattice light sheets\n\u003e  - Widefield\n\u003e  - 2photon\n\u003e  - Confocal\n\n\n```shell\npytest -s -v --disable-pytest-warnings --color=yes tests/test_datasets.py -k test_multimodal_dataset\n```\n\n```shell\n=========================================================== test session starts ===========================================================\nplatform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 -- /home/thayer/miniforge3/envs/beads/bin/python3.12\ncachedir: .pytest_cache\nrootdir: /home/thayer/Github/beads_simulator\nplugins: order-1.3.0\ncollected 9 items / 8 deselected / 1 selected\n\ntests/test_datasets.py::test_multimodal_dataset Loading cached SyntheticPSF instance from /home/thayer/Github/beads_simulator/SyntheticPSFCache/.._lattice_YuMB_NAlattice0p35_NAAnnulusMax0p40_NAsigma0p1.mat_shape_64-64-64_lam_0.51_na_1.0_ri_1.33_x_0.097_y_0.097_z_0.2_twd_simulator_False\nLoading cached SyntheticPSF instance from /home/thayer/Github/beads_simulator/SyntheticPSFCache/.._lattice_YuMB_NAlattice0p35_NAAnnulusMax0p40_NAsigma0p1.mat_shape_128-128-128_lam_0.51_na_1.0_ri_1.33_x_0.097_y_0.097_z_0.2_twd_simulator_False\nLoading cached SyntheticPSF instance from /home/thayer/Github/beads_simulator/SyntheticPSFCache/.._lattice_Gaussian_NAexc0p21_NAsigma0p21_annulus0p4-0p2_crop0p1_FWHM51p0.mat_shape_64-64-64_lam_0.51_na_1.0_ri_1.33_x_0.097_y_0.097_z_0.2_twd_simulator_False\nLoading cached SyntheticPSF instance from /home/thayer/Github/beads_simulator/SyntheticPSFCache/.._lattice_Gaussian_NAexc0p21_NAsigma0p21_annulus0p4-0p2_crop0p1_FWHM51p0.mat_shape_128-128-128_lam_0.51_na_1.0_ri_1.33_x_0.097_y_0.097_z_0.2_twd_simulator_False\nLoading cached SyntheticPSF instance from /home/thayer/Github/beads_simulator/SyntheticPSFCache/.._lattice_MBSq_NAexc0p30_annulus0p375-0p225_FWHM48p5.mat_shape_64-64-64_lam_0.51_na_1.0_ri_1.33_x_0.097_y_0.097_z_0.2_twd_simulator_False\nLoading cached SyntheticPSF instance from /home/thayer/Github/beads_simulator/SyntheticPSFCache/.._lattice_MBSq_NAexc0p30_annulus0p375-0p225_FWHM48p5.mat_shape_128-128-128_lam_0.51_na_1.0_ri_1.33_x_0.097_y_0.097_z_0.2_twd_simulator_False\nLoading cached SyntheticPSF instance from /home/thayer/Github/beads_simulator/SyntheticPSFCache/.._lattice_Sinc_by_lateral_SW_NAexc0p32_NAsigma5p0_annulus0p4-0p2_realSLM_FWHM51p5.mat_shape_64-64-64_lam_0.51_na_1.0_ri_1.33_x_0.097_y_0.097_z_0.2_twd_simulator_False\nLoading cached SyntheticPSF instance from /home/thayer/Github/beads_simulator/SyntheticPSFCache/.._lattice_Sinc_by_lateral_SW_NAexc0p32_NAsigma5p0_annulus0p4-0p2_realSLM_FWHM51p5.mat_shape_128-128-128_lam_0.51_na_1.0_ri_1.33_x_0.097_y_0.097_z_0.2_twd_simulator_False\nLoading cached SyntheticPSF instance from /home/thayer/Github/beads_simulator/SyntheticPSFCache/.._lattice_v2Hex_NAexc0p50_NAsigma0p075_annulus0p60-0p40_FWHM53p0.mat_shape_64-64-64_lam_0.51_na_1.0_ri_1.33_x_0.097_y_0.097_z_0.2_twd_simulator_False\nLoading cached SyntheticPSF instance from /home/thayer/Github/beads_simulator/SyntheticPSFCache/.._lattice_v2Hex_NAexc0p50_NAsigma0p075_annulus0p60-0p40_FWHM53p0.mat_shape_128-128-128_lam_0.51_na_1.0_ri_1.33_x_0.097_y_0.097_z_0.2_twd_simulator_False\nLoading cached SyntheticPSF instance from /home/thayer/Github/beads_simulator/SyntheticPSFCache/.._lattice_v2HexRect_NAexc0p50_NAsigma0p15_annulus0p60-0p40_FWHM_56p0.mat_shape_64-64-64_lam_0.51_na_1.0_ri_1.33_x_0.097_y_0.097_z_0.2_twd_simulator_False\nLoading cached SyntheticPSF instance from /home/thayer/Github/beads_simulator/SyntheticPSFCache/.._lattice_v2HexRect_NAexc0p50_NAsigma0p15_annulus0p60-0p40_FWHM_56p0.mat_shape_128-128-128_lam_0.51_na_1.0_ri_1.33_x_0.097_y_0.097_z_0.2_twd_simulator_False\nLoading cached SyntheticPSF instance from /home/thayer/Github/beads_simulator/SyntheticPSFCache/.._lattice_ACHex_NAexc0p40_NAsigma0p075_annulus0p6-0p2_crop0p1_FWHM52p0.mat_shape_64-64-64_lam_0.51_na_1.0_ri_1.33_x_0.097_y_0.097_z_0.2_twd_simulator_False\nLoading cached SyntheticPSF instance from /home/thayer/Github/beads_simulator/SyntheticPSFCache/.._lattice_ACHex_NAexc0p40_NAsigma0p075_annulus0p6-0p2_crop0p1_FWHM52p0.mat_shape_128-128-128_lam_0.51_na_1.0_ri_1.33_x_0.097_y_0.097_z_0.2_twd_simulator_False\nLoading cached SyntheticPSF instance from /home/thayer/Github/beads_simulator/SyntheticPSFCache/.._lattice_MBHex_NAexc0p43_annulus0p47_0p40_crop0p08_FWHM48p0.mat_shape_64-64-64_lam_0.51_na_1.0_ri_1.33_x_0.097_y_0.097_z_0.2_twd_simulator_False\nLoading cached SyntheticPSF instance from /home/thayer/Github/beads_simulator/SyntheticPSFCache/.._lattice_MBHex_NAexc0p43_annulus0p47_0p40_crop0p08_FWHM48p0.mat_shape_128-128-128_lam_0.51_na_1.0_ri_1.33_x_0.097_y_0.097_z_0.2_twd_simulator_False\nLoading cached SyntheticPSF instance from /home/thayer/Github/beads_simulator/SyntheticPSFCache/widefield_shape_64-64-64_lam_0.51_na_1.0_ri_1.33_x_0.097_y_0.097_z_0.2_twd_simulator_False\nLoading cached SyntheticPSF instance from /home/thayer/Github/beads_simulator/SyntheticPSFCache/widefield_shape_128-128-128_lam_0.51_na_1.0_ri_1.33_x_0.097_y_0.097_z_0.2_twd_simulator_False\nLoading cached SyntheticPSF instance from /home/thayer/Github/beads_simulator/SyntheticPSFCache/2photon_shape_64-64-64_lam_0.92_na_1.0_ri_1.33_x_0.097_y_0.097_z_0.2_twd_simulator_False\nLoading cached SyntheticPSF instance from /home/thayer/Github/beads_simulator/SyntheticPSFCache/2photon_shape_128-128-128_lam_0.92_na_1.0_ri_1.33_x_0.097_y_0.097_z_0.2_twd_simulator_False\nLoading cached SyntheticPSF instance from /home/thayer/Github/beads_simulator/SyntheticPSFCache/confocal_shape_64-64-64_lam_0.51_na_1.0_ri_1.33_x_0.097_y_0.097_z_0.2_twd_simulator_False\nLoading cached SyntheticPSF instance from /home/thayer/Github/beads_simulator/SyntheticPSFCache/confocal_shape_128-128-128_lam_0.51_na_1.0_ri_1.33_x_0.097_y_0.097_z_0.2_twd_simulator_False\n100%|██████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [04:48\u003c00:00, 28.83s/it]\nPASSED\n\n========================================= 1 passed, 8 deselected, 1 warning in 290.55s (0:04:50) ==========================================\n```\n\n\n\n# BibTeX\n\n```bibtex\n@article{alshaabi2025fourier,\n  title={Fourier-Based 3D Multistage Transformer for Aberration Correction in Multicellular Specimens},\n  author={Thayer Alshaabi and Daniel E. Milkie and Gaoxiang Liu and Cyna Shirazinejad and Jason L. Hong and Kemal Achour and Frederik Görlitz and Ana Milunovic-Jevtic and Cat Simmons and Ibrahim S. Abuzahriyeh and Erin Hong and Samara Erin Williams and Nathanael Harrison and Evan Huang and Eun Seok Bae and Alison N. Killilea and David G. Drubin and Ian A. Swinburne and Srigokul Upadhyayula and Eric Betzig},\n  journal={arXiv preprint arXiv:2503.12593},\n  year={2025},\n  url={https://arxiv.org/abs/2503.12593},\n}\n```\n\n\n# License \n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   [Apache License 2.0](LICENSE)\n\nCopyright 2025 Cell Observatory.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcell-observatory%2Fbeads_simulator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcell-observatory%2Fbeads_simulator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcell-observatory%2Fbeads_simulator/lists"}