When the Slicer first start the lines only on ‘Slice8’ (what I want), but start moving the slice, the other lines showed up in “Slice9” and “Slice10”
for view in ["Slice9", "Slice10"]:
sliceLogic = slicer.app.layoutManager().sliceWidget(view).sliceLogic()
sliceDisplayNode = sliceLogic.GetSliceDisplayNode()
sliceDisplayNode.SetIntersectingSlicesVisibility(flag)
sliceDisplayNode.SetIntersectingSlicesLineThicknessMode(1)
sliceCompositeNodes = slicer.util.getNodesByClass("vtkMRMLSliceCompositeNode")
defaultSliceCompositeNode = slicer.mrmlScene.GetDefaultNodeByClass("vtkMRMLSliceCompositeNode")
if not defaultSliceCompositeNode:
defaultSliceCompositeNode = slicer.mrmlScene.CreateNodeByClass("vtkMRMLSliceCompositeNode")
defaultSliceCompositeNode.UnRegister(None) # CreateNodeByClass is factory method, need to unregister the result to prevent memory leaks
slicer.mrmlScene.AddDefaultNode(defaultSliceCompositeNode)
sliceCompositeNodes.append(defaultSliceCompositeNode)
for sliceCompositeNode in sliceCompositeNodes:
sliceCompositeNode.SetLinkedControl(False)
sliceCompositeNode.SetHotLinkedControl(False)
sliceNode = slicer.util.getNode('Slice8')
sliceNode.Modified()
I posted a question last time but did not get solution, so I’m posting it again.
I created four 2D slice views looks like the video below. Among these, I only want to display the intersection view in the axial window.
To achieve this, I tried changing the visibility to 0 or modifying the LinkedControl as shown below, but I observed that the intersection line reappeared when I moved the slice.
Additionally, I performed SlabReconstruction on the leftmost panoramic view, but the line corresponding to the slab appeared, which interferes with the visualization.
Therefore, my questions are as follows:
How can I display the intersection line only in the axial view?
How can I remove the lines related to the slab?
(When I enable slab reconstruction with sliceNode.SetSlabReconstructionEnabled(True), the line is generated, and I couldn’t find a way to turn it off.)
In addition, How can I change the thickness of the intersection line?
(sliceDisplayNode.SetIntersectingSlicesLineThicknessMode(2) does not work.)
I suspect nobody has tried these exact features before so nobody has an out-of-the-box answer for you. But I think you can figure this out by digging into the code a bit - what you describe shouldn’t be that much different from other view-specific visibility controls. It would be best if you find a way to generalize the implementation in Slicer so these are easy to control, so if you can find a good architectures please contribute back, but since you are building your own custom app, you can even control these in an application-specific way that you keep in your codebase.