|
@@ -412,6 +412,7 @@ class imageBrowserLogic(ScriptedLoadableModuleLogic):
|
|
|
if not os.path.isdir(self.tempDir):
|
|
|
os.mkdir(self.tempDir)
|
|
|
self.lookups={}
|
|
|
+ self.segmentList=["Liver","Blood","Marrow","Disease","Deauville"]
|
|
|
print('imageBrowserLogic setup complete')
|
|
|
|
|
|
|
|
@@ -626,6 +627,19 @@ class imageBrowserLogic(ScriptedLoadableModuleLogic):
|
|
|
iData={'idx':'Segmentation','path':path,
|
|
|
'keepCached':0,'dataset':'SegmentationsMaster'}
|
|
|
self.loadImage(iData)
|
|
|
+ #look for missing segments
|
|
|
+ segNode=self.volumeNode['Segmentation']
|
|
|
+ seg=segNode.GetSegmentation()
|
|
|
+ segNames=[seg.GetNthSegmentID(i) for i in range(seg.GetNumberOfSegments())]
|
|
|
+ print('Segments')
|
|
|
+ for s in self.segmentList:
|
|
|
+ if s not in segNames:
|
|
|
+ seg.AddEmptySegment(s,s)
|
|
|
+ print(s)
|
|
|
+ print('Done')
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
def saveSegmentation(self):
|
|
|
#get the latest key by adding an entry to SegmentationList
|
|
@@ -700,10 +714,8 @@ class imageBrowserLogic(ScriptedLoadableModuleLogic):
|
|
|
slicer.mrmlScene.AddNode(segNode)
|
|
|
segNode.CreateDefaultDisplayNodes()
|
|
|
segNode.SetReferenceImageGeometryParameterFromVolumeNode(self.volumeNode['PET'])
|
|
|
- segNode.GetSegmentation().AddEmptySegment("Liver","Liver")
|
|
|
- segNode.GetSegmentation().AddEmptySegment("Blood","Blood")
|
|
|
- segNode.GetSegmentation().AddEmptySegment("Marrow","Marrow")
|
|
|
- segNode.GetSegmentation().AddEmptySegment("Disease","Disease")
|
|
|
+ for s in self.segmentList:
|
|
|
+ segNode.GetSegmentation().AddEmptySegment(s,s)
|
|
|
|
|
|
|
|
|
|