Skip to content
Zhang-jingxiangPublic

About

URA-SIM package for reduced-acquisition structured illumination microscopy

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

ura_sim

URA-SIM package for reduced-acquisition phase completion and reconstruction:

reduced raw stack + selection + topology + completion config
    -> completed raw stack + manifest
    -> optional super-resolution image via a bundled backend

Scope

This package is intended for a Linux / WSL environment with NVIDIA GPU. It is not a standalone Windows .exe distribution. Do not expect the bundled PhaseGate ELF or MATLAB engines to run from native Windows Python without WSL or MATLAB.

Modality Completion Super-resolution backend Extra runtime
2D-SIM in-package (modalities/sim2d/completion) bundled backends/phasegate/dftpe_recon (Linux ELF) WSL, NVIDIA GPU, libcudart.so.12 / libcufft.so.11 (bundled), libcuda.so from the driver
NL-SIM in-package (modalities/nlsim) bundled JSFR MATLAB under backends/jsfr_nlsim/ MATLAB, GPU
3D-SIM in-package (modalities/sim3d) bundled Open-3DSIM MATLAB under backends/open3dsim/ MATLAB, GPU, DIPimage / Bio-Formats shipped with the engine

Python dependencies: numpy, tifffile.

Not in this package: selection search, ranking, metrics gates, paper figures. You must pass --selection yourself.

CLI

# 2D-SIM reduced-frame completion + PhaseGate SR
python -m ura_sim \
  --modality sim2d \
  --source-tif ura_sim/data/stack.tif \
  --selection 01258 \
  --completion-mode count2 \
  --na 1.47 --mag 63

# NL-SIM (25-frame raw, 0-based selection)
python -m ura_sim \
  --modality nlsim \
  --source-tif nlsim_raw.tif \
  --selection 0,1,2,3,4,5,10,15,20 \
  --completion-model joint_five \
  --matlab-bin /path/to/matlab

# 3D-SIM (1-based Open-3DSIM raw indices)
python -m ura_sim \
  --modality sim3d \
  --source-tif volume.tif \
  --selection 1,2,3,6,7,8,11,12,13 \
  --completion-model phase_smooth \
  --matlab-bin /path/to/matlab

--complete-only writes the completed raw stack and skips reconstruction. MATLAB can also be set with URA_SIM_MATLAB.

Python API

from ura_sim import (
    NLSimCompletionConfig,
    Sim3DCompletionConfig,
    cli_completion_config,
    complete,
    complete_nlsim,
    complete_sim3d,
    load_nlsim_stack,
    load_raw_cycle,
    load_sim3d_stack,
)

raw, cycle_record = load_raw_cycle("stack.tif", cycle_index=0)
completed, manifest = complete(raw, selection, config=cli_completion_config("count2"))

nlsim_raw, _ = load_nlsim_stack("nlsim.tif")
nlsim_completed, nlsim_manifest = complete_nlsim(
    nlsim_raw, nlsim_selection, config=NLSimCompletionConfig()
)

sim3d_raw, _ = load_sim3d_stack("volume.tif")
sim3d_completed, sim3d_manifest = complete_sim3d(
    sim3d_raw,
    sim3d_selection,
    config=Sim3DCompletionConfig(model="phase_smooth"),
)

3D-SIM still has two estimators (phase_smooth vs five_component). The facade requires an explicit model and records the unresolved experiment/manuscript conflict in the manifest.

Layout

  • python -m ura_sim: package CLI
  • ura_sim/modalities/sim2d/completion/: 2D completion math
  • ura_sim/modalities/nlsim/: NL-SIM topology + completion
  • ura_sim/modalities/sim3d/: 3D topology + completion
  • ura_sim/backends/phasegate/: copied PhaseGate ELF
  • ura_sim/backends/jsfr_nlsim/: JSFR-NL-SIM MATLAB engine + driver
  • ura_sim/backends/open3dsim/: Open-3DSIM MATLAB engine + sidecar

License

Original code developed for this project is licensed under the Apache License, Version 2.0; see LICENSE. Apache 2.0 permits commercial use.

Third-party code and binaries are not relicensed by this declaration. In particular, the JSFR-NL-SIM and Open-3DSIM MATLAB engines and the PhaseGate executable contain third-party material; their respective copyright notices and license terms continue to apply. Some included engine files have different licenses, including GPL-licensed code.

About

URA-SIM package for reduced-acquisition structured illumination microscopy

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages