Slicer Custom Modules - PowerPoint PPT Presentation

1 / 15
About This Presentation
Title:

Slicer Custom Modules

Description:

Space-separated list of directories containing slicer module directory trees ... Module Making Steps (cont) ... Source all tcl files your module needs ... – PowerPoint PPT presentation

Number of Views:57
Avg rating:3.0/5.0
Slides: 16
Provided by: NAM7
Category:

less

Transcript and Presenter's Notes

Title: Slicer Custom Modules


1
Slicer Custom Modules
  • Steve Pieper, PhD

2
Overall Goals
  • Allow Independent Development of Run-Time
    Loadable Modules
  • Enforce code independence
  • Allow modules delivered under different licenses
  • Support development outside of main cvs prior to
    code sharing
  • The SLICER_MODULES environment variable
  • Space-separated list of directories containing
    slicer module directory trees
  • Used by cmaker, launch, and tarup
  • Allows you to keep your own code in a distinct
    cvs repository/working directory

3
What is a Module?
  • C code (optional)
  • VTK Subclasses
  • ITK Subclasses
  • Extra Helper code (GSL, OpenGL, etc)
  • Tcl code
  • Application Logic
  • User Interface Code

4
Directory Organization
  • Modules/vtkltModuleNamegt
  • cxx
  • CMakeListsLocal.txt lists the source files plus
    custom build directives
  • tcl
  • ltModuleNamegt.tcl has standard slicer entry points
  • builds
  • Platform specific binary directories
  • Wrapping
  • Standard tcl/java/python wrapping support
  • data
  • Additional files your module needs (will be
    included in distribution by tarup.tcl)

5
Modules in Slicer CVS
  • vtkCISGFile/ vtkITK/
  • vtkCorCTA/ vtkIbrowser/
  • BIRNDUP/ vtkCustomModule/
    vtkImageSmooth/
  • vtkDTMRI/ vtkLevelSets/
  • LDMMViewer/ vtkEMLocalSegment/
    vtkMIRIADSegment/
  • MultiVolumeReader/ vtkEMPrivateSegment/
    vtkMorphometrics/
  • vtkFMRIEngine/ vtkRealignResample/
  • iSlicer/ vtkFSLReader/
    vtkRigidIntensityRegistration/
  • vtkAffineSegment/ vtkFastMarching/
    vtkSubVolume/
  • vtkAnalyze/ vtkFluxDiffusion/
    vtkTensorUtil/
  • vtkBXH/ vtkFreeSurferReaders/
    vtkVolumeTextureMapping/

6
vtkCustomModule
  • A support script to help manage the many files
    that need to be created/customized when making a
    vtk loadable library source tree
  • Modules/vtkCustomModule/README.txt describes the
    step-by-step process

7
Module Making Steps
  • Copy vtkCustomModule to vtkltModuleNamegt and cd to
    that dir
  • Remove all CVS subdirs
  • (e.g. with rm -r find . -name CVS )
  • Run ./vtkNameModule
  • Your ltModuleNamegt will be propagated to the
    various files

8
Module Making Steps (cont)
  • Add your source files to cxx directory
  • Add references to files in CMakeListsLocal.txt
    (copy from SAMPLE)
  • SET(LOCAL_MODULE_SRCS
  • vtkMultiInputsSimpleImageToImageFilter.cxx
  • vtkActivationVolumeGenerator.cxx
  • vtkActivationDetector.cxx
  • vtkCDF.cxx
  • )

9
Module Making Steps (cont)
  • Set any classes not to be wrapped
  • SET ( LOCAL_NO_WRAP_SRCS
  • GeneralLinearModel.cxx
  • )
  • Set any Abstract classes
  • SET_SOURCE_FILES_PROPERTIES (
  • vtkMultiInputsSimpleImageToImageFilter.cxx
  • ABSTRACT
  • )

10
Module Making Steps (cont)
  • If your code subclasses Slicer classes, uncomment
    the include directories lines and add other
    modules you depend on if needed
  • INCLUDE_DIRECTORIES(
  • VTKSLICERBASE_SOURCE_DIR/cxx
  • VTKSLICERBASE_BUILD_DIR
  • VTKTENSORUTIL_SOURCE_DIR/cxx
  • VTKTENSORUTIL_BUILD_DIR
  • )
  • LINK_LIBRARIES (VTKSLICERBASE_BUILD_LIB
    VTKTENSORUTIL_BUILD_LIB VTKTENSORUTIL_BUILD_T
    CL_LIB)

11
Module Cxx Code
  • To ensure Windows dll files will be built
    correctly, be sure your .h files have the
    following code
  • include ltvtkModuleNameConfigure.hgt
  • and
  • class VTK_MODULENAME_EXPORT vtkTest ...

12
Module Tcl Files
  • vtkNameModule will create a tcl/ModuleName.tcl
    file for you with a default UI
  • Comments in that file tell how to customize your
    interface for your application

13
Module Tcl Wrapping
  • In the Wrapping/Tcl/vtkltModuleNamegt/vtkltModuleName
    gt.tcl file
  • Source all tcl files your module needs
  • If your module depends on another module,
    include, for example
  • package require vtkTensorUtil

14
What you get for this work
  • Cross-platform build and automatic detection at
    run time
  • Spot in the slicer More menu
  • Ability to interact with slicer scene

15
ITK Based Modules
  • Depend on vtkITK Module for build
  • To allow subclassing the vtkITKImageToImageFilters
  • Write vtkITK wrapper class (Raul will describe in
    the next section)
  • Just use the filter as if it were a vtk class
  • if info command vtkITKBSplineImageFilter
    ""
  • DevErrorWindow "DTMRI\nERROR
    vtkITKBSplineImageFilter does not exist, cannot
    use bspline filter
  • return
  • DTMRIMakeVTKObject vtkITKBSplineImageFilter
    bspline(i)
Write a Comment
User Comments (0)
About PowerShow.com