Presentation is loading. Please wait.

Presentation is loading. Please wait.

NA-MIC National Alliance for Medical Image Computing Slicer Custom Modules Steve Pieper, PhD.

Similar presentations


Presentation on theme: "NA-MIC National Alliance for Medical Image Computing Slicer Custom Modules Steve Pieper, PhD."— Presentation transcript:

1 NA-MIC National Alliance for Medical Image Computing http://na-mic.org Slicer Custom Modules Steve Pieper, PhD

2 National Alliance for Medical Image Computing http://na-mic.org 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 National Alliance for Medical Image Computing http://na-mic.org 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 National Alliance for Medical Image Computing http://na-mic.org Directory Organization Modules/vtk –cxx CMakeListsLocal.txt lists the source files plus custom build directives –tcl.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 National Alliance for Medical Image Computing http://na-mic.org 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 National Alliance for Medical Image Computing http://na-mic.org 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/READM E.txt describes the step-by-step process

7 National Alliance for Medical Image Computing http://na-mic.org Module Making Steps Copy vtkCustomModule to vtk and cd to that dir Remove all CVS subdirs –(e.g. with rm -r `find. -name CVS` ) Run./vtkNameModule –Your will be propagated to the various files

8 National Alliance for Medical Image Computing http://na-mic.org 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 National Alliance for Medical Image Computing http://na-mic.org 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 National Alliance for Medical Image Computing http://na-mic.org 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 National Alliance for Medical Image Computing http://na-mic.org Module Cxx Code To ensure Windows dll files will be built correctly, be sure your.h files have the following code: #include and class VTK_MODULENAME_EXPORT vtkTest :...

12 National Alliance for Medical Image Computing http://na-mic.org 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 National Alliance for Medical Image Computing http://na-mic.org Module Tcl Wrapping In the Wrapping/Tcl/vtk /vtk.tcl file: –Source all tcl files your module needs –If your module depends on another module, include, for example: package require vtkTensorUtil

14 National Alliance for Medical Image Computing http://na-mic.org 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 National Alliance for Medical Image Computing http://na-mic.org 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 National Alliance for Medical Image Computing http://na-mic.org 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


Download ppt "NA-MIC National Alliance for Medical Image Computing Slicer Custom Modules Steve Pieper, PhD."

Similar presentations


Ads by Google