Skip to content
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

Transfer function visuals #178

Merged
merged 10 commits into from
Dec 18, 2024
Merged

Transfer function visuals #178

merged 10 commits into from
Dec 18, 2024

Conversation

talonchandler
Copy link
Collaborator

@talonchandler talonchandler commented Nov 8, 2024

This PR adds visualization scripts for the Green's tensor spectrum and transfer functions.

Tagging @mattersoflight, @edyoshikun, @ieivanov who have requested these.

Running these scripts results in:

Screen.Recording.2024-11-08.at.1.33.04.PM.mov
Screen.Recording.2024-11-08.at.2.01.11.PM.mov

ziw-liu and others added 5 commits October 29, 2024 16:06
* bump torch to unpin numpy

* add SPEC-0 conformant numpy requirement
* bump torch to unpin numpy

* add SPEC-0 conformant numpy requirement
@talonchandler talonchandler marked this pull request as ready for review November 8, 2024 22:06
* helper functions

* fluorescence wrap safety

* 3d phase wrap safety

* fix axial nyquist bug

* 2d phase wrap safety

* fix interaction between padding and wrap safety
Copy link
Member

@mattersoflight mattersoflight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @talonchandler, these scripts work well! I tested on Mac.

Surface rendering of the support of the Green's tensor spectrum just like you surface render support of OTFs will lead to a more intuitive and compelling visualization.

Minor point: For visualization and slides, the dark theme looks better to me.

image

@talonchandler
Copy link
Collaborator Author

talonchandler commented Nov 12, 2024

Surface rendering of the support of the Green's tensor spectrum just like you surface render support of OTFs will lead to a more intuitive and compelling visualization.

I agree, I will iterate here. The aliasing and colormapping are making the volume renders suboptimal. I'll need to get a "marching cubes" or similar algorithm connected to napari's surface layer, but I don't expect an enormous lift.

Minor point: For visualization and slides, the dark theme looks better to me.

Sounds good, I can return to that default after changing to a surface rendered Green's.

@talonchandler
Copy link
Collaborator Author

  • Dark mode is now default for these scripts

  • Green's tensor is now rendered as a surface (see screenshots below)
    Screenshot 2024-12-05 at 5 17 08 PM

  • The paper figure is now updated with the surface renders
    Screenshot 2024-12-05 at 5 36 10 PM

@talonchandler talonchandler merged commit 6021e97 into vector-prototype Dec 18, 2024
3 checks passed
@talonchandler talonchandler deleted the tf-visuals branch December 18, 2024 23:49
talonchandler added a commit that referenced this pull request Dec 22, 2024
* Phase reconstruction is invariant to voxel-size (#164)

* fix bug finding focus in stack with only one slice

* refactor for clarify

* formatting

* print -> warnings.warn

* test single-slice case

* fix test bugs

* z-scale-invariant test object

* no rescaling on output

* forward simulation takes a "brightness" - simulating real microscope

* fix example script

* add background parameter for fluorescence forward model

* test voxel-size invariance

* rename I_norm -> direct_intensity

* refactor to clarify discretization factor

* remove comment

* fix fluorescence example bug

* improved docsring

---------

Co-authored-by: Ivan Ivanov <ivan.ivanov@czbiohub.org>

* poster scripting

* may 14 poster draft

* last-minute poster changes

* quick clearning

* checkpoint before svd refactor

* SVD refactor

* pass singular system

* update visualization script

* fix visualization script scaling

* correct phase recon regression, legacy recon assumes axially even green's function

* helper functions

* fluorescence wrap safety

* 3d phase wrap safety

* fix axial nyquist bug

* 2d phase wrap safety

* fix interaction between padding and wrap safety

* clean defaults

* refactor singular system computation

* remove accidental duplicate

* refactor visuals

* fix warnings from tensoring a tensor

* match defaults

* readme type

* handle napari dependency

* Revert "fix warnings from tensoring a tensor"

This reverts commit ca4e7c5.

* Reapply "fix warnings from tensoring a tensor"

This reverts commit 790df57.

* revive old version of greens tensor for backwards compatibility

* fix tests that fail because of napari on github

* wrap-safe vector transfer function

* sampling tests

* fourier-space oversampling

* better visualizations for debugging

* complex-valued napari visuals

* complex utils

* fix colormaps

* debugging coherent tfs

* formatting

* fix rotation matrices

* fix dc term

* cleaning up

* first-pass visuals checkpoint

* matplotlib visuals

* temporarily turn off rotations

* debugging progress

* example script to generate matplotlib tf figures

* add rose asset

* add all assets

* plot all stokes

* brighter plot for greens

* visual improvements

* revised rotation-symmetric Green's tensor

* ignore

* fix green's tensor units

* modify circular anisotropy gellman matrices so that all transfer function are hermitian

* improved matplotlib visuals

* clean up plotting script

* fix bug with 3x3 hardcoded shape

* update tf components

* minor reconstruction updates

* refactor greens tensor spectrum

* clean test script

* clean models

* simple memory reduction

* clean debug statements

* reorder svd for clean i/o

* invert phase contrast

* formatting

* padding warning

* revise visuals

* visual cleanup

* manage large reconstructions

* Transfer function visuals (#178)

* Bump torch to unpin numpy (#176)

* bump torch to unpin numpy

* add SPEC-0 conformant numpy requirement

* Bump torch to unpin numpy (#176)

* bump torch to unpin numpy

* add SPEC-0 conformant numpy requirement

* first-pass scripts

* cleanup greens

* clean transfer function support

* fix naming issue

* Wrap-safe transfer functions (#175)

* helper functions

* fluorescence wrap safety

* 3d phase wrap safety

* fix axial nyquist bug

* 2d phase wrap safety

* fix interaction between padding and wrap safety

* green's tensor surfaces

* dark theme default

---------

Co-authored-by: Ziwen Liu <67518483+ziw-liu@users.noreply.github.com>

* matplotlib movie features

* cheaper default viz script

* move all visuals to /examples/visuals

* update examples/README to table

* typo

* update badges

* typo

* revise main README

* add 10-second slideshow

* Clean installation instructions

* cleanup vector model example

* minor cleanup

* remove matplotlib plot example

* edits to README

* clarify contrast mechanisms in README

* simplify example installation w/ `pip install waveorder[examples]`

* fix unintended diff

* clarify `examples/README.md`

* document 3d-to-2d transfer function

* test orthonormal bases

* fix accidental deletion

* add deprecation warnings

* remove plotting assets

* label transfer function and simulation axes

* guard type hint

* matplotlib visuals docs and type hints

* add type hints throughout models

* revert TYPE_CHECKING to strings

---------

Co-authored-by: Ivan Ivanov <ivan.ivanov@czbiohub.org>
Co-authored-by: Ziwen Liu <67518483+ziw-liu@users.noreply.github.com>
Co-authored-by: Shalin Mehta <shalin.mehta@czbiohub.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants