<?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.2%2FDevelopers%2FLogics</id>
	<title>Documentation/4.2/Developers/Logics - 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.2%2FDevelopers%2FLogics"/>
	<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/4.2/Developers/Logics&amp;action=history"/>
	<updated>2026-04-21T15:14:49Z</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.2/Developers/Logics&amp;diff=32744&amp;oldid=prev</id>
		<title>UpdateBot: Prepend documentation/versioncheck template. See http://na-mic.org/Mantis/view.php?id=2887</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/4.2/Developers/Logics&amp;diff=32744&amp;oldid=prev"/>
		<updated>2013-06-14T07:43:19Z</updated>

		<summary type="html">&lt;p&gt;Prepend documentation/versioncheck template. See http://na-mic.org/Mantis/view.php?id=2887&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 07:43, 14 June 2013&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-l1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&amp;lt;/noinclude&amp;gt;&lt;/ins&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;A logic is a collection of &amp;quot;algorithms&amp;quot; that mainly process MRML nodes within a scene.&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;A logic is a collection of &amp;quot;algorithms&amp;quot; that mainly process MRML nodes within a scene.&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;!-- diff cache key mediawiki_slicer:diff::1.12:old-28632:rev-32744 --&gt;
&lt;/table&gt;</summary>
		<author><name>UpdateBot</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/4.2/Developers/Logics&amp;diff=28632&amp;oldid=prev</id>
		<title>UpdateBot: Nightly -&gt; 4.2</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/4.2/Developers/Logics&amp;diff=28632&amp;oldid=prev"/>
		<updated>2012-10-31T21:56:08Z</updated>

		<summary type="html">&lt;p&gt;Nightly -&amp;gt; 4.2&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;A logic is a collection of &amp;quot;algorithms&amp;quot; that mainly process MRML nodes within a scene.&lt;br /&gt;
&lt;br /&gt;
Logics can be:&lt;br /&gt;
* ''active'': observe the scene and nodes to react when receiving events are fired&lt;br /&gt;
* ''passive'' (helper): collection of utility functions to simplify the handling of nodes (e.g. &amp;lt;code&amp;gt;AddArchetypeVolume&amp;lt;/code&amp;gt; in Volumes logic, Application logic.)&lt;br /&gt;
* a mix of both: not ideal.&lt;br /&gt;
&lt;br /&gt;
There are 5 types of logics within Slicer. Their role is usually dictated by their dependencies. The [http://slicer.org/doc/html/classvtkMRMLAbstractLogic__inherit__graph.png inheritance graph] can be useful to understand the relationship between each logic types.&lt;br /&gt;
&amp;lt;!-- --------------------------------- --&amp;gt;&lt;br /&gt;
# '''MRML logics'''&lt;br /&gt;
#: Location&lt;br /&gt;
#:: ''Slicer/Libs/MRML/Logics''&lt;br /&gt;
#: Dependencies&lt;br /&gt;
#:: MRMLCore&lt;br /&gt;
#:: no graphical dependency&lt;br /&gt;
#:: no Slicer dendendency (can by used by other projects) &lt;br /&gt;
#: Role&lt;br /&gt;
#:: Contain the base classes for logics (&amp;lt;code&amp;gt;vtkMRMLAbstractLogic&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;vtkMRMLApplicationLogic&amp;lt;/code&amp;gt;) and helper classes&lt;br /&gt;
#:: MRML logics don't have access to the application, and so shouldn't contain any Slicer specific code.&lt;br /&gt;
#: Examples:&lt;br /&gt;
#::* factories: for MRML nodes (&amp;lt;code&amp;gt;vtkMRMLColorLogic&amp;lt;/code&amp;gt; creates default &amp;lt;code&amp;gt;vtkMRMLColor*Nodes&amp;lt;/code&amp;gt;)&lt;br /&gt;
#::* helpers: &amp;lt;code&amp;gt;vtkMRMLModelHierarchyLogic&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;!-- --------------------------------- --&amp;gt;&lt;br /&gt;
# '''Slicer logics'''&lt;br /&gt;
#: Location&lt;br /&gt;
#:: ''Slicer/Base/Logics''&lt;br /&gt;
#: Dependencies&lt;br /&gt;
#:: MRMLLogic&lt;br /&gt;
#: Role&lt;br /&gt;
#:: Specialization of '''MRML Logics''' for the Slicer application.&lt;br /&gt;
#: Examples:&lt;br /&gt;
#::* &amp;lt;code&amp;gt;vtkSlicerColorLogic&amp;lt;/code&amp;gt;: knows about the &amp;quot;application&amp;quot; default LUT IDs and custom application lut files.&lt;br /&gt;
&amp;lt;!-- --------------------------------- --&amp;gt;&lt;br /&gt;
# '''Application logics'''&lt;br /&gt;
#: Location&lt;br /&gt;
#:: ''Slicer/Libs/MRML/Logics/vtkMRMLApplicationLogic.[h|cxx]'' and ''Slicer/Base/Logics/vtkSlicerApplicationLogic.[h|cxx]'' &lt;br /&gt;
#: Dependencies&lt;br /&gt;
#:: &amp;lt;code&amp;gt;vtkMRMLApplicationLogic&amp;lt;/code&amp;gt; doesn't depend on Slicer however &amp;lt;code&amp;gt;vtkSlicerApplicationLogic&amp;lt;/code&amp;gt; does.&lt;br /&gt;
#: Role&lt;br /&gt;
#:: Contains application specific information. &amp;lt;code&amp;gt;vtkMRMLApplicationLogic&amp;lt;/code&amp;gt; is an abstract class that is specialized for the application using MRML (&amp;lt;code&amp;gt;vtkSlicerApplicationLogic&amp;lt;/code&amp;gt; for Slicer) &lt;br /&gt;
#:: &amp;lt;code&amp;gt;vtk[MRML/Slicer]ApplicationLogic&amp;lt;/code&amp;gt; is NOT a singleton, however, it can be accessed by any logics (see &amp;lt;code&amp;gt;vtkMRMLAbstractLogic::SetApplicationLogic&amp;lt;/code&amp;gt;)  so it can be considered as such. It currently contains a list of nodes/logics, unique in the application. It is here for historic reasons (Slicer3), but it should not be seen as a placeholder for everything. Querying a module to get its logic should be preferred to access logics.&lt;br /&gt;
&amp;lt;!-- --------------------------------- --&amp;gt;&lt;br /&gt;
# '''Module logics'''&lt;br /&gt;
#: Location&lt;br /&gt;
#:: ''Slicer/Modules/Loadable/XYZ/Logic/vtkSlicerXXXLogic''&lt;br /&gt;
#: Dependencies&lt;br /&gt;
#:: Slicer logics, XYZ nodes and optionally other module logics&lt;br /&gt;
#: Role&lt;br /&gt;
#:: A module logic is the module public API. While a module has typically (not necessarily) an associated widget/panel, no processing should be done within the widget, the widget is just the interface between the user and the logic/nodes. Modules can access other module logics (i.e. &amp;lt;code&amp;gt;qSlicerCoreApplication::moduleManager()-&amp;gt;module(&amp;quot;Volumes&amp;quot;)-&amp;gt;logic()&amp;lt;/code&amp;gt;) if needed. There is maximum 1 module logic per module, however, it doesn't prevent the module logic to use helper logics (&amp;lt;code&amp;gt;vtkSlicerModelsLogic&amp;lt;/code&amp;gt; can instantiate/use &amp;lt;code&amp;gt;vtkMRMLModelHierarchyLogic&amp;lt;/code&amp;gt;).&lt;br /&gt;
&amp;lt;!-- --------------------------------- --&amp;gt;&lt;br /&gt;
# '''[[Documentation/{{documentation/version}}/Developers/DisplayableManagers|Displayable managers]]'''&lt;br /&gt;
#: Location&lt;br /&gt;
#:: ''Slicer/Libs/MRML/DisplayableManager''&lt;br /&gt;
#: Dependencies&lt;br /&gt;
#:: MRMLLogic and vtkRendering&lt;br /&gt;
#: Role&lt;br /&gt;
#:: They are logics that focus on representing nodes in a VTK renderer and handling user interaction within the view.&lt;br /&gt;
#:: Theoretically the slice logics should be displayable managers ( however, it might be a huge effort for just the sake of being consistent ).&lt;br /&gt;
#:: Displayable managers contain some limitations:&lt;br /&gt;
#:::* there is no control (yet?) over their creation, and once instantiated, it's not easy to control their behavior (properties can't be set externally on displayable managers).&lt;br /&gt;
#:::* they are not (yet?) well designed to communicate with each others. &lt;br /&gt;
&lt;br /&gt;
A class (logic, widget...) should explicitly expose in its API the required logic(s) (e.g. &amp;lt;code&amp;gt;qMRMLColorPickerwidget::setColorLogic(vtkMRMLColorLogic*)&amp;lt;/code&amp;gt;) instead of hiding the requirements by directly using the application logic (e.g. &amp;lt;code&amp;gt;this-&amp;gt;GetApplicationLogic()-&amp;gt;GetModelHierarchyLogic()&amp;lt;/code&amp;gt; ).&lt;br /&gt;
&lt;br /&gt;
It is the role of the class instantiator to pass the required logics to the created class (e.g. the module plugin sets the module logic to the module widget). For module logics depending on other module logics, it is resolved in the &amp;lt;code&amp;gt;qSlicer*Module::setup()&amp;lt;/code&amp;gt; function, &amp;lt;code&amp;gt;qSlicer*Modules&amp;lt;/code&amp;gt; have access to all modules and their logics that way (i.e. &amp;lt;code&amp;gt;qSlicerCoreApplication::moduleManager()-&amp;gt;module(&amp;quot;Volumes&amp;quot;)-&amp;gt;logic()&amp;lt;/code&amp;gt;).&lt;br /&gt;
Exposing the requirements in the API instead of using singleton has the advantage of having a scope well defined and contained, the code becomes more modular and easier to unit test.&lt;/div&gt;</summary>
		<author><name>UpdateBot</name></author>
		
	</entry>
</feed>