DICOM Browser Layout

The latest nightly builds on all platforms include an updated DICOM browser that is embedded within a layout, rather than as a popup window.

To show the dicom browser within a module:
slicer.app.layoutManager().setLayout(slicer.vtkMRMLLayoutNode.SlicerLayoutDicomBrowserView)

If anybody has any feedback or encounters any issues with the new DICOM browser layout, it would be great if you could post them here.

Thanks,
Kyle

3 Likes

@Sunderlandkyl
How to auto-hide browser window, when use slicer.app.layoutManager().setLayout(slicer.vtkMRMLLayoutNode.SlicerLayoutDicomBrowserView) in python.
like this:
image

image

@lassoan@Juicy@jamesobutler @jcfr @pieperThanks @chir.set@Sunderlandkyl

It should automatically switch back to the previous layout when something is loaded.
Have you encountered any issues with this?

@Sunderlandkyl
Yes, the previous layout has automatically switch, but the side bar still couldn’t switch back…

I have to reopen my moudle to switch. I need not the side bar. I found the Auto-hide browser window checkbox in ‘DICOM database settings’ layout. How to “Auto-hide browser window” with python.

image

You can use this function to change the browser persistence setting from Python:
slicer.modules.dicom.widgetRepresentation().self().browserWidget.setBrowserPersistence(True)

slicer.app.layoutManager().setLayout(slicer.vtkMRMLLayoutNode.SlicerLayoutDicomBrowserView)
slicer.modules.dicom.widgetRepresentation().self().browserWidget.setBrowserPersistence(False)

I use above code, but open the Slicer, the first time “load DICOM”, the sidebar appears, and then “load DICOM”, the sidebar will not appear…Why?

ScreenFlow

Open the Slicer, the first time “load DICOM”, the sidebar appears, and then “load DICOM”, the sidebar will not appear…

打开Slicer,第一次“load DICOM”, 侧边栏出现, 此后再“load DICOM”,侧边栏就不会出现了…

Using a freshly started Slicer, running the following code in the python interactor does not cause the DICOM module to appear in the sidebar (tested on Windows & Linux):

slicer.modules.dicom.widgetRepresentation().self()
slicer.app.layoutManager().setLayout(slicer.vtkMRMLLayoutNode.SlicerLayoutDicomBrowserView)
slicer.modules.dicom.widgetRepresentation().self().browserWidget.setBrowserPersistence(False)

Can you provide an example that can be run in the Python interactor that will cause the issue?

Otherwise, you may be able to debug the issue by placing a breakpoint in slicer.util.selectModule() and check the call stack to see where the module is changed.

1 Like

@Sunderlandkyl
Thinks, my code use slicer.util.selectModule("DICOM"), I delete it.

  def showDICOMBrowser(self):
    if slicer.modules.DICOMInstance.browserWidget is None:
      # slicer.util.selectModule('DICOM')
      slicer.util.selectModule('PedicleTrianglePlaner')
    # Make the DICOM browser disappear after loading data
    slicer.modules.dicom.widgetRepresentation().self()
    slicer.app.layoutManager().setLayout(slicer.vtkMRMLLayoutNode.SlicerLayoutDicomBrowserView)
    slicer.modules.dicom.widgetRepresentation().self().browserWidget.setBrowserPersistence(False)

@Sunderlandkyl Problem solved, thank you, teacher!
问题解决,谢谢老师

1 Like