Nicholas Del Rio University of Texas at El Paso Computer Science Workshop Objectives U nderstand notion and purpose of visualization queries Understand why writing queries may be easier that writing visualization programs ID: 313168
Download Presentation The PPT/PDF document "Visualization Knowledge Query Language (..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
Visualization Knowledge Query Language (VKQL) Workshop
Nicholas Del
RioUniversity of Texas at El Paso Computer ScienceSlide2
Workshop ObjectivesUnderstand notion and purpose of visualization queriesUnderstand why writing queries may be easier that writing visualization programsLearn
the VKQL syntax and practice posing queriesSlide3
Workshop SummaryGenerating Visualizations ImperativelyVisualization Query
VKQL Syntax and Examples
Activity 1: Manual Inspection of Query
Activity 2: Copy and Pasting ExamplesConclusionSlide4
Velocity Model VisualizationA set of isosurfacesextracted from a seismic velocity modelCovers a region in southern New Mexico
8 km/s
3
km/s
DepthSlide5
Visualizing the Velocity ModelGenerated by custom Java applicationrelied on Visualization Toolkit (VTK) for renderingVTK was developed for rendering 3D visualizationsVTK is supported by Sandia, Los Alamos, ARL, and others
Writing a custom visualization application:may rely on third party package to support rendering
may need to perform some transformations on input dataset before renderingSlide6
Visualization ToolkitsVisualization Toolkit (VTK) was used to render the velocity visualizationVTK is a toolkit that provides functions such as:Filtering
Gridding/interpolatingMapping (i.e., transform data into views like isosurfaces)Rendering the views
Functions are referred to as operatorsGeneric mapping tools (GMT): 60 operators
VTK: hundreds of operatorsSlide7
Visualization Pipeline ModelVTK requires that users write pipelinesthe output of an operator feeds into the operator next in the pipeline sequencefirst operator in pipeline is usually data readerfinal operator in pipeline is usually renderer
Thus the Java program that visualizes the velocity model can be seen as a pipeline of VTK operators
It is up to the users to write these pipelines…Slide8
VTK Java Pipeline For Velocity Model
vtkImageReader rdr
= new vtkImageReader();rdr.SetFileName
(inputDatasetFilePath);rdr.SetDataScalarTypeToUnsignedShort();rdr.SetDataByteOrderToLittleEndian();rdr.SetFileDimensionality(3);rdr.SetDataOrigin
(0,0,0);rdr.SetDataSpacing(1,1,1);rdr.SetDataExtent(0,230,0,25,0,68);rdr.SetNumberOfScalarComponents(1);
rdr.FileLowerLeftOn();rdr.Update();vtkContourFilter contours = new vtkContourFilter();
contours.SetInput(rdr.GetOutput());contours.GenerateValues
(35,0.0,9000.0
);
vtkPolyDataMapper
contMapper
= new
vtkPolyDataMapper
();
contMapper.SetInput
(
contours.GetOutput
());
contMapper.SetScalarRange
(0.0,9000.0
);
vtkActor
contActor
= new
vtkActor
();
contActor.SetMapper
(
contMapper
);
contActor.RotateX
(105);
vtkRenderer
ren1 = new
vtkRenderer
();
ren1.AddActor(
contActor
);
ren1.AddActor2D(
outlineActor
);
ren1.SetBackground(1,1,1);
vtkRenderWindow
renWin
= new
vtkRenderWindow
();
renWin.SetOffScreenRendering
(1);
renWin.AddRenderer
(ren1);
renWin.SetSize
(300,300);
renWin.Render
();
vtkJPEGWriter
img
= new
vtkJPEGWriter
();
img.SetInputConnection
(
renWin.GetOutputPort
());
img.SetFileName
(
outputDatasetFilePath
);
img.SetQuality
(100);Slide9
Pipeline of Visualization Operators
vtkImageReader rdr
= new vtkImageReader();rdr.SetFileName
(inputDatasetFilePath);rdr.SetDataScalarTypeToUnsignedShort();rdr.SetDataByteOrderToLittleEndian();rdr.SetFileDimensionality(3);rdr.SetDataOrigin
(0,0,0);rdr.SetDataSpacing(1,1,1);rdr.SetDataExtent(0,230,0,25,0,68);rdr.SetNumberOfScalarComponents(1);
rdr.FileLowerLeftOn();rdr.Update();vtkContourFilter contours = new vtkContourFilter();contours.SetInput
(rdr.GetOutput());contours.GenerateValues
(35,0.0,9000.0
);
vtkPolyDataMapper
contMapper
= new
vtkPolyDataMapper
();
contMapper.SetInput
(
contours.GetOutput
());
contMapper.SetScalarRange
(0.0,9000.0
);
vtkActor
contActor
= new
vtkActor
();
contActor.SetMapper
(
contMapper
);
contActor.RotateX
(105);
vtkRenderer ren1 = new vtkRenderer();ren1.AddActor(contActor);ren1.AddActor2D(outlineActor);ren1.SetBackground(1,1,1);vtkRenderWindow renWin = new vtkRenderWindow();renWin.SetOffScreenRendering(1);renWin.AddRenderer(ren1);renWin.SetSize(300,300);renWin.Render();vtkJPEGWriter img = new vtkJPEGWriter();img.SetInputConnection(renWin.GetOutputPort());img.SetFileName(outputDatasetFilePath);img.SetQuality(100);
Op 1
Op 2
Op
3
Op 5
Op 6
Op 7
Op 8Slide10
Different Types of Operators
vtkImageReader rdr
= new vtkImageReader();rdr.SetFileName(
inputDatasetFilePath);rdr.SetDataScalarTypeToUnsignedShort();rdr.SetDataByteOrderToLittleEndian();rdr.SetFileDimensionality(3);rdr.SetDataOrigin
(0,0,0);rdr.SetDataSpacing(1,1,1);rdr.SetDataExtent(0,230,0,25,0,68);rdr.SetNumberOfScalarComponents(1);
rdr.FileLowerLeftOn();rdr.Update();vtkContourFilter contours = new vtkContourFilter();contours.SetInput
(rdr.GetOutput());contours.GenerateValues
(35,0.0,9000.0
);
vtkPolyDataMapper
contMapper
= new
vtkPolyDataMapper
();
contMapper.SetInput
(
contours.GetOutput
());
contMapper.SetScalarRange
(0.0,9000.0
);
vtkActor
contActor
= new
vtkActor
();
contActor.SetMapper
(
contMapper
);
contActor.RotateX
(105);
vtkRenderer ren1 = new vtkRenderer();ren1.AddActor(contActor);ren1.AddActor2D(outlineActor);ren1.SetBackground(1,1,1);vtkRenderWindow renWin = new vtkRenderWindow();renWin.SetOffScreenRendering(1);renWin.AddRenderer(ren1);renWin.SetSize(300,300);renWin.Render();vtkJPEGWriter img = new vtkJPEGWriter();img.SetInputConnection(renWin.GetOutputPort());img.SetFileName(outputDatasetFilePath);img.SetQuality(100);
Op 1
Op 2
Op
3
Op 5
Op 6
Op 7
Op 8
Transformer
View Mapper
Renderer
Transformer
Transformer
Transformer
TransformerSlide11
Operators are Parameterized
vtkImageReader rdr
= new vtkImageReader();rdr.SetFileName(
inputDatasetFilePath);rdr.SetDataScalarTypeToUnsignedShort();rdr.SetDataByteOrderToLittleEndian();rdr.SetFileDimensionality(3);rdr.SetDataOrigin
(0,0,0);rdr.SetDataSpacing(1,1,1);rdr.SetDataExtent(0,230,0,25,0,68);rdr.SetNumberOfScalarComponents(1);
rdr.FileLowerLeftOn();rdr.Update();vtkContourFilter contours = new vtkContourFilter();contours.SetInput
(rdr.GetOutput());contours.GenerateValues
(35,0.0,9000.0
);
vtkPolyDataMapper
contMapper
= new
vtkPolyDataMapper
();
contMapper.SetInput
(
contours.GetOutput
());
contMapper.SetScalarRange
(0.0,9000.0
);
vtkActor
contActor
= new
vtkActor
();
contActor.SetMapper
(
contMapper
);
contActor.RotateX
(105);
vtkRenderer ren1 = new vtkRenderer();ren1.AddActor(contActor);ren1.AddActor2D(outlineActor);ren1.SetBackground(1,1,1);vtkRenderWindow renWin = new vtkRenderWindow();renWin.SetOffScreenRendering(1);renWin.AddRenderer(ren1);renWin.SetSize(300,300);renWin.Render();vtkJPEGWriter img = new vtkJPEGWriter();img.SetInputConnection(renWin.GetOutputPort());img.SetFileName(outputDatasetFilePath);img.SetQuality(100);
Op 1
Op 2
Op
3
Op 5
Op 6
Op 7
Op 8
P1
P2
P5
P6
P7
P8
P9
P3
P4Slide12
Declarative RequestsMany user skills needed to visualize dataAside from cognitive aspects of visualization, a large part of the problem is engineeringStems from fact that we generate visualizations imperatively (i.e., write code)
Can we provide a means for users to generate visualizations declaratively (i.e.,
generate what visualization they want without having to write code)?Slide13
Workshop SummaryGenerating Visualizations ImperativelyVisualization Query
VKQL Syntax and Examples
Activity 1: Manual Inspection of Query
Activity 2: Copy and Pasting ExamplesConclusionSlide14
Visualization Query(AND
(hasView
?VIS isosurfaces)
(hasContent ?VIS http://vel.3d)
(hasFormat ?VIS floatArray)
(hasType ?VIS velocityData
)
(
viewedBy
?VIS
mozilla
-firefox
)
(
hasValue
numContours
36))
Desired View
URL of Data to visualize
Semantic Type of dataset
WDO types (UTEP)
Format of dataset
Parameter
Argument
Viewer
The velocity model visualization was actually a result of a
visualization query
Requested VisualizationSlide15
Visualization Queries and SQLVisualization queries mirror SQL queriesquery request is specified declarativelyrequest is then translated into a query planquery plan computes the result requested by the query
Information specified in visualization queries is used to derive pipelines rather than query plans
The pipeline in turn generates the visualization requested in the querySlide16
Information Needed to Write QueriesAt a minimum you need to know:The type of your dataset (e.g., gravity, seismic)The format it is stored
in (e.g., netCDF)The URL of your dataset
With only above info, all possible visualizations will be returned (wildcard)For more control, you need to know:What view you want (i.e., chart,
isolines, volume)The appropriate values for operator parametersSlide17
Workshop SummaryGenerating Visualizations ImperativelyVisualization Query
VKQL Syntax and Examples
Activity 1: Manual Inspection of QueryActivity
2: Copy and Pasting ExamplesConclusionSlide18
VKQL SyntaxA conjunction of Prolog statements that contain:hasView( -DATA, ?VIEW)hasContent(-DATA, +URL),
hasType(-DATA, +TYPE),
hasFormat(-DATA, +FORMAT)[hasValue
(+PARAM, +VALUE)]Variable NameMeaningDATA
The requested visualizationVIEWThe view (e.g., 2D plot, isolines, volume)URLURL of information to be visualized
TYPESemantic Type of Data (e.g., gravity, 3DVelocity)FORMATFormat of data (e.g., netCDF, ascii-tabular)
PARAMAn operator parameter
VALUE
Argument passed to PARAM
Symbol
Meaning
-
Unbound
?
Optional
+
RequiredSlide19
Workshop SummaryGenerating Visualizations ImperativelyVisualization Query
VKQL Syntax and
ExamplesActivity 1: Manual Inspection of Query
Activity 2: Copy and Pasting ExamplesConclusionSlide20
Activity 1: Manual Inspection of QueryNavigate to: http://trust.utep.edu/visko/vkql-examples/Refer to the first query specified on the page:What viewer is the query requesting the system to target?
What view is the query requesting the system to generate?
What is the type and format of the dataset being visualized?Are there any parameter bindings? If so what is the parameter bound to?Slide21
Workshop SummaryGenerating Visualizations ImperativelyVisualization Query
VKQL Syntax and
ExamplesActivity 1: Manual Inspection of Query
Activity 2: Copy and Pasting ExamplesConclusionSlide22
Submitting VKQL QueriesVKQL queries can be entered and executed at: http://trust.utep.edu/visko/vkql/You can build queries by selecting values from combo boxesYou can type queries manually in a text box without any guidance or copy and paste an existing querySlide23
Activity 2: Pasting ExamplesNavigate to: http://trust.utep.edu/visko/vkql-examples/
Copy query for: Gridded Time with RotationPaste and Submit Query in Query Submission Page
Try manually changing the values assigned to:
xRotationyRotationzRotationResubmit with new bindingsSlide24
Workshop SummaryGenerating Visualizations ImperativelyVisualization Query
VKQL Syntax and
ExamplesActivity 1: Manual Inspection of Query
Activity 2: Copy and Pasting ExamplesConclusionSlide25
ConclusionWriting queries may be easier to request for visualization generation than writing imperative codeVKQL Queries can be constructed a few ways using the VKQL Query Submit interfaceVKQL Queries can target more than a single toolkit for generation