Core 1b – Engineering Dynamic Coding a.k.a. Python in Slicer

Slides:



Advertisements
Similar presentations
NA-MIC National Alliance for Medical Image Computing 3D Slicer Qt Port & qCTKWidgets Steve Pieper, Ph.D.
Advertisements

How to enter the world of Python Programming for ArcGIS Or, a funny thing happened on the way from an ESRI conference By Katherine Paybins WVAGP Membership.
NA-MIC National Alliance for Medical Image Computing 3D Slicer Version 4 Architecture and Status Steve Pieper, Ph.D.
1 Generic logging layer for the distributed computing by Gene Van Buren Valeri Fine Jerome Lauret.
FlexJS™ Flex™ For JavaScript Seattle Web App Developers Meetup January 15, 2015 Alex Harui Apache FlexJS, Apache Flex, FlexJS and Flex are are either registered.
NA-MIC National Alliance for Medical Image Computing Slicer3 and Slicer4 Steve Pieper, PhD Chief Architect for 3D Slicer Engineering.
NA-MIC National Alliance for Medical Image Computing 3D Slicer Interactive Modules Steve Pieper, PhD.
Programming Creating programs that run on your PC
Chapter 3.2 C++, Java, and Scripting Languages hacked by jeffery.
Chapter 10 Application Development. Chapter Goals Describe the application development process and the role of methodologies, models and tools Compare.
CSC 2720 Building Web Applications JavaScript. Introduction  JavaScript is a scripting language most often used for client-side web development.  JavaScript.
Chapter 13 Web Application Infrastructure. Objectives Explain the components and purpose of a web application platform Describe several common webapp.
NA-MIC National Alliance for Medical Image Computing Slicer4 Guided Tour Steve Pieper, Ph.D.
© 2006 by IBM 1 How to use Eclipse to Build Rich Internet Applications With PHP and AJAX Phil Berkland IBM Software Group Emerging.
Python Introduction.
NA-MIC National Alliance for Medical Image Computing Slicer Custom Modules Steve Pieper, PhD.
NA-MIC National Alliance for Medical Image Computing Core 1b – Engineering End-user Platform Steve Pieper Isomics, Inc.
NA-MIC National Alliance for Medical Image Computing Core 1b – Engineering End-user Platform Steve Pieper Isomics, Inc.
Windows.Net Programming Series Preview. Course Schedule CourseDate Microsoft.Net Fundamentals 01/13/2014 Microsoft Windows/Web Fundamentals 01/20/2014.
Chapter Languages, Programming and Architecture.
Program development & programming languages Chapter 13.
Lecture 8 – Platform as a Service. Introduction We have discussed the SPI model of Cloud Computing – IaaS – PaaS – SaaS.
NA-MIC National Alliance for Medical Image Computing NAMIC-Kit Update Will Schroeder Jim Miller Bill Lorensen.
CSCI 224 Introduction to Java Programming. Course Objectives  Learn the Java programming language: Syntax, Idioms Patterns, Styles  Become comfortable.
Tools and software process for the FLP prototype B. von Haller 9. June 2015 CERN.
Lesley Bross, August 29, 2010 ArcGIS 10 add-in glossary.
NA-MIC National Alliance for Medical Image Computing NA-MIC Software Engineering Bill Lorensen GE Research NA-MIC Engineering Core PI.
NA-MIC National Alliance for Medical Image Computing Why NITRC Matters to NA-MIC Steve Pieper, PhD.
October 5, 2015 Pretty Programming and Packaging with Python Fedor Baart, Genna Donchyts, Hessel Winsemius Slides and course material will be made available.
K. Harrison CERN, 20th April 2004 AJDL interface and LCG submission - Overview of AJDL - Using AJDL from Python - LCG submission.
NA-MIC National Alliance for Medical Image Computing Slicer4 CLI Slicer Execution Model.
NA-MIC National Alliance for Medical Image Computing Core 1b – Engineering Highlights, Aims and Architecture Will Schroeder Kitware.
BLU-ICE and the Distributed Control System Constraints for Software Development Strategies Timothy M. McPhillips Stanford Synchrotron Radiation Laboratory.
1 3. Computing System Fundamentals 3.1 Language Translators.
Ch 1. A Python Q&A Session Spring Why do people use Python? Software quality Developer productivity Program portability Support libraries Component.
FLUKA GUI Status FLUKA Meeting CERN, 10/7/2006.
NA-MIC National Alliance for Medical Image Computing Slicer Building and Deployment Steve Pieper, PhD.
Guide to Programming with Python Chapter One Getting Started: The Game Over Program.
NA-MIC National Alliance for Medical Image Computing Core 1b – Engineering Software Process Stephen R. Aylward Kitware, Inc.
Chapter 0 Overview. Why you are here? Where will you go? What is this course for?
NA-MIC National Alliance for Medical Image Computing Core 1b – Engineering Components Jim Miller GE Research.
Report Sharp-Shooter is released in the following editions: 1) 2) 3) 4) 5) 6)
NA-MIC National Alliance for Medical Image Computing 3D Slicer and the NA-MIC Kit for IGT Research Steve Pieper, PhD NAC, SPL, NA-MIC,
David Lawrence 7/8/091Intro. to PHP -- David Lawrence.
NA-MIC National Alliance for Medical Image Computing Slicer 2010: Past, Present, and Future Steve Pieper, Ph.D.
Ch 1. A Python Q&A Session. Why do people use Python? Software Quality Developer productivity Program portability Support Libraries Component integration.
Neuroimage Analysis Center An NCRR National Resource Center NAC Engineering Core Steve Pieper, Core PI SPL; Isomics, Inc.
Chapter 3 JSP Overview. The Problem with Servlets processing the request and generating the response are both handled by a single servlet class Java programming.
NA-MIC National Alliance for Medical Image Computing 3D Slicer Modules and Extensions Steve Pieper, Ph.D.
NA-MIC National Alliance for Medical Image Computing Non-Interactive Tools Stephen Aylward, Kitware
NA-MIC National Alliance for Medical Image Computing Slicer 2010: Past, Present, and Future Steve Pieper, Ph.D.
NA-MIC National Alliance for Medical Image Computing Slicer3 Update
NA-MIC National Alliance for Medical Image Computing Slicer Progress in 2009 Steve Pieper, Ph.D.
Ganga/Dirac Data Management meeting October 2003 Gennady Kuznetsov Production Manager Tools and Ganga (New Architecture)
COMPARING CROSS-PLATFORM DEVELOPMENT APPROACHES FOR MOBILE APPLICATIONS Henning Heitkötter, Sebastian Hanschke and Tim A. Majchrzak Department of Information.
NA-MIC National Alliance for Medical Image Computing Core 1b – Engineering Data Management Daniel Marcus Washington University.
Environment & Education & More Dan Bothell. Overview Data Teaching Materials Environment Other ACT-R 5.0 and RPM issues.
Chapter 13 Web Application Infrastructure
Agenda:- DevOps Tools Chef Jenkins Puppet Apache Ant Apache Maven Logstash Docker New Relic Gradle Git.
3D Slicer module programming
Test Driven Development 1 November Agenda  What is TDD ?  Steps to start  Refactoring  TDD terminology  Benefits  JUnit  Mocktio  Continuous.
Core 1b – Engineering Data and Clinical Interface
GLAST Release Manager Automated code compilation via the Release Manager Navid Golpayegani, GSFC/SSAI Overview The Release Manager is a program responsible.
Prepared by Kimberly Sayre and Jinbo Bi
Top Reasons to Choose Angular. Angular is well known for developing robust and adaptable Single Page Applications (SPA). The Application structure is.
Do you know this browser?...
Introduction to MATLAB
Ron Kikinis, MD Professor of Radiology, Harvard Medical School
Simulation And Modeling
Introduction to JavaScript & jQuery
Presentation transcript:

Core 1b – Engineering Dynamic Coding a.k.a. Python in Slicer Steve Pieper Isomics, Inc.

Overview The Role of Dynamic Coding Practical Slicer Python Programming Python Examples and Resources Bonus Language

Typical Development Workflows Start Slicer Load Data Test Code Edit Code Compile Start Slicer Load Data Test Code Edit Code Reload C++ Python

Tradeoffs: C++ C++ Advantages C++ Negatives Access to the Compiler Templates Iterators Declared Typing Efficiency: Pointer Arithmetic / Iterators Symbolic Debugging C++ Negatives Verbosity Run-Time Rigidity Errors Often Fatal

Tradeoffs: Python Python Advantages Python Negatives Expressiveness: Less Code == Less Clutter Run-Time Flexibility Code Can be Redefined on the Fly Console Access to Program State Unified Coding / Testing / Debugging Python Negatives Incomplete Not all C/C++ APIs are Exposed Not an “Assembler Replacement” Asymmetric: Less Common to Expose Python APIs to C++ Code Size / Load Time Heavy Dependencies

Language Independent Truisms Bad Code is Bad Code Follow Good Design Examples: Qt Programming Is a Lot of Work Write Tests & Documentation; Support Your Code Consider Your Job, Colleagues, and Users Write Maintainable, Reusable Code Provide a Clean Interface (Ideally Pure Data - MRML) Don’t Sacrifice the User’s Interests for the Sake of Language Purity Try to Pick the Right Tool for the Job If There’s a Great Library, Use It. Always Consider the License Good: BSD, Apache 2.0, LGPL Bad: GPL, Proprietary, “Free for Academic”, Closed Source

Python Interaction Example b = qt.QPushButton('Toggle') b.connect('clicked()', toggle) b.show()

What’s Available in Python? Basically Everything VTK Pipelines Qt Interfaces via PythonQt SimpleITK (Work in Progress) MRML, Slicer Logic, Slicer GUI Modules Logics, CLIs But there are Limits Slicer Ships with Python 2.6 (not 2.7 or 3.x) Some Popular Python Libraries NOT Available in Distribution Scipy, matplotlib, iPython, PyOpenCL… Some Open Design Tradeoffs Reasonable People can Disagree on Best Implementation Choice for Any Given Task

Structure of a Scripted Module Logic Structure as a ‘Python Module’ for Import in Other ‘Slicer Modules’ No GUI Dependencies No QtGui or vtkRendering classes Widget Implements the Slicer Module GUI Package Components Reusable in Other Modules (Editor) Self Test Essential Component of Your Development Workflow Runable by End User on Their Installation Automatically a CTest

Examples and Resources DICOM Module Editor Module Editor Extensions DataProbe, LabelStatistics, Endoscopy… Diffusion Processing Wizard PET/CT Extension Self Tests RSNA 2012 Atlas Tests Python Programming Tutorial at slicer.org

Bonus Language: JavaScript! Arguably the Most Popular Language in 2012 (google it) You Probably Spend a Good Portion of Your Day Running JavaScript (GMail, github, …) JavaScript is a Great Language (XTK…) Qt (and therefore Slicer) Includes a Full WebKit Engine Like in Chrome and Safari HTML5/CSS/JavaScript: World Class Look & Feel Better WebKit in Qt5, Coming Soon (WebGL, …) Great JavaScript Libraries Work in Slicer jQuery, jQueryUI, d3js… Slicer 4.2 Usage in Slicer qMRMLChartView Implemented with jQPlot Extension Manager is a qWebView Remember the Programming Truisms…