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

Slides:



Advertisements
Similar presentations
Understand and appreciate Object Oriented Programming (OOP) Objects are self-contained modules or subroutines that contain data as well as the functions.
Advertisements

The content of these slides by John Galeotti, © 2013 Carnegie Mellon University (CMU), was made possible in part by NIH NLM contract# HHSN P,
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.
Adapted from Scott, Chapter 6:: Control Flow Programming Language Pragmatics Michael L. Scott.
The content of these slides by John Galeotti, © Carnegie Mellon University (CMU), was made possible in part by NIH NLM contract# HHSN P,
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 8 Registration with ITK
The content of these slides by John Galeotti, © 2012 Carnegie Mellon University (CMU), was made possible in part by NIH NLM contract# HHSN P,
1 ITK Lecture 10 Review & Toolbox Part II Methods in Image Analysis CMU Robotics Institute U. Pitt Bioengineering 2630 Spring Term, 2006 Damion.
Lecture 12 Level Sets & Parametric Transforms sec & ch
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.
Image Segmentation Image segmentation (segmentace obrazu) –division or separation of the image into segments (connected regions) of similar properties.
1 ITK Lecture 7 - Writing Filters, Part 1 Methods in Image Analysis CMU Robotics Institute U. Pitt Bioengineering 2630 Spring Term, 2006 Methods.
Methods in Image Analysis 2004, Damion Shelton 1 ITK Lecture 6 - The Pipeline Methods in Image Analysis CMU Robotics Institute U. Pitt Bioengineering.
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.
How To Register on HROCMMS. Suggestion for this manual may be sent at following s : 1. 2.
The content of these slides by John Galeotti, © Carnegie Mellon University (CMU), was made possible in part by NIH NLM contract# HHSN P,
Vertices and Fragments I CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
Testing an individual module
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,
Ppt-toolkit.com. Map – United States of America Individual states can be colored for highlight – click the state you would like to color and use the shape.
The content of these slides by John Galeotti, © Carnegie Mellon University (CMU), was made possible in part by NIH NLM contract# HHSN P,
1 GEM2505M Frederick H. Willeboordse Taming Chaos.
The content of these slides by John Galeotti, © Carnegie Mellon University (CMU), was made possible in part by NIH NLM contract# HHSN P,
Lecture 6 Linear Processing ch. 5 of Machine Vision by Wesley E
CS 106 Introduction to Computer Science I 04 / 13 / 2007 Friday the 13 th Instructor: Michael Eckmann.
The content of these slides by John Galeotti, © Carnegie Mellon University (CMU), was made possible in part by NIH NLM contract# HHSN P,
COMP 175: Computer Graphics March 24, 2015
Spatial Filtering: Basics
Chapter 11 Introduction to Classes Intro to Computer Science CS1510, Section 2 Dr. Sarah Diesburg.
Photosynthesis lab. Outline of the day 1.Turn in your lab reports at the front –More than 10 minutes late = bad 2.Any questions on last week’s lab? 3.Quiz.
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,
Franklin Township Professional Development October 12, 2009.
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,
1 ITK Lecture 8 - Neighborhoods Methods in Image Analysis CMU Robotics Institute U. Pitt Bioengineering 2630 Spring Term, 2006 Methods in Image.
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 13 Introduction to Classes.
Methods in Image Analysis 2004, Damion Shelton 1 ITK Lecture 9 - Toolbox Part I Methods in Image Analysis CMU Robotics Institute U. Pitt Bioengineering.
1 ITK Lecture 9 - Toolbox Part I Methods in Image Analysis CMU Robotics Institute U. Pitt Bioengineering 2630 Spring Term, 2006 Methods in Image.
CO1301: Games Concepts Dr Nick Mitchell (Room CM 226) Material originally prepared by Gareth Bellaby.
The content of these slides by John Galeotti, © Carnegie Mellon University (CMU), was made possible in part by NIH NLM contract# HHSN P,
MIS 105 LECTURE 1 INTRODUCTION TO COMPUTER HARDWARE CHAPTER REFERENCE- CHP. 1.
Computing Science 1P Lecture 14: Friday 2 nd February Simon Gay Department of Computing Science University of Glasgow 2006/07.
ECE 264 Object-Oriented Software Development Instructor: Dr. Honggang Wang Spring 2013 Lecture 19: Exam 3 Preview.
ECE450 - Software Engineering II1 ECE450 – Software Engineering II Today: Design Patterns VIII Chain of Responsibility, Strategy, State.
Ppt-toolkit.com.
CE Operating Systems Lecture 17 File systems – interface and implementation.
Lecture 9 Segmentation (ch 8) ch. 8 of Machine Vision by Wesley E
1. Computing Systems Lecture 3 Binary Representation & Boolean Logic Binary and Logic 2.
1 ITK Lecture 6 - The Pipeline Methods in Image Analysis CMU Robotics Institute U. Pitt Bioengineering 2630 Spring Term, 2006 Methods in Image Analysis.
April 2011BRCS Freeware SIG1 Opera Browser Set Up For Slow Connections.
1 ITK Lecture 5 Intro to Iterators Methods in Image Analysis CMU Robotics Institute U. Pitt Bioengineering 2630 Spring Term, 2006 Methods in Image.
Lecture 4 Page 1 CS 111 Online Modularity and Memory Clearly, programs must have access to memory We need abstractions that give them the required access.
Computing Systems Lecture 3 Binary Representation & Boolean Logic Binary and Logic 1.
ITK. Ch 9 Segmentation Confidence Connected Isolated Connected Confidence Connected in Vector Images Jin-ju Yang.
Chapter 5 Introduction to Defining Classes Fundamentals of Java.
Patterns An Easier Way to Think About Common Software Designs This presentation is licensed under a Creative Commons License.
Course : T Computer Vision
Ppt-toolkit.com.
Business System Development
Lecture 19 Write Your Own ITK Filters, Part2
Programming in JavaScript
Lecture Notes: Spatial Convolution
Programming in JavaScript
The Challenge of Cross - Language Interoperability
C++ Object Oriented 1.
The W3C More on images Entity codes Remote vs Local Computers
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 20 Write Your Own ITK Filters, Part2 Methods in Medical Image Analysis - Spring 2015 BioE 2630 (Pitt) : (CMU RI) (CMU ECE) : (CMU BME) Dr. John Galeotti Based on Shelton’s slides from 2006

What are “advanced” filters?  More than one input  Support progress methods  Output image is a different size than input  Multi-threaded 2

Details, details  In the interests of time I’m going to gloss over some of the finer details  I’d like to make you aware of some of the more complicated filter issues, but not scare you away  See book 1, chapter 8 of the software guide! 3

Different output size 4

Propagation of requested region size  Remember that requested regions propagate back up the pipeline from output to input  Therefore, it’s likely that if we are messing with the output image size, then we will also need to alter the input requested region 5

Changing the input requested region 6

An aside: base class implementations 7

Multi-threaded 8

Multi-threaded: overview  The pipeline framework “chunks” the output image into regions for each thread to process  Each thread gets its own region and thread ID  Keep in mind that this will not (and can not) work in all cases  Some filters can’t be multi-threaded 9

Multi-threaded: output regions 10

Multi-threaded: output allocation 11

Multi-threaded: order of operations 12

ThreadID  This deserves a special note…  In the naïve case a thread would not know how many other threads were out there  If a thread takes a non thread-safe action (e.g., file writing) it’s possible other threads would do the same thing 13

ThreadID, cont.  This could cause major problems!  The software guide suggests: 1.Don’t do “unsafe” actions in threads -or- 2.Only let the thread with ID 0 perform unsafe actions 14

Multiple inputs 15

Step 1: Define Number of Inputs 16

Step 2: 17

Step 3 18

Multiple outputs? 19

Progress reporting 20

Progress reporting cont. 21 Pointer to the filter ThreadID, or 0 for ST Total pixels or steps (for iterative filters)

Progress reporting, cont. 22

Querying progress from outside your filter  How does your program query the total progress?  Short answer is to use the inherited method: ProcessObject::ReportProgress()  All filters (including ones that you write) automatically have this function, since it is provided by ProcessObject.  Typically you create an external observer to both query your filter’s total progress and then update your GUI  In particular, you write an observer that calls your filter’s ReportProgress() method and then calls some other “short” function to update your GUI accordingly. 23

Helpful ITK features to use when writing your own filter  Points and vectors  VNL math  Functions  Conditional iterators  Other useful ITK filters 24

Points and Vectors 25

Interchangability  You can convert between Points and Vectors in a logical manner:  Point + Vector = Point  Vector + Vector = Vector  Point + Point = Undefined  This is pretty handy for maintaining clarity, since it distinguishes between the intent of different arrays 26

Things to do with Points 27

Things to do with Vectors 28

Need more complicated math? 29

VNL  VNL could easily occupy an entire lecture  Extensive documentation is available at:  Click on the the VXL book link and look at chapter 6 30

Things VNL can do 31

More VNL tricks 32 Solves the generalized eigenproblem Matrix_1 * x = Matrix_2 * x (Matrix_2 will often be the identity matrix)

VNL take home message  VNL can do a lot more cool stuff that you do not want to write from scratch  SVD  Quaternions  C++ can work like Matlab!  It’s worth spending the time to learn VNL  Especially true for C++ programmers!  But Python programmers may rather learn NumPy: 33

Change of topic  Next we’ll talk about how ITK encapsulates the general idea of functions  Generically, functions map a point in their domain to a point in their range 34

Functions 35 Domain Range

What good is FunctionBase? 36

Spatial functions 37

Spatial function example 38

Interior-exterior spatial functions 39

IE spatial function example 40

Image functions 41

Image function examples 42

Hey - this is messy...  You might be wondering why there are so many levels in this hierarchy  The goal is to enforce conceptual similarity in order to better organize the toolkit  In particular, the interior-exterior functions have a specific reason for existence 43

Change of topic  You may have observed that we have (at least) two ways of determining whether or not a point/pixel is “included” in some set  Within the bounds of a spatial function  Within a threshold defined by an image function  Useful for, e.g., connected component labeling... 44

Conditional iterators 45

The “condition” 46

Using the condition - brute force  If the pixel passes the test, it can be accessed by the iterator  Otherwise, it’s not part of the set  The brute force implementation is to visit all pixels in an image, apply the test, and return the pixel if it passes 47

Conditional iterators - UI 48

Conditional iterators - guts 49

Special case - connected regions  For small regions within large, high-dimension images, applying this test everywhere is needlessly expensive  Moreover, the brute-force method can’t handle region growing, where the “condition” is based on neighbor inclusion (in an iterative sense) 50

Flood filled iterators 51

How they work  Create the iterator and specify an appropriate function  You need a seed pixel(s) to start the flood - set these a priori or find them automatically with FindSeedPixel(s)  Start using the iterator as you normally would 52

“Drawing” geometric objects 53

Flood filled spatial function example 54

Origin Strategy 55

Center Strategy 56

Complete Strategy 57

Intersect Strategy 58

Useful ITK filters  These are filters that solve particularly common problems that arise in image processing  You can use these filters at least 2 ways:  In addition to your own filters  Inside of your own filters  Don’t re-invent the wheel!  This list is not comprehensive (obviously)  Specific filter documentation is an EFTR 59

Padding an image 60

Cropping an image 61

Rescaling image intensity 62

Computing image derivatives 63

Compute the mirror image 64

Rearrange the axes in an image 65

Resampling an image 66

Getting a lower dimension image 67