chanzuckerberg / napari-cryoet-data-portal

A napari plugin to list, preview, and open data from the CZ Imaging Institute's CryoET Data Portal
MIT License
9 stars 2 forks source link

Fix color choice based on object ID #32

Closed uermel closed 3 months ago

uermel commented 3 months ago

The data portal now also supports UniProtKB accessions as Annotation.object_id. UniProtKB accessions can contain letters, so the ID can't be directly converted to an integers anymore. This PR instead uses hash(Annotation.object_id.split(':')[-1]) to determine consistent colors for annotations of the same objects.

uermel commented 3 months ago

Tests were broken because some SegmentationMasks were ingested with the wrong data type (f32). I fixed that in production for the Tomogram that is used in tests here.