Skip to content

SlicerRt developers page

Csaba Pinter edited this page Apr 27, 2020 · 4 revisions

Assembla tickets archive

Building 3D Slicer with RT extensions

Prerequisites on Windows:

  • Install Git and TortoiseGit

Build procedure:

  • Build Slicer as described on the Slicer build instructions page
    • When configuring Slicer:
      • For 64-bit builds: choose "Visual Studio 16 2019". For optional tooset to use (argument to -T) enter v140
      • 32-bit builds are not recommended
    • If the build process stalls at the "Cloning into ..." step then uncheck the "Slicer_USE_GIT_PROTOCOL" option (it is somewhat slower but more robust download method, more suitable for using from behind firewalls), reconfigure, and rebuild the project
  • Checkout SlicerRT extension code using Git from https://github.com/SlicerRt/SlicerRT.git
  • When configuring the project set the Slicer_DIR to the Slicer version that you have built (e.g., c:/d/S4D/Slicer-build)
  • Open SlicerRT.sln, select the Debug/Release configuration that matches the configuration that used for Slicer build, and build ALL_BUILD
  • Start Slicer and in the application settings add the following additional module paths (replace Debug by Release if you are testing in Release mode):
    • <SlicerRt-bin>\inner-build\lib\Slicer-4.11\cli-modules  # For unix
    • <SlicerRt-bin>\inner-build\lib\Slicer-4.11\cli-modules[Debug or Release]   # For windows
    • <SlicerRt-bin>\inner-build\lib\Slicer-4.11\qt-scripted-modules
    • <SlicerRt-bin>\inner-build\lib\Slicer-4.11\qt-loadable-modules   # For unix
    • <SlicerRt-bin>\inner-build\lib\Slicer-4.11\qt-loadable-modules[Debug or Release]   # For windows

Automatic testing

  • Run the automatic SlicerRT tests on your computer:
    • Open a command line in the inner-build in your SlicerRT binary directory, and run the command ctest -C Release -D Experimental
    • If you have a debug build, then use -C Debug instead
    • As a result, a line should appear in the Slicer dashboard in the Extensions-Experimental section. Similarly, the nightly appears in the nightly section.
    • It is advised to have a separate directory for the nightly test, which does not contain any local modifications.
  • Set up a nightly dashboard on your computer: follow instructions at http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Tutorials/DashboardSetup

Create a new Slicer extension version

SlicerRT nightly is released automatically every night now, but stable releases are still manual

  • Confgure SlicerRt: send your MIDAS username and password

  • Update the version number in the main CMakeLists.txt file

  • Choose Release configuration

  • Build the ExperimentalUpload project (this will build, test, and upload the extension as an Experimental build to the dashboard and Slicer App Store)

  • If everything works then merge the changes from the trunk to the actual stable SlicerRT version

    • List of known differences to keep between the trunk and the stable branch can be found here
    • Avoid applying the changes of removing workarounds for a bug that has been solved since the release of the latest stable Slicer version (the bug is still there so we need the workaround)
  • Commit and push the updated SlicerRT.s4ext file to https://github.com/SlicerRt/ExtensionsIndex/tree/update-SlicerRT-4.6 (clone the master and use the Switch command to the branch)

    • In the commit and push comment enter the following line. Replace (summary of changes) with the actual changes and MMM and NNN with the old and new svn revision number: ENH: SlicerRT X.YY.Z: (summary of changes)
  • Request a pull to Slicer/ExtensionIndex/tree/4.8

  • Update Slicer wiki pages: Main page, Nightly documentation, Stable documentation

  • (Links for the nightly releases which are now unnecessary: SlicerRt/ExtensionIndex, nightly pull request)

How to link between external modules

Steve and JC explained how to do this, if we want to call plastimatch functions from SlicerRT extension

  • Build plastimatch as extension, including library such as libfoo.so
  • In SlicerRT, do FIND_PACKAGE(plastimatch), then INCLUDE(${PLM_USE_FILE})
  • Use file will set include and library directories for SlicerRT to find header and libraries at build time
  • Add "depends" section to SlicerRT .s4ext file, so build machines can build them in the right order
  • Extension manager will look at dependency, and automatically install plastimatch if SlicerRT is chosen

Sample data

Documentation

Useful information

Task tracking

Important tasks are tracked as GitHub issues: https://github.com/SlicerRt/SlicerRT/issues

Make sure the link of the GitHub issue the commit is related to is pasted on the bottom of the commit message in a new line.

Coding rules

  • Slicer (NA-MIC) coding rules apply: windows file endings for all files, indentation is 2 spaces (no tabs). See http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Style_Guide
  • The following exceptions / clarifications are noted:
    • Lines may be longer than 80 characters
    • Curly braces should be on a separate line from the if / for statement
    • Windows line ending is used
    • Comments are C++-style, starting with // in each row
  • Variable naming convention
    • Local variables start with lower case
    • VTK members start with upper case
    • Qt members start with m_