The Pipeline. Lecture 17 ITK Pipeline. The pipeline idea. Image sources. Image to image filters. Input and output

Similar documents
Lecture 15 Active Shape Models

What are advanced filters? Lecture 19 Write Your Own ITK Filters, Part2. Different output size. Details, details. Changing the input requested region

Goals for this lecture. Lecture 4 Getting Started with ITK! Getting help. Assignments. Assignments, cont. Grading of assignments

Lecture 14 Shape. ch. 9, sec. 1-8, of Machine Vision by Wesley E. Snyder & Hairong Qi. Spring (CMU RI) : BioE 2630 (Pitt)

All images are degraded

Lecture 12 Level Sets & Parametric Transforms. sec & ch. 11 of Machine Vision by Wesley E. Snyder & Hairong Qi

2/7/18. For more info/gory detail. Lecture 8 Registration with ITK. Transform types. What is registration? Registration in ITK

Lecture 10 Segmentation, Part II (ch 8) Active Contours (Snakes) ch. 8 of Machine Vision by Wesley E. Snyder & Hairong Qi

Lecture 6 Linear Processing. ch. 5 of Machine Vision by Wesley E. Snyder & Hairong Qi. Spring (CMU RI) : BioE 2630 (Pitt)

Recap. Disclaimer. Goals for this lecture. C++ vs. Python. Reference & Review Material

Lecture 13 Theory of Registration. ch. 10 of Insight into Images edited by Terry Yoo, et al. Spring (CMU RI) : BioE 2630 (Pitt)

Registration: Rigid vs. Deformable

Separable Kernels and Edge Detection

Lecture 09 Segmentation (ch 8) ch. 8 of Machine Vision by Wesley E. Snyder & Hairong Qi. Dr. John Galeo3. Into connected regions

Most of the slides in this lecture are either from or adapted from slides provided by the authors of the textbook Computer Systems: A Programmer s

COSC 2P91. Bringing it all together... Week 4b. Brock University. Brock University (Week 4b) Bringing it all together... 1 / 22

Data Structures and Algorithms Dr. Naveen Garg Department of Computer Science and Engineering Indian Institute of Technology, Delhi.

CS1 Lecture 3 Jan. 22, 2018

COSC 2P91. Introduction Part Deux. Week 1b. Brock University. Brock University (Week 1b) Introduction Part Deux 1 / 14

CS251 Spring 2014 Lecture 7

CSE P567 - Winter 2010 Lab 1 Introduction to FGPA CAD Tools

Instruction-Level Parallelism Dynamic Branch Prediction. Reducing Branch Penalties

Promote ALEX with Postcards

Lecture (01) Getting started. Dr. Ahmed ElShafee

Welcome to Lab! Feel free to get started until we start talking! The lab document is located on the course website:

Image Registration Lecture 4: First Examples

Lecture 15: Segmentation (Edge Based, Hough Transform)

The Art and Science of Memory Allocation

CS1 Lecture 3 Jan. 18, 2019

Progress on G4 FDIRC Simulation. Doug Roberts University of Maryland

OPEN THE HOTLINE CLIENT

These are notes for the third lecture; if statements and loops.

Lecture 2: SML Basics

2/8/2017. SOP Form Gives Good Performance. ECE 120: Introduction to Computing. K-Maps Can Identify Single-Gate Functions

(Refer Slide Time 3:31)

} Evaluate the following expressions: 1. int x = 5 / 2 + 2; 2. int x = / 2; 3. int x = 5 / ; 4. double x = 5 / 2.

CS 112 Project Assignment: Visual Password

(Refer Slide Time 6:48)

Google Docs Tipsheet. ABEL Summer Institute 2009

Sixth lecture; classes, objects, reference operator.

Lecture 14: more class, C++ streams

Have you ever created a website?

Lab 2 Building on Linux

Introduction. A Brief Description of Our Journey

Remembering the Past. Who Needs Documentation?

Using Devices with Microsoft HealthVault

CS 248 Assignment 2 Polygon Scan Converter. CS248 Presented by Abe Davis Stanford University October 17, 2008

Interactive MATLAB use. Often, many steps are needed. Automated data processing is common in Earth science! only good if problem is simple

Announcements. No book chapter for this topic! Slides are posted online as usual Homework: Will be posted online Due 12/6

No book chapter for this topic! Slides are posted online as usual Homework: Will be posted online Due 12/6

Repetition Through Recursion

Lecture 7: Efficient Collections via Hashing

Lecture - 14 Transport Layer IV (Reliability)

Tracking Computer Vision Spring 2018, Lecture 24

CS1 Lecture 13 Feb. 13, 2019

Guide to B2B Marketing Part four : Effective reporting

Lecture note 7: Playing with convolutions in TensorFlow

An aside. Lecture 14: Last time

Google Tag Manager. Guide

9/10/2016. Time for Some Detailed Examples. ECE 120: Introduction to Computing. Let s See How This Loop Works. One Statement/Step at a Time

Google Tag Manager GUIDE. Total Completion Time Pros: 37 min 1hr 52 min Beginners: +4 hrs. blitzmetrics.com Google Tag Manager V2.

Welcome to Lab! You do not need to keep the same partner from last lab. We will come around checking your prelabs after we introduce the lab

Operator overloading

Computer Science 322 Operating Systems Mount Holyoke College Spring Topic Notes: C and Unix Overview

Project 1: Web Client and Server

CSE332: Data Abstractions Lecture 23: Programming with Locks and Critical Sections. Tyler Robison Summer 2010

Software Design and Analysis for Engineers

Lecture 4 CSE July 1992

(Refer Slide Time: 02:59)

USB Control Transfers with LUFA

Lecture 11. Demonstration #1. More Inheritance, More Constructors. Absolute C++ Chapter 15. Virtual Functions. Overriding

. Digital Marketing Agency Telephone: Parliament Street, Floor 3, Office 6, Liverpool, L8 5RN

WebGL and GLSL Basics. CS559 Fall 2015 Lecture 10 October 6, 2015

CS 161 Computer Security

This article will walk you through a few examples in which we use ASP to bring java classes together.

Type Checking in COOL (II) Lecture 10

A student was asked to point out interface elements in this code: Answer: cout. What is wrong?

File Systems. ECE 650 Systems Programming & Engineering Duke University, Spring 2018

(Refer Slide Time: 1:43)

CPE 101, reusing/mod slides from a UW course (used by permission) Lecture 5: Input and Output (I/O)

CS519: Computer Networks. Lecture 1 (part 2): Jan 28, 2004 Intro to Computer Networking

Bridge 101 Lesson 7, Jacoby Transfers Presented by Eire1

Software Design and Analysis for Engineers

(Refer Slide Time 5:19)

Accounts and Passwords

Assignment 1: Chunked File Transfer (CFT)

Basic Guide to Google+ Hangouts

Using Novell s DHCP Server Version 2.10

Q1: Multiple choice / 20 Q2: C input/output; operators / 40 Q3: Conditional statements / 40 TOTAL SCORE / 100 EXTRA CREDIT / 10

CS1114 Assignment 5, Part 1

Agent Design Example Problems State Spaces. Searching: Intro. CPSC 322 Search 1. Textbook Searching: Intro CPSC 322 Search 1, Slide 1

PA2 Introduction to Tracking. Connected Components. Moving Object Detection. Pixel Grouping. After Pixel Grouping 2/19/17. Any questions?

Image processing. Reading. What is an image? Brian Curless CSE 457 Spring 2017

Data parallel algorithms 1

Compiler Design Spring 2017

CPE 101. Overview. Programming vs. Cooking. Key Definitions/Concepts B-1

Operational Semantics of Cool

Intermediate Algebra. Gregg Waterman Oregon Institute of Technology

Comp 11 Lectures. Mike Shah. June 26, Tufts University. Mike Shah (Tufts University) Comp 11 Lectures June 26, / 57

FOR Loops. Last Modified: 01 June / 1

Transcription:

The Pipeline Lecture 17 ITK Pipeline Methods in Medical Analysis - Spring 2016 18-791 (CMU ECE) : 42-735 (CMU BME) : BioE 2630 (Pitt) Dr. John Galeotti Based in part on Shelton s slides from 2006 ITK is organized around data objects and process objects You should now be somewhat familiar with the primary data object, Today we ll talk about how to do cool things to images, using process objects A pipeline is a series of process objects that operate on one or more data objects The data objects flow along the pipeline Th i s wo rk b y Jo h n Gal eo tti an d Dami o n Sh el to n, 200 4-2016, was mad e p o ssi bl e i n part b y NIH NLM co ntract# HHSN276201000580P, and is licensed under a Creative Commons Attribution 3.0 Unported License. To view a copy of this license, visit http://creati veco mmo n s. o rg/l i cen ses/b y/3.0 / or sen d a l etter to Creati ve C o mmo n s, 1 71 2nd Street, Sui te 300, San Fran ci sco, C al i fo rn i a, 94 10 5, USA. Permissions beyond the scope of this license may be available by emailing itk@galeotti.net. The most re ce nt ve rsion of the se slides may be acce sse d online via http: //itk.galeotti.ne t/ 1 2 The pipeline idea sources Source Filter A Source Filter A Filter B Filter B The pipeline consists of: Data objects Process object (things that create data objects) itk::source<toutput> The base class for all process objects that produce images without an input image 3 4 to image filters Input and output Source FilterA FilterB Source s do not require input, so they have only a function ToFilter s have both and functions itk::tofilter<tinput, TOutput> The base class for all process objects that produce images when provided with an image as input. 5 6 1

Ignoring intermediate images How this looks in code Source FilterA = FilterB 7 8 When execution occurs The previous page of code only sets up the pipeline - i.e., what connects to what This does not cause the pipeline to execute In order to run the pipeline, you must call on the last filter in the pipeline Propagation of Update() When is called on a filter, the update propagates back up the pipeline until it reaches a process object that does not need to be updated, or the start of the pipeline 9 10 When are process objects updated? If the input to the process object has changed If the process object itself has been modified - e.g., I change the radius of a Gaussian blur filter How does it know? Detecting process object modification The easy way (when writing your own proces object) is to use which produces the function that calls for you when a new value is set in the class. For example, the compiler turns this line of code: into a member function,, that sets member variable. 11 12 2

Process object modification, cont. The other way is to call () from within a process object function when you know something has changed You can call () from outs ide the clas s as well, to force an update Using the macros is a better idea though... Running the pipeline Step 1?? 13 14 Running the pipeline Step2 Running the pipeline Step3 15 16 Running the pipeline Step4 Modifying the pipeline Step1 Change a filter parameter here Then call here 17 18 3

Modifying the pipeline Step2 Modifying the pipeline Step3 We detect that the input is modified This executes This executes 19 20 Thoughts on pipeline modification Note that in the previous example the source never re-executed; it had no input and it was never modified, so the output cannot have changed This is good! We can change things at the end of the pipeline without wasting time recomputing things at the beginning It s easy in practice 1. Build a pipeline 2. Call on the last filter - get the output 3. Tweak some of the filters 4. Call on the last filter - get the output 5....ad nauseam 21 22 Reading & writing You will often begin and end pipelines with readers and writers Fortunately, ITK knows how to read a wide variety of image types! Reading and writing images Read images with: Write images with: Both classes have a function used to optionally specify a particular type of image to read or write 23 24 4

Reading an image (4.1.2) Create a reader If you know the file format (optional): Create an instance of an derived class (e.g. ) Pass the IO object to the reader Set the file name of the reader Update the reader Reader notes The template parameter is the type of image you want to convert the stored image to, not necessarily the type of image stored in the file ITK assumes a valid conversion exists between the stored pixel type and the target pixel type 25 26 Writing an image Almost identical to the reader case, but you use an instead of a reader Output format can be specified with an IO object (optional) If you ve already created an IO object during the read stage, you can recycle it for use with the writer More read/write notes ITK actually has several different ways of reading files - what I ve presented is the simplest conceptually Remember, you can read files without knowing their format a-priori Just don t specify any IO objects. Many more details are in ch. 7 of the software guide. 27 28 SimpleITK Pipeline It doesn t have one! SimpleITK s interface does NOT use a pipeline Every time you call a filter in SimpleITK, it reexecutes. You manually execute each filter every time you think it is necessary You als o manually pas s the updated output from one filter to the input of the next filter Combining ITK and SimpleITK You can combine ITK with SimpleITK! For example: Use SimpleITK to quickly read and preprocess images Use full ITK to perform a complex registration Use SimpleITK to save the results This is really easy in C++ We just need to integrate SimpleITK into our ITK pipeline 29 30 5

Using SimpleITK in an ITK Pipeline Using SimpleITK in an ITK Pipeline Convert a SimpleITK image into a full ITK image: Warning: Conversion from SimpleITK to ITK requires matching image types! Full ITK hard-codes (via template parameters) each output image s pixel type and dimensionality SimpleITK automatically makes decisions about an output image s pixel type and dimensionality The definitive list of SimpleITK pixel types is in its source code, at the bottom of this file: Convert a full ITK image into a SimpleITK image: Solution: Verify that dimensions match, and then Use SimpleITK s to convert pixel type See 31 Example: ITK with SimpleITK 32 Example: ITK with SimpleITK 33 34 CMakeLists.txt: ITK + SimpleITK 35 6