Skip to content
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

Copying all metadata from messages as attributes on nodes #89

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

adamrankin
Copy link
Contributor

@adamrankin adamrankin commented May 7, 2019

Instead of just transform node copying status metadata as node attribute, copy all metadata to node attributes

@adamrankin
Copy link
Contributor Author

@lassoan @leochan2009 PR changed to specific change, could you review and merge

@adamrankin
Copy link
Contributor Author

@lassoan any objections to this PR?

@lassoan
Copy link
Contributor

lassoan commented Aug 2, 2019

Accessing all metadata can be useful and I don't see any obvious way how it could cause regressions.

My only concern is that metadata is never deleted, so metadata from old messages would hang around forever. It could be nice to be able to clear old metadata. You could add a node attribute that would contain all metadata field names of the last message. Using this information you could remove all node attributes contained in the previous message that do not have new value in the current message.

@adamrankin
Copy link
Contributor Author

I agree, old metadata could cause issues. Are there any risks of deleting not-new metadata? A server that only sends updated fields, but the client app is still using the values? Do we assume the client copies metadata to local information?

@adamrankin
Copy link
Contributor Author

Do we assume the client copies metadata to local information?

This could be a reasonable assumption, "use it or lose it".

@lassoan
Copy link
Contributor

lassoan commented Aug 5, 2019

We would only remove custom attributes that store frame metadata, so that should not cause any trouble. Additional string messages can be used to transfer metadata that is not tightly linked to an image frame.

@adamrankin
Copy link
Contributor Author

adamrankin commented Aug 7, 2019

@lassoan I can't come up with a clean way to implement this. A string message itself can have metadata which would be stored as node attributes on the vtkMRMLTextNode for example.

I don't know how to identify what should be removed and what shouldn't. If another piece of code adds a node attribute, I have no way of identifying that that shouldn't be removed.

@lassoan
Copy link
Contributor

lassoan commented Aug 7, 2019

As I wrote above, you could add a node attribute that would contain all metadata field names of the last message. If you are worried that metadata field names could interfere with other attribute names then you could add "OpenIGTLink." prefix to create attribute name from metadata field name.

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