Difference between revisions of "SciVisFall2007/Assignment 3/FAQ"

From VistrailsWiki
Jump to navigation Jump to search
 
(2 intermediate revisions by the same user not shown)
Line 28: Line 28:


A:  The Mplot source that was included in the example VisTrail has two sub-sections.  Each of these 2 sections plots a (simple) contour spectrum in a different way.  Explore how using sub-plots vs. combining each piece of data in the same plot changes how the data is represented.
A:  The Mplot source that was included in the example VisTrail has two sub-sections.  Each of these 2 sections plots a (simple) contour spectrum in a different way.  Explore how using sub-plots vs. combining each piece of data in the same plot changes how the data is represented.
Q:  I can't seem to get a vector visualization for Problem 1.  Do I need to separate the vector and scalar data? 
A:  No.  VTK's streamline classes are smart enough to automatically extract the vector field from the dataset regardless of how many scalar fields are attached to it.  If you are having problems, keep in mind that the starting point of the streamline is very important to how the final visualization is rendered.
Q:  I'm having some problems with streamlines.  What am I doing wrong?
A:  Streamlines in VTK are very flexible... unfortunately, this means that they can also be slightly more difficult to get working than you would think.  Firstly, make sure that your seed points are inside the vector field.  To do this, attach your seed point collection to a vtkDataSetMapper/Actor combo and render them.  If they are inside the vector field, you're good to go.  Secondly, make sure that the vtkStreamTracer module has the following functions set on it:
SetIntegrationDirectionToBoth  - This ensures proper streamline formation
SetMaximumPropogation  - Controls how long the streamlines are
SetMaximumPropogationUnitToCellLengthUnit  - Without this, you can get some strange results!
Q:  How can I inspect a vtk dataset to get things like the scalar range, bounding box, etc?
A:  This can be done inside a PythonSource module.  By grabbing the output of the data reader, any method of the dataset can be called and the result printed.  You can also print the dataset directly (it calls the dataset Print() function) to get more detailed information on it.  The PythonSource should have an input port of type vtkAlgorithmOutput like below:
Ports:
input      vtkAlgorithmOutput
Code:
data = input.vtkInstance.GetProducer().GetOutput()
print data
print data.GetScalarRange()
print data.GetBounds()
The appropriate information will be printed to stdout (the command prompt that opens with VisTrails)  commenting out or adding additional print statements will let you control how much information is printed.  A VisTrail with a PythonSource that does this is [http://www.sci.utah.edu/~eranders/scivis_fall07/assignment3/datasetInspector.vt here.]

Latest revision as of 20:19, 27 November 2007

Q: I cannot read the tokamak datasets. VisTrails crashes regardless of what I try to do!

A: The version of VisTrails distributed uses a different version of the VTK libraries than those used to generate the dataset. To fix this, we have substituted the dataset to be used for the problems relating to Iso-Surfacing. The problems and general dataset properties remain the same, but the underlying data description is a bit different.


Q: In problem 1c, what do you mean by "change from the initial conditions?"

A: The initial condition here is meant to be time-step 1, with the change being exhibited by changing the time-step being visualized.


Q: In problem 1c, what do you mean by "the two data?" Is it the two time steps?

A: In this case, visualizing the two data refers to the fact that there is a scalar field as well as a vector field in each data set. What method(s) can be used to visualize both of these types of data (vector field with a scalar field) simultaneously?


Q: I'm having problems generating contour spectra. It gives me a "Volume May Not Be Closed" error, am I doing something wrong?

A: No, you are probably not doing anything wrong. All contours that you generate for the Columbia River datasets will NOT be closed. This is something that you should expect. In the PythonSource that generates the contours, I put a check in there on purpose for exactly this sort of situation. Examine the PythonSource module generating the spectra and edit it to NOT use volume information and instead use some other metric(s). These metrics are explained in detail in the class documentation for the vtkMassProperties class Simply replace the GetVolume() call to the metric you wish to use.


Q: In problem 1, you have vertex-centered unstructured hexahedral mesh for the dataset of Colombia river. That's different with tetrahedral mesh we usually use. I looked up for the vtk function for hexahedral in vistrail to try to extract the scalar and normal vector but can not find anything relevant. Do you have any references about that?

A: VTK's classes are generally smarter to handle any type of volumetric data. In this case, we have hexahedral meshes instead of tetrahedral ones. The iso-contour filters and stream tracing filters handle all types of data. The only change you need to be aware of is if you are trying to volume render the data. Try using vtkUnstructuredGridVolumeZSweepMapper instead of the standard raycaster or other volume mapper. Beware, though, this method could be quite slow. I recommend using a DataSetMapper with a LUT or using only the iso-contouring methods.


Q: In problem 3c, you ask us to generate 2 visualizations for the contour spectra. What do you mean by this?

A: The Mplot source that was included in the example VisTrail has two sub-sections. Each of these 2 sections plots a (simple) contour spectrum in a different way. Explore how using sub-plots vs. combining each piece of data in the same plot changes how the data is represented.


Q: I can't seem to get a vector visualization for Problem 1. Do I need to separate the vector and scalar data?

A: No. VTK's streamline classes are smart enough to automatically extract the vector field from the dataset regardless of how many scalar fields are attached to it. If you are having problems, keep in mind that the starting point of the streamline is very important to how the final visualization is rendered.


Q: I'm having some problems with streamlines. What am I doing wrong?

A: Streamlines in VTK are very flexible... unfortunately, this means that they can also be slightly more difficult to get working than you would think. Firstly, make sure that your seed points are inside the vector field. To do this, attach your seed point collection to a vtkDataSetMapper/Actor combo and render them. If they are inside the vector field, you're good to go. Secondly, make sure that the vtkStreamTracer module has the following functions set on it:

SetIntegrationDirectionToBoth - This ensures proper streamline formation SetMaximumPropogation - Controls how long the streamlines are SetMaximumPropogationUnitToCellLengthUnit - Without this, you can get some strange results!


Q: How can I inspect a vtk dataset to get things like the scalar range, bounding box, etc?

A: This can be done inside a PythonSource module. By grabbing the output of the data reader, any method of the dataset can be called and the result printed. You can also print the dataset directly (it calls the dataset Print() function) to get more detailed information on it. The PythonSource should have an input port of type vtkAlgorithmOutput like below:

Ports:

input vtkAlgorithmOutput

Code:

data = input.vtkInstance.GetProducer().GetOutput()

print data

print data.GetScalarRange()

print data.GetBounds()


The appropriate information will be printed to stdout (the command prompt that opens with VisTrails) commenting out or adding additional print statements will let you control how much information is printed. A VisTrail with a PythonSource that does this is here.