refactor: rewrite simulation stages, improve optical config spectral considerations#74
Merged
tlambert03 merged 49 commits intomainfrom Sep 10, 2024
Merged
refactor: rewrite simulation stages, improve optical config spectral considerations#74tlambert03 merged 49 commits intomainfrom
tlambert03 merged 49 commits intomainfrom
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. |
Owner
Author
|
@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 |
Contributor
|
Hi @tlambert03! |
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.
this generally rewords the simulation pipeline. I think the biggest conceptual shift is probably this:
illumination_fluxmethod (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_fluxstill 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_fluorthat represents the fullest expansion of dimensions in the pipeline(C, F, Z, Y, X), all it does is returnmodality.render; andoptical_imageis 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