Skip to content

add ContextlessAnnotation #144

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Conversation

ericphanson
Copy link
Member

when one only has a Samples object (and not a signal), and they run some algorithm over it that generates annotations, that algo doesn’t have the context of recording or start of the signal, and can only output things relative to the samples itself. That leads to the need for something like this ContextlessSpanV1.

More beacon-internal context: https://beacon-biosignals.slack.com/archives/CKS1Y5F5X/p1695907224398859

Comment on lines -26 to 36
#= 5 =# AnnotationV1(recording=recs[2], id=uuid4(), span=TimeSpan(67, 95)),
#= 6 =# AnnotationV1(recording=recs[2], id=uuid4(), span=TimeSpan(15, 170)),
#= 7 =# AnnotationV1(recording=recs[1], id=uuid4(), span=TimeSpan(43, 89)),
#= 8 =# AnnotationV1(recording=recs[3], id=uuid4(), span=TimeSpan(0, 50)),
#= 9 =# AnnotationV1(recording=recs[2], id=uuid4(), span=TimeSpan(2, 10)),
#= 10 =# AnnotationV1(recording=recs[1], id=uuid4(), span=TimeSpan(111, 140)),
#= 11 =# AnnotationV1(recording=recs[3], id=uuid4(), span=TimeSpan(60, 100)),
#= 12 =# AnnotationV1(recording=recs[3], id=uuid4(), span=TimeSpan(23, 80)),
#= 13 =# AnnotationV1(recording=recs[3], id=uuid4(), span=TimeSpan(100, 110)),
#= 14 =# AnnotationV1(recording=recs[1], id=uuid4(), span=TimeSpan(200, 300))]
sources = [AnnotationV1(recording=recs[1], id=uuid4(), span=TimeSpan(0, 100)), #= 1 =#
AnnotationV1(recording=recs[2], id=uuid4(), span=TimeSpan(55, 100)), #= 2 =#
AnnotationV1(recording=recs[1], id=uuid4(), span=TimeSpan(34, 76)), #= 3 =#
AnnotationV1(recording=recs[1], id=uuid4(), span=TimeSpan(120, 176)), #= 4 =#
AnnotationV1(recording=recs[2], id=uuid4(), span=TimeSpan(67, 95)), #= 5 =#
AnnotationV1(recording=recs[2], id=uuid4(), span=TimeSpan(15, 170)), #= 6 =#
AnnotationV1(recording=recs[1], id=uuid4(), span=TimeSpan(43, 89)), #= 7 =#
AnnotationV1(recording=recs[3], id=uuid4(), span=TimeSpan(0, 50)), #= 8 =#
AnnotationV1(recording=recs[2], id=uuid4(), span=TimeSpan(2, 10)), #= 9 =#
AnnotationV1(recording=recs[1], id=uuid4(), span=TimeSpan(111, 140)), #= 10 =#
AnnotationV1(recording=recs[3], id=uuid4(), span=TimeSpan(60, 100)), #= 11 =#
AnnotationV1(recording=recs[3], id=uuid4(), span=TimeSpan(23, 80)), #= 12 =#
AnnotationV1(recording=recs[3], id=uuid4(), span=TimeSpan(100, 110)), #= 13 =#
AnnotationV1(recording=recs[1], id=uuid4(), span=TimeSpan(200, 300))] #= 14 =#
merged = merge_overlapping_annotations(sources)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these changes seem unrelated?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatter autoformatted, my bad. Will fix

@ericphanson
Copy link
Member Author

On slack we decided the id isn't necessary here, and this can just be a Vector{TimeSpan}, or some other table (if other columns are needed too for some purpose), but we don't need a ContextlessAnnotation object.

@ericphanson ericphanson deleted the eph/contextless-annotation branch November 6, 2023 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants