Skip to content

point quiver enginer/layer for single molecule orientation microscopy data#1520

Draft
barentine wants to merge 3 commits into
python-microscopy:masterfrom
barentine:smolmrender
Draft

point quiver enginer/layer for single molecule orientation microscopy data#1520
barentine wants to merge 3 commits into
python-microscopy:masterfrom
barentine:smolmrender

Conversation

@barentine
Copy link
Copy Markdown
Member

Addresses issue #1504 .

Is this a bugfix or an enhancement?
enhancement
Proposed changes:

image

MWE, from a jupyter notebook:

from PYME.LMVis import VisGUI
%gui wx

pymevis = VisGUI.ipython_pymevisualize()
pipeline = pymevis.pipeline


import numpy as np
from PYME.IO import tabular, MetaDataHandler

n_points = 100
ds = tabular.DictSource({'x': np.linspace(0, 100, n_points),
                         'y': np.linspace(0, 100, n_points),
                         'z': np.zeros(n_points),
                         'azimuth': np.linspace(0, 2* np.pi, n_points),
          
                         'zenith': np.linspace(0, np.pi, n_points)})

ds.mdh = MetaDataHandler.DictMDHandler()


pipeline.addDataSource('points', ds)
pipeline.selectDataSource('points')

from PYME.recipes.localisations import LocalizationOrientationAngles
mod = LocalizationOrientationAngles(pipeline.recipe, input_name='points', output_name='oriented_points')

pipeline.recipe.add_modules_and_execute([mod])

pipeline.selectDataSource('oriented_points')

pymevis.add_point_quiver_layer('oriented_points')

remaining:

  • refactor how orientation angles / unit vectors get identified. Hacking them into a potentially large array as an attribute is certainly not the way to do it.
  • make this accessible from the 'add layer' menu (might be able to tie in the orientation/unit vector parameter identification to this part too)

@David-Baddeley , any thoughts on how best to identify what datasource columns correspond to azimuth/zenith or mu_x/mu_y_mu_z?

@barentine
Copy link
Copy Markdown
Member Author

barentine commented Jun 10, 2024

Couple outstanding issues:

  • color/alpha variation along vectors [unintentional] that then doesn't match orientation
  • not all points getting drawn, it seems

image

@barentine
Copy link
Copy Markdown
Member Author

OK, that's sorted.
I was only drawing half the vertices, and was only providing colors for that half (so each half of the line was taking a different color value rather). Fixed:
image

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.

1 participant