Presentation is loading. Please wait.

Presentation is loading. Please wait.

National Alliance for Medical Image Computing Slicer3 plugins Common architecture for interactive and batch processing.

Similar presentations


Presentation on theme: "National Alliance for Medical Image Computing Slicer3 plugins Common architecture for interactive and batch processing."— Presentation transcript:

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

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

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

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

5 National Alliance for Medical Image Computing http://na-mic.org Example module http://www.nitrc.org/projects/slicer3examples/

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

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

8 National Alliance for Medical Image Computing http://na-mic.org Adding example modules to Slicer3 … from a Slicer3ExampleModules installation … from a Slicer3ExampleModules build * Slicer3 restart required

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

10 National Alliance for Medical Image Computing http://na-mic.org ExampleModule.xml

11 National Alliance for Medical Image Computing http://na-mic.org ExampleModule.cxx

12 National Alliance for Medical Image Computing http://na-mic.org ExampleModule.cxx

13 National Alliance for Medical Image Computing http://na-mic.org CMakeLists.txt

14 National Alliance for Medical Image Computing http://na-mic.org Communicating status (easy) #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(); VTK #include "itkPluginFilterWatcher.h... typedef itk::MedianImageFilter FilterType; FilterType::Pointer median = FilterType::New(); itk::PluginFilterWatcher watchMedian(median, "Denoise Image", CLPProcessInformation); Median->Update(); ITK

15 National Alliance for Medical Image Computing http://na-mic.org Communicating status (hard) name of program section or algorithm description of program section or algrotihm floating number from 0 to 1 name of program section or algorithm execution time Executable 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; } Shared object

16 National Alliance for Medical Image Computing http://na-mic.org Python modules XML = """ Filtering.Denoising... 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 National Alliance for Medical Image Computing http://na-mic.org Parameters | | | | | | | | | | | [type="scalar|label|tensor|diffusion-weighted|vector|model"] | [type="fiberbundle|model"] | [multiple="true|false"] [coordinateSystem="lps|ras|ijk"] | [multiple="true|false"] [coordinateSystem="lps|ras|ijk"]

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

19 National Alliance for Medical Image Computing http://na-mic.org 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 National Alliance for Medical Image Computing http://na-mic.org Slicer3 Plugins Common architecture for interactive and batch processing


Download ppt "National Alliance for Medical Image Computing Slicer3 plugins Common architecture for interactive and batch processing."

Similar presentations


Ads by Google