Create a MRML Viewer

Operating system: Windows 10
Slicer version: 4.13.0

Hi All,

I am new to Slicer and have been playing with it for a month or so. My requirement is to create a MRML viewer for users (doctors) with associated threshold controls. I intend to create registration prior to the users using it. I have gone through SlicerCAT template, Slicer IGT and Slicelets. I am still not clear about how best to approach this problem. Can anyone guide and point to a good step by step article / tutorial / resource on net?

The easiest to get started is to implement a slicelet: a custom module that has all the user interface that your users need (so that they don’t need to switch between modules) and hides all other user interface elements (so that they are not confused by the lots of options that they don’t need. See QuickSegment example and let us know if you have any specific question.

If you are ready to develop a custom application (so that you have full control over branding, have a custom installer, etc.) then you can use SlicerCAT or use or contribute to an existing trimmed-down custom version of Slicer, such as SlicerQReads, which is a Slicer-based simple DICOM viewer developed for clinicians at Mayo Clinic (developed by @spycolyf and @jcfr).

Hi Andras,

Thanks a lot for your response. Based on your inputs, SlicerCAT is the way to go for me.

However, I am finding it very time consuming with this trial and error approach. I make changes to the CMAKE files, then configure, build, verify, repeat. Am I doing something wrong?

You only need to build the top-level project once. Then, you only need to build Slicer.sln in the Slicer-build subdirectory. Build at that level takes less than 30 seconds.

Thanks a lot for your guidance. I tried Build/Slicer.sln. But I was getting “access is denied” error. After fiddling around a bit, I realized that the startup project was pointing to ALL_BUILD. So I changed it to SlicerQReadsApp (Is this right?).

The build is working fine and I am getting the exe and it executes also. But when I try to debug, I get “DLL not found” errors with the following DLLs.
CTKWidgets.dll
qt5widgets.dll
qt5guid.dll
qt5cored.dll

Based on your answer here (Nightly build does not run - #2 by lassoan) I tried building the whole application again. I still get the same problem. I fail to understand how the build was successful if the dlls were not found. Seeking your help once again.

Thanks a lot for your time. Really appreciate.

It is all good. You just need to start Visual Studio using the Slicer launcher as described in the build instructions.

Hi Andras,

Yes, that worked. I now need to read up on why they are different.

I am using the SlicerCAT template and trying to make the landing module to be “Volumes”. So I modifed the following lines.

set(Slicer_DEFAULT_HOME_MODULE "Volumes")
set(Slicer_DEFAULT_FAVORITE_MODULES "Home, Data, Models, Transforms, Markups, SegmentEditor")

I even got the following lines during the compilation.

1>-- Configuring Sudhirs default home module [Volumes]
1>-- Configuring Sudhirs default favorite modules [Homes, Data, Models, Transforms, Markups, SegmentEditor]

However when the application opens of the default module is still “Home”. I tried deleting the .ini file based on this Custom application does not open module at startup - #15 by lassoan. But that has not changed anything. Can you please guide on what I should look for now.

Thanks a lot for your suggestions and guidance. Really appreciate it.

Slicer_DEFAULT_HOME_MODULE is used for generating the default application settings ((applicationname).ini) file. It has no effect if the file already exists. You need to delete the existing application settings file.

Hi Andras,

I did delete the ini file. Unfortunately I had deleted slicer’s ini file. Your answer pointed me to the right ini file. Now the application starts with Volumes module (Which is exactly what I wanted).

However the open data and open DCIM button has disappeared. Is the application bar dependent on the module selected? I was of the opinion that only the left pane is dependent on the loaded module. Kindly correct me if I am wrong.

Only a toolbar’s overall visibility and position is stored in application settings, not the list or visibility of individual buttons. If some of the “Load/Save” toolbar buttons are not visible then your application customizations explicitly made them hidden. Since Qt allows introspection of all objects, it is impossible to list all the possible places where these toolbar actions got hidden, but it should be somewhere in your code.

Hi Andras,
I wanted to have a slicelet with only segment editor module and save and load and windows all windows for viewing the medical images.

From within the segment editor module I only wanted few of the already available functionality like paint, eraser, grow from seed.

What is the best way to start to make a slicelet with only essential functionality and hiding all the details?

Regards,
Saima Safdar

Hi andras,
Regarding the quicksegment. the axial coronal and sagital window is showing just one slice. How can it be extended to show all the slices like in the slicer.

Regards,
Saima Safdar

The view layout defines what views are displayed. See how to customize and select a layout in the script repository.