Slicer3 plugins: Going Further - PowerPoint PPT Presentation

About This Presentation
Title:

Slicer3 plugins: Going Further

Description:

vtkPluginFilterWatcher watchDecimate(decimate, 'Reduce Triangle Count' ... decimate- Update(); VTK #include 'itkPluginFilterWatcher.h ... – PowerPoint PPT presentation

Number of Views:32
Avg rating:3.0/5.0
Slides: 12
Provided by: NAM24
Category:

less

Transcript and Presenter's Notes

Title: Slicer3 plugins: Going Further


1
Slicer3 plugins Going Further
Common architecture for interactive and batch
processing
2
Example module
http//www.nitrc.org/projects/slicer3examples/
3
Adding example modules to Slicer3
from a Slicer3ExampleModules installation
from a Slicer3ExampleModules build
Slicer3 restart required
4
Running the modules
5
Communicating status (easy)
VTK
include "vtkPluginFilterWatcher.h" ...
vtkMarchingCubes cubes vtkMarchingCubesNew()
cubes-gtSetInput(reader-gtGetOutput())
vtkPluginFilterWatcher watchCubes(cubes,
"Generate Isosurface", CLPProcessInformation, .5,
0.0) vtkDecimatePro decimate
vtkDecimateProNew() decimate-gtSetInput(cubes-gt
GetOutput()) vtkPluginFilterWatcher
watchDecimate(decimate, "Reduce Triangle Count",
CLPProcessInformation, .5, 0.5)
decimate-gtUpdate()
ITK
include "itkPluginFilterWatcher.h ... typedef
itkMedianImageFilterltImageType,ImageTypegt
FilterType FilterTypePointer median
FilterTypeNew() itkPluginFilterWatcher
watchMedian(median, "Denoise Image",
CLPProcessInformation) Median-gtUpdate()
6
Communicating status (hard)
Executable
ltfilter-startgt ltfilter-namegt name of program
section or algorithm lt/filter-namegt
ltfilter-commentgt description of program section
or algrotihm lt/filter-commentgt lt/filter-startgt
ltfilter-progressgt floating number from 0 to 1
lt/filter-progressgt ltfilter-endgt ltfilter-namegt
name of program section or algorithm
lt/filter-namegt ltfilter-timegt execution time
lt/filter-timegt lt/filter-endgt
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
ProgressMessage1024 void
(ProgressCallbackFunction)(void ) void
ProgressCallbackClientData double
ElapsedTime
7
Python modules
XML """lt?xml version"1.0" encoding"utf-8"?gt
ltexecutablegt ltcategorygtFiltering.Denoisinglt/cate
gorygt ... def toXML() return XML
def Execute ( inputVolume, outputVolume,
conductance1.0, timeStep0.0625, iterations1 )
print "Executing Python Demo Application!"
Slicer __import__ ( "Slicer" ) slicer
Slicer.Slicer() in slicer.MRMLScene.GetNodeByI
D ( inputVolume ) out slicer.MRMLScene.GetNod
eByID ( outputVolume ) filter
slicer.vtkITKGradientAnisotropicDiffusionImageFilt
er.New() filter.SetConductanceParameter (
conductance ) filter.SetTimeStep ( timeStep )
filter.SetNumberOfIterations ( iterations )
filter.SetInput ( in.GetImageData() )
filter.Update() out.SetAndObserveImageData(fil
ter.GetOutput()) return
8
Parameters
ltintegergt ltfloatgt ltdoublegt ltbooleangt
ltstringgt ltinteger-vectorgt ltfloat-vectorgt
ltdouble-vectorgt ltstring-vectorgt
ltinteger-enumerationgt ltfloat-enumerationgt
ltdouble-enumerationgt ltstring-enumerationgt
ltfilegt ltdirectorygt ltimagegttype"scalarlabe
ltensordiffusion-weightedvectormodel"
ltgeometrygt type"fiberbundlemodel"
ltpointgtmultiple"truefalse"
coordinateSystem"lpsrasijk"
ltregiongtmultiple"truefalse"
coordinateSystem"lpsrasijk"
9
Parameter description
ltnamegt C variable name of the
parameter ltdescriptiongt Help message for
parameter ltlabelgt GUI label for the
parameter ltdefaultgt Default value ltflaggt
Single character flag, e.g. f ltlongflaggt
Single word flag, e.g. --outputImage ltconstraints
gt Block around minimum/maximum/step. Trigger a
slider to be used. ltminimumgt Minimum parameter
value ltmaximumgt Maximum parameter
value ltstepgt Step size ltchannelgt Input or
output parameter (image, geometry, file,
directory) ltindexgt Position of a parameter
without a flag. Starts at 0 ltenumerationgt
Block around element ltelementgt Choice value
for an enumeration
Required tags Required under certain
conditions
10
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.
11
Slicer3 Plugins
Common architecture for interactive and batch
processing
Write a Comment
User Comments (0)
About PowerShow.com