Difference between revisions of "Documentation/Nightly/Developers/FAQ/Modules"

From Slicer Wiki
Jump to: navigation, search
(Prepend documentation/versioncheck template. See http://na-mic.org/Mantis/view.php?id=2887)
 
(6 intermediate revisions by 4 users not shown)
Line 5: Line 5:
 
</includeonly>
 
</includeonly>
  
== Within a Slicer build-tree, where are located Slicer modules ? ==
+
== Within a Slicer build-tree, where are Slicer modules located? ==
 
Slicer module executables and libraries are located in your main Slicer build directory <code>Slicer-Superbuild/Slicer-build</code>. Refer to [[Documentation/{{documentation/version}}/Developers/DirectoryStructure|Directory Structure]] description for more details.
 
Slicer module executables and libraries are located in your main Slicer build directory <code>Slicer-Superbuild/Slicer-build</code>. Refer to [[Documentation/{{documentation/version}}/Developers/DirectoryStructure|Directory Structure]] description for more details.
  
Line 11: Line 11:
  
 
Follow [[Documentation/{{documentation/version}}/Developers/Build_Module|developers guide for building modules]]
 
Follow [[Documentation/{{documentation/version}}/Developers/Build_Module|developers guide for building modules]]
 +
 +
== How to modify local version of external module ==
 +
 +
Some Slicer modules (such as OpenIGTLink and OpenIGTLinkIF) are built as External git projects by CMake scripts in the Slicer/SuperBuild directory.
 +
The SuperBuild process may refresh from the repository unexpectedly, overwriting any local changes. To avoid this, comment out the git settings
 +
in the appropriate external build file while making local edits. For example, in SuperBuild/External_OpenIGTLinkIF.cmake:
 +
 +
{|
 +
|<pre>
 +
    GIT_REPOSITORY "${git_protocol}://github.com/openigtlink/OpenIGTLinkIF.git"
 +
    GIT_TAG "f9b65b1ffd2992862025f3c6ec5fe30e6f5dd395"
 +
    SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}</pre>
 +
|<pre>
 +
    # GIT_REPOSITORY "${git_protocol}://github.com/openigtlink/OpenIGTLinkIF.git"
 +
    # GIT_TAG "f9b65b1ffd2992862025f3c6ec5fe30e6f5dd395"
 +
    SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}</pre>
 +
|}
 +
 +
== How to call a CLI module from a C++ loadable module? ==
 +
 +
Discussion: http://slicer-devel.65872.n3.nabble.com/Calling-CLI-module-from-a-C-loadable-module-tt4031930.html
 +
 +
Example: [https://github.com/Slicer/Slicer/blob/master/Modules/Loadable/CropVolume/Logic/vtkSlicerCropVolumeLogic.cxx#L318-351 vtkSlicerCropVolumeLogic.cxx#L318-351]
 +
 +
== How to call a CLI module from command-line? ==
 +
 +
Example:
 +
 +
    Slicer.exe --launch CastScalarVolume input.mha output.mha
 +
 +
Notes for windows:
 +
* Full name of the Slicer executable is required (''Slicer.exe'', not just ''Slicer'')
 +
* To get help on command-line arguments the CLI module supports, run:
 +
 +
    Slicer.exe --launch CastScalarVolume 2>c:\SomeWriteAbleDirectory\usage.txt

Latest revision as of 15:37, 23 August 2017

Home < Documentation < Nightly < Developers < FAQ < Modules


For the latest Slicer documentation, visit the read-the-docs.


Modules

Within a Slicer build-tree, where are Slicer modules located?

Slicer module executables and libraries are located in your main Slicer build directory Slicer-Superbuild/Slicer-build. Refer to Directory Structure description for more details.

How to build module outside of Slicer source tree

Follow developers guide for building modules

How to modify local version of external module

Some Slicer modules (such as OpenIGTLink and OpenIGTLinkIF) are built as External git projects by CMake scripts in the Slicer/SuperBuild directory. The SuperBuild process may refresh from the repository unexpectedly, overwriting any local changes. To avoid this, comment out the git settings in the appropriate external build file while making local edits. For example, in SuperBuild/External_OpenIGTLinkIF.cmake:

     GIT_REPOSITORY "${git_protocol}://github.com/openigtlink/OpenIGTLinkIF.git"
     GIT_TAG "f9b65b1ffd2992862025f3c6ec5fe30e6f5dd395"
     SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
     # GIT_REPOSITORY "${git_protocol}://github.com/openigtlink/OpenIGTLinkIF.git"
     # GIT_TAG "f9b65b1ffd2992862025f3c6ec5fe30e6f5dd395"
     SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}

How to call a CLI module from a C++ loadable module?

Discussion: http://slicer-devel.65872.n3.nabble.com/Calling-CLI-module-from-a-C-loadable-module-tt4031930.html

Example: vtkSlicerCropVolumeLogic.cxx#L318-351

How to call a CLI module from command-line?

Example:

   Slicer.exe --launch CastScalarVolume input.mha output.mha

Notes for windows:

  • Full name of the Slicer executable is required (Slicer.exe, not just Slicer)
  • To get help on command-line arguments the CLI module supports, run:
   Slicer.exe --launch CastScalarVolume 2>c:\SomeWriteAbleDirectory\usage.txt