[Insight-users] ParaView : Tutorial in 20 minutes + 2 Cups of
Coffee
Luis Ibanez
luis . ibanez at kitware . com
Wed, 10 Dec 2003 15:52:40 -0500
Hi Bing,
Here is a 20 minutes tutorial on how to use
ParaView for viewing vector deformation fields.
First,
get some coffee,..
Session One :
Objective: viewing 3D datasets
Time to complete: 10 minutes
0) Download ParaView from
http://www . paraview . org
It is open-source and
free as in "freedom" and as in "free beer".
1) Start paraview
2) Go to the menu "File"->"Open"
and load one of the brainweb images
You can get these images from:
ftp://public . kitware . com/pub/itk/Data
ParaView supports reading from RAW image
data and as VTK file format. Load the
file
brainweb1e5a10f17.raw
in the left panel select:
Data type = unsigned char
Byte order = little endian
FileDimensionality = 3
Origin 0 0 0
Spacing 1 1 1
Extent 0 180 0 216 0 179
Num.components 1
Then click on the "red" button "Accept".
This button will turn red every time that
you modify data associated with the dataset.
The display will only be updated when you
click on the "Accept" button.
3) In the same panel select the "Display" tab
and click on the "Set View to Data" button.
This will scale and center the data in the
display window.
4) Go to the menu bar and select "Filter",
then "Cut". This will add a cutting plane
to the data.
You will see a plane and an orthogonal arrow
crossing it. You can change the position of
the plane by clicking and dragging the arrow
head, the arrow tail or the sphere at the
intersection of the arrow and the plane.
5) On top of the left panel you should now
have the text:
brainweb165a10f17.raw and Cut0
click on brainweb165a10f17.raw
Then go to the menu bar and select "Filter"
"contour" This will generate an isosurface.
In the lower part of the left panel go to
"New value" and enter 30, then click on the
"Add" button and then in "Accept".
ParaView will extract the isosurface of level
20 and render it in the display window.
End of session One:
You graduated in viewing
single component data with ParaView !
Now,
got the second cup of coffee
Session Two:
Objective: Viewing displacement vector fields
Time to complete: 10 minutes
0) In order to generate a vector image you can
use the example:
Insight/Examples/Filtering/
GradientRecursiveGaussianImageFilter.cxx
http://www . itk . org/cgi-bin/cvsweb . cgi/Insight/Examples/Filtering/GradientRecursiveGaussianImageFilter . cxx?cvsroot=Insight
It will take a scalar image as input and will
produce a vector image as output. The vector
image representing the gradient of the input image.
Once you compile this example you run it as
GradientRecursiveGaussianImageFilter
with the arguments
brainweb165a10f17.mhd gradient.mhd 1.0
the output vector image will be saved in the
files "gradient.mhd" and "gradient.raw"
1) Start ParaView
Go to the menu bar and select "File"->"Open",
go for the file "gradient.raw" (not the .mhd)
on the left panel set:
Data type : float
Byte order: little endian
File Dimensionality: 3
Origin : 0 0 0
Spacing : 1 1 1
Extent : 0 180 0 216 0 179
Then click on the "Accept" button
The outline of the dataset should appear in
the display window.
2) Go to the menu bar and select
"Filter"-->"ExtractVOI"
This will subsample the vector data set.
The reason for subsampling is that if you
visualize a vector placed on every pixel,
the density of vector on the screen will
be too high to see anything.
On the lower part of the left panel select
Sample rate = 10 10 10
That will sample one voxel every ten voxels
along every dimension.
3) Go to the menu bar and select
"Filter"->"Glyph"
On the left panel select
"Orient" = vector
"Scale mode" = scalar
"Scale factor" = 0.5
Then click on the Accept button.
ParaView will render a set of vector
representing the gradient that you loaded.
That's it !
You graduated in viewing vector data using ParaView.
You are now ready for starting to register your 3D
datasets and using ParaView for visualizing the
deformation fields.
Now you can attempt to load the vector displacement
field generated from the deformable registration.
Enjoy ITK and ParaView !
Luis
-----------------------
Bing Jian wrote:
> Hi everyone,
>
> I recalled that Luis mentioned a tool like ParaView can be used to
> visualize the deformation field. I just downloaded the ParaView1.0
> for Windows and tried to use it. It looks very cool but also very
> complicated to use. I even don't know how to view an mhd/raw or
> hdr/img file. I noted there is no MetaImage and Analyse in Supported
> Data Formats. and I don't know what are Extent and Num.component
> in Parameters setting. The on-line help does not give much more
> explanation and seems the User's Guide is still under development.
>
> Is there any body who has experience with Paraview and could
> tell me how to visualize the deformation field using it? Many
> thanks in advance!
>