# How Can I debug the Module and create the personally Module?

**URL:** <https://discourse.slicer.org/t/how-can-i-debug-the-module-and-create-the-personally-module/20011>\
**Category:** Development\
**Tags:** debug\
**Created:** [October 5, 2021, 6:53am UTC](https://discourse.slicer.org/t/how-can-i-debug-the-module-and-create-the-personally-module/20011 "2021-10-05T06:53:06Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![kookoo9999](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/kookoo9999/32/12394_2.png) [@kookoo9999](https://discourse.slicer.org/u/kookoo9999)\
**Post date:** [October 5, 2021, 6:53am UTC](https://discourse.slicer.org/t/how-can-i-debug-the-module-and-create-the-personally-module/20011/1 "2021-10-05T06:53:06Z")

</div>

Hello everyone.

I succeeded in building Slicer master branch without SimpleITK because I can’t to solve the fix error(MSB 8066 in SimpleITK.sln) during build Slicer.  
and I want to debug each module and I create the module that Augmented Reality module with Camera(3D,Stereo,Web,Usb,etc…).  
I build the Slicer.exe but I couldn’t debug the module…  
I want to debug each module(ex Volume,Markup,VolumeRendering,Segmentation,etc…) in Slicer because I don’t know how each module works.

Is it right to make a module using Qt Designer?? I am studying Qt.(I usually coded using only c++.)  
and I’m curious about the difference between SlicerIGT and OpenIGT and their installation and usage.

Thanks for reading.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [October 5, 2021, 4:17pm UTC](https://discourse.slicer.org/t/how-can-i-debug-the-module-and-create-the-personally-module/20011/2 "2021-10-05T16:17:27Z")

</div>

See debugging instructions here:

[https://slicer.readthedocs.io/en/latest/developer\_guide/debugging/index.html](https://slicer.readthedocs.io/en/latest/developer_guide/debugging/index.html)

---

<div class="post-metadata">

**Author:** ![kookoo9999](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/kookoo9999/32/12394_2.png) [@kookoo9999](https://discourse.slicer.org/u/kookoo9999)\
**Post date:** [October 6, 2021, 1:18am UTC](https://discourse.slicer.org/t/how-can-i-debug-the-module-and-create-the-personally-module/20011/3 "2021-10-06T01:18:00Z")

</div>

> [@lassoan](#):
>
> e debugging instructions here:

Thanks 🙂  
I know that among the Add Module to Extension options, scripted is python is the base. Referring to [this](https://www.slicer.org/wiki/Documentation/Nightly/Developers/ExtensionWizard#Creating_Extensions), I made it into a scripted type and modified the UI, but I couldn’t modify it because the console window was quickly opened and closed. (python3.7 is installed.) And then, I selected Add Module to Extension, and created the type to write c++. It’s made like a picture, but I don’t add and automatically load modules like type scripted, so what should I do? As you can see in the picture below, I tried to add a createable path through Extension in Edit-Application Setting, but it doesn’t come out. It doesn’t come up even if you do the Selection Extension of the Extension Wizard.Do I have to build a module separately through CMake?  
I want code correction and ui correction.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/2/e/2eb9a8a105b74d61c655731932650c41c8a1f244.png)  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/b/4/b4bc59579b1331f2caaf8b973424c179fc0a5c6c.png)

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [October 6, 2021, 1:21am UTC](https://discourse.slicer.org/t/how-can-i-debug-the-module-and-create-the-personally-module/20011/4 "2021-10-06T01:21:30Z")

</div>

If you develop a module in C++ then you need to [build your extension](https://slicer.readthedocs.io/en/latest/developer_guide/extensions.html#build-an-extension). You can test your module by following [these instructions](https://slicer.readthedocs.io/en/latest/developer_guide/extensions.html#test-an-extension).

---

<div class="post-metadata">

**Author:** ![kookoo9999](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/kookoo9999/32/12394_2.png) [@kookoo9999](https://discourse.slicer.org/u/kookoo9999)\
**Post date:** [October 6, 2021, 1:25am UTC](https://discourse.slicer.org/t/how-can-i-debug-the-module-and-create-the-personally-module/20011/5 "2021-10-06T01:25:05Z")

</div>

@lassoan  
Thanks!! I will try now 🙂

---

<div class="post-metadata">

**Author:** ![kookoo9999](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/kookoo9999/32/12394_2.png) [@kookoo9999](https://discourse.slicer.org/u/kookoo9999)\
**Post date:** [October 6, 2021, 2:41am UTC](https://discourse.slicer.org/t/how-can-i-debug-the-module-and-create-the-personally-module/20011/6 "2021-10-06T02:41:06Z")

</div>

@lassoan  
Hello,I built a building referring to here.and I added path.  
Edit-Application Settings-modules also added the path of qt-loadable-module-deubg of the path created by building a sln made of cmake. However, the module cannot be found on the Slicer.  
Did I do something wrong?

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/f/6/f6013a2b5f2bec32a0100cf21416d7b914eabbba.png)  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/3/c/3c5a8a4898c7c89c931619ffff11ba5e8eff4530.png)  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/e/9/e9c690ec8beed351e1d32e9cab8f576ffddf6d06.png)

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [October 6, 2021, 2:56am UTC](https://discourse.slicer.org/t/how-can-i-debug-the-module-and-create-the-personally-module/20011/7 "2021-10-06T02:56:43Z")

</div>

Is your module DLL present in the Debug folder that you added?

---

<div class="post-metadata">

**Author:** ![kookoo9999](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/kookoo9999/32/12394_2.png) [@kookoo9999](https://discourse.slicer.org/u/kookoo9999)\
**Post date:** [October 6, 2021, 3:37am UTC](https://discourse.slicer.org/t/how-can-i-debug-the-module-and-create-the-personally-module/20011/8 "2021-10-06T03:37:27Z")

</div>

@lassoan  
yes, These are the files in the directory.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/4/d/4d61385c96cb1ac28582b6fe758768937cb54814.png)

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [October 6, 2021, 3:56am UTC](https://discourse.slicer.org/t/how-can-i-debug-the-module-and-create-the-personally-module/20011/9 "2021-10-06T03:56:04Z")

</div>

It looks good, your module is loaded then. If not, then you can find an error message in the application log.

---

<div class="post-metadata">

**Author:** ![kookoo9999](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/kookoo9999/32/12394_2.png) [@kookoo9999](https://discourse.slicer.org/u/kookoo9999)\
**Post date:** [October 6, 2021, 4:03am UTC](https://discourse.slicer.org/t/how-can-i-debug-the-module-and-create-the-personally-module/20011/10 "2021-10-06T04:03:41Z")

</div>

@lassoan  
Test4 is scripted type. I created lodable type via extension wizard and added the path the picture above but I can’t find Test3 module, How can I check the application log??

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [October 6, 2021, 12:33pm UTC](https://discourse.slicer.org/t/how-can-i-debug-the-module-and-create-the-personally-module/20011/11 "2021-10-06T12:33:47Z")

</div>

> [@kookoo9999](#):
>
> How can I check the application log?

See here: [Get Help — 3D Slicer documentation](https://slicer.readthedocs.io/en/latest/user_guide/get_help.html?#i-need-help-in-using-slicer)

---

<div class="post-metadata">

**Author:** ![kookoo9999](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/kookoo9999/32/12394_2.png) [@kookoo9999](https://discourse.slicer.org/u/kookoo9999)\
**Post date:** [October 6, 2021, 3:58pm UTC](https://discourse.slicer.org/t/how-can-i-debug-the-module-and-create-the-personally-module/20011/12 "2021-10-06T15:58:10Z")

</div>

> [@lassoan](#):
>
> See here: [Get Help — 3D Slicer documentation](https://slicer.readthedocs.io/en/latest/user_guide/get_help.html?#i-need-help-in-using-slicer)

Thanks 🙂  
When I try to debug only the module, if I enter this command on the path, it comes out like this, but how do I solve it?  
And what is SlicerRT??  
Here is It mentions SlicerRT [here](https://slicer.readthedocs.io/en/latest/developer_guide/debugging/windowscpp.html#debugging-using-cross-platform-ides)…  
c:\D\S4D\Slicer-build\>Slicer.exe --VisualStudio --launcher-no-splah --launcher-additional-settings C:\Slicer\_Module\bin\inner-build\AdditionalLauncherSettings.ini C:\Slicer\_Module\bin\inner-build\Test3.sln

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/e/4/e4e54d05eb0a5a55909258a88d01b93363ec45d5.png)

---

<div class="post-metadata">

**Author:** ![kookoo9999](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/kookoo9999/32/12394_2.png) [@kookoo9999](https://discourse.slicer.org/u/kookoo9999)\
**Post date:** [October 7, 2021, 6:31am UTC](https://discourse.slicer.org/t/how-can-i-debug-the-module-and-create-the-personally-module/20011/13 "2021-10-07T06:31:10Z")

</div>

Thanks @lassoan .  
I succeeded to add extension that I made for test. 🙂

---

<div class="post-metadata">

**Author:** ![kookoo9999](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/kookoo9999/32/12394_2.png) [@kookoo9999](https://discourse.slicer.org/u/kookoo9999)\
**Post date:** [October 23, 2021, 5:36am UTC](https://discourse.slicer.org/t/how-can-i-debug-the-module-and-create-the-personally-module/20011/14 "2021-10-23T05:36:46Z")

</div>

@lassoan  
Hello lassoan ,  
I am making my module with Extension Wizard (type:default, loadable).  
If I make a module for Debug and add a module from a Slicer built with Debug, the module will be recognized normally, but it will not be built upon release from the solution of the same module.  
Conversely, when adding a module built with Debug, it adds and operates normally.  
Other test cases, modules built from Slicer to Release to Debug cannot be added.  
In addition, you can add the module created through the extension wizard in the Release Slicer after building it as release, but it is not recognized if you build the module with debug and add it.  
In order to develop a module that can be added to a typical user’s Slicer, what kind of environment and how do I set the type of module?

---

<div class="post-metadata">

**Author:** ![kookoo9999](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/kookoo9999/32/12394_2.png) [@kookoo9999](https://discourse.slicer.org/u/kookoo9999)\
**Post date:** [October 23, 2021, 5:43am UTC](https://discourse.slicer.org/t/how-can-i-debug-the-module-and-create-the-personally-module/20011/15 "2021-10-23T05:43:17Z")

</div>

I checked that module(build-release) is added to stable Slicer4.13, but not added to Slicer Debug Solution(S4D\slicer-build\Slicer.exe).

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [November 16, 2021, 6:54am UTC](https://discourse.slicer.org/t/how-can-i-debug-the-module-and-create-the-personally-module/20011/16 "2021-11-16T06:54:26Z")

</div>

You need to have a completely different build tree for release and debug mode builds.

During development, I mostly use debug builds, which run slower but allow me to step through the code using a debugger. Release are useful for testing the application at full speed and to deployable to end users.

---

<div class="post-metadata">

**Author:** ![kookoo9999](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/kookoo9999/32/12394_2.png) [@kookoo9999](https://discourse.slicer.org/u/kookoo9999)\
**Post date:** [November 16, 2021, 1:57pm UTC](https://discourse.slicer.org/t/how-can-i-debug-the-module-and-create-the-personally-module/20011/17 "2021-11-16T13:57:14Z")

</div>

> [@lassoan](#):
>
> During development, I mostly use debug builds, which run slower but allow me to step through the code using a debugger. Release are useful for testing the application at full speed and to deployable to end users.

I understood that developing it as Debug when developing and Reesae when distributing it.  
When I use debug, Can I debug basic module is VS studio??

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [November 16, 2021, 1:58pm UTC](https://discourse.slicer.org/t/how-can-i-debug-the-module-and-create-the-personally-module/20011/18 "2021-11-16T13:58:43Z")

</div>

Yes, you debug all the Slicer core modules and your custom modules the same way. Detailed instructions are available here: [C++ debugging on Windows — 3D Slicer documentation](https://slicer.readthedocs.io/en/latest/developer_guide/debugging/windowscpp.html)

---

<div class="post-metadata">

**Author:** ![kookoo9999](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/kookoo9999/32/12394_2.png) [@kookoo9999](https://discourse.slicer.org/u/kookoo9999)\
**Post date:** [November 16, 2021, 2:11pm UTC](https://discourse.slicer.org/t/how-can-i-debug-the-module-and-create-the-personally-module/20011/19 "2021-11-16T14:11:11Z")

</div>

Slicer Debug Directory : S4D\slicer-build

If I want to debug the Segmentation or Segmentation Editor following this comment…

> .\S4D\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

I can find my moudle.sln in my module directory but I can’t find any other loadable-module .sln and Segmentation.sln and in loadable-module dirctory…

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [November 16, 2021, 2:13pm UTC](https://discourse.slicer.org/t/how-can-i-debug-the-module-and-create-the-personally-module/20011/20 "2021-11-16T14:13:59Z")

</div>

> [@kookoo9999](#):
>
> I can find my moudle.sln in my module directory but I can’t find any other loadable-module .sln and Segmentation.sln and in loadable-module dirctory…

That’s fine, it does not matter which files you see in the project tree in Visual Studio. You can load any of the .cxx files add breakpoints in them, and execution will stop at the breakpoints.

[Next page](https://discourse.slicer.org/t/how-can-i-debug-the-module-and-create-the-personally-module/20011.md?page=2)
