Difference between revisions of "AHM2012-Slicer-Architecture"
From NAMIC Wiki
(26 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
== Modularization Object Specialization == | == Modularization Object Specialization == | ||
− | |||
+ | * Slicer is built on top libraries/toolkits/tools supported by the community. | ||
+ | * The new build system allows to optionally disable/enable most of them. | ||
+ | <!-- ------- --> | ||
+ | ** '''Core''' | ||
+ | *** [https://github.com/Slicer/Slicer/blob/master/SuperBuild/External_CLAPACK.cmake CLAPACK] | ||
+ | *** [https://github.com/Slicer/Slicer/blob/master/SuperBuild/External_cmcurl.cmake cmcurl] | ||
+ | *** [https://github.com/Slicer/Slicer/blob/master/SuperBuild/External_CTKAPPLAUNCHER.cmake CTKAPPLAUNCHER] | ||
+ | *** [https://github.com/Slicer/Slicer/blob/master/SuperBuild/External_CTK.cmake CTK] | ||
+ | *** [https://github.com/Slicer/Slicer/blob/master/SuperBuild/External_ITKv3.cmake ITKv3] | ||
+ | *** [https://github.com/Slicer/Slicer/blob/master/SuperBuild/External_teem.cmake teem] | ||
+ | *** [https://github.com/Slicer/Slicer/blob/master/SuperBuild/External_VTK.cmake VTK] | ||
+ | <!-- ------- --> | ||
+ | ** '''Core <- CLI Support''' [Option Slicer_BUILD_CLI_SUPPORT - Enabled by default] | ||
+ | *** [https://github.com/Slicer/Slicer/blob/master/SuperBuild/External_SlicerExecutionModel.cmake SlicerExecutionModel] | ||
+ | <!-- ------- --> | ||
+ | ** ''' Core <- Python''' [Option Slicer_USE_PYTHONQT - Enabled by default] | ||
+ | *** [https://github.com/Slicer/Slicer/blob/master/SuperBuild/External_python.cmake python] | ||
+ | <!-- ------- --> | ||
+ | ** ''' Core <- Python <- NUMPY''' [Option Slicer_USE_NUMPY - Enabled by default] | ||
+ | *** [https://github.com/Slicer/Slicer/blob/master/SuperBuild/External_NUMPY.cmake NUMPY] | ||
+ | <!-- ------- --> | ||
+ | ** ''' Core <- ExtensionManager ''' [Option Slicer_BUILD_EXTENSIONMANAGER_SUPPORT - Enabled by default] | ||
+ | *** [https://github.com/Slicer/Slicer/blob/master/SuperBuild/External_LibArchive.cmake LibArchive] | ||
+ | *** [https://github.com/Slicer/Slicer/blob/master/SuperBuild/External_qMidasAPI.cmake qMidasAPI] | ||
+ | <!-- ------- --> | ||
+ | ** ''' Core <- Python <- Tcl Compatibility layer''' [Option Slicer_USE_PYTHONQT_WITH_TCL - Enabled by default] | ||
+ | *** [https://github.com/Slicer/Slicer/blob/master/SuperBuild/External_tcl.cmake tcl] | ||
+ | *** [https://github.com/Slicer/Slicer/blob/master/SuperBuild/External_incrTcl.cmake incrTcl] | ||
+ | *** [https://github.com/Slicer/Slicer/blob/master/SuperBuild/External_tk.cmake tk] | ||
+ | <!-- ------- --> | ||
+ | ** '''Core <- BatchMake ''' | ||
+ | *** [https://github.com/Slicer/Slicer/blob/master/SuperBuild/External_BatchMake.cmake BatchMake] | ||
+ | <!-- ------- --> | ||
+ | ** ''' Core <- OpenIGTLink''' [Option Slicer_USE_OpenIGTLink] | ||
+ | *** [https://github.com/Slicer/Slicer/blob/master/SuperBuild/External_OpenIGTLink.cmake OpenIGTLink] | ||
+ | <!-- ------- --> | ||
+ | ** ''' Core <- OpenIGTLink <- OpenIGTLinkIF''' [Option Slicer_USE_OpenIGTLinkIF] | ||
+ | *** [https://github.com/Slicer/Slicer/blob/master/SuperBuild/External_OpenIGTLinkIF.cmake OpenIGTLinkIF] | ||
+ | <!-- ------- --> | ||
+ | ** ''' Core <- Built-in ''Extension''''' | ||
+ | *** [https://github.com/Slicer/Slicer/blob/master/SuperBuild/External_ABC.cmake ABC] | ||
+ | *** [https://github.com/Slicer/Slicer/blob/master/SuperBuild/External_BRAINSTools.cmake BRAINSTools] | ||
+ | *** [https://github.com/Slicer/Slicer/blob/master/SuperBuild/External_ChangeTrackerPy.cmake ChangeTrackerPy] | ||
+ | *** [https://github.com/Slicer/Slicer/blob/master/SuperBuild/External_EMSegment.cmake EMSegment] | ||
+ | <!-- ------- --> | ||
+ | ** ''' Core <- ITKv4 ''' [Experimental - Option ITK_VERSION_MAJOR = 4] | ||
+ | *** [https://github.com/Slicer/Slicer/blob/master/SuperBuild/External_ITKv4.cmake ITKv4] | ||
+ | <!-- ------- --> | ||
+ | ** ''' Core <- ITKv4 <- SimpleITK ''' [Experimental - Option Slicer_USE_SimpleITK] | ||
+ | *** [https://github.com/Slicer/Slicer/blob/master/SuperBuild/External_PCRE.cmake PCRE] | ||
+ | *** [https://github.com/Slicer/Slicer/blob/master/SuperBuild/External_SimpleITK.cmake SimpleITK] | ||
+ | *** [https://github.com/Slicer/Slicer/blob/master/SuperBuild/External_Swig.cmake Swig] | ||
+ | |||
+ | * Libraries living in Slicer repository - Look inside [https://github.com/Slicer/Slicer/tree/master/Libs Slicer/Libs] directory | ||
+ | ** [https://github.com/Slicer/Slicer/tree/master/Libs/FreeSurfer FreeSurfer] | ||
+ | ** [https://github.com/Slicer/Slicer/tree/master/Libs/IGT IGT] | ||
+ | ** [https://github.com/Slicer/Slicer/tree/master/Libs/MGHImageIO MGHImageIO] | ||
+ | ** [https://github.com/Slicer/Slicer/tree/master/Libs/MRML MRML] - Contains MRML/'''CLI''', MRML/'''Core''', MRML/'''DisplayableManager''', MRML/'''IDImageIO''', MRML/'''Logic''', MRML/'''Widgets''' | ||
+ | ** [https://github.com/Slicer/Slicer/tree/master/Libs/RemoteIO RemoteIO] | ||
+ | ** [https://github.com/Slicer/Slicer/tree/master/Libs/vtkITK vtkITK] | ||
+ | ** [https://github.com/Slicer/Slicer/tree/master/Libs/vtkTeem vtkTeem] | ||
+ | |||
+ | * The Slicer base classes - Look inside [https://github.com/Slicer/Slicer/tree/master/Base Slicer/Base] directory | ||
+ | ** [https://github.com/Slicer/Slicer/tree/master/Base/CLI CLI] | ||
+ | ** [https://github.com/Slicer/Slicer/tree/master/Base/Logic Logic] | ||
+ | ** [https://github.com/Slicer/Slicer/tree/master/Base/Python Python] | ||
+ | ** [https://github.com/Slicer/Slicer/tree/master/Base/QTCLI QTCLI] | ||
+ | ** [https://github.com/Slicer/Slicer/tree/master/Base/QTCore QTCore] | ||
+ | ** [https://github.com/Slicer/Slicer/tree/master/Base/QTGUI QTGUI] | ||
+ | |||
+ | * The Slicer application - Look inside [https://github.com/Slicer/Slicer/tree/master/Applications Slicer/Applications] directory | ||
+ | ** [https://github.com/Slicer/Slicer/tree/master/Applications/SlicerQT SlicerQT] | ||
+ | |||
+ | * Slicer base classes relationship: | ||
+ | [[File:AHM2012_SlicerArch.png]] | ||
+ | |||
+ | <br><br><br> | ||
== Displayable Managers == | == Displayable Managers == | ||
Line 10: | Line 86: | ||
** ... handle mouse/keyboard interaction. | ** ... handle mouse/keyboard interaction. | ||
** ... synchronize widget across different views. | ** ... synchronize widget across different views. | ||
− | |||
* '''Overview''': | * '''Overview''': | ||
Line 20: | Line 95: | ||
** Currently, there are two type of DisplayableManager: '''ThreeD''' and '''Slice''' '''DisplayableManager''' - Similar API. | ** Currently, there are two type of DisplayableManager: '''ThreeD''' and '''Slice''' '''DisplayableManager''' - Similar API. | ||
** Both derive from [https://github.com/Slicer/Slicer/blob/master/Libs/MRML/DisplayableManager/vtkMRMLAbstractDisplayableManager.h vtkMRMLAbstractDisplayableManager]. | ** Both derive from [https://github.com/Slicer/Slicer/blob/master/Libs/MRML/DisplayableManager/vtkMRMLAbstractDisplayableManager.h vtkMRMLAbstractDisplayableManager]. | ||
− | ** ThreeDDisplayableManager: deals with [https://github.com/Slicer/Slicer/blob/master/Libs/MRML/Core/vtkMRMLViewNode.h MRMLViewNode] / [https://github.com/Slicer/Slicer/blob/master/Libs/MRML/DisplayableManager/vtkThreeDViewInteractorStyle.h ThreeDInteractorStyle] | + | ** '''ThreeDDisplayableManager [https://github.com/Slicer/Slicer/blob/master/Libs/MRML/DisplayableManager/vtkMRMLAbstractThreeDViewDisplayableManager.h]''': deals with [https://github.com/Slicer/Slicer/blob/master/Libs/MRML/Core/vtkMRMLViewNode.h MRMLViewNode] / [https://github.com/Slicer/Slicer/blob/master/Libs/MRML/DisplayableManager/vtkThreeDViewInteractorStyle.h ThreeDInteractorStyle] |
− | ** SliceDisplayableManager: deals with [https://github.com/Slicer/Slicer/blob/master/Libs/MRML/Core/vtkMRMLSliceNode.h MRMLSliceNode] / [https://github.com/Slicer/Slicer/blob/master/Libs/MRML/DisplayableManager/vtkSliceViewInteractorStyle.h SliceInteractorStyle] | + | ** '''SliceDisplayableManager [https://github.com/Slicer/Slicer/blob/master/Libs/MRML/DisplayableManager/vtkMRMLAbstractSliceViewDisplayableManager.h]''': deals with [https://github.com/Slicer/Slicer/blob/master/Libs/MRML/Core/vtkMRMLSliceNode.h MRMLSliceNode] / [https://github.com/Slicer/Slicer/blob/master/Libs/MRML/DisplayableManager/vtkSliceViewInteractorStyle.h SliceInteractorStyle] |
* '''Factories''': | * '''Factories''': | ||
Line 27: | Line 102: | ||
** [https://github.com/Slicer/Slicer/blob/master/Libs/MRML/DisplayableManager/vtkMRMLSliceViewDisplayableManagerFactory.h vtkMRMLSliceViewDisplayableManagerFactory] | ** [https://github.com/Slicer/Slicer/blob/master/Libs/MRML/DisplayableManager/vtkMRMLSliceViewDisplayableManagerFactory.h vtkMRMLSliceViewDisplayableManagerFactory] | ||
+ | * '''DisplayableManager within Module''' | ||
+ | ** Module can also register DisplayableManager. See [https://github.com/Slicer/Slicer/blob/master/Modules/Loadable/Annotations/qSlicerAnnotationsModule.cxx#L65 qSlicerAnnotationsModule.cxx#L65] | ||
+ | |||
+ | * '''DisplayableManager and Python''' | ||
+ | ** Mechanism to load python based DisplayableManager | ||
+ | ** Achieved using [https://github.com/Slicer/Slicer/blob/master/Libs/MRML/DisplayableManager/vtkMRMLScriptedDisplayableManager.h vtkMRMLScriptedDisplayableManager] | ||
+ | |||
+ | * '''List of DisplayableManager''' (available in Libs/MRML/DisplayableManager directory) | ||
+ | ** [https://github.com/Slicer/Slicer/blob/master/Libs/MRML/DisplayableManager/vtkMRMLCameraDisplayableManager.h vtkMRMLCameraDisplayableManager] | ||
+ | ** [https://github.com/Slicer/Slicer/blob/master/Libs/MRML/DisplayableManager/vtkMRMLCrosshairDisplayableManager.h vtkMRMLCrosshairDisplayableManager] | ||
+ | ** [https://github.com/Slicer/Slicer/blob/master/Libs/MRML/DisplayableManager/vtkMRMLModelDisplayableManager.h vtkMRMLModelDisplayableManager] | ||
+ | ** [https://github.com/Slicer/Slicer/blob/master/Libs/MRML/DisplayableManager/vtkMRMLModelSliceDisplayableManager.h vtkMRMLModelSliceDisplayableManager] | ||
+ | ** [https://github.com/Slicer/Slicer/blob/master/Libs/MRML/DisplayableManager/vtkMRMLThreeDReformatDisplayableManager.h vtkMRMLThreeDReformatDisplayableManager] | ||
+ | ** [https://github.com/Slicer/Slicer/blob/master/Libs/MRML/DisplayableManager/vtkMRMLViewDisplayableManager.h vtkMRMLViewDisplayableManager] | ||
+ | ** [https://github.com/Slicer/Slicer/blob/master/Libs/MRML/DisplayableManager/vtkMRMLVolumeGlyphSliceDisplayableManager.h vtkMRMLVolumeGlyphSliceDisplayableManager] | ||
+ | |||
+ | <br><br><br> | ||
== Views and Layouts == | == Views and Layouts == | ||
+ | |||
+ | * '''Implemented layouts''' | ||
+ | ** conventionalView | ||
+ | ** fourUpView | ||
+ | ** oneUp3DView | ||
+ | ** oneUpRedView | ||
+ | ** oneUpYellowView | ||
+ | ** oneUpGreenView | ||
+ | ** tabbed3DView | ||
+ | ** tabbedSliceView | ||
+ | ** dual3DView | ||
+ | ** triple3DView | ||
+ | ** conventionalWidescreenView | ||
+ | ** threeOverThreeView | ||
+ | ** fourOverFourView | ||
+ | ** compareView | ||
+ | |||
+ | * '''Concept''' | ||
+ | ** Management of '''Layout''' and their associated '''View''' have been revisited. | ||
+ | ** Layout are now described using a simple '''XML description'''. See [https://github.com/Slicer/Slicer/blob/master/Libs/MRML/Logic/vtkMRMLLayoutLogic.cxx vtkMRMLLayoutLogic] | ||
+ | |||
+ | <pre> | ||
+ | const char* triple3DEndoscopyView = | ||
+ | "<layout type=\"vertical\" split=\"true\" >" | ||
+ | " <item>" | ||
+ | " <view class=\"vtkMRMLViewNode\">" | ||
+ | " <property name=\"viewlabel\" action=\"default\">1</property>" | ||
+ | " </view>" | ||
+ | " </item>" | ||
+ | " <item>" | ||
+ | " <layout type=\"horizontal\">" | ||
+ | " <item>" | ||
+ | " <view class=\"vtkMRMLViewNode\" type=\"secondary\">" | ||
+ | " <property name=\"viewlabel\" action=\"default\">2</property>" | ||
+ | " </view>" | ||
+ | " </item>" | ||
+ | " <item>" | ||
+ | " <view class=\"vtkMRMLViewNode\" type=\"endoscopy\">" | ||
+ | " <property name=\"viewlabel\" action=\"default\">3</property>" | ||
+ | " </view>" | ||
+ | " </item>" | ||
+ | " </layout>" | ||
+ | " </item>" | ||
+ | "</layout>"; | ||
+ | </pre> | ||
+ | |||
+ | * '''MRMLLayoutManager''' | ||
+ | ** Bridge between MRML nodes, Layout description and corresponding Widgets layout. | ||
+ | ** Aggregates a '''MRMLLayoutLogic''' | ||
+ | ** Based on [https://github.com/commontk/CTK/blob/master/Libs/Widgets/ctkLayoutManager.h ctkLayoutManager] | ||
+ | |||
+ | * '''vtkMRMLLayoutLogic''' | ||
+ | ** Observes LayoutNode and ViewNodes | ||
+ | ** Ensures that at least one 3D view and three slice views are always in the MRML scene (after a scene is closed or imported). | ||
+ | ** Keeps an up-to-date list of the different MRML view nodes (3D, slice ...) that are mapped into a given layout. | ||
+ | |||
+ | * '''What's next ?''' | ||
+ | ** API to ... | ||
+ | *** ... dynamically update a given layout description | ||
+ | *** ... register new layout. |
Latest revision as of 14:40, 10 January 2012
Home < AHM2012-Slicer-ArchitectureModularization Object Specialization
- Slicer is built on top libraries/toolkits/tools supported by the community.
- The new build system allows to optionally disable/enable most of them.
- Core
- Core <- CLI Support [Option Slicer_BUILD_CLI_SUPPORT - Enabled by default]
- Core <- Python [Option Slicer_USE_PYTHONQT - Enabled by default]
- Core <- Python <- NUMPY [Option Slicer_USE_NUMPY - Enabled by default]
- Core <- ExtensionManager [Option Slicer_BUILD_EXTENSIONMANAGER_SUPPORT - Enabled by default]
- Core <- Python <- Tcl Compatibility layer [Option Slicer_USE_PYTHONQT_WITH_TCL - Enabled by default]
- Core <- BatchMake
- Core <- OpenIGTLink [Option Slicer_USE_OpenIGTLink]
- Core <- OpenIGTLink <- OpenIGTLinkIF [Option Slicer_USE_OpenIGTLinkIF]
- Core <- Built-in Extension
- Core <- ITKv4 [Experimental - Option ITK_VERSION_MAJOR = 4]
- Core <- ITKv4 <- SimpleITK [Experimental - Option Slicer_USE_SimpleITK]
- Libraries living in Slicer repository - Look inside Slicer/Libs directory
- FreeSurfer
- IGT
- MGHImageIO
- MRML - Contains MRML/CLI, MRML/Core, MRML/DisplayableManager, MRML/IDImageIO, MRML/Logic, MRML/Widgets
- RemoteIO
- vtkITK
- vtkTeem
- The Slicer application - Look inside Slicer/Applications directory
- Slicer base classes relationship:
Displayable Managers
- Displayable manager: Specialized logic handling both RenderWindow <-> MRML and RenderWindow <-> Logic interactions.
- Motivation: Have a well-designed mechanism to ...
- ...represent MRML node within a Renderer/RenderWindow.
- ... handle mouse/keyboard interaction.
- ... synchronize widget across different views.
- Overview:
- Each time a viewer is instantiated, it asks a factory to provide him with a DisplayableManagerGroup.
- DisplayableManagerGroup contain a list of DisplayableManager
- Each DisplayableManager is associated with Renderer + InteractorStyle
- DisplayableManager
- Currently, there are two type of DisplayableManager: ThreeD and Slice DisplayableManager - Similar API.
- Both derive from vtkMRMLAbstractDisplayableManager.
- ThreeDDisplayableManager [1]: deals with MRMLViewNode / ThreeDInteractorStyle
- SliceDisplayableManager [2]: deals with MRMLSliceNode / SliceInteractorStyle
- DisplayableManager within Module
- Module can also register DisplayableManager. See qSlicerAnnotationsModule.cxx#L65
- DisplayableManager and Python
- Mechanism to load python based DisplayableManager
- Achieved using vtkMRMLScriptedDisplayableManager
- List of DisplayableManager (available in Libs/MRML/DisplayableManager directory)
Views and Layouts
- Implemented layouts
- conventionalView
- fourUpView
- oneUp3DView
- oneUpRedView
- oneUpYellowView
- oneUpGreenView
- tabbed3DView
- tabbedSliceView
- dual3DView
- triple3DView
- conventionalWidescreenView
- threeOverThreeView
- fourOverFourView
- compareView
- Concept
- Management of Layout and their associated View have been revisited.
- Layout are now described using a simple XML description. See vtkMRMLLayoutLogic
const char* triple3DEndoscopyView = "<layout type=\"vertical\" split=\"true\" >" " <item>" " <view class=\"vtkMRMLViewNode\">" " <property name=\"viewlabel\" action=\"default\">1</property>" " </view>" " </item>" " <item>" " <layout type=\"horizontal\">" " <item>" " <view class=\"vtkMRMLViewNode\" type=\"secondary\">" " <property name=\"viewlabel\" action=\"default\">2</property>" " </view>" " </item>" " <item>" " <view class=\"vtkMRMLViewNode\" type=\"endoscopy\">" " <property name=\"viewlabel\" action=\"default\">3</property>" " </view>" " </item>" " </layout>" " </item>" "</layout>";
- MRMLLayoutManager
- Bridge between MRML nodes, Layout description and corresponding Widgets layout.
- Aggregates a MRMLLayoutLogic
- Based on ctkLayoutManager
- vtkMRMLLayoutLogic
- Observes LayoutNode and ViewNodes
- Ensures that at least one 3D view and three slice views are always in the MRML scene (after a scene is closed or imported).
- Keeps an up-to-date list of the different MRML view nodes (3D, slice ...) that are mapped into a given layout.
- What's next ?
- API to ...
- ... dynamically update a given layout description
- ... register new layout.
- API to ...