<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.slicer.org/w/index.php?action=history&amp;feed=atom&amp;title=Documentation%2F4.6%2FDevelopers%2FModules</id>
	<title>Documentation/4.6/Developers/Modules - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.slicer.org/w/index.php?action=history&amp;feed=atom&amp;title=Documentation%2F4.6%2FDevelopers%2FModules"/>
	<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/4.6/Developers/Modules&amp;action=history"/>
	<updated>2026-05-11T12:06:04Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.33.0</generator>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/4.6/Developers/Modules&amp;diff=61989&amp;oldid=prev</id>
		<title>Unknown user: Text replacement - &quot;slicerWiki/index.php&quot; to &quot;wiki&quot;</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/4.6/Developers/Modules&amp;diff=61989&amp;oldid=prev"/>
		<updated>2019-11-21T17:33:48Z</updated>

		<summary type="html">&lt;p&gt;Text replacement - &amp;quot;slicerWiki/index.php&amp;quot; to &amp;quot;wiki&amp;quot;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 17:33, 21 November 2019&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l43&quot; &gt;Line 43:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 43:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;An extensive tutorial and reference page was created [http://www.na-mic.org/Wiki/index.php/2013_Project_Week_Breakout_Session:Slicer4Python for the Slicer/Python breakout session at the NA-MIC 2014 Summer Project Week].  Please read through this and many of your questions will be answered.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;An extensive tutorial and reference page was created [http://www.na-mic.org/Wiki/index.php/2013_Project_Week_Breakout_Session:Slicer4Python for the Slicer/Python breakout session at the NA-MIC 2014 Summer Project Week].  Please read through this and many of your questions will be answered.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Several tutorials for developers are available from the Slicer Training page: http://wiki.slicer.org/&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;slicerWiki/index.php&lt;/del&gt;/Documentation/Nightly/Training#Tutorials_for_software_developers&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Several tutorials for developers are available from the Slicer Training page: http://wiki.slicer.org/&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;wiki&lt;/ins&gt;/Documentation/Nightly/Training#Tutorials_for_software_developers&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    &lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Python Console&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Python Console&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Unknown user</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/4.6/Developers/Modules&amp;diff=47729&amp;oldid=prev</id>
		<title>UpdateBot: Nightly -&gt; 4.6</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/4.6/Developers/Modules&amp;diff=47729&amp;oldid=prev"/>
		<updated>2016-11-07T07:17:16Z</updated>

		<summary type="html">&lt;p&gt;Nightly -&amp;gt; 4.6&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&amp;lt;/noinclude&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{TOC left}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;Slicer supports three types of modules: [[Documentation/{{documentation/version}}/Developers/Modules#Command_Line_Interface_.28CLI.29|Command Line Interface (CLI)]], [[Documentation/{{documentation/version}}/Developers/Modules#Loadable_Modules|Loadable Modules]] and [[Documentation/{{documentation/version}}/Developers/Modules#Scripted_Modules|Scripted Modules]].&lt;br /&gt;
&lt;br /&gt;
While the developer has to choose between one of the three types to implement its module, the end user will &amp;lt;b&amp;gt;NOT&amp;lt;/b&amp;gt; notice the difference as they all share the same look &amp;amp; feel. &lt;br /&gt;
&lt;br /&gt;
The choice for a given type of module is usually based on the type of inputs/parameters for a given module.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;{{Clear|left}}&lt;br /&gt;
&lt;br /&gt;
= Command Line Interface (CLI) =&lt;br /&gt;
CLIs are standalone executables with a limited input/output arguments complexity (simple argument types, no user interactions...). They are typically implemented using [http://www.itk.org ITK].&lt;br /&gt;
* Shared lib or executable&lt;br /&gt;
* UI automatically generated&lt;br /&gt;
* Where to start ?&lt;br /&gt;
# Create initial skeleton using the [[Documentation/{{documentation/version}}/Developers/ExtensionWizard|Extension Wizard]]&lt;br /&gt;
# Read [[Documentation/{{documentation/version}}/Developers/Build_Module|Compiling slicer modules outside of the slicer source tree.]]&lt;br /&gt;
# Learn from [http://viewvc.slicer.org/viewvc.cgi/Slicer4/trunk/Modules/CLI/ existing modules]&lt;br /&gt;
* Links:&lt;br /&gt;
**[[Documentation/{{documentation/version}}/Training#Developing_and_contributing_extensions_for_3D_Slicer|Developing and contributing extensions for 3D Slicer]]&lt;br /&gt;
** [[Documentation/{{documentation/version}}/Developers/SlicerExecutionModel|Slicer execution model]]&lt;br /&gt;
** [http://www.na-mic.org/Wiki/index.php/File:Slicer4_CLI.ppt CLI in Slicer4] (presentation of 2012 NAMIC AHM)&lt;br /&gt;
&lt;br /&gt;
= Loadable Modules =&lt;br /&gt;
Loadable modules are [http://en.wikipedia.org/wiki/C%2B%2B C++] plugins that are built against Slicer. They define custom GUIs for their specific behavior as they have full control over the application.&lt;br /&gt;
* C++ shared library&lt;br /&gt;
* Full control over the UI (based on [http://qt.nokia.com/products/ Qt]) and Slicer internals (MRML, logics, display managers...)&lt;br /&gt;
* Optimized for heavy computations&lt;br /&gt;
* Where to start ?&lt;br /&gt;
# Create initial skeleton using the [[Documentation/{{documentation/version}}/Developers/ExtensionWizard|Extension Wizard]]&lt;br /&gt;
# Read [[Documentation/{{documentation/version}}/Developers/Build_Module|Compiling slicer modules outside of the slicer source tree.]]&lt;br /&gt;
# Learn from [http://viewvc.slicer.org/viewvc.cgi/Slicer4/trunk/Modules/Loadable/ existing modules]&lt;br /&gt;
* Links:&lt;br /&gt;
**[[Documentation/{{documentation/version}}/Training#Developing_and_contributing_extensions_for_3D_Slicer|Developing and contributing extensions for 3D Slicer]]&lt;br /&gt;
**[http://www.na-mic.org/Wiki/index.php/File:LoadableModules.pptx Loadable modules] (presentation of 2012 NAMIC AHM)&lt;br /&gt;
**[[Documentation/{{documentation/version}}/Developers/Tutorials/CreateLoadableModule|How to write a loadable module]]&lt;br /&gt;
&lt;br /&gt;
= Scripted Modules =&lt;br /&gt;
Scripted modules are written in [http://www.python.org/ Python]. &lt;br /&gt;
&lt;br /&gt;
An extensive tutorial and reference page was created [http://www.na-mic.org/Wiki/index.php/2013_Project_Week_Breakout_Session:Slicer4Python for the Slicer/Python breakout session at the NA-MIC 2014 Summer Project Week].  Please read through this and many of your questions will be answered.&lt;br /&gt;
&lt;br /&gt;
Several tutorials for developers are available from the Slicer Training page: http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Training#Tutorials_for_software_developers&lt;br /&gt;
  &lt;br /&gt;
* Python Console&lt;br /&gt;
* Full access to the API: [http://www.vtk.org VTK], [http://qt.nokia.com/products/ Qt], [http://slicer.org/doc/html/annotated.html MRML and Slicer],[http://www.itk.org/SimpleITKDoxygen/html/classes.html SimpleITK] are fully wrapped&lt;br /&gt;
* Recommended for fast prototyping and custom workflow development&lt;br /&gt;
* Where to start?&lt;br /&gt;
# Read the [http://www.na-mic.org/Wiki/index.php/2013_Project_Week_Breakout_Session:Slicer4Python  Slicer/Python breakout session at the NA-MIC 2014 Summer Project Week] tutorial.&lt;br /&gt;
# Create initial skeleton using the [[Documentation/{{documentation/version}}/Developers/ExtensionWizard|Extension Wizard]]&lt;br /&gt;
# [http://1drv.ms/12dQ5vV Python scripted module design - beyond basics (role of widget, logic, MRML classes, using MRML node for storing module parameters, etc.)]&lt;br /&gt;
# Learn from [http://viewvc.slicer.org/viewvc.cgi/Slicer4/trunk/Modules/Scripted/ existing modules]&lt;br /&gt;
* More information:&lt;br /&gt;
**[[Documentation/{{documentation/version}}/Training#Developing_and_contributing_extensions_for_3D_Slicer|Developing and contributing extensions for 3D Slicer]]&lt;br /&gt;
** [[Documentation/{{documentation/version}}/Developers/Python_scripting|Python Scripting]]&lt;br /&gt;
** [[Documentation/{{documentation/version}}/Training#Slicer4_Programming_Tutorial|Python Scripting Tutorial]]&lt;br /&gt;
** [[Documentation/{{documentation/version}}/ScriptRepository|Community contributed examples]]&lt;br /&gt;
** [[Documentation/{{documentation/version}}/Developers/Slicelets|Developing slicelets: standalone applications with simplified, fully customized user interface]]&lt;br /&gt;
&lt;br /&gt;
=Module Factory=&lt;br /&gt;
Loading modules into slicer happens in multiple steps:&lt;br /&gt;
*module factories must be registered into the factory manager&lt;br /&gt;
* directories where the modules to load are located must be passed to the factory manager&lt;br /&gt;
* Optionally specify module names to ignore&lt;br /&gt;
* scan the directories and test which file is a module and register it (not instantiated yet) &lt;br /&gt;
* Instantiate all the register modules&lt;br /&gt;
* Connect each module with the scene and the application&lt;br /&gt;
More details can be found in the [http://slicer.org/doc/html/classqSlicerAbstractModuleFactoryManager.html online doc]&lt;br /&gt;
&lt;br /&gt;
=Association of MRML nodes to modules=&lt;br /&gt;
&lt;br /&gt;
Modules can be associated with MRML nodes, which for example allows determining what module can be used to edit a certain MRML node. A module can either specify the list of node types that it supports by overriding [https://www.slicer.org/doc/html/classqSlicerAbstractCoreModule.html#a932cfab8cb00c2e770b95a97fce92670 qSlicerAbstractCoreModule::associatedNodeTypes()] method or a module can call [https://www.slicer.org/doc/html/classqSlicerCoreApplication.html#a748d8b0ab3914bded820337534a1aa76 qSlicerCoreApplication::addModuleAssociatedNodeTypes()] to associate any node type with any module.&lt;br /&gt;
&lt;br /&gt;
Multiple modules can be associated with the same MRML node type. The best module for editing a specific node instance is determined run-time. The application framework calls [https://www.slicer.org/doc/html/classqSlicerAbstractModuleWidget.html#a8e1bdbc248688677af5cd91f0849d44e qSlicerAbstractModuleWidget::nodeEditable()] for each associated module candidate and will activate the one that has the highest confidence in handling the node.&lt;br /&gt;
&lt;br /&gt;
To select a MRML node as the &amp;quot;active&amp;quot; or &amp;quot;edited&amp;quot; node in a module the module widget's [https://www.slicer.org/doc/html/classqSlicerAbstractModuleRepresentation.html#adfd05c2484d8cab8e3e9cda09e45d227 qSlicerAbstractModuleWidget::setEditedNode()] method is called.&lt;br /&gt;
&lt;br /&gt;
=ToDo - Planned developments=&lt;br /&gt;
* Transform all core modules into Loadable modules.&lt;br /&gt;
** the factory manager only support file based modules, core modules are not file based (linked into the core factory itself)&lt;br /&gt;
* Move factory registration in qSlicerApplication (or a general application library) to support module discovery/loading without needing to instantiate Slicer.&lt;br /&gt;
** Currently can't be moved into qSlicerApplication as the CLI factories that are in QTCLI depend on QTGUI&lt;br /&gt;
** QtTesting is also limited with the QTCLI dependency on QtGUI (-&amp;gt;qSlicerApplication would need to access QtTesting code from QtCli)&lt;br /&gt;
** Proposed architecture&lt;br /&gt;
 Base&lt;br /&gt;
   Application -&amp;gt; classes that are useful to build an application (mix of qSlicerCoreApplication, qSlicerApplication, Main.cxx...)&lt;br /&gt;
   Core -&amp;gt; formally QtCore&lt;br /&gt;
   Modules -&amp;gt; contains the factories and module specific code&lt;br /&gt;
      Loadable&lt;br /&gt;
      CLI&lt;br /&gt;
      Scripted&lt;br /&gt;
   Scripted -&amp;gt; all that is python specific&lt;br /&gt;
      Cxx&lt;br /&gt;
      Python&lt;br /&gt;
   Widgets -&amp;gt; formally QtGUI&lt;br /&gt;
* Add category hierarchy in the Settings module panel&lt;br /&gt;
* Register factory settings/command-options(e.g. disable-loadable-modules) when registering module factories&lt;br /&gt;
** To have the settings panel be generic but have the code proper of each registered factory somewhere else&lt;br /&gt;
* Add mechanism for modules to register dialogs (toolbars that open dialogs),  e.g. the sceneview module needs to register the sceneView dialog into an icon.&lt;br /&gt;
* &amp;lt;s&amp;gt;Ignore modules from the launcher command line.&amp;lt;/s&amp;gt; {{done}}&lt;br /&gt;
* cloning&amp;quot; of module panels at run time. See [http://massmail.spl.harvard.edu/public-archives/slicer-devel/2012/008965.html &amp;quot;here] and [http://massmail.spl.harvard.edu/public-archives/slicer-devel/2012/008039.html here]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>UpdateBot</name></author>
		
	</entry>
</feed>