Top Banner
NA-MIC National Alliance for Medical Image Computing http://na-mic.org IGT Software Design and Process Bill Lorensen GE Research
27

NA-MIC National Alliance for Medical Image Computing IGT Software Design and Process Bill Lorensen GE Research.

Dec 25, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: NA-MIC National Alliance for Medical Image Computing  IGT Software Design and Process Bill Lorensen GE Research.

NA-MICNational Alliance for Medical Image Computing http://na-mic.org

IGTSoftware Design and Process

Bill Lorensen

GE Research

Page 2: NA-MIC National Alliance for Medical Image Computing  IGT Software Design and Process Bill Lorensen GE Research.

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

Outline

• Background• Design Principles• Software Process• Challenges

Page 3: NA-MIC National Alliance for Medical Image Computing  IGT Software Design and Process Bill Lorensen GE Research.

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

Open Source Menu for Success

• A Community with a common vision• A pool of talented and motivated

developers/scientists• A mix of academic and commercial• An organized, light weight approach to

software development• A leadership structure• Communication• A business model

Page 4: NA-MIC National Alliance for Medical Image Computing  IGT Software Design and Process Bill Lorensen GE Research.

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

Guiding Principles

• Open is good

• Proprietary is bad

• Reuse is good

• NIH* is bad

• Modularity is good

• Monolithic is bad

*Not invented here

Page 5: NA-MIC National Alliance for Medical Image Computing  IGT Software Design and Process Bill Lorensen GE Research.

NA-MICNational Alliance for Medical Image Computing http://na-mic.org

Design Principles

Page 6: NA-MIC National Alliance for Medical Image Computing  IGT Software Design and Process Bill Lorensen GE Research.

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

Toolkits and Libraries

• Visualization - VTK

• Segmentation/Registration - ITK

• State machines – IGSTK

• UI – KWWidgets, ??

• Tracking – OpenTracker, ??

• DICOM – dcmtk, gdcm

• File I/O – nrrd, meta, pnglib, …

Page 7: NA-MIC National Alliance for Medical Image Computing  IGT Software Design and Process Bill Lorensen GE Research.

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

Object-Oriented Design

• Dominated software systems throughout the 1990’s

• Continues to be the accepted software design technique

• Particularly useful for dealing with complexity• Provides programmatic abstractions to deal

with generalization and encapsulation• C++ and Java have mechanisms to support

OOD

Page 8: NA-MIC National Alliance for Medical Image Computing  IGT Software Design and Process Bill Lorensen GE Research.

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

Generic Programming

• Organize libraries consisting of generic—or reusable—software components.

• The essential ideas of generic programming are containers to hold data, iterators to access the data, and generic algorithms that use containers and iterators to create efficient, fundamental algorithms.

• ITK uses generic programming to process n-dimensional “images”.

Page 9: NA-MIC National Alliance for Medical Image Computing  IGT Software Design and Process Bill Lorensen GE Research.

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

Design Patterns

• Good object-oriented software systems have recurring designs (patterns) that occur frequently

• ITK employs a number of powerful design patterns– object factories– command/observer– smart pointer memory management

Page 10: NA-MIC National Alliance for Medical Image Computing  IGT Software Design and Process Bill Lorensen GE Research.

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

Frameworks

• Define how a group of participants can be put together to solve a particular task.

• Particularly suitable for describing complex flows or algorithms that have a number of steps that can be varied

• ITK Frameworks– A demand-driven data processing pipeline

that connects algorithms to process n-dimensional image data

– Registration framework– Level-set framework

Page 11: NA-MIC National Alliance for Medical Image Computing  IGT Software Design and Process Bill Lorensen GE Research.

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

Separation of Algorithms from Interfaces

• Implement the algorithms with a clear separation from the applications and especially the user interfaces.

• Uses the Command/Observer design pattern that permits applications to watch for significant events during the execution of an algorithm

• ITK has no built-in visualization, but has been interfaced to several systems including 3D Slicer, Analyze, SciRun and Volview.

Page 12: NA-MIC National Alliance for Medical Image Computing  IGT Software Design and Process Bill Lorensen GE Research.

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

Slicer 3 Execution Model: Goals

• Provide interface to batch programs– Simplify and unify command line

processing• Auto generate C++ command line

processing

– Simplify and unify GUI• Auto generate GUI

Page 13: NA-MIC National Alliance for Medical Image Computing  IGT Software Design and Process Bill Lorensen GE Research.

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

UserDesktop

Slicer 3.0

Algorithms ITK VTK SlicerModules

VTK AppsUsing ITK

Scripts ofSlicer Mods

BatchPrograms

Non-NAMICCmd tools

LONIPipeline

Birn GridData/Compute

Slicer 3.0

Page 14: NA-MIC National Alliance for Medical Image Computing  IGT Software Design and Process Bill Lorensen GE Research.

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

Execution Model: Plugins

• XML Interface Description– Describes command line options– Describes suggestions for GUI

• GenerateCLP– Generates C++ command line

processing code from XML– Reports XML description

Page 15: NA-MIC National Alliance for Medical Image Computing  IGT Software Design and Process Bill Lorensen GE Research.

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

Program Flow

UserDesktopprog.xml GenerateCLP progCLP.h

SlicerModules

prog.cxx

Non-NAMICCmd tools

LONIPipeline

Birn GridData/Compute

Slicer 3.0

Page 16: NA-MIC National Alliance for Medical Image Computing  IGT Software Design and Process Bill Lorensen GE Research.

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

Resample --xml<?xml version="1.0" encoding="utf-8"?><executable> <category>filtering</category> <title>Resample Volume</title> <description>Resamples a volume</description> <version>1.0</version> <documentationurl></documentationurl> <license></license> <contributor>Bill Lorensen</contributor> <parameters> <label>Resampling Parameters</label> <description>Parameters used for resampling</description> <float-vector> <name>outputPixelSpacing</name> <flag>-s</flag> <longflag>--spacing</longflag> <description>Spacing along each dimension (0 means use

input spacing)</description> <label>Spacing</label> <default>0,0,0</default> </float-vector> </parameters>

<label>IO</label> <description>Input/output parameters</description> <image> <name>InputVolume</name> <label>input Volume</label> <channel>input</channel> <index>0</index> <description>Input volume to be

resampled</description> </image> <image> <name>OutputVolume</name> <label>Output Volume</label> <channel>output</channel> <index>1</index> <description>Resampled Volume</description> </image> </parameters></executable>

Page 17: NA-MIC National Alliance for Medical Image Computing  IGT Software Design and Process Bill Lorensen GE Research.

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

Resample.cxx

.

.

.#include “ResampleCLP.h”

Main (int argc, char *argv[]){ PARSE_ARGS; algorithm code}

Page 18: NA-MIC National Alliance for Medical Image Computing  IGT Software Design and Process Bill Lorensen GE Research.

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

Resample --helpUSAGE: ResampleVolume [--xml] [--echo] [-s <std::vector<float>>]

[--] [--version] [-h] <std::string> <std::string>Where: --xml Produce xml description of command line arguments (default: 0) --echo Echo the command line arguments (default: 0) -s <std::vector<float>>, --spacing <std::vector<float>> Spacing along each dimension (0 means use input spacing) (default: 0,0,0) --, --ignore_rest Ignores the rest of the labeled arguments following this flag. --version Displays version information and exits. -h, --help Displays usage information and exits. <std::string> (required) Input volume to be resampled (default: None) <std::string> (required) Resampled Volume (default: None)

Resamples a volume

Page 19: NA-MIC National Alliance for Medical Image Computing  IGT Software Design and Process Bill Lorensen GE Research.

NA-MICNational Alliance for Medical Image Computing http://na-mic.org

Software Process

Page 20: NA-MIC National Alliance for Medical Image Computing  IGT Software Design and Process Bill Lorensen GE Research.

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

NA-MIC Rhythms

• Yearly All-Hands Meeting

• Bi-annual Programmers’ Week

• Weekly Engineering T-Cons

• Nightly Build/Test– ITK– VTK– Slicer

Page 21: NA-MIC National Alliance for Medical Image Computing  IGT Software Design and Process Bill Lorensen GE Research.

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

NA-MIC Tools

• CMake– Cross-platform build

• Dart 2– Build/Test server

• CTest– Build/Test client

• Cpack– Packaging and Distribution

• Media Wiki– Reporting/discussion forum

• POTS– T-cons

Page 22: NA-MIC National Alliance for Medical Image Computing  IGT Software Design and Process Bill Lorensen GE Research.

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

How DART Enables Collaboration

CVSSVN

Results posted on web(the dashboard)

CVS/SVN maintainssource code

revisions DART compilessource code, runs tests

Developers review results

Developers check-in code

Page 23: NA-MIC National Alliance for Medical Image Computing  IGT Software Design and Process Bill Lorensen GE Research.

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

Dart

Dart

Page 24: NA-MIC National Alliance for Medical Image Computing  IGT Software Design and Process Bill Lorensen GE Research.

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

Page 25: NA-MIC National Alliance for Medical Image Computing  IGT Software Design and Process Bill Lorensen GE Research.

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

Multi-Platform Builds

Page 26: NA-MIC National Alliance for Medical Image Computing  IGT Software Design and Process Bill Lorensen GE Research.

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

IGT Challenges

• Define an architecture tailored to IGT requirements

• Leverage existing toolkits

• Fill in toolkit gaps

Page 27: NA-MIC National Alliance for Medical Image Computing  IGT Software Design and Process Bill Lorensen GE Research.

NA-MICNational Alliance for Medical Image Computing http://na-mic.org

IGTSoftware Design and Process

Bill Lorensen

GE Research