brisvag / blik

Python tool for visualising and interacting with cryo-ET and subtomogram averaging data.
https://brisvag.github.io/blik/
GNU General Public License v3.0
23 stars 8 forks source link

Updates to depiction #86

Closed brisvag closed 3 years ago

brisvag commented 3 years ago

This PR has a few small changes scattered around, but it's mainly focused on depiction.

Depiction

The previous system of having multiple viewer was discarded in favour of a much sturdier, 1-viewer approach. The benefits were too small (w.g: playing around with watching a 3D line while creating 2D points) and will probably be soon irrelevant (3D interactivty in napari ;)).

I added a couple of purging methods to Peeper to clean up all the generated layers or reset depictors completely. This helps especially in development, but is also a workaround until napari fixes layers being broken by closing the viewer.

datablock.depict() became datablock.init_depictor() because it was very confusing when next to the very different depictor.depict().

The Viewer object is now in charge of everything about WHAT to visualize, while depiction is now ONLY handled by the depictor, which creates either napari layers or pyqt plots. These are simply plucked out of the bunch by the viewer when requested.

A new PT_OMI (not sure on the name :P) special volume is now treated differently from normal volumes. This is always visible. One can put anything there, and it's going to be displayed no matter the selected volume (useful for example for plots that describe the whole dataset, like classification centroids).

IO

Datablock now keep trach of their file path, which is also used to hash them. This allows, for example, that 2 images with the same name and volume can coexist if they come from different sources (now it's easy to open a micrograph and a CC image in the same volume).

Stuff

Classification and deduplication are update to the latest specs (though as we discussed, they will probably be moved out of this repo soon).

codecov[bot] commented 3 years ago

Codecov Report

Merging #86 (db47ff9) into develop (17ab4d0) will increase coverage by 1.11%. The diff coverage is 63.11%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop      #86      +/-   ##
===========================================
+ Coverage    82.15%   83.27%   +1.11%     
===========================================
  Files          103      100       -3     
  Lines         2163     2200      +37     
===========================================
+ Hits          1777     1832      +55     
+ Misses         386      368      -18     
Impacted Files Coverage Δ
peepingtom/_tests/test_cli.py 100.00% <ø> (ø)
peepingtom/datablocks/abstractblocks/multiblock.py 88.23% <0.00%> (ø)
peepingtom/depictors/__init__.py 100.00% <ø> (ø)
peepingtom/depictors/napari/linedepictor.py 73.91% <0.00%> (-3.36%) :arrow_down:
peepingtom/depictors/pyqtgraph/__init__.py 100.00% <ø> (ø)
peepingtom/gui/__init__.py 100.00% <ø> (ø)
peepingtom/utils/dispatchlist.py 56.55% <0.00%> (ø)
peepingtom/depictors/napari/particledepictor.py 67.44% <20.00%> (-5.54%) :arrow_down:
peepingtom/depictors/pyqtgraph/plotdepictor.py 46.15% <33.33%> (+11.15%) :arrow_up:
...ingtom/depictors/pyqtgraph/propertyplotdepictor.py 50.00% <33.33%> (+5.55%) :arrow_up:
... and 22 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 17ab4d0...db47ff9. Read the comment docs.

brisvag commented 3 years ago

I think it's better to keep None as the default volume. This simply results in bein put in a fake volume that I think shows up as unassigned. Not sure if this is the best way, but there definitely should be a difference between not setting a volume and setting it to "every volume".

Which makes me think: maybe datablock with unassigned volume should actually go each in their own volume, rather than all in the same one? Any thoughts?

alisterburt commented 3 years ago

Makes sense - yeah I think you're right, they should probably end up separate rather than together