Lecture 3 Getting Started with ITK!. Goals for this lecture Learn how to use Cmake Build ITK Example programs that use ITK.

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
Chapter 3: Editing and Debugging SAS Programs. Some useful tips of using Program Editor Add line number: In the Command Box, type num, enter. Save SAS.
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.
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.
Introduction To Java Objectives For Today â Introduction To Java â The Java Platform & The (JVM) Java Virtual Machine â Core Java (API) Application Programming.
Assembly 01. Outline Binary vs. Text Files Compiler vs. Assembler Mnemonic Assembly Process Development Process Debugging Example 1 this analogy will.
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.
Documentation Generators: Internals of Doxygen John Tully.
© by Pearson Education, Inc. All Rights Reserved.
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.
1 Real-Time System Design Developing a Cross Compiler and libraries for a target system.
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.
ITK Lecture 12: Open Source & Cross Platform Software Development Methods in Image Analysis CMU Robotics Institute U. Pitt Bioengineering 2630 Spring.
How to install CGAL Yuanzhen Wang. What is CGAL Computational Geometry Algorithms Library “Provide easy access to efficient and reliable geometric algorithms.
Introduction to The Linaro Toolchain Embedded Processors Training Multicore Software Applications Literature Number: SPRPXXX 1.
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
Software Process, CMake, Dashboards, CPack Bill Hoffman Kitware, Inc.
Lesson 4 Computer Software
Linux Operations and Administration
Fall CIS 764 Database Systems Engineering L3: Two Assignments Relating to J2EE.
11 Getting Started with C# Chapter Objectives You will be able to: 1. Say in general terms how C# differs from C. 2. Create, compile, and run a.
CS Tutorial 1 Getting Started with Visual Studio 2012 (Visual Studio 2010 are no longer available on MSDNAA, please choose Visual Studio 2012 which.
 To explain the importance of software configuration management (CM)  To describe key CM activities namely CM planning, change management, version management.
E-Commerce: Introduction to Web Development 1 Dr. Lawrence West, Management Dept., University of Central Florida Topics What is a Web.
Software Engineering in Robotics Packaging and Deployment of Systems Henrik I. Christensen –
C O M P U T E R G R A P H I C S Jie chen Computer graphic -- OpenGL Howto.
How to Install ITK ? (Insight Segmentation and Registration Toolkit) Prepared by: Hussain Rahman MS (CS) 1 st semester Supervised.
Makefiles. makefiles Problem: You are working on one part of a large programming project (e. g., MS Word).  It consists of hundreds of individual.cpp.
Lecture Set 2 Part B – Configuring Visual Studio; Configuration Options and The Help System (scan quickly for future reference)
Lecture Set 1 Part C: Understanding Visual Studio and.NET – Applications, Solutions, Projects (no longer used – embedded in Lecture Set 2A)
(1) A Beginner’s Quick Start to SIMICS. (2) Disclaimer This is a quick start document to help users get set up quickly Does not replace the user guide.
Python From the book “Think Python”
IDEs Department of Information Systems and Computer Science Ateneo de Manila University.
Computer Science I How to Configure Visual Studio.NET 2003 for C++ Colin Goble.
Lecture Set 2 Part A: Creating an Application with Visual Studio – Solutions, Projects, Files.
FLUKA GUI Status FLUKA Meeting CERN, 10/7/2006.
Installing CompuCell3D from source Maciej Swat Biocomplexity Institute, Indiana University.
NA-MIC National Alliance for Medical Image Computing Slicer Building and Deployment Steve Pieper, PhD.
CMake refactoring P. Hristov 19/03/2014. History I  Recursive makefiles (F.Carminati):  Problems in dependencies  Slow  "Recursive Makefiles.
Programming with Visual C++ A short review of the process.
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.
Programming with Visual Studio 2005.NET A short review of the process.
 Linux Mint is a computer operating system designed to work on most modern systems, including typical x86 and x64 PC’s. Linux Mint can be thought of.
1 Chapter 12 Configuration management This chapter is extracted from Sommerville’s slides. Text book chapter 29 1.
Lecture Set 2 Part A: Creating an Application with Visual Studio – Solutions, Projects, Files 8/10/ :35 PM.
1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.
SPI NIGHTLIES Alex Hodgkins. SPI nightlies  Build and test various software projects each night  Provide a nightlies summary page that displays all.
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:
How to configure, build and install Trilinos November 2, :30-9:30 a.m. Jim Willenbring.
Ravi Mathur January 8,  What does CMake NOT do? ◦ Doesn’t compile (gcc, MSVC, llvm, make) ◦ Doesn’t manage source code (XCode, Visual Studio) ◦
 CSC 215 : Procedural Programming with C C Compilers.
CMake: Experience in ALICE P. Hristov 19/06/12. History I Recursive makefiles (F.Carminati): – Problems in dependencies – Slow "Recursive Makefiles.
CMake - Cross-Platform Make R. Douglas Barbieri Made to Order Software Corporation.
Development Environment
Lecture 4 Getting Started with ITK!
CMPE 152: Compiler Design ANTLR 4 and C++
CSC235 - Visual Studio Getting Started.
Using Visual Studio and VS Code for Embedded C/C++ Development
ITK-Overview Insight Software Consortium.
Microsoft Connect /17/2019 9:04 AM
Download and Installation of code::blocks
Lecture 4 Getting Started with ITK!
CSCE 206 Lab Structured Programming in C
Review of Previous Lesson
Presentation transcript:

Lecture 3 Getting Started with ITK!

Goals for this lecture Learn how to use Cmake Build ITK Example programs that use ITK

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

So, what’s it good for? ITK code is easy to add to existing C++ code 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

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

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

CMake is: Cross-platform project generator Often simpler than particular environments Text as input Project file as output – Windows: Visual Studio Solution – UNIX: Makefile – Mac OS X: Makefile or XCode project

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

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

CMakeLists.txt syntax Comment lines indicated with # Simple example: #Give this project a name: PROJECT(cool_demo) #The command-line executable “demo” #is built from “demo_code.cxx” ADD_EXECUTABLE(demo demo_code.cxx) TARGET_LINK_LIBRARIES(cool_demo ITKCommon)

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: 

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

In source vs. out source builds

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

Configure - Easy Start Run Cmake Select the SOURCE directory Select the BINARY directory

Configure - Easy Start, cont.

Disable BUILD_EXAMPLES Disable BUILD_TESTS Disable BUILD_SHARED_LIBS

Configure - Easy Start, cont.

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

Build ITK Open the ITK Visual Studio Solution file in the Binary Directory Select Build→Build Solution It will probably take somewhere between 20 – 40 minutes, but your mileage may vary

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

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

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

Now what? At this point, you should have two things: A directory containing a bunch of source code (e.g. ~/InsightToolkit /) A directory containing the built ITK libraries (e.g. ~/InsightBin) As mentioned earlier, you don’t have anything executable

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 /Examples/Installation

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

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

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

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

An aside: how to use ITK with existing applications Your app probably does 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

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 tml