Medical Image Processing and Analysis Lecture -12

1 Dr. Qaiser Chaudry

What is VTK? • An open source, freely available software system for 3D graphics, image processing, and visualization. • Support for hundreds of algorithms in visualization and image processing • Object-oriented design with different interpreted language wrapers.

Dr. Qaiser Chaudry

At a Glance • The core of VTK is written entirely in C++ • Contains 600 existing classes with 325K lines of code • VTK will compile and run on Windows, SGI, Linux, Sun, HP, etc. • Support OpenGL • Different interfaces for fast prototyping: Tcl , Java, and Python • Have users all over the world – The beauty of Open Source!

Dr. Qaiser Chaudry

System Architecture Interpreted Wrapper (Tcl, Java, Python) •Tcl/Tk shell •Java interpreter •Python interpreter

•Tcl/Tk source •Java JDK •Python source

C++ core Libraries and includes All class source code (could take hours to (dll and .h files) compile) Or (.a and .h files)

Binary Installation: if you will use The classes to build your applicatoin

Dr. Qaiser Chaudry

Source code Installation: If you want to extend vtk

VTK classes

Dr. Qaiser Chaudry

The Graphics Model The purpose is to render the geometry (volume) on the screen vtkCamera

vtkRenderWindow vtkRenderWindowInteractor

Dr. Qaiser Chaudry

vtkActor

vtkLight

•vtkProperty •vtkMapper •vtkTransform vtkRenderer

To see is to believe … 1 vtkRenderWindow

2 vtkRenderer

vtkCamera vtkLight vtkActor ( property, geometry(mapper), transformation, etc)

Dr. Qaiser Chaudry

The Graphics Model The purpose is to render the geometry (volume) on the screen camera

screen

Dr. Qaiser Chaudry

Actor

Light

Example Program Main() {

create a window; create a renderer; give the renderer to the window; create procedural geometry; create a mapper; give the geometry to the mapper; create an actor; give the mapper to the actor;

}

Dr. Qaiser Chaudry

give the actor to the renderer; window->render();

Window Renderer Actor Mapper Geometry

Example -1 • • • •

Dr. Qaiser Chaudry

A polygonal model of a cone Render to screen. Rotate the cone 360 degrees source -> mapper -> actor -> renderer -> renderwindow

Example -1 # # This example creates a polygonal model of a cone, and then rendered it to # the screen. It willrotate the cone 360 degrees and then exit. The basic # setup of source -> mapper -> actor -> renderer -> renderwindow is # typical of most VTK programs. # # # First we include the VTK Tcl packages which will make available # all of the vtk commands to Tcl # package require vtk # # Next we create an instance of vtkConeSource and set some of its # properties # vtkConeSource cone cone SetHeight 3.0 cone SetRadius 1.0 cone SetResolution 10

Dr. Qaiser Chaudry

Example -1 # # We create an instance of vtkPolyDataMapper to map the polygonal data # into graphics primitives. We connect the output of the cone souece # to the input of this mapper # vtkPolyDataMapper coneMapper coneMapper SetInput [cone GetOutput] # # create an actor to represent the cone. The actor coordinates rendering of # the graphics primitives for a mapper. We set this actor's mapper to be # coneMapper which we created above. # vtkActor coneActor coneActor SetMapper coneMapper # # Create the Renderer and assign actors to it. A renderer is like a # viewport. It is part or all of a window on the screen and it is responsible # for drawing the actors it has. We also set the background color here # vtkRenderer ren1 ren1 AddActor coneActor ren1 SetBackground 0.5 0.2 0.4

Dr. Qaiser Chaudry

Example -1 # # Finally we create the render window which will show up on the screen # We put our renderer into the render window using AddRenderer. We also # set the size to be 300 pixels by 300 # vtkRenderWindow renWin renWin AddRenderer ren1 renWin SetSize 300 300 # # now we loop over 360 degreeees and render the cone each time # for {set i 0} {$i < 360} {incr i} { after 20 # render the image renWin Render # rotate the active camera by one degree [ren1 GetActiveCamera] Azimuth 1 } # # Free up any objects we created # vtkCommand DeleteAllObjects

Dr. Qaiser Chaudry

Creating Multiple Renderers •

package require vtk

• • • •

vtkConeSource cone cone SetHeight 3.0 cone SetRadius 1.0 cone SetResolution 10

• •

vtkPolyDataMapper coneMapper coneMapper SetInput [cone GetOutput]

• •

vtkActor coneActor coneActor SetMapper coneMapper

• • • • •

#add viewport vtkRenderer ren1 ren1 AddActor coneActor ren1 SetBackground 0.5 0.2 0.4 ren1 SetViewport 0.0 0.0 0.5 1.0

Dr. Qaiser Chaudry

Creating Multiple Renderers • • • • •

# added 2nd renderer vtkRenderer ren2 ren2 AddActor coneActor ren2 SetBackground 0.0 0.5 0.4 ren2 SetViewport 0.5 0.0 1.0 1.0

• • • • •

# add both renderers to window and change size vtkRenderWindow renWin renWin AddRenderer ren1 renWin AddRenderer ren2 renWin SetSize 600 300

• • • • • •

for {set i 0} {$i < 360} {incr i} { after 20 renWin Render [ren1 GetActiveCamera] Azimuth 1 [ren2 GetActiveCamera] Azimuth 1 }

Dr. Qaiser Chaudry

User interaction • vtkRenderWindowInteractor – allow the user to interact with the graphics objects

Dr. Qaiser Chaudry



w: wireframe mode



Left Button: rotate



s: surface mode



Right Button: zoom



r: reset the transformation



e: exit

User interaction // The vtkRenderWindowInteractor class watches for events (e.g., keypress, mouse) in the vtkRenderWindow. vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New(); iren->SetRenderWindow(renWin); // Here we specify a particular interactor style. vtkInteractorStyleTrackballCamera *style = vtkInteractorStyleTrackballCamera::New(); iren->SetInteractorStyle(style); // leave an event loop running. Exit when the user presses the "e" key iren->Initialize(); iren->Start();

Dr. Qaiser Chaudry

User interaction vtkRenderWindow renWin renWin AddRenderer ren1 renWin SetSize 300 300 renWin Render # create rendrer window interactor vtkRenderWindowInteractor iren iren SetRenderWindow renWin # Add observer and initialize interactor iren AddObserver UserEvent {wm deiconify .vtkInteract} iren Initialize # prevent the tk window from showing up then start the event loop wm withdraw .

Dr. Qaiser Chaudry

Demos • Bottle • Spring • 3D Model Motor • Medical imaging • Stomach model

Dr. Qaiser Chaudry

What is ITK?

National Library of Medicine Insight Segmentation and Registration Toolkit (ITK)

• Image Processing • Segmentation • Registration • No Graphical User Interface (GUI) • No Visualization

Dr. Qaiser Chaudry

References • • • • • •

Dr. Qaiser Chaudry

www.cse.ohio-state.edu/~hwshen/788/sp01/ http://www.kitware.com/ http://www.vtk.org/ The VTK Users's Guide The Visualization Toolkit An Object-Oriented Approach To 3D Graphics 3rd Edition http://www.itk.org/

Lecture -12

Dr. Qaiser Chaudry. System Architecture. Interpreted Wrapper (Tcl, Java, Python). C++ core. Binary Installation: if you will use. The classes to build your applicatoin. Source code Installation: If you want to extend vtk. •Tcl/Tk source. •Java JDK. •Python source. All class source code. (could take hours to compile). Libraries and ...

719KB Sizes 0 Downloads 138 Views

Recommend Documents

lecture 12: distributional approximations - GitHub
We have data X, parameters θ and latent variables Z (which often are of the ... Suppose we want to determine MLE/MAP of p(X|θ) or p(θ|X) over q: .... We limit q(θ) to tractable distributions. • Entropies are hard to compute except for tractable

EE 396: Lecture 12
Mar 26, 2011 - Thus, along lines that are parallel to v the function remains ... x ∈ R. We simply follow a line parallel to v starting from (t, x) and follow the line ...

Lecture 7
Nov 22, 2016 - Faculty of Computer and Information Sciences. Ain Shams University ... A into two subsequences A0 and A1 such that all the elements in A0 are ... In this example, once the list has been partitioned around the pivot, each sublist .....

LECTURE - CHECKLIST
Consider hardware available for visual aids - Computer/ Laptop, LCD ... Decide timing- 65 minutes for lecture and 10 minutes for questions and answers.

Lecture 3
Oct 11, 2016 - request to the time the data is available at the ... If you want to fight big fires, you want high ... On the above architecture, consider the problem.

pdf-1490\record-of-agard-lecture-series-lecture ...
... the apps below to open or edit this item. pdf-1490\record-of-agard-lecture-series-lecture-series-i ... unne-j-c-north-atlantic-treaty-organization-vannucci.pdf.

Lectures / Lecture 4
Mar 1, 2010 - Exam 1 is next week during normal lecture hours. You'll find resources to help you prepare for the exam, which will be comprehensive, on the.

Prize Lecture slides
Dec 8, 2011 - Statistical Model for government surplus net-of interest st st = ∞. ∑ ... +R. −1 bt+1,t ≥ 0. Iterating backward bt = − t−1. ∑ j=0. Rj+1st+j−1 + Rtb0.

Lecture Note_Spectrophotometry.pdf
Aug 18, 2016 - ... rival UV‐Visible spectrometry. for its simplicity simplicity, versatility versatility, speed, accuracy accuracy and. cost‐effectiveness. Page 1 of 34 ...

Lecture 9
Feb 15, 2016 - ideological content have persisted among the American public from 1987 to 2012.2 ... That is, learning is social and takes place within the individuals' ... independent network structures, deriving always consensus results.

Lectures / Lecture 4
Mar 1, 2010 - course website. After lecture today, there will also be a review section. • Assignments are graded on a /–, /, /+ basis whereas exams are graded.

Lectures / Lecture 7
Apr 5, 2010 - Contents. 1 Introduction (0:00–5:00). 2. 2 Security (5:00–112:00). 2 .... use it to distribute pornography, you don't have to pay for disk space or bandwidth, but you might make money off ... requests—the more of a threat you pose

Inaugural lecture
Jan 31, 2001 - Contemporary global capitalism results from interactions between economics, finance, and technology. Any number of ... the form of software, but in the creation of images, and symbols. You could view it as a .... formal structures, rul

Frederick Sanger - Nobel Lecture
and hence the number of amino acid residues present. Values varying from ... In order to study in more detail the free amino groups of insulin and other proteins, a general ... disulphide bridges of cystine residues. Insulin is relatively rich in ...

Lecture Capture - USFSM
Step 2 on the Crestron: Touch the Lecture Capture Mode to turn on the projector and camera. Page 2. Step 3 on the Crestron Choose Podium PC. Now you will see your desktop on the projector. Panopto. Step 1 Log in to myUSF. Page 3. Step 2 Launch Canvas

Lecture 1 - GitHub
Jan 9, 2018 - We will put special emphasis on learning to use certain tools common to companies which actually do data ... Class time will consist of a combination of lecture, discussion, questions and answers, and problem solving, .... After this da

Lecture(PDF)
Structured programming uses an approach whichistop down,. OOPuses an ... anyshape it get rotated clockwise 360 degree and a soundis also played.

Inquisitive semantics lecture notes
Jun 25, 2012 - reformulated as a recursive definition of the set |ϕ|g of models over a domain. D in which ϕ is true relative to an assignment g. The inductive ...

Lecture 1
Introduction to object oriented programming. • The C++ primitive data types (int, float, double, char, etc) can be used by declaring a variable and assigning a value to it. • Consider creating your own data type, a variable of which can hold mult

Lecture 02
Engr. Syed Rizwan Ali, MS(CAAD) UK,. PDG(CS) UK, PGD (PM) IR, BS (BCE) PK. HEC Certified – Master Trainer (MT-FPDP). Computer Sciences Department.

Lecture: 10
Create a class Circle derived from Point class. Apart from data of Point class circle should store its radius. W rite constructor and appropriate methods .

Lecture(PDF)
Use java.io package and throWS Exception. ... jaVa. ENProgram Filles NuJava Nijdk1.6.0_11NbinXjava Comments ... proce&&Or &Cheduling.memory J83ge.

Lectures / Lecture 7
Apr 5, 2010 - Next we might try passing a phrase like “DELETE FROM ... your hard drive. This is why you should never open attachments from sources you don't trust! • Worms are more insidious because they don't require user interaction in order to