-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: rewrite simulation stages, improve optical config spectral considerations #74
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #74 +/- ##
==========================================
+ Coverage 84.19% 84.84% +0.64%
==========================================
Files 49 47 -2
Lines 2892 3094 +202
==========================================
+ Hits 2435 2625 +190
- Misses 457 469 +12 ☔ View full report in Codecov by Sentry. |
@federico-carrara, if you have time/interest, you may wish to take a peek at this. I don't expect you to review the entire thing, but if you have any questions/concerns about your particular use case, let me know |
Hi @tlambert03! |
this generally rewords the simulation pipeline. I think the biggest conceptual shift is probably this:
illumination_flux
method (with a full zyx extent); instead there is a newfiltered_emission_rates()
method that returns a non-spatial(C, F, W)
array, representing the full spectral emission profile of each channel/fluorophore pair (without binning), in units of photons/sec.emission_flux
still exists as a convenience method, but isn't used internally by the simulation anymoremodality.render()
method now takes in theground_truth
((F, Z, Y, X)
) and thefiltered_emission_rates
((C, F, W)
). it is then responsible for binning of the emission (if desired), which is only necessary for "hyperaccurate" simulations that want to represent a single channel as a superposition of many slightly different PSFs. The default is simply to bin all the emission photons (per channel/fluor) into an average wavelength and use a single PSF, but that setting is controlled bysettings.spectral_bins_per_emission_channel
. One advantage here is that all channels don't need to "agree" on the binning edges or strategy: the binning is an interim step that happens only within a single channel/fluorophore.optical_image_per_fluor
that represents the fullest expansion of dimensions in the pipeline(C, F, Z, Y, X)
, all it does is returnmodality.render
; andoptical_image
is simply the output of that method summed over fluorophores:(C, Z, Y, X)
the rest is pretty much the same.
New tutorial added here, which will be in the docs:
https://github.com/tlambert03/microsim/blob/bdc748878df587691809d951bbe8a654fa323463/docs/tutorial.ipynb