This work by John Galeotti and Damion Shelton was made possible in part by NIH NLM contract# HHSN276201000580P, and is licensed under a Creative Commons.

Slides:



Advertisements
Similar presentations
ITK-Overview Insight Software Consortium. What is ITK Image Processing Segmentation Registration No Graphical User Interface (GUI) No Visualization.
Advertisements

Configuration management
Configuration management
1 Welcome to the Insight Toolkit! ITK Lecture 1 - Getting Started Methods in Image Analysis CMU Robotics Institute U. Pitt Bioengineering 2630 Spring.
This work by John Galeotti and Damion Shelton, © , was made possible in part by NIH NLM contract# HHSN P, and is licensed under a Creative.
Lecture 3 Getting Started with ITK!. Goals for this lecture Learn how to use Cmake Build ITK Example programs that use ITK.
This work by John Galeotti and Damion Shelton, © , was made possible in part by NIH NLM contract# HHSN P, and is licensed under a Creative.
This work by John Galeotti and Damion Shelton, © , was made possible in part by NIH NLM contract# HHSN P, and is licensed under a Creative.
MC365 Ant. Today We Will Cover: Overview of Ant Installing Ant Using the Ant command line tool Various Ant commands available Using Ant in Eclipse.
Using subversion COMP 2400 Prof. Chris GauthierDickey.
Version Control Systems Phil Pratt-Szeliga Fall 2010.
CVS II: Parallelizing Software Development Author: Brian Berliner John Tully.
Guide To UNIX Using Linux Third Edition
Installing geant4 v9.5 using Windows Daniel Brandt, 06 April 2012 Installing Geant4 v9.5 for Windows A step-by-step guide for Windows XP/Vista/7 using.
The content of these slides by John Galeotti, © 2008 to 2015 Carnegie Mellon University (CMU), was made possible in part by NIH NLM contract# HHSN P,
ITK Lecture 12: Open Source & Cross Platform Software Development Methods in Image Analysis CMU Robotics Institute U. Pitt Bioengineering 2630 Spring.
Cap 333 Network Administration. Grades  20 marks distributed on  Assignments / Project Activities Individual Pairs  1 or 2 tutorial quizzes.
The Project AH Computing. Functional Requirements  What the product must do!  Examples attractive welcome screen all options available as clickable.
CS190/295 Programming in Python for Life Sciences: Lecture 1 Instructor: Xiaohui Xie University of California, Irvine.
1 Introduction to Tool chains. 2 Tool chain for the Sitara Family (but it is true for other ARM based devices as well) A tool chain is a collection of.
This chapter is extracted from Sommerville’s slides. Text book chapter
Version Control with Subversion. What is Version Control Good For? Maintaining project/file history - so you don’t have to worry about it Managing collaboration.
Fall CIS 764 Database Systems Engineering L3: Two Assignments Relating to J2EE.
CS110/CS119 Introduction to Computing (Java)
The content of these slides by John Galeotti, © Carnegie Mellon University (CMU), was made possible in part by NIH NLM contract# HHSN P,
The content of these slides by John Galeotti, © Carnegie Mellon University (CMU), was made possible in part by NIH NLM contract# HHSN P,
Moodle (Course Management Systems). Assignments 1 Assignments are a refreshingly simple method for collecting student work. They are a simple and flexible.
Instructor: Tina Tian. About me Office: RLC 203A Office Hours: Wednesday 1:30 - 4:30 PM or .
C O M P U T E R G R A P H I C S Jie chen Computer graphic -- OpenGL Howto.
Object-Oriented Software Engineering Using UNIX groups and Subversion Estimated Time: minutes “Unix is user-friendly. It's just very selective about.
Object-Oriented Software Engineering Using UNIX groups and CVS Estimated Time: minutes.
SharePoint document libraries I: Introduction to sharing files Sharjah Higher Colleges of Technology presents:
Python From the book “Think Python”
Just as there are many human languages, there are many computer programming languages that can be used to develop software. Some are named after people,
Copyright © 2015 – Curt Hill Version Control Systems Why use? What systems? What functions?
Computer Science and Engineering The Ohio State University  Widely used, especially in the opensource community, to track all changes to a project and.
Getting Started with MATLAB 1. Fundamentals of MATLAB 2. Different Windows of MATLAB 1.
Guide to Programming with Python Chapter One Getting Started: The Game Over Program.
Robert Crawford, MBA West Middle School.  Explain how the binary system is used by computers.  Describe how software is written and translated  Summarize.
Cap 333 Network Administration. Grades  20 marks distributed on  Assignments / Project Activities Individual Pairs  1 or 2 tutorial quizzes.
Installing CompuCell3D from source. Why you might want to install from source? 1.There are no binaries for your platform (e.g. gentoo linux) 2.You want.
240-Current Research Easily Extensible Systems, Octave, Input Formats, SOA.
C++ and Ubuntu Linux Review and Practice CS 244 Brent M. Dingle, Ph.D. Game Design and Development Program Department of Mathematics, Statistics, and.
The content of these slides by John Galeotti, © Carnegie Mellon University (CMU), was made possible in part by NIH NLM contract# HHSN P,
Module 1 – Lesson 6 Ms. Tracy. Bell Ringer What is the typical useful life for a personal computer?
1 Chapter 12 Configuration management This chapter is extracted from Sommerville’s slides. Text book chapter 29 1.
Version Control and SVN ECE 297. Why Do We Need Version Control?
Build Tools 1. Building a program for a large project is usually managed by a build tool that controls the various steps involved. These steps may include:
OPERATING SYSTEMS (OS) By the end of this lesson you will be able to explain: 1. What an OS is 2. The relationship between the OS & application programs.
Chapter 2 Build Your First Project A Step-by-Step Approach 2 Exploring Microsoft Visual Basic 6.0 Copyright © 1999 Prentice-Hall, Inc. By Carlotta Eaton.
Subversion Subversion is a brand of version control software that is frequently used to store the code and documentation of a project so as to permit.
Development Environment
CSC207 Fall 2016.
Version Control with Subversion
A Simple Introduction to Git: a distributed version-control system
Adding Assignments and Learning Units to Your TSS Course
Lecture 4 Getting Started with ITK!
Prepared by Kimberly Sayre and Jinbo Bi
slides borrowed and adapted from Alex Mariakis and CSE 390a
CS190/295 Programming in Python for Life Sciences: Lecture 1
Design and Programming
Final Project Details Note: To print these slides in grayscale (e.g., on a laser printer), first change the Theme Background to “Style 1” (i.e., dark.
ITK-Overview Insight Software Consortium.
Inside a PMI Online Course
Lecture 4 Getting Started with ITK!
CSCE 206 Lab Structured Programming in C
Review of Previous Lesson
Wireless Networks for 4G/5G Getting started with ns-3
Presentation transcript:

This work by John Galeotti and Damion Shelton was made possible in part by NIH NLM contract# HHSN P, and is licensed under a Creative Commons Attribution 3.0 Unported License. To view a copy of this license, visit or send a letter to Creative Commons, 171 2nd Street, Suite 300, San Francisco, California, 94105, USA. Permissions beyond the scope of this license may be available by ing Commons Attribution 3.0 Unported License The most recent version of these slides may be accessed online via Lecture 4 Getting Started with ITK! Methods in Medical Image Analysis - Spring 2012 BioE 2630 (Pitt) : (CMU RI) (CMU ECE) : (CMU BME) Dr. John Galeotti Based in part on Shelton’s slides from

Goals for this lecture  Compile, compile, compile  Learn how to use SVN & CMake  Build ITK  Compile several programs that use ITK  Find documentation online  Learn the quirks (if any) of the system you choose to use 2

Getting help  your TA  Do this sooner rather than later!  Vikas R.S.   your instructor  Join the insight-users mailing list; instructions are at 3

Assignments  Collaboration is encouraged; unless told otherwise, feel free to discuss assignments with other students  But… please submit your own code - don’t copy and paste stuff from friends  More so than other classes, you will be learning techniques that translate directly to the real world - don’t cheat yourself 4

Grading of assignments  Grading criteria:  Does it accomplish the specified task?  Is it well commented? Follow the “6 month rule” - if you leave for 6 months, you should be able to pick up where you left off.  Many/most assignments will be divided into sections, with each section pass-fail.  We may give opportunities to fix “stupid” problems before final judgment is passed 5

Assignments, cont.  Please interpret due dates as absolute, unless told otherwise  Really  We’re happy to spend time helping you debug code, but not at 11 pm the day before the assignment is due 6

Computer requirements: recommended  Your own computer is preferable  Cluster machines should also work  Please be aware that ITK can consume a lot of disk space during the build process  Windows, Visual Studio 2010, Python 2.7  We aren’t trying to force everyone to use this, but…  This is what the grader will be primarily using.  On a Mac? Consider Parallels or VMware Fusion  Run Linux? Consider VMware Workstation 7

Alternative usable computer configurations  Any platform supported by ITK (Mac, Linux, etc.)  If there are problems, you will have to work with the grader to get your code working on their machine.  Try having the TA or grader check your code before it is due.  If the grader’s computer can’t run your code, you will have a short (but reasonable) period of time to fix it after he s you that your code appears broken (along with what errors he got).  If you are trying to make things work, but have many things to “fix,” then more time may be granted.  For final projects, we may decide to let you show the TA your code running on your own machine, on a case-by-case basis. 8

What is ITK?  To clarify, ITK is a toolkit  It doesn’t “do” anything  You can’t “run” it  There isn’t an itk.exe file  Typically, you use ITK in conjunction with other toolkits to handle visualization and GUI interaction 9

So, what’s it good for?  ITK code is easy to add to existing C++ code  Also Python, Java, …  It provides a variety of flexible data containers, and ways of processing / analyzing them  You can do a lot in only a few lines of code  Once you get used to it, it’s easy to use (gasp!) 10

What we assume you can do  Understand C++ and/or Python syntax  Standard flow control such as for, do, calling functions, etc.  Classes  Inheritance  For C++: Pointers, dereferencing, passing by reference  Work comfortably in the operating system of your choice, using the compiler or Python environment of your choice 11

You may have not …  Used revision control using SVN (or CVS)  Engaged in collaborative programming  Written C++ code that builds on multiple platforms  Used cross-platform make software  (CMake or Jam, for example)  Designed software using a data-flow architecture, worried about smart pointers, etc. 12

Revision control with SVN  Revision control software allows you to store incremental changes to software  You will be expected to use SVN to manage your homework assignments  SVN is like CVS, but better  I encourage you to use revision control on your code outside of this class as well - it’s a good habit to develop 13

SVN terms  Server - what it sounds like  Module - a group of files that can be accessed on the server  User - each module has associated users, with varying levels of access (read only, read/write, etc.). 14

SVN terms, cont.  Checkout - Download a fresh copy of a module from the server to your computer  Update - Sync your copy of a module with the server copy; much faster than a checkout  Commit - Merge changes made to your local copy with the server 15

SVN setup  The SVN server for this course will be:   You will each have a module, based on your ; you will get about this in a week or two.  Only you and the instructors will have access to this module 16

SVN setup, cont.  GUI wrappers for SVN  Windows: Tortoise SVN   Mac: svnX  ls/svnx.html  Windows, Mac, Linux, etc: RapidSVN   Command line works fine too, but may be more awkward if you’re used to GUI’s 17

Cross platform (C++) development  ITK builds on a large combination of operating systems and platforms  For C++, each compiler has it’s own input format: Makefiles, workspaces, etc.  Q: How can you possibly coordinate builds on different platforms? 18

The answer: CMake  Cross platform tool to manage the build process  Simplifies the build process  Auto-configuration  Easy access to external libraries  Used by several other open source projects 19

CMake is:  Required to build native (C++) ITK  Cross-platform project generator  Often simpler than particular environments  Text as input  Project file as output: 20

How CMake runs  Write a CMakeLists.txt file describing your project in CMake’s language  Run CMake to generate an appropriate makefile/project/workspace for your compiler  Compile as you normally would 21

How CMake runs, cont.  This is not unlike the configure-make process you may be familiar with from various Unix systems  But… it works with many compilers  CMakeLists.txt files are easy to perform revision control on 22

CMakeLists.txt syntax  Comment lines indicated with #  Look at examples in ITK  Simple example: cmake_minimum_required(VERSION 2.4) #Make sure the user’s CMake is recent enough #Give this project a name: PROJECT(cool_demo) #The command-line executable “demo” #is built from “demo_code.cxx” and #must be linked with the ITK libraries ADD_EXECUTABLE(demo demo_code.cxx) TARGET_LINK_LIBRARIES(demo ${ITK_LIBRARIES}) 23

Steps to get started with ITK  Pay Attention  This is part of HW2 24

Step 0 – Don’t panic!  There is substantial documentation on everything I’m going to present here, and vastly more about things that we will never cover in this course  ml  Download a copy of the ITK Software Guide 25

Step 1 - Install CMake  Check if a recent version of CMake is already installed on your computer.  If not, …  Download and install a binary distribution of CMake from:  26

Step 2 - Install ITK  Check if ITK 4.0 is already installed on your computer.  If not, …  Download the latest version of InsightToolkit:   Extract, e.g., InsightToolkit zip to your working source directory for this class 27

In source vs. out source builds 28 Source Tree ITK Common Algorithms BasicFilter Numerics IO ITKb Common Algorithms BasicFilter Numerics IO Binary Tree Recommended ! Out Source Build In Source Build

Why use two trees?  Keeps your C++ source and binary code separate  Minimizes the amount of damage you can do to your SVN tree  ITK is found in the InsightToolkit folder  We suggest that you build it in a new folder you create named InsightBin 29

Configure - Easy Start  Run CMake  Select the SOURCE directory  Select the BINARY directory 30

Configure - Easy Start, cont. 31

Configure - Easy Start, cont.  Disable BUILD_EXAMPLES  Disable BUILD_TESTS  Disable BUILD_SHARED_LIBS 32

Configuring and Generating  Each time you change an option or options you may need to “configure” CMake again  If the generate option (“OK” under Windows) is not presented, you definitely need to hit configure again  If any of the options are highlighted in red, you need to reconfigure 33

 Open the ITK Visual Studio Solution file in the Binary Directory  Select Build  Build Solution  It will probably take somewhere between minutes, but your mileage may vary 34 Build ITK

Verify the Build Libraries will be found in: ITK_BINARY / bin / { Debug, Release} 35

Building with gcc  Order of operations is the same  Differences  Run the ccmake executable, which uses a curses TUI, the options are identical  Run make instead of Visual Studio  Think of CMake as replacing the “./configure” step you may be used to 36

Building with gcc cont. Start in directory containing InsightToolkit mkdir InsightBin cd InsightBin ccmake../InsightToolkit Edit CMake options Reconfigure if needed make 37

Now what?  At this point, you should have two things:  A directory containing a bunch of source code  E.g. …/MIIA/InsightToolkit-4.0.0/  A directory containing the built ITK libraries  E.g. …/MIIA/InsightBin  As mentioned earlier, you don’t have anything executable 38

Building an application  ITK comes with a simple application you can build in order to test the ITK libraries “out of source” (i.e. not built inside ITK)  It can be found in: InsightToolkit-4.0.0/Examples/Installation 39

How to build HelloWorld  Copy & rename the Installation directory somewhere outside of the Insight directory  Run CMake on HelloWorld  Remember the source/binary distinction and use HelloWorldBin as your build location  CMake should automatically find ITK  if not, edit the ITK_DIR option 40

How to build HelloWorld, cont.  Once CMake is happy, generate the makefile/project for your compiler  Build HelloWorld  Give it a try 41

More examples  You can turn on ITK’s Examples option in CMake, which will build all of the examples for you  Or… you can copy the examples out-of-source and build them like you did HelloWorld  These examples link into ITK Software Guide; read the chapter, poke the code and see what happens… 42

C++ Workflow thoughts You should get used to the idea of: 1.Writing some code 2.Writing a CMakeLists.txt file 3.Running CMake 4.Building your code 5.Rinse, repeat 43

An aside: how to use ITK with existing C/C++ applications  Your existing app may not use CMake  In this case, you need to link to the ITK libraries explicitly and include the appropriate source directories  This isn’t hard, but it may take some trial and error to discover everything you need  You don’t need to worry about this in the context of this class 44

ITK Documentation  Most of the ITK documentation is generated automatically from source comments using Doxygen  Please familiarize yourself with the various means of navigating the Doxygen documentation online, e.g. “Alphabetical List”:  45

Assignment 2 …  Is due in one week (next Thursday evening)  Recommend “doing” this lecture now  Specifically, install Cmake from part 1 and then do part 4 today.  Don’t procrastinate!  If you’re going to have compiler problems, they will show up early in the course, so don’t procrastinate this assignment. 46