From 615264159439aa826ed7a82a9ed5fba4defe836f Mon Sep 17 00:00:00 2001 From: Junichi Tokuda Date: Fri, 17 Nov 2023 16:09:40 -0500 Subject: [PATCH] Import the message time stamp to the MRML node. (openigtlink/SlicerOpenIGTLink#129) --- OpenIGTLinkIF/MRML/vtkMRMLIGTLConnectorNode.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/OpenIGTLinkIF/MRML/vtkMRMLIGTLConnectorNode.cxx b/OpenIGTLinkIF/MRML/vtkMRMLIGTLConnectorNode.cxx index 566770f..d3a6729 100644 --- a/OpenIGTLinkIF/MRML/vtkMRMLIGTLConnectorNode.cxx +++ b/OpenIGTLinkIF/MRML/vtkMRMLIGTLConnectorNode.cxx @@ -601,10 +601,13 @@ void vtkMRMLIGTLConnectorNode::ProcessIncomingDeviceModifiedEvent( // copy metadata from igtl message to MRML node for (igtl::MessageBase::MetaDataMap::const_iterator iter = modifiedDevice->GetMetaData().begin(); iter != modifiedDevice->GetMetaData().end(); ++iter) - { + { std::string tag = "OpenIGTLink." + iter->first; modifiedNode->SetAttribute(tag.c_str(), iter->second.second.c_str()); - } + } + + // Copy time stamp from igtl message to MRML node + modifiedNode->SetAttribute("OpenIGTLink.TimeStamp", std::to_string(modifiedDevice->GetTimestamp()).c_str()); } vtkMRMLIGTLQueryNode* queryNode = this->Internal->GetPendingQueryNodeForDevice(modifiedDevice);