Scientific Visualization With VTK, The . - Tcl/Tk

2y ago
13 Views
2 Downloads
4.97 MB
72 Pages
Last View : 11d ago
Last Download : 3m ago
Upload by : Mika Lloyd
Transcription

Scientific Visualization with VTK,The Visualization ToolkitScience and Technology Support GroupHigh Performance ComputingOhio Supercomputer Center1224 Kinnear RoadColumbus, OH 43212-1163

Table of Contents Day 1: Session 1– Preparation on BALE Cluster– What is VTK?– Installing VTK! Cmake, C Java, Tcl/Tk, Python– First Look Using the four platforms C , Python, Tcl, Java– VTK Overview Graphics model Visualization model Day 1: Session 2– Basics Interacting with the WindowProcedural Source ObjectsRead Source ObjectsFiltering DataControlling CamerasControlling LightsControlling 3D PropsTexturesPickingOther Controls– Annotation– LOD-Level of Detail– Assemblies– Volume– Programming and theVisualization Pipeline– Special Plotting Classes Scalar BarsX-Y PlotsBounding Box AxesLabeling Data– 3D Widgets2Scientific Visualization with VTK

Table of Contents Day 2: Session 1– Visualization Techniques Color CuttingMerge dataProbingIsosurfaces Day 2: Session 2– Case Study Material defectsComputational Fluid DynamicsFinite Element AnalysisSegmented Volume Data3Scientific Visualization with VTK

Preparation on BALE Cluster Limited disk space for workshop accounts in {HOME}Change the shell environment– tcsh Change to larger disk space– cd /tmpCopy the resource directory to the local disk– cp –r pete/VTKWorkshop .– cd VTKWorkshop– source Stuff/cshrc Creates needed environment variables Contents of directory– Docs Supporting book4Scientific Visualization with VTK

Preparation on BALE Cluster Looking for VTK expression– Position shell script, search.csh, in Examples cd Examples cp ./Stuff/search.csh .– search.csh dir vtkexpression dir is one of Cxx Python Tcl vtkexpression is any VTK class or functionname search.csh Python SetColor For the rest of this workshop this will beyour working directory5Scientific Visualization with VTK

What is VTK? Open source software for 3D computer graphics, imageprocessing and visualizationDistributed by Kitware, Inc., http://www.vtk.orgConsists of a C class librarySeveral interpreted interface layers, including Python, Tcl/Tk,and JavaSupports a wide variety of visualization algorithms, includingscalar, vector, tensor, texture, and volumetricAdvanced modeling techniques, such as implicit modeling,polygon reduction, mesh smoothing, cutting, contouring andDelaunay triangulation.Additionally, many imaging algorithms have been integrated,mixing 2D imaging and 3D graphics algorithms and dataDesign and implementation influenced by object-orientedprinciples6Scientific Visualization with VTK

What is VTK? Source distribution comes with manyexamplesNot cool?– Not super-fast graphics engine, usesC dynamic binding and deviceindependent graphics model– Very large need a decent system andgraphics card– C source code (Tcl or Pythonrecommended) Documentation consists of online help,HTML based,[http://www.vtk.org/doc/release/4.2/html]Two manuals, The Visualization Toolkitand The VTK User’s Guide,[httlp//www.vtk.org/buy-books.php]– Together about 160.00– Very recommended7Scientific Visualization with VTK

Installing VTK! No Unix, No Linux, No ServiceOSC forums,[http://www.osc.edu/forums]–– – Compiling from source recommendedbecause of dependenciesUseful Linux tools–– Sebastien Barre’s ers mailing kusers]Looking for installed executables: “whichcommand”Locating specific files, libraries, includefiles: “locate filename”Installation instructions very straightforwardCmake installation required; url linkedoff http://www.vtk.orgInstalling as root highly recommendedInstall any of the support programmingplatforms first–Look for a VTK/Paraview forumIssues of an open access vs. secure accessC should be already installed Additional resources– ––– Cmake typically will find and set mostoptionsCustomizing build using interactivewizard mode, “cmake –i”–– Tcl/Tk [http://www.tcl.org]Python [http://www.python.org] Should install Tkinter.pyJava [http://www.java.sun.com]Terminal based user interface, ccmake– /usr/bin/c /usr/bin/gccMost options will be set by cmakeBut check to be sure, especially withsettings for libraries/includes for supportplatformsAfter cmake, three steps––make (makes binaries/libraries)make test –Will create a report of successes/failuresmake install (if root)8Scientific Visualization with VTK

First Look Running an example under the fourdifferent platformsChange directory to/tmp/dirname/Examples/Tutorial/Step1 C – Change directory to Cxx/– Do not need to compile anyadditional support like Java, Pythonor Tcl/Tk– Cmake generates a makefile Tcl– Change directory to Tcl/– The VTK build includes a VTK tclcommand called ‘vtk’– Execute the command vtk Cone.tcl cmake . The dot, ‘.’, is required– Use the make command to generatethe executable– To execute type the command‘./Cone’Image created by Cone.py9Scientific Visualization with VTK

First Look Python––– Change directory to PythonVTK build includes a VTK pythoncommand called ‘vtkpython’May want to alias this to something short alias vtkpython vpMake sure no other command called vp which vpFor BALE this is done by sourcing Stuff/cshrcJava––Change directory to Java/Make certain Java CLASSPATHenvironment variable is set to the VKTjava directory –Byte compile java code using ‘javac’ –PathtoVTK/Wrapping/java/vtkCreates ‘Cone.class’Execute using java runtime java Cone10Scientific Visualization with VTK

Graphics Model Graphics model–––– Transform graphical data into imagesActors, lighting, cameras, renderers,mappersCreates a sceneMappers interface between thevisualization pipeline and the graphicsmodel––Visualization pipeline transformsinformation into graphical dataUses a data flow approachTwo basic types of objects �� Visualization Model– Process objects (filters)Filters operate on data objects toproduce new data objectsProcess and data objects form thevisualization pipelinePipeline topology based on filter I/OthisFilter- setInput(thatFilter- getOutput) Visualization pipelines use lazyevaluation–Only executes when data is required forcomputationvtkDataObject––––Datasets (vtkDataSet) have formalstructuresData objects have geometric andtopological structure (points and cells)Attribute data (scalars and vectors) areassociated with the data objectsCells are topological arrangements ofpoints11Scientific Visualization with VTK

Graphics ModelData objects combined with process objectto create viz pipelineConceptual view of pipeline execution12Scientific Visualization with VTK

Graphics ModelMultiplicity of input and output13Scientific Visualization with VTK

Graphics ModelData attributes associated with the points and cells of a dataset14Scientific Visualization with VTK

Graphics ModelDataset types found in VTK.15Scientific Visualization with VTK

Programming and the Visualization Pipeline Look at the programmingimplementationFrom Cone.py inExamples/Tutorial/Step1/Python/Represents the basic setup for VTKprogramsData source [here vtkConeSource]–– vtkMapper and vtkLookupTable––– Procedural data, cone, sphere, cylinder,etc.Or data read from a fileTransform and render geometryInterface between the viz pipeline andthe graphics modelvtkScalarToColors maps data values tocolorvtkActors–Combine object properties, geometriesand orientation in virtual coordinates vtkRenderer– Coordinates lights, cameras and actorsto create and imagevtkRenderWindow–Manages window(s) on display device# The basic setup of:# source - mapper - actor - renderer - renderwindow# is typical of most VTK programs.cone vtk.vtkConeSource()cone.SetHeight( 3.0 )cone.SetRadius( 1.0 )cone.SetResolution( 10 )coneMapper vtk.vtkPolyDataMapper()coneMapper.SetInput( cone.GetOutput() )coneActor vtk.vtkActor()coneActor.SetMapper( coneMapper )ren1 vtk.vtkRenderer()ren1.AddActor( coneActor )ren1.SetBackground( 0.1, 0.2, 0.4 )renWin vtk.vtkRenderWindow()renWin.AddRenderer( ren1 )renWin.SetSize( 300, 300 )16Scientific Visualization with VTK

Programming and the Visualization Pipeline Conversions between languages relativelystraightforward––––Class names and method names remain the sameImplementation details change (syntax)GUI details changeExample, in the Cone program Python: “ren1.GetActiveCamera().Azimuth( 1 )” C : “ren1- GetActiveCamera()- Azimuth( 1 );” Tcl: “[ren1 GetActiveCamera] Azimuth 1”Java: “ren1.GetActiveCamera().Azimuth( 1 );”17Scientific Visualization with VTK

Basics - Interacting with the Window Interacting with the data once renderedUsing the vtkRenderWindowInteractor– –Toggle between joystick or trackball modeIn joystick style the motion occurscontinuously as long as the mouse button ispressedIn trackball style the motion occurs when themouse button is pressed and the mouse cursormoves – Rotate camera or actorCamera rotated around its focal pointActor rotated around its origin –Zoom camera or scale actorZoom in/increase scale in top half of theviewportZoom out/decrease scale in lower half of theviewportIn joystick mode amount is controlled bydistance of the pointer from the horizontalcenter lineKeypress 3 –Pan camera or translate actorIn joystick mode direction of pan/translationis from center of the viewport toward themouse positionIn trackball mode, direction of motion in thedirection of the mouse movement MMBRMB Toggle between camera and actor modesIn camera mode, the mouse events affect thecamera position and focal pointIn actor mode, the mouse events affect theobject under the mouse pointerLMBMMB Keypress c a –vtkRenderWindowInteractor (cont’d)Keypress j t – Toggle in and out of stereo modeDefault is red-blue stereo pairsKeypress e q Exit/quit application18Scientific Visualization with VTK

Basics - Interacting with the Window vtkRenderWindowInteractor (cont’d)–Keypress f –Keypress p –Reset the camera along the viewing directionCenters the actorsAll actors visibleAll actors represented as surfacesKeypress u –solid coneKeypress s –Pick operationRender window has an internal instance ofvtkPropPicker for picking.Keypress r –Fly-to the point under the cursorSets the focal point allowing rotations aboutthat pointwired coneInvokes user-defined modeTypically, brings up an command interactorwindowRerender using “iren Render”Keypress w All actors represented in wire framestereo cone19Scientific Visualization with VTK

Basics – Creating Models Two basic ways to obtain data–– Read into a system from file, stream, etc.Procedurally created by math expression oralgorithmCreating a procedural object–Load the vtk resources –––––vtkinteraction permits typing commands atrun time, among other resourcesvtktesting defines a set of colorsCreate a cylinder defining the geometryUsing the SetInput method the cylindermapper is created from the cylinder geometryPipeline consists of two objects, source andmapperAs yet, no data processed, lazy evaluationCreate graphics objects to render actor(s) /Examples/Rendering/Tcl/Cylinder.tcl:package require vtkpackage require vtkinteractionpackage require vtktestingvtkCylinderSource cylindercylinder SetResolution 8vtkPolyDataMapper cylinderMappercylinderMapper SetInput [cylinder GetOutput]vtkActor cylinderActorcylinderActor SetMapper cylinderMappereval [cylinderActor GetProperty] SetColor tomatocylinderActor RotateX 30.0cylinderActor RotateY -45.0vtkRenderer ren1vtkRenderWindow renWinrenWin AddRenderer ren1vtkRenderWindowInteractor ireniren SetRenderWindow renWinren1 coordinates rendering process for theviewportrenWin controls the mapping of the viewportto the deviceiren is a 3D widget for manipulating thecamera20Scientific Visualization with VTK

Basics – Creating Models Creating a procedural object (cont’d)––––––– Renderer is connected to the render windowMust connect actor(s) to rendererAssociate GUI interactor with render windowinteractor’s user-defined methodInitialize method begins the event loopTcl/Tk command withdraw defines that theinterpreter widget, .vtkInteract, is not visibleat startupPipeline executes because rendering processwill request dataForce execution of pipeline with by invokingrenWin RenderCreating reader object––––––Similar to previous exampleException is that reading data from disk42400-IDGH.stl is in binary STL data formatSTL is stereo-lithography fileIf changes made to file, pipeline not reexecutedInvoke Modified() method /Examples/Rendering/Tcl/Cylinder.tcl:ren1 AddActor cylinderActorren1 SetBackground 0.1 0.2 0.4renWin SetSize 200 200iren AddObserver UserEvent {wm deiconify\.vtkInteract}iren Initialize[ren1 GetActiveCamera] Zoom 1.5renWin Render# suppress Tcl/Tk empty “.” window# with VTK “withdraw” commandwm withdraw . /Examples/Rendering/Tcl/CADPart.tcl:# This creates a polygonal cylinder model with# eight circumferential facets.#vtkSTLReader partpart SetFileName \" VTK DATA ROOT/Data/42400-IDGH.stl"21Scientific Visualization with VTK

Basics – Creating Models Creating reader object (cont’d)––VTK has very limited modeling toolsSupports wide range of formats for thereader classes –Movie BYUWavefront .objASCII Gaussian cubeMolecular (PDB)XML poly dataVTK formatVTK importer class reads/writes multipledatasets Comprise a sceneImporter will create instances of lights,cameras, actors, etc.Create instances of vtkRenderer andvtkRenderWindow /Examples/IO/Python/flamingo.py22Scientific Visualization with VTK

Basics – Filtering Data Adding filters to the pipeline–Filters connected to pipeline using VTKmethods ––––SetInput()GetOutput()Example shows the vtkShrinkPolyData classMake sure input/output type is compatiblewith its counterpartViz pipelines can contain loopsBut, output of filters cannot be directlyconnected to its input# This creates a polygonal cylinder model with eight circumferentialfacets.#vtkSTLReader partpart SetFileName " VTK DATA ROOT/Data/42400-IDGH.stl"# A filter is a module that takes at least one input and produces at# least one output. The SetInput and GetOutput methods are used to do# the connection. What is returned by GetOutput is a particulat dataset# type. If the type is compatible with the SetInput method, then the# filters can be connected together.## Here we add a filter that computes surface normals from the geometry.#vtkShrinkPolyData shrinkshrink SetInput [part GetOutput]shrink SetShrinkFactor 0.85 ific Visualization with VTK

Basics – Controlling Cameras VTK renderer automatically instancescamerasCamera settings–––– Clipping range (hither/yon)Direction and position set by the focal pointand positionOrientation set by the view up settingNormal to the current position and focal pointset by ComputeViewPlaneNormal() methodvtkCamera cam1cam1 SetClippingRange 0.5 200.0cam1 SetFocalPoint 0.45 -0.23 -5.1cam1 SetPosition 0 0 5cam1 ComputeViewPlaneNormalcam1 SetViewUp -0.02 0.99995 0.045ren1 SetActiveCamera cam1Retrieving cameraset cam1 [ren1 GetActiveCamera] cam1 Zoom 1.4Simple manipulation–Move camera about the focal point Camera settingsUses spherical coordinate systemAzimuth moves in the longitude direction– cam1 Azimuth 150Elevation moves in latitude direction– cam1 Elevation 60Do not alter view upSingularities occur at north and south polePerspective/Orthogonal projection–Perspective may introduce distortion, viewangleElevationRollAzimuthCamera movements aroundfocal point24Scientific Visualization with VTK

Basics – Controlling Cameras Perspective/Orthogonal projection–Perspective projection may introducedistortion –view angle creates clipping pyramidOrthogonal projection alternative method View rays are parallelObjects are rendered without distance effectsUse the methodvtkCamera::ParallelProjectionOn()View angle cannot control zoomUse SetParallelScale() method to magnify theactorsView UpYawRollPitch25Scientific Visualization with VTK

Basics – Controlling Lights Lights easier to controlDirectional lighting––– Light assumed at infinityLight rays parallel to a directionSetting the lighting Position Direction ColorvtkLight lightlight SetColor 1 0 0light SetFocalPointlight SetPosition [cam1 GetPosition]ren1 AddLight lightPositional lighting (spot lights)–––Method PositionalOn()Method SetConeAngle()Cone angle of 180 degrees No spot light effectsOnly effects of the position ntific Visualization with VTK

Basics – Controlling 3D Props vtkProp3D superclass of types of propsexisting in 3D space–– Defining Position (cont’d)–Has a 4x4 transformation matrixSupports scaling, translating, rotating andgeometric projection–Class vtkActor is a type vtkProp3D––Analytic primitives define geometry PolygonsLines Actors are the most common type of vtkProp3D–Defining Position–––––SetPosition(x, y, z) in world coordinatesAddPosition(x, y, z), translates from thecurrent positionRotateX(theta), RotateY(theta),RotateZ(theta), rotate around the respectiveaxis by theta degreesSetOrientation(x, y, z), rotate, in degrees,about the z axis, then x axis, and finally yaxisAddOrientation(t1, t2, t3), add to the currentorientationRotateWXYZ(theta, x, y, z), rotate theta degreesabout the axis determined by the x-y-z vectorScale(sx, sy, sz), scale in the x, y, z axesdirectionsSetOrigin(x, y, z), specify origin, around whichrotations and scaling occurGroup rendering attributes –Surface propertiesRepresentationTexture mapsGeometric definitionDefining geometry Specified by the SetMapper() methodvtkPolyDataMapper mappermapper SetInput [aFilter GetOutput]vtkActor anActoranActor SetMapper mapper27Scientific Visualization with VTK

Basics – Controlling 3D Props Actors (cont’d)–Properties –control the appearance of the actorFeatures include controlling color, shading,representation, opacity and lighting effectsMay dereference property usingGetProperty() methodAlternate method is create a property thenassign it to the actoradvantage is that one property may be usedfor a number of actorsColor Use the SetColor() methodSets red, green, blue in that orderValues range from zero to oneAlternatively, set ambient, specular anddiffuse colors separatelyvtkActor anActoranActor SetMapper mapper[anActor getProperty] SetOpacity 0.25[anActor getProperty] SetAmbient 0.25[anActor getProperty] SetDiffuse 0.25[anActor getProperty] SetSpecular 0.25[anActor getProperty] SetSpecularPower 0.25vtkProperty propprop SetOpacity 0.25prop SetAmbient 0.25prop SetDiffuse 0.25prop SetSpecular 0.25prop SetSpecularPower 0.25vtkActor anActoranActor SetMapper mapperanActor SetProperty propanActor SetColor 0.8 0.5 0.01vtkActor anActoranActor SetMapper mapper[anActor getProperty] SetAmbientColor .1 .1 .1[anActor getProperty] SetDiffuseColor .1 .6. 78[anActor getProperty] SetSpecularColor 1 1 128Scientific Visualization with VTK

Basics – Controlling 3D Props Actors (cont’d)–Transparency –Visibility –VisibilityOn() methodVisibilityOff() methodTurn off the pickability of an actor –Useful when need to view surfaces hidden byother surfacesAn example would be to show the skeletonwithin the skin of a patient by adjusting thetransparency of the skinUse the vtkProperty::SetOpacity() methodImplemented using an α–blending processRequires polygons rendered in the correctorderAdd transparent actors to the end ofrenderer’s list; add them lastUse the filter vtkDepthSortPolydata to sortalong the view vectorvtkActor anActoranActor SetMapper mapper[anActor getProperty] SetOpacity 0.3[anActor getProperty] SetColor .1 .6 .1PickableOff()Bounding Box of Actor GetBounds() methodAxis-aligned bounding box l29Scientific Visualization with VTK

Basics – Textures Texture mapping––Pasting images onto geometryRequire three pieces Surface/geometry 2D texture or image Texture coordinates– 3D textures not widely supported onmost rendering hardware– openGL only accepts texture imageswhose dimensions are powers of 2!– VTK will resample images for nonpowers of 2 .py Impacts performanceTexture coordinates refer to pixel positions inthe imageNormalized to the domain of [0.0, 1.0]Texture coordinates refer topositions in the image30Scientific Visualization with VTK

Basics – TexturesReplicated and Scaled TexturesSimple texturesRotated and Scaled Textures31Scientific Visualization with VTK

Basics – Picking Picking used to select data and actors, orsample underlying data valuesSyntax of pick method :The pick refers to a display position (pixelcoordinate) in a rendererPick(selectionX, selectionY, selectionZ, Renderer)Pick() method in the vtkAbstractPicker classis referenced––Requires a rendererselectionZ is typically 0.0 –– Relates to the z-bufferMethod is not invoked directlyAssign an instance to thevtkRenderWindowInteractorTwo direct subclasses of vtkAbstractPicker–Class vtkWorldPointPicker –Fast, usually in hardwareUses z-buffer to return x-y-z global pickpositionNo other information returnedClass vtkAbstractPropPicker s an APIPick up instance of vtkProp32Scientific Visualization with VTK

Basics – Picking–Class vtkAbstractPropPicker (cont’d) Several convenience methods to determine returntype of pick––––––– Defines an APIPick up instance of vtkPropGetProp()-pointer to instance of vtkProp, otherwiseNULLGetProp3D()-pointer to instance of vtkProp3DGetActor2D()- pointer to instance of vtkActor2DGetActor()- pointer to instance of vtkActorGetVolume()- pointer to instance of vtkVolumnGetAssembly()- pointer to instance of vtkAssemblyGetPropAssembly()- pointer to instance ofvtkPropAssemblyTwo subclasses of vtkAbstractPropPicker–Class vtkPropPicker Uses hardware pickingDetermines the instance of vtkPropGenerally, faster than vtkPickerCan’t return information about the cell picked33Scientific Visualization with VTK

Basics – Picking–Class vtkPicker (cont’d) Software basedSelects vtpProp’s by bounding boxCasts ray from camera through the selection pointReturns closest prop3DHere, the picker binds the procedure annotatePick tothe EndPickEventIn annotatePick, note the methods GetSelectionPointand GetPickPosition# Create a cell picker.vtkCellPicker pickerpicker AddObserver EndPickEvent annotatePick# Create a Tcl procedure to create the text for the text# mapper used to display the results of picking.proc annotatePick {} {if { [picker GetCellId] 0 } {textActor VisibilityOff} else {set selPt [picker GetSelectionPoint]set x [lindex selPt 0]set y [lindex selPt 1]set pickPos [picker GetPickPosition]set xp [lindex pickPos 0]set yp [lindex pickPos 1]set zp [lindex pickPos 2]textMapper SetInput "( xp, yp, zp)"textActor SetPosition x ytextActor VisibilityOn}renWin Render}# Pick the cell at this location.picker Pick 85 126 0 ren134Scientific Visualization with VTK

Basics – Other Controls Controlling vtkActor2D–––– Draws on overlay planeNo 4x4 transformation matrixAs with vtkActor, refers to a mapper(vtkMapper2D)And property object (vtkProperty2D) /Examples/Annotation/Python/TestText.py2D Annotation––––Uses 2D Actors and mappersSimilar to 3D counterpartsWith the exception that they render inthe overlay planevtkTextProperty controls –FontsPosition and ColorBolding and ItalicsShadowingJustificationMultiline text, use \n characterFor multiline text look at /Examples/Annotation/Pyton/multiLineText.py# Create a scaled text actor.# Set the text, font, justification, and properties (bold, italics,# etc.).textActor r.SetDisplayPosition(90, 50)textActor.SetInput("This is a sition2Coordinate().SetValue(0.6, 0.1)tprop owOn()tprop.SetColor(0, 0, 1)35Scientific Visualization with VTK

Basics – Other Controls 3D annotation––––Employs class vtkVectorTextCreates polygonal text dataPositioned as any other 3D actorvtkFollower useful class forpositioning 3D text# Create the 3D text and the associated mapper and follower (a type of# actor). Position the text so it is displayed over the origin of the# axes.atext er etOutput())textActor xtActor.SetScale(0.2, 0.2, 0.2)textActor.GetProperty().SetColor(1.0, .75, .32)textActor.AddPosition(0, -0.1, 0) . (after rendering)# Reset the clipping range of the camera; set the camera of the# follower; Camera(ren.GetActiveCamera()) fic Visualization with VTK

Basics – Other Controls LOD-Level of Detail–––––Enhance performance of graphicssystemReduces resolution of viewable objectReplaces instances of vtkActor withvtkLODActorControl of the level of representationDefault LOD has two additionallower-resolution models – Assemblies–––––Point cloud (default is 150 points)Bounding box Additional levels through use ofvtkAddLODMapper() methodDo not need to add in order ofcomplexityvtkLODActor dotActordotActor SetMapper dotMapperdotActor SetNumberOfCloudPoints 1000–– ––Reference /Examples/Rendering/Python/assembly.pyHierarchical assembies (eg. Robotlimbs)Subclass of vtkProp3DHas no notion of properties or mappersLeaf nodes of vtkAssembly carryinformation– Material propertiesGeometryActors used by multiple assembliesAddActor() method registers top actorof assembly with rendererActors at lower levels addedrecursivelyVolumesSet the desired frame rateAppropriate level-of-detail selectedautomatically––vtkRenderWindow ren1renWin SetDesiredUpdateRate 5.0–vtkVolume used for volume renderingInherits from vtkProp3D for positionand orientationvtkVolumeProperty method isassociated property object37Scientific Visualization with VTK

Special Plotting Classes Scalar Bar–––Creates color-coded keyRelates color values to data valuesThree parts ––Colored segmentLabelsTitleMust instance of vtkLookupTable –Placeholder for scalar bar imageDefines colorsDefines range of data valuesPosition and Orientation on theoverlay planeSpecify attributes ColorNumber of labelsTitle text stringvtkSetOrientationToHorizontal() andvtkSetOrientationToVertical()methods control orientation38Scientific Visualization with VTK

Special Plotting Classes X-Y Plots––Generates x-y plots from multipledatasetsvtkXYPlotActor2D –––Specify one or more data setsAxesPlot titlePosition on the overlay planePositionCoordinate instance variabledefines lower-left cornerPosition2Coordinate defines upperright cornerTogether they define the rectangle todisplay the plot /Examples/Annotation/Python/xyPlot.py39Scientific Visualization with VTK

Special Plotting Classes Bounding Box Axes–––Composite actor class isvtkCubeAxesActor2DIndicates the position in space of thecamera viewUser controlled attributes –Various font attributesRelative font size, selectedautomaticallyMethod SetFontFactor() used to affectsize of selected fontTwo methods to draw axes SetFlyModeToOuterEdges()SetFlyModeToClosestTriad() /Examples/Annotation/Tcl/cubeAxes.tcl40Scientific Visualization with VTK

Special Plotting Classes Labeling Data––Label the points of a dataset using themethod vtkLabeledDataMapperIncludes ––ScalarsVectorsTensorsNormalsTexture coordinatesField dataPoint IdsText is placed in the overlay planeIn our example, use three new classes vtkCellCenters()– vtkIdFilter()– /Examples/Annotation/Tcl/LabeledMesh.tclGenerate points at parametric centerof cellsGenerate ids as scalar of field datafrom dataset idsvtkSelectVisiblePoints()–Selects only visible points41Scientific Visualization with VTK

3D Widgets Subclasses of vtkInteractorObserverWatch for events invoked byvtkRenderWindowInteractor3D widgets represent themselves in thesceneList of most important widgets––––––––– WidgetvtkSphereWidgetvtkSplineWidgetWidgets differ in functionOffer different API Procedure much the same for allwidgets––Instantiate the widgetSpecify thevtkRenderWindowInteractor ––Create callbacks (functions)Widgets invoke events tionEventMost widgets require placing –Invokes events the widget may processInstancing of vtkProp3DA datasetInvoke PlaceWidget() methodEnable the widget keypress IWidget will appear in the scene42Scientific Visualization with VTK

3D Widgets Example of Plane Widget––vtkImplicitPlaneWidget is used to clip an objectvtkProp3D to be clipped is an object (mace) –––Made from a sphere and cone glyphsGlyphs positioned at sphere pointsOriented in the direction of sphere normalPlane clips mace into two piecesOne is colored greenPosition and orientation controlled Mousing on widget normalPoint defining the origin of the planeTranslate the plane by grabbing the widget lvtkSphereSource spherevtkConeSource conevtkGlyph3D glyphglyph SetInput [sphere GetOutput]glyph SetSource [cone GetOutput]glyph SetVectorModeToUseNormalglyph SetScaleModeToScaleByVectorglyph SetScaleFactor 0.25# The sphere and spikes are appended into a single polydata.# This just makes things simpler to manage.vtkAppendPolyData apdapd AddInput [glyph GetOutput]apd AddInput [sphere GetOutput]vtkPolyDataMapper maceMappermaceMapper SetInput [apd GetOutput]vtkLODActor maceActor

or Tcl/Tk – Cmake generates a makefile cmake . The dot, ‘.’, is required – Use the make command to generate the executable – To execute type the command ‘./Cone’ Tcl – Change directory to Tcl/ – The VTK build includes a VTK tcl command called ‘vtk’ –

Related Documents:

May 02, 2018 · D. Program Evaluation ͟The organization has provided a description of the framework for how each program will be evaluated. The framework should include all the elements below: ͟The evaluation methods are cost-effective for the organization ͟Quantitative and qualitative data is being collected (at Basics tier, data collection must have begun)

Silat is a combative art of self-defense and survival rooted from Matay archipelago. It was traced at thé early of Langkasuka Kingdom (2nd century CE) till thé reign of Melaka (Malaysia) Sultanate era (13th century). Silat has now evolved to become part of social culture and tradition with thé appearance of a fine physical and spiritual .

On an exceptional basis, Member States may request UNESCO to provide thé candidates with access to thé platform so they can complète thé form by themselves. Thèse requests must be addressed to esd rize unesco. or by 15 A ril 2021 UNESCO will provide thé nomineewith accessto thé platform via their émail address.

̶The leading indicator of employee engagement is based on the quality of the relationship between employee and supervisor Empower your managers! ̶Help them understand the impact on the organization ̶Share important changes, plan options, tasks, and deadlines ̶Provide key messages and talking points ̶Prepare them to answer employee questions

Dr. Sunita Bharatwal** Dr. Pawan Garga*** Abstract Customer satisfaction is derived from thè functionalities and values, a product or Service can provide. The current study aims to segregate thè dimensions of ordine Service quality and gather insights on its impact on web shopping. The trends of purchases have

Chính Văn.- Còn đức Thế tôn thì tuệ giác cực kỳ trong sạch 8: hiện hành bất nhị 9, đạt đến vô tướng 10, đứng vào chỗ đứng của các đức Thế tôn 11, thể hiện tính bình đẳng của các Ngài, đến chỗ không còn chướng ngại 12, giáo pháp không thể khuynh đảo, tâm thức không bị cản trở, cái được

Le genou de Lucy. Odile Jacob. 1999. Coppens Y. Pré-textes. L’homme préhistorique en morceaux. Eds Odile Jacob. 2011. Costentin J., Delaveau P. Café, thé, chocolat, les bons effets sur le cerveau et pour le corps. Editions Odile Jacob. 2010. Crawford M., Marsh D. The driving force : food in human evolution and the future.

Preparing for the Test 5 Taking the Practice Tests Taking the TOEFL ITP Practice Tests will give you a good idea of what the actual test is like in terms of the types of questions you will be asked, and