-
Notifications
You must be signed in to change notification settings - Fork 28
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
base: master
Are you sure you want to change the base?
Conversation
…ode status entries
6671b51
to
67ca3d1
Compare
@lassoan @leochan2009 PR changed to specific change, could you review and merge |
@lassoan any objections to this PR? |
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. |
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? |
This could be a reasonable assumption, "use it or lose it". |
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. |
@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. |
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. |
Instead of just transform node copying status metadata as node attribute, copy all metadata to node attributes