1 / 20

Slicer3 plugins

Slicer3 plugins. Common architecture for interactive and batch processing. User Desktop. Slicer 3.0. Algorithms. ITK. VTK. Slicer Modules. Scripts of Slicer Mods. VTK Apps Using ITK. Batch Programs. Non-NAMIC Cmd tools. BatchMake. BIRN Grid Wizard. The grand vision…. User

Télécharger la présentation

Slicer3 plugins

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. Slicer3 plugins Common architecture for interactive and batch processing

  2. User Desktop Slicer3.0 Algorithms ITK VTK Slicer Modules Scripts of Slicer Mods VTK Apps Using ITK Batch Programs Non-NAMIC Cmd tools BatchMake BIRN Grid Wizard The grand vision…

  3. User Desktop Slicer3.0 Algorithms ITK VTK Slicer Modules Scripts of Slicer Mods VTK Apps Using ITK Batch Programs Non-NAMIC Cmd tools BatchMake BIRN Grid Wizard Common architecture for interactive and batch processing

  4. Each module has … … an entry in the module menu … a panel of user interface controls

  5. Example module http://www.nitrc.org/projects/slicer3examples/

  6. Configuring example modules … from a Slicer3 installation … from a Slicer3 build

  7. Building the example modules

  8. Adding example modules to Slicer3 … from a Slicer3ExampleModules installation … from a Slicer3ExampleModules build * Slicer3 restart required

  9. Running the modules

  10. ExampleModule.xml

  11. ExampleModule.cxx

  12. ExampleModule.cxx

  13. CMakeLists.txt

  14. Communicating status (easy) VTK #include "vtkPluginFilterWatcher.h" ... vtkMarchingCubes *cubes = vtkMarchingCubes::New(); cubes->SetInput(reader->GetOutput()); vtkPluginFilterWatcher watchCubes(cubes, "Generate Isosurface", CLPProcessInformation, .5, 0.0); vtkDecimatePro *decimate = vtkDecimatePro::New(); decimate->SetInput(cubes->GetOutput()); vtkPluginFilterWatcher watchDecimate(decimate, "Reduce Triangle Count", CLPProcessInformation, .5, 0.5); decimate->Update(); ITK #include "itkPluginFilterWatcher.h ... typedef itk::MedianImageFilter<ImageType,ImageType> FilterType; FilterType::Pointer median = FilterType::New(); itk::PluginFilterWatcher watchMedian(median, "Denoise Image", CLPProcessInformation); Median->Update();

  15. Communicating status (hard) Executable <filter-start> <filter-name> name of program section or algorithm </filter-name> <filter-comment> description of program section or algrotihm </filter-comment> </filter-start> <filter-progress> floating number from 0 to 1 </filter-progress> <filter-end> <filter-name> name of program section or algorithm </filter-name> <filter-time> execution time </filter-time> </filter-end> Shared object extern "C" { struct ModuleProcessInformation { /** Inputs from calling application to the module **/ unsigned char Abort; /** Outputs from the module to the calling application **/ float Progress; char ProgressMessage[1024]; void (*ProgressCallbackFunction)(void *); void *ProgressCallbackClientData; double ElapsedTime; } }

  16. Python modules XML = """<?xml version="1.0" encoding="utf-8"?> <executable> <category>Filtering.Denoising</category> ... def toXML(): return XML; def Execute ( inputVolume, outputVolume, conductance=1.0, timeStep=0.0625, iterations=1 ): print "Executing Python Demo Application!" Slicer = __import__ ( "Slicer" ); slicer = Slicer.Slicer() in = slicer.MRMLScene.GetNodeByID ( inputVolume ); out = slicer.MRMLScene.GetNodeByID ( outputVolume ); filter = slicer.vtkITKGradientAnisotropicDiffusionImageFilter.New() filter.SetConductanceParameter ( conductance ) filter.SetTimeStep ( timeStep ) filter.SetNumberOfIterations ( iterations ) filter.SetInput ( in.GetImageData() ) filter.Update() out.SetAndObserveImageData(filter.GetOutput()) return

  17. Parameters <integer> | <float> | <double> | <boolean> | <string> | <integer-vector> | <float-vector> | <double-vector> | <string-vector> | <integer-enumeration> | <float-enumeration> | <double-enumeration> | <string-enumeration> | <file> | <directory> | <image>[type="scalar|label|tensor|diffusion-weighted|vector|model"] | <geometry> [type="fiberbundle|model"] | <point>[multiple="true|false"] [coordinateSystem="lps|ras|ijk"] | <region>[multiple="true|false"] [coordinateSystem="lps|ras|ijk"]

  18. Parameter description <name> * C++ variable name of the parameter <description> * Help message for parameter <label> * GUI label for the parameter <default> Default value <flag> * Single character flag, e.g. –f <longflag> * Single word flag, e.g. --outputImage <constraints> Block around minimum/maximum/step. Trigger a slider to be used. <minimum> Minimum parameter value <maximum> Maximum parameter value <step> Step size <channel> * Input or output parameter (image, geometry, file, directory) <index> * Position of a parameter without a flag. Starts at 0 <enumeration> * Block around element <element> * Choice value for an enumeration * Required tags * Required under certain conditions

  19. Behind the scenes • Tasks queued for processing thread • Three types of modules: • executable, • shared object, and • Python modules • Scalar images sent via files for executables and memory* for shared objects and python • Vector images, tensor images, geometry, tables, transforms sent via files • Scalars, file names, directories, fiducials, regions sent via command line * VTK-based modules using scalar images are only supported as executable (command line) modules.

  20. Slicer3 Plugins Common architecture for interactive and batch processing

More Related