# Build Slicer with SlicerRT

**URL:** <https://discourse.slicer.org/t/build-slicer-with-slicerrt/41445>\
**Category:** Development\
**Tags:** slicerrt\
**Created:** [February 2, 2025, 12:25am UTC](https://discourse.slicer.org/t/build-slicer-with-slicerrt/41445 "2025-02-02T00:25:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![SSDad](https://avatars.discourse-cdn.com/v4/letter/s/f14d63/32.png) [@SSDad](https://discourse.slicer.org/u/SSDad)\
**Post date:** [February 2, 2025, 12:25am UTC](https://discourse.slicer.org/t/build-slicer-with-slicerrt/41445/1 "2025-02-02T00:25:59Z")

</div>

I am trying to follow this website to add SlicerRT Extension to Slicer

> **[SlicerRt developers page](https://github.com/SlicerRt/SlicerRT/wiki/SlicerRt-developers-page)**
>
> Open-source toolkit for radiation therapy research, an extension of 3D Slicer. Features include DICOM-RT import/export, dose volume histogram, dose accumulation, external beam planning (TPS), struc...

I have a couple questions here.

1. What does the following sentence mean?  
" \* When configuring the project set the Slicer\_DIR to the Slicer version that you have built (e.g., c:/d/S4D/Slicer-build)"

2. Where is ‘SlicerRT.sln’? I just cannot find it from the repo?  
“\* Open SlicerRT.sln, select the Debug/Release configuration that matches the configuration that used for Slicer build, and build ALL\_BUILD”

Any help will be appreciated!

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [February 3, 2025, 10:10am UTC](https://discourse.slicer.org/t/build-slicer-with-slicerrt/41445/2 "2025-02-03T10:10:54Z")

</div>

When building SlicerRT you need to point to an existing Slicer build. The line means specifying the directory in CMake before starting the build

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/1/b/1b84417ec4629dc2c3ceb4a8f70bff2c81feebcb.png)

Or if you configure in command line:  
`cmake -G "Visual Studio 17 2022" -DSlicer_DIR:PATH=c:/d/%SLICER_SUPERBUILD_DIR_NAME%/Slicer-build %3 %SRC_DIR%`

SlicerRT.sln will appear after successful configuration+generation with CMake.

---

<div class="post-metadata">

**Author:** ![SSDad](https://avatars.discourse-cdn.com/v4/letter/s/f14d63/32.png) [@SSDad](https://discourse.slicer.org/u/SSDad)\
**Post date:** [February 4, 2025, 5:55am UTC](https://discourse.slicer.org/t/build-slicer-with-slicerrt/41445/3 "2025-02-04T05:55:49Z")

</div>

Hi @cpinter ,

Thanks a lot for your help. I was able to generate SlicerRT.sln in the folder ‘B’ by

‘PS D:\OA\SlicerRT\B\> cmake -G “Visual Studio 17 2022” -DSlicer\_DIR:PATH=D:\OA\Slicer\D\Slicer-build D:\OA\SlicerRT\S’

and then loaded the SlicerRT.sln in Visual Studio to build the binary.

However, after adding the paths as the following

- Start Slicer and in the application settings add the following additional module paths (replace Debug by Release if you are testing in Release mode):
  - \inner-build\lib\Slicer-4.11\cli-modules
  - \inner-build\lib\Slicer-4.11\qt-scripted-modules
  - \inner-build\lib\Slicer-4.11\qt-loadable-modules

and restarted Slicer, I had the following in the terminal

* * *

DLL load failed while importing vtkSlicerDicomRtImportExportModuleLogicPython: The specified module could not be found.  
DLL load failed while importing vtkSlicerDicomSroImportExportModuleLogicPython: The specified module could not be found.DLL load failed while importing vtkSlicerDicomSroImportExportModuleLogicPython: The specified module could not be found.DLL load failed while importing vtkSlicerDicomSroImportExportModuleLogicPython: The specified module could not be found.DLL load failed while importing vtkSlicerDicomSroImportExportModuleLogicPython: The specified module could not be found.DLL load failed while importing vtkSlicerDrrImageComputationModuleLogicPython: The specified module could not be found.  
DLL load failed while importing vtkSlicerDrrImageComputationModuleLogicPython: The specified module could not be found.  
DLL load failed while importing vtkSlicerDrrImageComputationModuleLogicPython: The specified module could not be found.  
DLL load failed while importing vtkSlicerDrrImageComputationModuleLogicPython: The specified module could not be found.  
Failed to load vtkSlicerExternalBeamPlanningModuleLogicPython: No module named vtkSlicerBeamsModuleLogicPython  
Failed to load vtkSlicerExternalBeamPlanningModuleLogicPython: No module named vtkSlicerBeamsModuleLogicPython  
Failed to load vtkSlicerExternalBeamPlanningModuleLogicPython: No module named vtkSlicerBeamsModuleLogicPython  
Failed to load vtkSlicerExternalBeamPlanningModuleLogicPython: No module named vtkSlicerBeamsModuleLogicPython  
DLL load failed while importing vtkSlicerRoomsEyeViewModuleLogicPython: The specified module could not be found.  
DLL load failed while importing vtkSlicerRoomsEyeViewModuleLogicPython: The specified module could not be found.  
DLL load failed while importing vtkSlicerRoomsEyeViewModuleLogicPython: The specified module could not be found.  
DLL load failed while importing vtkSlicerRoomsEyeViewModuleLogicPython: The specified module could not be found.  
DLL load failed while importing qSlicerBeamsModuleWidgetsPythonQt: The specified module could not be found.  
DLL load failed while importing qSlicerBeamsModuleWidgetsPythonQt: The specified module could not be found.  
DLL load failed while importing qSlicerBeamsModuleWidgetsPythonQt: The specified module could not be found.  
DLL load failed while importing qSlicerBeamsModuleWidgetsPythonQt: The specified module could not be found.  
DLL load failed while importing qSlicerExternalBeamPlanningModuleWidgetsPythonQt: The specified module could not be found.  
DLL load failed while importing qSlicerExternalBeamPlanningModuleWidgetsPythonQt: The specified module could not be found.  
DLL load failed while importing qSlicerExternalBeamPlanningModuleWidgetsPythonQt: The specified module could not be found.  
DLL load failed while importing qSlicerExternalBeamPlanningModuleWidgetsPythonQt: The specified module could not be found.  
DLL load failed while importing qSlicerPlmProtonDoseEngineDoseEnginesPythonQt: The specified module could not be found.  
DLL load failed while importing qSlicerPlmProtonDoseEngineDoseEnginesPythonQt: The specified module could not be found.  
DLL load failed while importing qSlicerPlmProtonDoseEngineDoseEnginesPythonQt: The specified module could not be found.  
DLL load failed while importing qSlicerPlmProtonDoseEngineDoseEnginesPythonQt: The specified module could not be found.  
When loading module “BatchStructureSetConversion” , the dependency “DicomRtImportExport” failed to be loaded.  
When loading module “DvhComparison” , the dependency “DoseVolumeHistogram” failed to be loaded.  
When loading module “IGRTWorkflow\_SelfTest” , the dependency “DicomRtImportExport” failed to be loaded.  
Switch to module: “Welcome”

* * *

The problem seems qt/python related. Any idea how to fix?

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [February 4, 2025, 9:59am UTC](https://discourse.slicer.org/t/build-slicer-with-slicerrt/41445/4 "2025-02-04T09:59:46Z")

</div>

First of all, make sure the module paths are valid (I doubt you built 4.11).

The DLL loading errors are due to not all paths being explored for loading dependencies, i.e. missing paths. One workaround you can do is to copy the DLLs from `...\SlicerRT_R\bin\Release\*.dll` to `\SlicerRT_R\inner-build\lib\Slicer-5.7\qt-loadable-modules\Release`, but this is not a proper solution. It is recommended to use the `inner-build\SlicerWithSlicerRT.exe` file for starting SlicerRT, which sets up all the paths.

If you need this for debugging, then start VS like this  
`..\S5D\Slicer-build\Slicer.exe --VisualStudio --launcher-no-splash --launcher-additional-settings ./SlicerRT_D/inner-build/AdditionalLauncherSettings.ini c:\d\_Extensions\SlicerRT_D\inner-build\SlicerRT.sln`

---

<div class="post-metadata">

**Author:** ![SSDad](https://avatars.discourse-cdn.com/v4/letter/s/f14d63/32.png) [@SSDad](https://discourse.slicer.org/u/SSDad)\
**Post date:** [February 4, 2025, 10:43pm UTC](https://discourse.slicer.org/t/build-slicer-with-slicerrt/41445/5 "2025-02-04T22:43:36Z")

</div>

Hi @cpinter ,

Thanks again!

You are right, my Slicer version is 5.7.

Now I can start SlicerRT by running ‘inner-build\SlicerWithSlicerRT.exe’.

But when I try ‘./Slicer.exe --VisualStudio --launcher-no-splash --launcher-additional-settings D:\OA\SlicerRT\B/inner-build/AdditionalLauncherSettings.ini D:\OA\SlicerRT\B\inner-build\SlicerRT.sln’ in VS and run debug (ALL\_BUILD is set as Startup Project), I got a pop up said ‘Unable to start program ‘.\SlicerRT\inner-build\x64\Debug\All\_BUILD’, access is denied’ (sorry I do know how to post images here). Any idea?

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [February 5, 2025, 11:45am UTC](https://discourse.slicer.org/t/build-slicer-with-slicerrt/41445/6 "2025-02-05T11:45:36Z")

</div>

You need to specify the executable for your startup project (which you need to change to basically any other project). Please see in the [developer documentation](https://slicer.readthedocs.io/en/latest/developer_guide/debugging/windowscpp.html#debugging-using-visual-studio).
