Add tuple-pattern return format for simulate and gen_images#31
Merged
Add tuple-pattern return format for simulate and gen_images#31
Conversation
Introduces AbstractLabeling type hierarchy to separate labeling statistics from molecule photophysics: - FixedLabeling: deterministic n fluorophores per site - PoissonLabeling: Poisson-distributed fluorophores per site - BinomialLabeling: binomial-distributed (n trials, p probability) All types include labeling_efficiency parameter for probability that a site gets labeled at all. Key design decisions: - Labeling is orthogonal to Molecule (photophysics) - enables composition - Default FixedLabeling(n=1, efficiency=1.0) preserves backward compatibility - apply_labeling() dispatches on labeling type for coordinate expansion - Metadata tracks labeling_type and labeling_params Usage: simulate(params; pattern=Nmer2D(), labeling=PoissonLabeling(1.5), molecule=fluor) Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Update emitter constructors in simulation.jl, photophysics.jl, and coordinate_noise.jl to set σ_xy=0.0 (correct for symmetric PSFs) - Update test files to use new Emitter2DFit keyword constructor format - Require SMLMData >= 0.5.1 for σ_xy field support Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Add burn_in parameter to intensity_trace() and kinetic_model() for simulating pre-illumination before recording (photobleaching models) - Add state1 parameter to simulate() for explicit initial state control - Fix CTMC warnings for absorbing states (Q[i,i]=0 is valid) - Update api_overview.md with labeling types documentation - Update CLAUDE.md with simulation pipeline documentation burn_in is useful for 3-state photobleaching models where you want to simulate the experimental protocol of high laser power for several seconds before data collection begins. Co-Authored-By: Claude Opus 4.5 <[email protected]>
- uniform2D/uniform3D now return pattern_ids indicating pattern membership - apply_labeling preserves pattern_ids through expansion (with backward-compat overloads) - Emitters now carry pattern id through simulation pipeline - Update SMLMData compat to "0.5, 0.6" - Update documentation for new return signatures Co-Authored-By: Claude Opus 4.5 <[email protected]>
BREAKING CHANGE: All simulation and image generation functions now return (output, info) tuples instead of single values or 3-tuples. Changes: - simulate(::StaticSMLMParams) returns (smld_noisy, SimInfo) - SimInfo contains smld_true, smld_model, timing, and counts - simulate(::DiffusionSMLMParams) returns (smld, SimInfo) - gen_images() returns (images, ImageInfo) - gen_image() returns (image, ImageInfo) New types: - SimInfo: elapsed_ns, backend, device_id, seed, smld_true, smld_model, n_patterns, n_emitters, n_localizations, n_frames - ImageInfo: elapsed_ns, backend, device_id, frames_generated, n_photons_total, output_size Bump version to 0.5.0 Co-Authored-By: Claude Opus 4.5 <[email protected]>
- SimInfo.elapsed_s::Float64 (was elapsed_ns::UInt64) - ImageInfo.elapsed_s::Float64 (was elapsed_ns::UInt64) - Time now stored directly in seconds for convenience Co-Authored-By: Claude Opus 4.5 <[email protected]>
Breaking change: Renamed simulation config types for consistency: - StaticSMLMParams -> StaticSMLMConfig - DiffusionSMLMParams -> DiffusionSMLMConfig Updated all source files, tests, and documentation. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Breaking changes in this release: - simulate() returns (output, info) tuple instead of 3-tuple or single value - gen_images()/gen_image() return (images, ImageInfo) tuple - StaticSMLMParams renamed to StaticSMLMConfig - DiffusionSMLMParams renamed to DiffusionSMLMConfig Co-Authored-By: Claude Opus 4.5 <[email protected]>
SMLMSimParams <: AbstractSMLMConfig, SimInfo <: AbstractSMLMInfo, ImageInfo <: AbstractSMLMInfo. Remove unused AbstractSim type. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Requires SMLMData v0.7.0 which provides AbstractSMLMConfig and AbstractSMLMInfo abstract types for the tuple pattern. Co-Authored-By: Claude Opus 4.6 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
(output, info)tuplessimulate(::StaticSMLMParams)returns(smld_noisy, SimInfo)with intermediate results in infosimulate(::DiffusionSMLMParams)returns(smld, SimInfo)gen_images()andgen_image()return(images/image, ImageInfo)SimInfoandImageInfotypes provide timing, counts, and metadataTest plan
🤖 Generated with Claude Code