2D - 3D side by side

Hi Slicers, I am doing some segmentations in 2D and checking the result in 3D as I move from slice to slice. Wouldn’t it be nice to be able to do a side by side between the slice you are segmenting and the 3D view? the only way to do this currently is by the 4-way view which is a waste of space that you don’t use. I would like for instance maximize the space of the slice where I am segmenting and have next to it the 3D view. What do you think?

It’s possible to set up custom views with a little coding:


If that view is particularly handy it could be added to the layout menu (but that menu is already so long…)

I also would appreciate, if this three views could be added:
Red + 3D
Yellow + 3D
Green + 3D

Did you try the customizer python script or is it too cryptic?

Although it is quite easy to define your own layouts using Python scripting, I agree that it would be nice to be able to define and switch between custom layouts more easily. I think this issue covers this feature request already: https://issues.slicer.org/view.php?id=2384. Add a comment there to indicate there is interest in having this feature (when we prioritize issues, having recent comments from multiple users puts an issue ahead of the others).

Is there a way to store my custom layout or every time I start slicer I have to do it again? Maybe put into the layout view selector?

Yes, of course. Either add the layout registration code to your application startup script (menu: Edit / Application Settings / General) or your scripted module initialization (triggered with a single-shot timer so that registration happens when Slicer startup is completed).

How and where do we add this code. I cant seem to find the mrmlLayoutlogic.cxx file

Can you please tell me where to find the MRMLLayoutlogic.cxx file to make these changes

It should not be necessary to modify MRMLLayoutLogic.cxx. Nevertheless, you can find a link to the source code of this logic class and detailed description of how to register and use a custom layouts in the example referenced above.