Closed nthndy closed 1 year ago
Preview page for your plugin is ready here: https://preview.napari-hub.org/quantumjot/btrack/354 Updated: 2023-08-03T11:32:14.925278
Patch coverage: 71.42%
and project coverage change: +0.79%
:tada:
Comparison is base (
0d8b714
) 85.26% compared to head (ff27f9a
) 86.05%. Report is 12 commits behind head on main.
:exclamation: Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Hey @nthndy - this is cool! I don't have a way to test this. Can you confirm that it works and/or provide an automated test?
Yes although I am currently working on a fix for objects with property mean_intensity
measured from a multichannel image... unsure what went wrong since this morning as it worked then...
https://github.com/nthndy/btrack/blob/a0578ff4ae59d7be96148435cc9a49018bcbf0c4/btrack/utils.py#L285 it's this line here, where it calls len(keys)
confuses things. This is because there are N = len(keys)
keys but N + len(channels)
columns of information for each individual object measurement. By which I mean if you have measured the mean intensity of a 4 channel image you have a column with 4 extra values in it, which confuses things when you convert to coords_array
. If I just remove the len(keys)
it works again, but is this a suitable fix?
or i could add a new line that measures the number of keys as more accurate reflection of the number of data points for each object observation, so if there is an N channel image it adds N-1 more to the len(keys)
Ah, becuase the property values are not scalar?
Yeah exactly
How about something like this:
def update_segmentation(
...,
color_by: Union[str, Callable] = "ID",
...
) -> npt.NDArray:
then color_by
could also be a user specified function, e.g.
def color_by_channel_zero(track) -> npt.NDArray:
# returns just the scalar value from each track, e.g.
return track.properties["mean_intensity"][:, 0]
that is passed when calling update_segmentation
. What do you think?
I prefer passing a simple string input to update_segmentation
... I've been testing both approaches today and writing a function anew for every property I wanted to colour the segmentation by seemed a bit uhh verbose. But maybe I don't understand the versatility a function input would provide?
@nthndy - Do you want a review on this?
Ok looks good, will merge
Propsing two changes to the
update_segmentation
function:scale
parameter that can change the size of the segmentation to match any previously scaled tracks you have. This allows you to color the segmentation using the scaled tracks.color_by
any of the non-default track parameters by updating the keys from DEFAULT_EXPORT_PROPERTIES to include new track properties too.Let me know what you think.