palvarezc / cavendish-particle-tracks

A Napari plugin to perform a simple particle tracking analysis for the Cavendish laboratory's Undergraduate Part II Particle Tracks experiment.
https://palvarezc.github.io/cavendish-particle-tracks/
Other
2 stars 0 forks source link

Make the measurements layer 4D #154

Closed palvarezc closed 4 weeks ago

palvarezc commented 1 month ago

For the layer that contains the measurements of the radii and decay lengths, it makes more sense to have the dimensionality of the data itself.

Potentially, this also allows to raise an error if the wrong particle is being used (by consulting the event_number and view_number) introduced in:

This is not implemented yet!

Solves

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Flag Coverage Δ
93.26% <100.00%> (+0.12%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/cavendish_particle_tracks/_main_widget.py 93.41% <100.00%> (+0.23%) :arrow_up:
src/cavendish_particle_tracks/analysis.py 97.22% <100.00%> (+0.05%) :arrow_up:
palvarezc commented 1 month ago

For the layer that contains the measurements of the radii and decay lengths, it makes more sense to have the dimensionality of the data itself.

But you're not changing the layer setup here? I mean: you've just switched to 4D and haven't used it..?

Shit, you are right.... I think the tests in test_calculate would not catch this.

I think the calculation of lengths is probably fine, but the radius will break. I'll try to update the test...

palvarezc commented 1 month ago

Modified the relevant functions to deal with 4D points.

In the table and the data we save only the 2D projection (x,y), is there any value in saving the 4D points instead, maybe for debug purposes?

samcunliffe commented 1 month ago

Retrospectively added

which is my understanding of the usability feature we're trying to implement here.

samcunliffe commented 1 month ago

P.s. is the title of this PR correct? 4D is still the understanding of a layer that is new for each event vs. one layer for all events.

samcunliffe commented 1 month ago

would be handling 1000 × 3 layers × 3 (or 4) points per event per layer?

More like 500 images × 10 points per event × (2 × floating point numbers per point) which is 100s of kbs but should be fine in RAM.

samcunliffe commented 4 weeks ago

Conflicts don't look too bad.

palvarezc commented 4 weeks ago

P.s. is the title of this PR correct? 4D is still the understanding of a layer that is new for each event vs. one layer for all events.

(Event, View, x, y)