How can I make all 6 views Link together

Hello there,

I have 2 files in layout. I want to make all 6 views link together, So when I move the mouse while the Shift key is pressed, all the other 5 views will move at the same time.

Thanks for your help

Views that have the same View group are linked. You can set it from Python or using View Controllers module’s Advanced section.

Thank you very much~

Is there a way to link the views in Python? We need to be able to zoom all 3 views at the same time. I > imagine it would be like pushing the “Link button” in the view tool bar.

See entry Set all slice views linked by default from the script repository

@jamesobutler @pieper @lassoan
Is there a way to reset, reinitialize or recreate a 3D view after it contains a rendering. In other words, dispose or delete the rendering or view and create a new one in the same view window?

Thanks

@spycolyf - the way it works in Slicer is that the views observe the scene and display whatever meets their display criteria (i.e. if matches their view ID or doesn’t specify a view ID). So for example if a model node has multiple model display nodes, each one of which will have a list of zero or more view IDs. The view will then display the model using the display properties for the matching display node or nodes. Clearing the view would mean making sure none of the display nodes match what the view ID.

OK, my apologies. I should show you what I’m trying to do.

I currently have a MIP displayed. How do I replace it with a transparent rendering?

Here’s the MIP…
image

And when I try to replace it with a render, here’s what I get. The MIP wont go away…

image

I’m trying to switch from the MIP to this…

image

What step do you do when you try to replace the MIP?

@pieper

Sorry about all of that code :expressionless:

Here’s what get executed after to replace the MIP with the rendered…

def showVolumeRendering self, volumeNode):
    volRenLogic = slicer.modules.volumerendering.logic()
    displayNode = volRenLogic.CreateDefaultVolumeRenderingNodes(volumeNode)
    displayNode.SetVisibility(True)
    scalarRange = volumeNode.GetImageData().GetScalarRange()
    if scalarRange[1]-scalarRange[0] < 1500:
      # Small dynamic range, probably MRI
      displayNode.GetVolumePropertyNode().Copy(volRenLogic.GetPresetByName("MR-Default"))
    else:
      # Larger dynamic range, probably CT
      displayNode.GetVolumePropertyNode().Copy(volRenLogic.GetPresetByName("CT-Chest-Contrast-Enhanced"))

Probably you are ending up with multiple display nodes so changing one leaves the other in place. You should be able to replace all the display nodes with a new version with the settings you want (or change the settings of the existing ones)

Thanks @pieper. But, how? What code am I missing?

I couldn’t say for sure - debugging is half the fun, so you’ll need to do some digging.

A good way to better understand what’s going on is to use the Data module’s All nodes tab, and open the Node information box and enable showing of hidden nodes and MRML ids. Then as you interact with the scene you can see all the details of node values and what nodes reference each other by ID. All this node information is what gets saved and restored in the scene, and also what controls communication across the app. Once you get a good handle on what happens there you will have a much better understanding of how to write and debug Slicer code.

It seems that you haven’t switched back the rendering technique in the view from MIP to composite rendering. See my answer to this question here. It would be easier to keep track of discussions if we kept the topics short and focused on one question.