slicer365
(HuoLeifeng)
September 4, 2023, 7:40am
1
I saved a property file(0.vp), I want to use this property file torender the volume through the script, how to achieve, the following is the code I can complete.
volumeNode=getNode("CTChest")
volRenLogic = slicer.modules.volumerendering.logic()
volRenLogic.AddVolumePropertyFromFile(r"C:\Users\Administrator\Desktop\0.vp")
propertyNode=getNode("0")
displayNode = volRenLogic.CreateDefaultVolumeRenderingNodes(volumeNode)
displayNode.SetVisibility(True)
slicer365
(HuoLeifeng)
September 5, 2023, 4:48pm
2
volRenLogic = slicer.modules.volumerendering.logic()
volRenLogic.AddVolumePropertyFromFile(self.resourcePath('chestPre.vp'))
volRenLogic.AddPreset(slicer.util.getNode("chestPre"))
volumeNode=self.ui.imgSelector.currentNode()
displayNode = volRenLogic.CreateDefaultVolumeRenderingNodes(volumeNode)
displayNode.GetVolumePropertyNode().Copy(slicer.util.getNode("chestPre"))
displayNode.SetVisibility(True)
the codes need to add the vp file as a preset, this is not what I want.