Programming
in
Slicer4
Ph.D.
Sonia Pujol,
Surgical Planning Laboratory,
Harvard Medical School
Steve Pieper, Ph.D.
Paul Cézanne, Moulin sur la Couleuvre à Pontoise, 1881, Staatliche
Museen zu Berlin, Na:onalgalerie
Isomics Inc.
The NA-MIC Kit
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
3D Slicer version 4 (Slicer4.7.0-2017-07-12)
• An end-user applica:on for
image analysis
• An open-source environment
for soNware development
• A soNware plaPorm that is
both easy to use for clinical
researchers and easy to
extend for programmers
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Slicer Modules
• Command Line Interface (CLI):
standalone executable with limited input/
output arguments
• Scripted Modules (Python):
recommended for fast prototyping
• Loadable Modules (C++ Plugins):
optimized for heaving computation
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Slicer4 Highlights: Python
The Python console of Slicer4 gives access to
• scene objects (MRML)
• data arrays (volumes, models)
• GUI elements that can be encapsulated in a
module (Qt)
• Processing Libraries: numpy, VTK, ITK, CTK
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Slicer4 Scripted Modules
• Python scripted modules allow more
interac(ve func(onali(es (e.g. ‘Flythrough’
in Endoscopy module) and rapid prototyping
• GUI based on Qt libraries accessed via Python
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Tutorial Goal
• This tutorial guides you through the steps of
crea:ng a very simple “Hello World” Python
scripted module and two small modules for
performing Laplacian filtering and sharpening.
• For addi:onal details and pointers, visit the
Slicer Documenta:on page
hdp://[Link]/slicerWiki/[Link]/Documenta:on/
Nightly
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Processing Examples in this Tutorial
Manipulation
with numpy
Image Data on
Disk (DICOM,
Nifti, nrrd…)
Manipulation
with VTK
MRML Scene
Manipulation
MRML: Medical Reality Markup Language, with ITK
the Slicer Data Representation (Slicer CLI)
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Prerequisites
• This course supposes that you have taken
the tutorial: ‘Slicer4 Data Loading and
Visualiza:on’- Sonia Pujol Ph.D.
• The tutorial and HelloPython dataset are
available in the Slicer training
compendium
• Programming experience is required, and
some familiarity with Python is essen:al.
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Course Material
[Link] à Slicer training à Slicer4 Programming Tutorial
Sample data set: [Link] Completed programming
(124-slice MRI volume) examples:
Note: other volumes (for example, HelloPython, HelloLaplace,
provided by SampleData module) HelloSharpen
can be used just as well.
Unzip the HelloPython_Nightly.zip archive
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Course Overview
• Part A: Exploring Slicer via Python
• Part B: “Hello world” simple Python scripted
module (HelloPython)
• Part C: Implementa:on of Laplace operator
for a 3D volume (HelloLaplace)
• Part D: Image sharpening using Laplace
operator and subtrac:on (HelloSharpen)
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Part A: EXPLORING SLICER VIA
PYTHON
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Python in Slicer
Slicer includes python 2.7 and a rich set of
standard libraries
• Included:
Ø numpy, VTK, CTK, PythonQt,
and most of standard python library
• Not included:
Ø scipy (scien:fic tools for python),
Ø matplotlib (python 2D plo:ng library),
Ø ipython (interac:ve python)
and some other popular packages that we have
found difficult to package for distribu:on
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Python Console in Slicer
Select View à Python Interactor, or
click the button
Drag-and-drop the title bar to dock to
the side of application window or
move to other screen.
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
General Python Console Features
• Command Line Edi:ng:
Ø LeN/Right Arrow Keys, Home, End
Ø Delete (Control-D)
Ø Copy/Paste
• Command Comple:on:
Ø Tab Key
• Input History:
Ø Up/Down Arrow Keys
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Add Volume
1. Select File à Add Data
2. Select Choose File(s) to add
3. Load the dataset [Link]
located in the directory
HelloPython/data
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Add Volume
4. Verify in Description column
that file will be loaded as Volume
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Access to MRML and Arrays
Run the following code in
the Python console
a = [Link]('spgr’)
àUses the slicer.u:l package to
return a numpy array of the image
àThe variable 'a' is a numpy ndarray
of the volume data we just loaded
print(a)
!Shows a shortened view of the array
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Access to MRML and Arrays
The intensity values of the spgr
image appear in the Python
console
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Access to MRML and Arrays
Type the following command to
display the min and max
intensity value of the spgr image
print([Link](),[Link]())
àUse numpy array methods
to analyze and process the data
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Access to MRML and Arrays
Voxel value:
min = 0
max = 355
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Manipula:ng Arrays
Run the following code in the Python console,
(indent each new line with 2 spaces)
def toggle():
n = [Link]('spgr')
a = [Link]('spgr')
a[:] = [Link]() - a
[Link]()
print('Toggled')
toggle()
For practice: use up arrow and return
keys to execute toggle() over and over
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
The toggle func:on in more detail
• def toggle():
Ø Defines a python func:on
Ø Body of func:on performs element-wise math on
en:re volume
Ø Easy mix of scalar and volume math
• Telling Slicer that the image data for node 'n'
has been modified causes the slice view
windows to refresh
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Qt GUI in Python
Run the following code in the
Python console
b = [Link]('Toggle')
[Link]('clicked()',toggle)
[Link]()
What do you think will happen when you run this code?
What about when you push the button?
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Result with budon toggling
Original Result
Put the slicer view windows front to see the changes
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
In More Detail
• Slicer uses PythonQt to expose the Qt library
in Python (hdp://[Link])
• Sophis:cated interac:ve modules can be
wriden en:rely with Python code calling C++
code that is wrapped in Python
Ø e.g. Endoscopy, SegmentEditor, SampleData,
ChangeTracker, and other slicer modules in the
Slicer source code
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
PART B: INTEGRATION OF THE
HELLOPYTHON TUTORIAL TO
SLICER4
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Modules and Extensions
• Module:
• Defines user interface, processing, self-tests
• Various types: Scripted (Python), Command
Line Interface (CLI), Loadable (C++)
• Extension:
• Collection of modules
• Packaged in a single zip file and distributed
through the Extension Manager (Slicer app
store)
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Create new extension
• Create new extension: “Hello”
• Choose destination folder by
clicking […] button
• Select a folder (for example,
your Desktop)
• Click Choose and OK
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Set extension metadata
• No need for setting metadata
now, just click OK.
• Metadata can be edited later by
clicking “Edit Extension
Metadata”
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Add module
• Click “Add module to Extension”
• Enter “HelloPython” as module
name (must not contain spaces
or special characters)
• Click “OK”
Check “Add selected module…”
to load the module automatically
when Slicer is restarted
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Adding modules to be loaded
For future reference only - no need to add the module manually if “Add
selected module to search paths” box (see previous slide) was checked.
Specify location of additional modules
that Slicer will load on startup:
• Click “Add” and select file, or
• Drag-and-drop the folder
or .py file in the path listbox
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Edit module
• Click “Edit” to open source code of the
module in default application associated
with .py files
• If the source code is not opened
automatically then start an editor and
load the source code file: …\Desktop\Hello
\HelloPython\[Link]
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
[Link]
Module
Description
Module Widget
(GUI)
Module Logic
(processing, no
user interface)
Module Test
(automatic self-
tests)
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Update Module Descrip:on
class HelloPython(ScriptedLoadableModule):
"""Uses ScriptedLoadableModule base class, available at:
[Link]
"""
def __init__(self, parent): constructor
ScriptedLoadableModule.__init__(self, parent)
[Link] = "HelloPython" # TODO make this more human readable by adding spaces
[Link] = ["Examples"]
[Link] = []
[Link] = ["John Doe (AnyWare Corp.)"]
[Link] = """
This is an example of scripted loadable module bundled in an extension.
It performs a simple thresholding on the input volume and optionally captures a screenshot.
"""
[Link] += [Link]()
[Link] = """
This file was originally developed by Jean-Christophe Fillion-Robin, Kitware Inc.
and Steve Pieper, Isomics, Inc. and was partially funded by NIH grant 3P41RR013218-12S1.
""" # replace with organization, grant and thanks.
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Implement Module GUI
class HelloPythonWidget(ScriptedLoadableModuleWidget):
…
def setup(self):
[Link](self)
…
parametersCollapsibleButton = [Link]()
[Link] = "Parameters"
[Link](parametersCollapsibleButton)
# Layout within the dummy collapsible button
parametersFormLayout = [Link](parametersCollapsibleButton)
# HelloWorld button
helloWorldButton = [Link]("Hello world")
[Link] = "Print 'Hello world' in standard output."
[Link](helloWorldButton)
Update [Link]('clicked(bool)', [Link])
widget to # Add vertical spacer
[Link](1)
have only
a single # Set local var as instance attribute
[Link] = helloWorldButton
button
def onHelloWorldButtonClicked(self):
logic = HelloPythonLogic()
result = [Link]()
[Link]([Link](),
'Slicer Python', result)
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Reload module
• Save [Link] file
• Click “Reload” button to update the
module based on changes in the
source code
• If the module GUI is not updated or
disappears then check the Python
console for error messages
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Implement Module Logic
Replace content of logic class with a single method.
class HelloPythonLogic(ScriptedLoadableModuleLogic):
"""This class should implement all the actual
computation done by your module. The interface
should be such that other python code can import
this class and make use of the functionality without
requiring an instance of the Widget.
Uses ScriptedLoadableModuleLogic base class, available at:
"""
def process(self):
return "Hello world!"
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Run the module
Click on Help and
Acknowledgment
in the Hello Python module
Click on the Hello World button
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Implement self-test
Replace test_HelloPython1 with a simple test.
Use asserts, such as assertIsNone(…), assertTrue(…)to test that
the module works correctly.
class HelloPythonTest(ScriptedLoadableModuleTest):
def setUp(self):
[Link](0)
def runTest(self):
[Link]()
self.test_HelloPython1()
def test_HelloPython1(self):
[Link]("Starting the test")
logic = HelloPythonLogic()
result = [Link]()
[Link](result)
[Link]('Test passed!')
If an extension is submitted to the Extension Manager (Slicer App Store) then all
tests of all of its modules are executed for every release and results are reported
on the dashboard: [Link]
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Test the module
• Save [Link] file
• Click “Reload and Test” button to
update the module based on
changes in the source code and
run all the tests
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Part C:
Implemen:ng the
Text
Laplace* Operator
*named aNer Pierre-Simon, Marquis de Laplace (1749-1827)
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Overview
The goal of this sec:on is to build an image
analysis module that implements a Laplacian
filter on volume data
• Use qMRML widgets: widgets
that automa:cally track the
state of the Slicer MRML scene
• Use VTK filters to manipulate
volume data
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Add module to exis:ng extension
• Open Extension Wizard module (press
Ctrl+F shortcut, type exte, and select
Extension Wizard from list)
• Click “Select Extension”, select your
extension folder (…Desktop/Hello)
• Click Add module to Extension”
• Enter “HelloLaplace” as module name
• Click “OK”
Check “Add selected module…”
to load the module automatically
when Slicer is restarted
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Edit module
• Click “Edit” to open source code of the
HelloLaplace module in default
application associated with .py files
• If the source code is not opened
automatically then start an editor and
load the source code file: …\Desktop\Hello
\HelloPython\[Link]
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Implement Module GUI (Part 1)
class HelloLaplaceWidget(ScriptedLoadableModuleWidget):
…
[Link]( "Pick the output to the algorithm." )
[Link]("Output Volume: ", [Link])
We only need
#
input and # threshold value
#
output volume [Link] = [Link]()
[Link] = 0.1
selectors, so
X
[Link] = -100
[Link] = 100
remove [Link] = 0.5
[Link]("Set threshold value for computing the
threshold output image. Voxels that have intensities lower than this value will set to zero.")
[Link]("Image threshold", [Link])
value and
#
check box # check box to trigger taking screen shots for later use in tutorials
#
sections from [Link] = [Link]()
[Link] = 0
the [Link]("If checked, take screen shots for
tutorials. Use Save Data to write them to disk.")
HelloLaplace [Link]("Enable Screenshots",
[Link])
Widget
#
# Apply Button
#
[Link] = [Link]("Apply")
…
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Implement Module GUI (Part 2)
class HelloLaplaceWidget(ScriptedLoadableModuleWidget):
…
def onSelect(self):
[Link] =
[Link]() and
[Link]()
Update Apply def onApplyButton(self):
button event logic = HelloLaplaceLogic()
handler [Link]([Link](),
[Link]())
(onApplyButton) # make the output volume appear in all the slice views
to only use input [Link](
background = [Link]())
and output
volumes #
# HelloLaplaceLogic
#
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Reload module
• Save [Link] file
• Click “Reload” button to update the
module based on changes in the
source code
• “Image threshold” slider and
“Enable screenshots” checkbox
should disappear
• If the module GUI is not updated or
disappears then check the Python
console for error messages
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
In More Detail
• CTK is a Qt Add-On Library with many useful
widgets, par:cularly for visualiza:on and medical
imaging see hdp://[Link]
• Qt Widgets, Layouts, and Op(ons are well
documented at hdp://[Link]
• qMRMLNodeComboBox is a powerful slicer widget
that monitors the scene and allows you to select/
create nodes of specified types (we used
vtkMRMLScalarVolumeNode). Documented here:
hdp://[Link]/master/
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Implement Module Logic
class HelloLaplaceLogic(ScriptedLoadableModuleLogic):
…
def run(self, inputVolume, outputVolume):
if not [Link](inputVolume, outputVolume):
return False
Update [Link]('Processing started')
processing laplacian = [Link]()
[Link] ([Link]())
method to [Link](3)
compute output [Link]()
by a VTK filter. # Copy image origin, spacing, directions from input
ijkToRAS = vtk.vtkMatrix4x4()
[Link](ijkToRAS)
[Link](ijkToRAS)
[Link]([Link]())
[Link]('Processing completed')
return True
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
In More Detail
• vtkImageLaplacian is a vtkImageAlgorithm operates
on vtkImageData (see hdp://[Link])
• vtkMRMLScalarVolumeNode is a Slicer MRML class
that contains vtkImageData, plus orienta:on
informa:on ijkToRAS matrix (see hdp://[Link].
org/slicerWiki/[Link]/Coordinate_systems)
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
In More Detail (Con:nued)
• Global slicer package gives python access to:
Ø Convenience func:ons: slicer.u(l
hdp://[Link]/en/latest/developer_guide/[Link]#module-slicer.u:l
Ø Data: [Link]
hdp://[Link]/master/[Link]
Ø CLI modules: [Link]
Ø Scripted modules: by impor:ng Python classes
Ø Loadable modules: [Link].(modulename).logic()
hdp://[Link]/master/[Link]
Ø Applica:on GUI: [Link]
hdp://[Link]/master/classqSlicerApplica:[Link]
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Running the module
1. Note that Input Volume combobox
auto-selected new volume
2. Create new volume for output
3. Run the module
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Output of HelloLaplace
Result of Laplace Operator
on spgr volume
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Part D:
Image Sharpening with
Laplace Operator and
subtrac:on
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Overview
The goal of this sec:on is to add a
processing op:on for image sharpening.
• We’ll implement this
opera:on using our
HelloLaplace module
and an exis:ng Slicer
Command Line Module
‘Subtract Scalar Volumes’
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Add module to exis:ng extension
• Open Extension Wizard module (press
Ctrl+F shortcut, type exte, and select
Extension Wizard from list)
• Click “Select Extension”, select your
extension folder (…Desktop/Hello)
• Click Add module to Extension”
• Enter “HelloSharpen” as module name
• Click “OK”
Check “Add selected module…”
to load the module automatically
when Slicer is restarted
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Edit module
• Click “Edit” to open source code of the
HelloSharpen module in default
application associated with .py files
• If the source code is not opened
automatically then start an editor and
load the source code file: …\Desktop\Hello
\HelloPython\[Link]
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Implement Module GUI (Part 1)
class HelloSharpenWidget(ScriptedLoadableModuleWidget):
…
[Link]( "Pick the output to the algorithm." )
[Link]("Output Volume: ", [Link])
#
# threshold value
#
[Link] = [Link]()
Remove [Link] = 0.1
X
[Link] = -100
unneeded [Link] = 100
[Link] = 0.5
slider and [Link]("Set threshold value for computing the
output image. Voxels that have intensities lower than this value will set to zero.")
checkbox [Link]("Image threshold", [Link])
(same as for #
# check box to trigger taking screen shots for later use in tutorials
HelloLaplace #
[Link] = [Link]()
module) [Link] = 0
[Link]("If checked, take screen shots for
tutorials. Use Save Data to write them to disk.")
[Link]("Enable Screenshots",
[Link])
#
# Apply Button
#
[Link] = [Link]("Apply")
…
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Implement Module GUI (Part 2)
class HelloSharpenWidget(ScriptedLoadableModuleWidget):
…
def onSelect(self):
[Link] =
[Link]() and
[Link]()
Update Apply def onApplyButton(self):
button event logic = HelloSharpenLogic()
handler [Link]([Link](),
[Link]())
(onApplyButton) # make the output volume appear in all the slice views
to only use input [Link](
background = [Link]())
and output
volumes #
# HelloSharpenLogic
#
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Implement Module Logic
class HelloSharpenLogic(ScriptedLoadableModuleLogic):
…
def run(self, inputVolume, outputVolume):
if not [Link](inputVolume, outputVolume):
return False
Update
processing [Link]('Processing started')
method to # Compute Laplacian by scripted module
import HelloLaplace
compute output laplaceLogic = [Link]()
by using success = [Link](inputVolume, outputVolume)
if not success:
HelloLaplace return False
module and # Subtract Laplacian from input volume using CLI module
SubtractVolumes parameters = {}
parameters['inputVolume1'] = [Link]()
CLI module. parameters['inputVolume2'] = [Link]()
parameters['outputVolume'] = [Link]()
[Link]([Link], None,
parameters)
[Link]('Processing completed')
return True
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
In More Detail
• [Link] gives access to Command Line
Interface (CLI) modules
• CLI modules allow packaging of arbitrary C++
code (oNen ITK-based) into slicer with
automa:cally generated GUI and python
wrapping
• Note: if only ITK filters needed, they can be
accessed directly from Python, using
SimpleITK
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Run module
1. Note that Input Volume combobox
autoselected new volume
2. Create new volume for output
3. Run the module
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Output of HelloSharpen
Result of Laplacian
Sharpening Operator on
spgr volume
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Adjus:ng output display
Adjust Window/Level with
Left-Mouse-Drag in Slice
Window
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Improve Module Logic
Set output volume’s window/level automatically,
by copying the input volume’s window/level.
class HelloSharpenLogic(ScriptedLoadableModuleLogic):
…
def run(self, inputVolume, outputVolume):
…
[Link]([Link], None,
parameters)
# Copy window/level (brightness/contrast) setting to output
inputDisplay = [Link]()
outputDisplay = [Link]()
[Link](False)
[Link]([Link]())
[Link]([Link]())
[Link]('Processing completed')
return True
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Image Sharpening Results
original Laplacian Sharpen
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Going Further
• Review scripted modules in Slicer for more
examples
hdps://[Link]/Slicer/Slicer/tree/master/Modules/Scripted
• Explore numpy for numerical array
manipula:on
[Link]
• Explore SimpleITK for image processing
using ITK
hdps://[Link]/SimpleITKDoxygen/html/[Link]
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Conclusion
This course demonstrated how to
program custom behavior in Slicer
with Python
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017
Acknowledgments
National Alliance for Medical Image
Computing
NIH U54EB005149
Neuroimage Analysis Center
NIH P41RR013218
Sidong Liu and Fan Zhang, The University of Sydney
Andras Lasso, PerkLab, Queen’s University
[Link], Ph.D. - [Link], Ph.D.
NA-MIC ARR 2012-2017