Slicer 3 plugins Common architecture for interactive and

  • Slides: 20
Download presentation
Slicer 3 plugins Common architecture for interactive and batch processing National Alliance for Medical

Slicer 3 plugins Common architecture for interactive and batch processing National Alliance for Medical Image Computing http: //na-mic. org

The grand vision… Algorithms ITK VTK Slicer Modules Slicer 3. 0 Scripts of Slicer

The grand vision… Algorithms ITK VTK Slicer Modules Slicer 3. 0 Scripts of Slicer Mods VTK Apps Using ITK Batch Programs Non-NAMIC Cmd tools Batch. Make BIRN Grid Wizard National Alliance for Medical Image Computing http: //na-mic. org User Desktop

Common architecture for interactive and batch processing Algorithms ITK VTK Slicer Modules Slicer 3.

Common architecture for interactive and batch processing Algorithms ITK VTK Slicer Modules Slicer 3. 0 User Desktop Scripts of Slicer Mods VTK Apps Using ITK Batch Programs Non-NAMIC Cmd tools Batch. Make BIRN Grid Wizard National Alliance for Medical Image Computing http: //na-mic. org

Each module has … … an entry in the module menu … a panel

Each module has … … an entry in the module menu … a panel of user interface controls National Alliance for Medical Image Computing http: //na-mic. org

Example module http: //www. nitrc. org/projects/slicer 3 examples/ National Alliance for Medical Image Computing

Example module http: //www. nitrc. org/projects/slicer 3 examples/ National Alliance for Medical Image Computing http: //na-mic. org

Configuring example modules … from a Slicer 3 installation National Alliance for Medical Image

Configuring example modules … from a Slicer 3 installation National Alliance for Medical Image Computing http: //na-mic. org … from a Slicer 3 build

Building the example modules National Alliance for Medical Image Computing http: //na-mic. org

Building the example modules National Alliance for Medical Image Computing http: //na-mic. org

Adding example modules to Slicer 3 … from a Slicer 3 Example. Modules installation

Adding example modules to Slicer 3 … from a Slicer 3 Example. Modules installation … from a Slicer 3 Example. Modules build * Slicer 3 restart required National Alliance for Medical Image Computing http: //na-mic. org

Running the modules National Alliance for Medical Image Computing http: //na-mic. org

Running the modules National Alliance for Medical Image Computing http: //na-mic. org

Example. Module. xml National Alliance for Medical Image Computing http: //na-mic. org

Example. Module. xml National Alliance for Medical Image Computing http: //na-mic. org

Example. Module. cxx National Alliance for Medical Image Computing http: //na-mic. org

Example. Module. cxx National Alliance for Medical Image Computing http: //na-mic. org

Example. Module. cxx National Alliance for Medical Image Computing http: //na-mic. org

Example. Module. cxx National Alliance for Medical Image Computing http: //na-mic. org

CMake. Lists. txt National Alliance for Medical Image Computing http: //na-mic. org

CMake. Lists. txt National Alliance for Medical Image Computing http: //na-mic. org

Communicating status (easy) VTK #include "vtk. Plugin. Filter. Watcher. h". . . vtk. Marching.

Communicating status (easy) VTK #include "vtk. Plugin. Filter. Watcher. h". . . vtk. Marching. Cubes *cubes = vtk. Marching. Cubes: : New(); cubes->Set. Input(reader->Get. Output()); vtk. Plugin. Filter. Watcher watch. Cubes(cubes, "Generate Isosurface", CLPProcess. Information, . 5, 0. 0); vtk. Decimate. Pro *decimate = vtk. Decimate. Pro: : New(); decimate->Set. Input(cubes->Get. Output()); vtk. Plugin. Filter. Watcher watch. Decimate(decimate, "Reduce Triangle Count", CLPProcess. Information, . 5, 0. 5); decimate->Update(); ITK #include "itk. Plugin. Filter. Watcher. h. . . typedef itk: : Median. Image. Filter<Image. Type, Image. Type> Filter. Type; Filter. Type: : Pointer median = Filter. Type: : New(); itk: : Plugin. Filter. Watcher watch. Median(median, "Denoise Image", CLPProcess. Information); Median->Update(); National Alliance for Medical Image Computing http: //na-mic. org

Communicating status (hard) Executable <filter-start> <filter-name> name of program section or algorithm </filter-name> <filter-comment>

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> National Alliance for Medical Image Computing http: //na-mic. org Shared object extern "C" { struct Module. Process. Information { /** Inputs from calling application to the module **/ unsigned char Abort; /** Outputs from the module to the calling application **/ float Progress; char Progress. Message[1024]; void (*Progress. Callback. Function)(void *); void *Progress. Callback. Client. Data; double Elapsed. Time; } }

Python modules XML = """<? xml version="1. 0" encoding="utf-8"? > <executable> <category>Filtering. Denoising</category>. .

Python modules XML = """<? xml version="1. 0" encoding="utf-8"? > <executable> <category>Filtering. Denoising</category>. . . def to. XML(): return XML; def Execute ( input. Volume, output. Volume, conductance=1. 0, time. Step=0. 0625, iterations=1 ): print "Executing Python Demo Application!" Slicer = __import__ ( "Slicer" ); slicer = Slicer() in = slicer. MRMLScene. Get. Node. By. ID ( input. Volume ); out = slicer. MRMLScene. Get. Node. By. ID ( output. Volume ); filter = slicer. vtk. ITKGradient. Anisotropic. Diffusion. Image. Filter. New() filter. Set. Conductance. Parameter ( conductance ) filter. Set. Time. Step ( time. Step ) filter. Set. Number. Of. Iterations ( iterations ) filter. Set. Input ( in. Get. Image. Data() ) filter. Update() out. Set. And. Observe. Image. Data(filter. Get. Output()) return National Alliance for Medical Image Computing http: //na-mic. org

Parameters <integer> | <float> | <double> | <boolean> | <string> | <integer-vector> | <float-vector>

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"] [coordinate. System="lps|ras|ijk"] | <region>[multiple="true|false"] [coordinate. System="lps|ras|ijk"] National Alliance for Medical Image Computing http: //na-mic. org

Parameter description <name> * C++ variable name of the parameter <description> * Help message

Parameter description <name> * C++ variable name of the parameter <description> * Help message for parameter <label> * <default> GUI label for the parameter Default value <flag> * Single character flag, e. g. –f <longflag> * <constraints> <minimum> <maximum> <step> Single word flag, e. g. --output. Image Block around minimum/maximum/step. Trigger a slider to be used. Minimum parameter value Maximum parameter value 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 National Alliance for Medical Image Computing http: //na-mic. org

Behind the scenes • • Tasks queued for processing thread Three types of modules:

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

Slicer 3 Plugins Common architecture for interactive and batch processing National Alliance for Medical

Slicer 3 Plugins Common architecture for interactive and batch processing National Alliance for Medical Image Computing http: //na-mic. org