Loading presentation...

Present Remotely

Send the link below via email or IM

Copy

Present to your audience

Start remote presentation

  • Invited audience members will follow you as you navigate and present
  • People invited to a presentation do not need a Prezi account
  • This link expires 10 minutes after you close the presentation
  • A maximum of 30 users can follow your presentation
  • Learn more about this feature in our knowledge base article

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.

DeleteCancel

Aula VTK

Aula introdução ao VTK
by

Walmor Godoi

on 20 June 2013

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of Aula VTK

Visualização Científica com o VTK
Palestra
// Now we loop over 360 degrees and render the cone each time.
int i;
for (i = 0; i < 360; ++i)
{
// Render the image.
renWin->Render();
// Rotate the active camera by one degree.
ren1->GetActiveCamera()->Azimuth( 1 );
// Introduce delay to slow down motion.
Sleep(10);
}
// Free up any objects we created.
cone->Delete();
coneMapper->Delete();
coneActor->Delete();
ren1->Delete();
renWin->Delete();
return 0;
}
Example -1
// First include the required header files for the VTK classes we are using.
#include "vtkConeSource.h"
#include "vtkPolyDataMapper.h"
#include "vtkRenderWindow.h"
#include "vtkCamera.h"
#include "vtkActor.h"
#include "vtkRenderer.h“
int main( int argc, char *argv[] )
{
// Create an instance of vtkConeSource.
vtkConeSource *cone = vtkConeSource::New();
cone->SetHeight( 3.0 );
cone->SetRadius( 1.0 );
cone->SetResolution( 10 );
Example -1
Instalação
VTK
// Create a property and directly manipulate it. Assign it to the second actor.

vtkProperty *property = vtkProperty::New();
property->SetColor(1.0, 0.3882, 0.2784);
property->SetDiffuse(0.7);
property->SetSpecular(0.4);
property->SetSpecularPower(20);


vtkActor *coneActor2 = vtkActor::New();
coneActor2->SetMapper(coneMapper);
coneActor2->GetProperty()->SetColor(0.2, 0.63, 0.79);
coneActor2->SetProperty(property);
coneActor2->SetPosition(0, 3, 0);
Properties and Transformation
// Create an actor to represent the first cone. The actor's properties are modified to give it different surface properties. By default, an actor is created with a property so the GetProperty() method can be used.

vtkActor *coneActor = vtkActor::New();
coneActor->SetMapper( coneMapper );
coneActor->GetProperty()->SetColor(0.2, 0.63, 0.79);
coneActor->GetProperty()->SetDiffuse(0.7);
coneActor->GetProperty()->SetSpecular(0.4);
coneActor->GetProperty()->SetSpecularPower(20);
Properties and Transformation

// Make one view 90 degrees from the other.
ren1->GetActiveCamera()->Azimuth(90);

// Now we loop over 360 degrees and render the cone each time.
int i;
for (i = 0; i < 360; ++i)
{
// render the image
renWin->Render();
// rotate the active camera by one degree
ren1->GetActiveCamera()->Azimuth( 1 );
ren2->GetActiveCamera()->Azimuth( 1 );
Sleep(10);
}
Creating Multiple Renderers
vtkRenderer *ren1= vtkRenderer::New();
ren1->AddActor( coneActor );
ren1->SetBackground( 0.1, 0.2, 0.4 );
ren1->SetViewport(0.0, 0.0, 0.5, 1.0);

vtkRenderer *ren2= vtkRenderer::New();
ren2->AddActor( coneActor );
ren2->SetBackground( 0.2, 0.3, 0.5 );
ren2->SetViewport(0.5, 0.0, 1.0, 1.0);

vtkRenderWindow *renWin = vtkRenderWindow::New();
renWin->AddRenderer( ren1 );
renWin->AddRenderer( ren2 );
renWin->SetSize( 600, 300 );
Creating Multiple Renderers
A polygonal model of a cone
Render to screen.
Rotate the cone 360 degrees
source -> mapper -> actor -> renderer -> renderwindow
Example -1
Exemplo
VTK
Filter types (a quick summary)
diffusion filters
Butterworth, low-pass, high-pass filters
dilation, erosion, skeleton
convolution
difference, arithmetic, magnitude, divergence, gradient, mean
distance
FFT
Fourier, Gaussian, Sobel
histogram
threshold
permutation, conversion, padding
Aspectos Técnicos
Imagem - Filtros
Data Interface (Readers/Writers treat a single dataset; Importers/Exporters treat a scene.) variety of polygonal formats including stereo-lithography , MOVIE.BYU, Cyberware, etc. our own VTK formats (including a parallel XML format)
for all data types
Inventor Writer, IV Exporters , 3D Studio Importer, PLOT3D, PNM, RIB (RenderMan) Exporter, SLC (Volume) Reader, TIFF Writer, VRML Exporter,Wavefront .OBJ Exporter, .OBJ Reader, BMP reader and writer, Raw image formats , HDF, Ensight, HDF, Cosmo, Fluent, DICOM, SQL, Postscript writer, STL
Aspectos Técnicos
Visualização
Data Types:
polygonal data (points, lines, polygons, triangle strips)
images and volumes (i.e., structured point datasets)
structured grids (e.g., finite difference grids)
unstructured grids (e.g, finite element meshes)
unstructured points
Cell Types:
vertex, poly-vertex
line, poly-line
triangle
...
Aspectos Técnicos
Visualização
Lights
infinite
spot
Cameras
parallel and perspective projection
nice methods like elevation, azimuth, zoom, reset
automatic camera/light creation
Aspectos Técnicos
3D Graphics
Properties
ambient, ambient color
diffuse, diffuse color
specular, specular color
color (lights & object)
transparency
texture mapping
shading (flat/Gouraud)
backlighting on/off
Aspectos Técnicos
3D Graphics
Qt, FLTK, wxWindows, Tcl/Tk, Python/Tk, Java (Eclipse e Netbeans), X11, Motif, Windows (MS VS Studio), Cocoa e CARBON.
Interação por diversos modos de trackball e joystick para câmeras and atores.
Extensivo grupo de widgets 3D: ponto, linha, plano, box, esfera, scalar bar, image plane, e splines
Aspectos técnicos
GUI
~1000 classes C++
Acima de 1,000,000 de linhas de código C++
Suporte para Tcl, Java, Python e C#
Ferramentas de processo de controle de qualidade de software da Kitware (CMake, CTest, CDash e Cpack)
Documentação
Suporte multithreading e distributed memory
Aspectos técnicos
Software
Aspectos técnicos
VTK
Classes de bibliotecas em C++ e várias interfaces (Tcl/Tk, Python, Java e C#)
Kitware dá continuidade ao toolkit e oferece suporte profissional, vende livros e consultoria
Outros projetos: ITK, CMake, Paraview, VolView, MIDAS, KiwiViewer, ...


VTK - O que é
Dez. 1993, lançamento do livro “The Visualization Toolkit An Object-Oriented Approach to 3D Graphics” por Will Schroeder, Ken Martin, e Bill Lorensen, (autorizados pela GE Corporate R&D)
Open-source
Ferramentas para aplicações em computação gráfica 3D, processamento de imagens e visualização.
VTK - O que é
O que é?
VTK
Obrigado!
walmorgodoi@utfpr.edu.br

www.vtk.org
Download (source and binaries)
Documentation
Mailing lists
Links
FAQ, Search
www.kitware.com
VTK Textbook
VTK User’s guide
Mastering CMake
VTK resources
Tcl -> executável do VTK, GUI com Qt
Compilar em C++ via CMake – MS Visual Studio ou pelo Linux (GUI com Qt)
Java -> Netbeans ou Eclipse (vtk.jar) –Linux e Windows
C# -> .NET Wrapper do VTK em MS Visual Studio (ActiViz .NET is a tool for generating C# wrappers around VTK)
Caminhos a optar
http://www.vtk.org/VTK/resources/software.html
Download
// Create the renderer and assign actors to it.
vtkRenderer *ren1= vtkRenderer::New();
ren1->AddActor( coneActor );
ren1->AddActor( coneActor2 );
ren1->SetBackground( 0.1, 0.2, 0.4 );
Properties and Transformation
// We create an instance of vtkPolyDataMapper
vtkPolyDataMapper *coneMapper = vtkPolyDataMapper::New();
coneMapper->SetInput( cone->GetOutput() );
// Create an actor.
vtkActor *coneActor = vtkActor::New();
coneActor->SetMapper( coneMapper );
// Create the renderer.
vtkRenderer *ren1= vtkRenderer::New();
ren1->AddActor( coneActor );
ren1->SetBackground( 0.1, 0.2, 0.4 );
// Finally we create the render window.
vtkRenderWindow *renWin = vtkRenderWindow::New();
renWin->AddRenderer( ren1 );
renWin->SetSize( 300, 300 );
Example -1
BSD license
Copyright (c) 1993-2008 Ken Martin, Will Schroeder, Bill Lorensen
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither name of Ken Martin, Will Schroeder, or Bill Lorensen nor the names of any contributors may be used to endorse or promote products derived from this software without specific prior written permission.
Licença
Annotation
2D and 3D text
Scalar bar (scalar to color index)
x-y plots
Flying axes
Overlay plane drawing
Attach overlay annotation to 3D positions
Aspectos Técnicos
Visualização
A collection of vertices, edges, faces and cells whose connectivity information must be explicitly stored
Unstructured Grid
Surface Rendering
Volume Rendering
A flexible software ray casting implementation
Supports texture-based volume rendering
Support for VolumePRO volume rendering hardware
Supports mixing opaque surface geometry and volume rendering
GPU-based rendering support
Rendering Primitives
Aspectos Técnicos
3D Graphics
VTK suporta uma larga variedade de algoritmos de visualização: escalar, vetor, tensor, textura, e métodos volumétricos
Técnicas de modelamento avançadas, tais como: redução poligonal, suavização de malhas e triangulação de Delaunay.
VTK - O que é
National Library of Medicine Insight Segmentation and Registration Toolkit (ITK)
Processamento de Imagens
Segmentação de Imagens
Registro de Imagens
Sem Graphical User Interface (GUI)
Sem visualização
ITK
Visualização Científica
Kitware e seus projetos
O que é o VTK
Aspectos técnicos
Exemplos
Instalação
Aplicações
Agenda
http://www.vtk.org/
Prof. Walmor Cardoso Godoi
walmorgodoi@utfpr.edu.br
Departamento de Física - DAFIS
Universidade Tecnológica Federal do Paraná - UTFPR
Jun/2013

Left Button: rotate
Right Button: zoom
w: wireframe mode
s: surface mode
r: reset the transformation
e: exit
vtkRenderWindowInteractor – permite ao usuário interagir com os objetos gráficos (atores)
User interaction
Vectors
Oriented Lines

Oriented Glyphs

Streamlines
Visualization of Attributes
( property, geometry(mapper), transformation, etc)
vtkActor
vtkLight
vtkCamera
2 vtkRenderer
1 vtkRenderWindow
To see is to believe …
Contour Value of 5
8
4
10
1
Scalar
Color Mapping

Countouring
3D Isosurface
Visualization of Attributes
Fluxograma
Interpreted Wrapper (Tcl, Java, Python)
C++ core
Tcl/Tk source
Java JDK
Python source
Tcl/Tk shell
Java interpreter
C# interpreter
Python interpreter
Libraries and includes
(dll and .h files)
Or
(.a and .h files)
All class source code
(could take hours to
compile)
Binary Installation: if you will use
the classes to build your applicatoin
Source code Installation: If you want to extend vtk
System Architecture
vtkRenderWindowInteractor
vtkRenderWindow
vtkRenderer
vtkActor

vtkProperty
vtkMapper
vtkTransform
vtkLight
vtkCamera
O objetivo é renderizar a geometria (volume ou superfície) na tela do computador
The Graphics Model
TELA
ATOR
LUZ
CÂMERA
O objetivo é renderizar a geometria (volume ou superfície) na tela
The Graphics Model
Geometria
Mapper
Ator
Renderer
Window
textura
relativamente próxima do domínio público
http://w3.impa.br/~rbs/pdf/vc.pdf
http://w3.impa.br/~rbs/pdf/vc.pdf
Full transcript