Hi all,
When I uncheck the Bottom Left
checkbox in the Data Probe module, only annotations for background and foreground layers are hidden, but the one for the label layer stays.
There must be something wrong in Modules/Scripted/DataProbe/DataProbeLib/SliceViewAnnotations.py
, but I haven’t been able to spot it.
I’ve tried getting the widget and doing widget.sliceView().cornerAnnotation().SetText(0, '')
with no luck.
pieper
(Steve Pieper (Isomics, Inc.))
August 9, 2018, 9:37pm
2
Hi Fernando -
It looks like if self.bottomLeft:
needs to be added before the block at line 631. Let me know if that fixes it for you and I can make the change.
if self.bottomLeft:
foregroundVolumeName = foregroundVolume.GetName()
self.cornerTexts[0]['2-Foreground']['text'] = 'F: ' + foregroundVolumeName
uids = foregroundVolume.GetAttribute('DICOM.instanceUIDs')
if uids:
uid = uids.partition(' ')[0]
# passed UID as bg
self.makeDicomAnnotation(uid,None,sliceViewName)
self.dicomVolumeNode = 1
else:
self.dicomVolumeNode = 0
if (labelVolume is not None):
labelOpacity = sliceCompositeNode.GetLabelOpacity()
labelVolumeName = labelVolume.GetName()
self.cornerTexts[0]['1-Label']['text'] = 'L: ' + labelVolumeName + ' (' + str(
"%d"%(labelOpacity*100)) + '%)'
1 Like
Hi Steve
Thanks for your answer, that worked.
You’ll need another if self.bottomLeft:
for Case I, it doesn’t work either.
# Case I: Both background and foregraound
if ( backgroundVolume is not None and foregroundVolume is not None):
foregroundOpacity = sliceCompositeNode.GetForegroundOpacity()
backgroundVolumeName = backgroundVolume.GetName()
foregroundVolumeName = foregroundVolume.GetName()
self.cornerTexts[0]['3-Background']['text'] = 'B: ' + backgroundVolumeName
self.cornerTexts[0]['2-Foreground']['text'] = 'F: ' + foregroundVolumeName + ' (' + str(
"%d"%(foregroundOpacity*100)) + '%)'
bgUids = backgroundVolume.GetAttribute('DICOM.instanceUIDs')
fgUids = foregroundVolume.GetAttribute('DICOM.instanceUIDs')
if (bgUids and fgUids):
bgUid = bgUids.partition(' ')[0]
fgUid = fgUids.partition(' ')[0]
self.dicomVolumeNode = 1
self.makeDicomAnnotation(bgUid,fgUid,sliceViewName)
elif (bgUids and self.backgroundDICOMAnnotationsPersistence):
uid = bgUids.partition(' ')[0]
self.dicomVolumeNode = 1
self.makeDicomAnnotation(uid,None,sliceViewName)
This file has been truncated. show original
pieper
(Steve Pieper (Isomics, Inc.))
August 10, 2018, 8:00pm
5
Great! I"m just rebuilding now for a quick test and will commit.