Repository navigation
Add per-bundle label properties; fix shard-size and alignment bugs - #6
Open
chourroutm wants to merge 1 commit into
Open
chourroutm wants to merge 1 commit into
chourroutm wants to merge 1 commit into
Conversation
Adds label_id/label_name/label_color annotation properties, populated
from a trk's per-point "label_id" scalar (e.g. bundle group id) and an
optional {bundle_name: label_id} sidecar JSON, with label_name carrying
enum_values/enum_labels so Neuroglancer displays bundle names and
label_color assigning a deterministic random color per label id.
While wiring this up, found and fixed two pre-existing correctness bugs
that this change would otherwise have made worse:
- length_of_tract_chunk/length_of_tract_minishard and
length_of_id_chunk/length_of_id_minishard undercounted each record's
on-disk size by 4 bytes (48/52 vs. the true 44/56-byte layout + id
trailer), corrupting minishard index offsets for any shard spanning
more than one minishard.
- Neuroglancer requires each record's byte size to be a multiple of 4;
the label fields add 7 bytes, which isn't. Records now get an extra
1-byte alignment field when labels are present.
Also:
- generate_info_dict now declares real per-axis voxel-size dimensions
(derived from the trk's affine) instead of a hardcoded 1mm, which was
silently misplacing annotations relative to a paired image layer
using the same affine.
- new sharding=False path (skip_relationships in main()) writes only
the spatial pyramid with relationships: [] and by_id: {"key": ""},
matching a known-working minimal structure, for callers who don't
need by-streamline-ID lookup.
- --label_json, --skip_segmentation, --skip_relationships CLI flags.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds label_id/label_name/label_color annotation properties, populated from a trk's per-point "label_id" scalar (e.g. bundle group id) and an optional {bundle_name: label_id} sidecar JSON, with label_name carrying enum_values/enum_labels so Neuroglancer displays bundle names and label_color assigning a deterministic random color per label id.
While wiring this up, found and fixed two pre-existing correctness bugs that this change would otherwise have made worse:
Also: