1 / 16

Slicer Custom Modules

Slicer Custom Modules. Steve Pieper, PhD. 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

rune
Télécharger la présentation

Slicer Custom Modules

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  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/vtk<ModuleName> • cxx • CMakeListsLocal.txt lists the source files plus custom build directives • tcl • <ModuleName>.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 vtk<ModuleName> and cd to that dir • Remove all CVS subdirs • (e.g. with rm -r `find . -name CVS` ) • Run ./vtkNameModule • Your <ModuleName> 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_TCL_LIB})

  11. Module Cxx Code • To ensure Windows dll files will be built correctly, be sure your .h files have the following code: #include <vtkModuleNameConfigure.h> 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/vtk<ModuleName>/vtk<ModuleName>.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 and in the Hierarchical “Modules” menu on the main toolbar • 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)

  16. Resources • www.slicer.org • www.na-mic.org/Wiki • www.na-mic.org/Bug • www.na-mic.org/Testing • slicer-devel@bwh.harvard.edu • slicer-users@bwh.harvard.edu

More Related