Tutorial on ParaView: Difference between revisions

From bone.wiki
Jump to navigation Jump to search
No edit summary
Deleting, Replaced with Using ParaView page
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
==Purpose==


This is a tutorial that will demonstrate how to use ParaView to examine AIM files, and how to use vtkski and python scripting to construct finite element models with complicated coundary conditions.
This tutorial was done on OS-X, but should be essentially similar for Windows or Linux, with some minor differences.
==Prerequisites==
You'll need ParaView built with the bonelab extensions.  You should be able to find in on the server mike .  On OS-X, click on this link: [[afp://mike.kin.ucalgary.ca/Data0/Software/ParaView_with_extensions/]] .  On Windows, enter \\mike\Data0\Software\ParaView_with_extensions in an Explorer address bar.  In either case, you'll need to be on the university network.
You'll also need python.  Windows users can get it from [[http://www.python.org/]] ; everyone else has it already.
You will need a compiled version of the vtkski library.  To compile it yourself, refer to [[Bone lab libraries#Build_Instructions]] .
You can find the data file used in this tutorial, SAWBONE51_BC_CSTR.AIM, as well as the python script that we will construct, on the server mike at /Data0/Tutorials/ParaView_and_vtkski .
==Background Material==
* If you're not familiar with Python, you might want to go through the tutorial [[http://docs.python.org/tutorial/]] .
* There are a couple of books on VTK floating about the lab, "The Visualization Toolkit" and "VTK User's Guide".
* The API documentation for VTK is at [[http://www.vtk.org/doc/release/5.6/html/index.html]] .  This is where you go to find out exactly what classes are available in VTK and exactly how to use them.
* The API documentation for vtkski is at [[http://mike.kin.ucalgary.ca/vtkski/index.html]] .
==Model Overview==
We want to construct a finite element model of an AIM file that contains a scan of a bone with a screw in it.  Physical tests were done in which the bone was constrained with a ring and the screw was pulled out.  We want to model this with a finite element model.
==Examining the AIM file with ParaView==
Open ParaView.  Click File->Open, and browse to SAWBONE51_BC_CSTR.AIM .  Click OK.  Our custom version of ParaView with bonelab extensions is able to open AIMs, but it may inquire about the file type, as shown in the following dialog.  Just select "AIM File" and proceed.
[[Image:Open_data_with.png]]
Click the Apply button in the Object Inspector.  You should see the following, which is so far only the outline of the bounds of the data.
[[Image:Paraview_open_aim.png]]
In order to convert this data, which is 3D image data to something that can be rendered, a number of different filters can be used.  We are going to use the Threshold filter.  You can find this at the menu item Filters->Common->Threshold .  There is also a button for it on the toolbar.  Click it.  Now in the Object Inspector, set the Lower Threshold to 1.  (If you keep the default value of 0, you just end up rendering a box with the size of the bounds of the data.)  Now hit Apply.
[[Image:ParaView_Threshold_AIM.png]]
We still don't see much!  Why not?  Well, this is such a large data set, that ParaView has decided to render just the outline for now, to save time.  To see the object, go to the Display tab of the Object Inspector, scroll down to the Style box, and change the Representation to Surface.  Voila!
[[Image:ParaView_Change_Representation.png]]

Latest revision as of 17:04, 15 September 2010