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

BUG: Ensure DicomUltrasoundPlugin sets DICOM.instanceUIDs #28

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions DicomUltrasoundPlugin/DicomUltrasoundPlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,10 +565,23 @@ def load(self,loadable):
else:
loadedNode = self.loadPhilips4DUSAsSequence(loadable)

# Save DICOM SOP instance UID into the sequence so DICOM metadata can be retrieved later if needed
if loadedNode:
loadedNode.SetAttribute('DICOM.instanceUIDs', slicer.dicomDatabase.instanceForFile(loadable.files[0]))

# Show sequence browser toolbar if a sequence has been loaded
if loadedNode and loadedNode.IsA('vtkMRMLSequenceNode'):
sequenceBrowserNode = slicer.modules.sequences.logic().GetFirstBrowserNodeForSequenceNode(loadedNode)
if sequenceBrowserNode:

# Save DICOM SOP instance UID into the master node so DICOM metadata can be retrieved later from
# the proxy nodes if needed
masterSequenceNode = sequenceBrowserNode.GetMasterSequenceNode()
masterSequenceNode.SetAttribute('DICOM.instanceUIDs', loadedNode.GetAttribute('DICOM.instanceUIDs'))

volumeNode = browserNode.GetProxyNode(loadedNode)
volumeNode.SetAttribute('DICOM.instanceUIDs', loadedNode.GetAttribute('DICOM.instanceUIDs'))
Comment on lines +577 to +583
Copy link
Contributor Author

Choose a reason for hiding this comment

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

To follow-up on the commit originally posted by @lassoan in #28 (comment):

The sequence browser node can browse many different images, so in general the DICOM instance UIDs cannot be saved into that.

Instead, the attribute need to be set on the volume node in the sequence (and those attributes are copied to the proxy node).

I am not clear which approach was implied ?

  • Getting the master node
  • Or getting the proxy node

Copy link
Contributor

Choose a reason for hiding this comment

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

You need to set the attribute of the data node that you set in the sequence.

Content of the data node in the sequence (including the attributes) are copied to the proxy node during replay.


slicer.modules.sequences.showSequenceBrowser(sequenceBrowserNode)

return loadedNode
Expand Down