Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
VTK
Sonu mangal
Prepared by,
C4console.com
VTK
• VTK stands for Visualization tool kit
•Act or process of interpreting in visual terms or
of putting into visual form...
VTK Process
C4console.com
How to create VTK file?
various ways to create VTK file like C++, Java,
Python and so on.
Import header file or standard...
Create cone file using VTK
Step 1: Header file
first include the required header files for the vtk
classes we are using li...
Create cone file using VTK
Step 2: Source
In our case, source is a cone.
Next we create an instance of vtkConeSource
and ...
Create cone file using VTK >
Source
Step 2: Source
// create instance of cone
vtkConeSource *cone = vtkConeSource::New();
...
Create cone file using VTK
Step : filter
Process with both input and output.
Filter will be process object with at least...
Create cone file using VTK
Step : intermediate filter
Output of source should be behave as input for
mapper by using these...
Create cone file using VTK
Step 3: mapper
Now we create an instance of mapper to map
the polygonal data into graphics pri...
Create cone file using
VTK>mapper
Step 3: mapper
// create instance of mapper
vtkPolyDataMapper *coneMapper =
vtkPolyDataM...
Pipeline
Consist of object to represent,
•Data object
•Process Object
•Arrow connection object
C4console.com
Pipeline topology
Element of pipeline: Source, filter and mapper to
create visualization pipeline or network
C4console.com
Pipeline issue
Mostly 2 important issue that arises when we
use pipeline
1. Type
2. Multiplicity
Type :
means the form or ...
Pipeline issue
Multiplicity
Is used to read a data file and manipulate them
and to also show them.
For ex: stream file
C4c...
Create cone file using VTK
Step 4: actor
Previously, we create source and set properties
and then map them now, we repres...
Create cone file using
VTK>actor
Step 4: actor
// set mapper graphics into actor for
represent
vtkActor *coneActor = vtkAc...
Create cone file using VTK
Step 5: rendering
Render is the process to convert data as input
and converted into graphics o...
Create cone file using
VTK>render
Step 5: rendering
// create render object
vtkRenderer *ren1= vtkRenderer::New();
// add ...
Create cone file using VTK
Step 6: rendering window
 Now, finally show output in screen by
using renderwindow.h header fi...
Create cone file using
VTK>render window
Step 6: rendering window
// create renderwindow object
vtkRenderWindow *renWin =
...
Create cone file using
Step 7: delete
Now we free OS memory or to release
resource by using delete() function.
cone->Delet...
Result
When we configure and generate .cxx file
then we get following result like,
C4console.com
Thank you
C4console.com
For more details:
www.c4console.com
C4console.com
Upcoming SlideShare
Loading in …5
×

Vtk Image procesing

VTK is for visualisation tool kit

  • Be the first to comment

  • Be the first to like this

Vtk Image procesing

  1. 1. VTK Sonu mangal Prepared by, C4console.com
  2. 2. VTK • VTK stands for Visualization tool kit •Act or process of interpreting in visual terms or of putting into visual form. • in other words, transformation of data or information into picture. •Example : Weather forecasting maps C4console.com
  3. 3. VTK Process C4console.com
  4. 4. How to create VTK file? various ways to create VTK file like C++, Java, Python and so on. Import header file or standard library file and simple use them. C4console.com
  5. 5. Create cone file using VTK Step 1: Header file first include the required header files for the vtk classes we are using like for cone, #include "vtkConeSource.h" #include "vtkPolyDataMapper.h“ #include "vtkActor.h" #include "vtkRenderer.h" #include "vtkRenderWindow.h“ C4console.com
  6. 6. Create cone file using VTK Step 2: Source In our case, source is a cone. Next we create an instance of vtkConeSource and set some of its properties. Is a source process object means with no input. Part of visualization pipeline. Only produces data of output type is vtkpolydata. Which other filter may process. C4console.com
  7. 7. Create cone file using VTK > Source Step 2: Source // create instance of cone vtkConeSource *cone = vtkConeSource::New(); // set properties cone->SetHeight( 3.0 ); cone->SetRadius( 1.0 ); cone->SetResolution( 10 ); C4console.com
  8. 8. Create cone file using VTK Step : filter Process with both input and output. Filter will be process object with at least one input and one output (intermediate data store will not be represented) C4console.com
  9. 9. Create cone file using VTK Step : intermediate filter Output of source should be behave as input for mapper by using these filter. Source mapper Intermediate filter (Vtk shrink polydata filter) C4console.com
  10. 10. Create cone file using VTK Step 3: mapper Now we create an instance of mapper to map the polygonal data into graphics primitives.  declared in vtkploydatamapper.h header file.  also known as sink. Process that consume data with no output. Because these process map data to a final image or output. C4console.com
  11. 11. Create cone file using VTK>mapper Step 3: mapper // create instance of mapper vtkPolyDataMapper *coneMapper = vtkPolyDataMapper::New(); // output of source into mapper coneMapper->SetInputConnection( cone- >GetOutputPort() ); C4console.com
  12. 12. Pipeline Consist of object to represent, •Data object •Process Object •Arrow connection object C4console.com
  13. 13. Pipeline topology Element of pipeline: Source, filter and mapper to create visualization pipeline or network C4console.com
  14. 14. Pipeline issue Mostly 2 important issue that arises when we use pipeline 1. Type 2. Multiplicity Type : means the form or type of data that process object take as input or generate output. For ex: Sphere, cone C4console.com
  15. 15. Pipeline issue Multiplicity Is used to read a data file and manipulate them and to also show them. For ex: stream file C4console.com
  16. 16. Create cone file using VTK Step 4: actor Previously, we create source and set properties and then map them now, we represent the cone. Actor rendering of the mapper's graphics primitives. An actor also refers to properties via a vtkProperty instance, and includes an internal transformation matrix. We set this actor's mapper to be coneMapper which we created previous. C4console.com
  17. 17. Create cone file using VTK>actor Step 4: actor // set mapper graphics into actor for represent vtkActor *coneActor = vtkActor::New(); coneActor->SetMapper( coneMapper ); C4console.com
  18. 18. Create cone file using VTK Step 5: rendering Render is the process to convert data as input and converted into graphics or pictorial representation. 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.  also set the background color here. C4console.com
  19. 19. Create cone file using VTK>render Step 5: rendering // create render object vtkRenderer *ren1= vtkRenderer::New(); // add render with actor ren1->AddActor( coneActor ); // set background ren1->SetBackground( 0.1, 0.2, 0.4 ); C4console.com
  20. 20. Create cone file using VTK Step 6: rendering window  Now, finally show output in screen by using renderwindow.h header file .  we put our renderer into the render window using AddRenderer. C4console.com
  21. 21. Create cone file using VTK>render window Step 6: rendering window // create renderwindow object vtkRenderWindow *renWin = vtkRenderWindow::New(); // add renderwindow with render renWin->AddRenderer( ren1 ); C4console.com
  22. 22. Create cone file using Step 7: delete Now we free OS memory or to release resource by using delete() function. cone->Delete(); coneMapper->Delete(); coneActor->Delete(); ren1->Delete(); renWin->Delete(); C4console.com
  23. 23. Result When we configure and generate .cxx file then we get following result like, C4console.com
  24. 24. Thank you C4console.com
  25. 25. For more details: www.c4console.com C4console.com

×