scientific visualization in scirun n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Scientific Visualization in SCIRun PowerPoint Presentation
Download Presentation
Scientific Visualization in SCIRun

Loading in 2 Seconds...

play fullscreen
1 / 53
anthea

Scientific Visualization in SCIRun - PowerPoint PPT Presentation

129 Views
Download Presentation
Scientific Visualization in SCIRun
An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. Scientific Visualization inSCIRun David Weinstein SIAM CSE 02.09.2003 Scientific Computing and Imaging Institute School of Computing University of Utah

  2. Overview • Examples • Tour of SCIRun • - How To Get / Install It • - Dataflow • - Building A Module • Live Demos

  3. Natalie: Surgical Planning

  4. Aneurysm: Volume Rendering

  5. Forward and Inverse EEG

  6. Electrocardiography

  7. Electroencephalography

  8. MEG / Diffusion Tensors

  9. Photorealism for Sci Vis: RTRT

  10. CSAFE: Fire-spread

  11. Nuclear Fusion: Tokamak

  12. What If? user guides Integration and Interaction Modeling Simulation Visualization

  13. Elements of SCIRun • Visual programming Environment

  14. PSE Relationships

  15. Extensibility • Leverage existing utilities • Extensibility through bridges GENESIS Matlab libimage SQL lib socket SCIRun Teem lib mpeg lib

  16. Documentation: The Central Source http://internal.sci.utah.edu/developer/doc/

  17. Documentation: User Support • On-line Documentation • Tutorial • User’s Manual • FAQ Lists • Printed Documentation • User’s Manuals • Mailing List • scirun-users@sci.utah.edu • Direct Contact • Email and Bugzilla • Phone

  18. System Specs and Requirements • Required OS and Build Tools • SGI • IRIX 6.5 • MIPSPro Compilers (CC) 7.3.1.1m • Linux • Kernel 2.2.17 • GCC 2.95.3 • Both • GNU Make 3.79.1 http://software.sci.utah.edu/doc/TechnicalGuide/p1c1.html

  19. Minimum System Requirements • Tested Systems: Gateway, Micron, Dell. • http://software.sci.utah.edu/tested_systems/tested_systems.html http://software.sci.utah.edu/doc/TechnicalGuide/p1c2.html

  20. Documentation: Tutorial

  21. Network Design • Dataflow Vocabulary • Module • Dataport • Datapipe • UI • Send and Get • GuiVars • Scheduler • Dependencies • loops: send_intermediate

  22. Packages • Encapsulated project • External code resides in Thirdparty • Packages enabled via “configure” options % configure ‘--enable-package=BioPSE mypackage’

  23. Module Categories • …/Dataflow/Modules/{Fields,Math,…}

  24. Fields Data int, float, double, … Vector, Tensor, … PointCloudField Geometry Regular Irregular ScanlineField CurveField QuadSurfField TriSurfField ImageField Properties Data_at (center) TetVolField LatVolField HexVolField

  25. On-the-fly Compilation • Combinatorial Explosion! • Geometry • Data type • Data_at • Build source, compile, link – all at run time

  26. Error Messages • Run-time messages are sent to the module’s “log” Startup messages Log message indicator Gray: no messages Red: error Blue: warning/remark

  27. Tikhonov Regularization

  28. Tikhonov Regularization

  29. How To Build A Module • Before You Start • Structure of a Module • Ports and Datatypes • Component Wizard • GUI’s • Dynamic Compilation Algorithm

  30. Before You Start • Design Your Function • A Module is a Function • Inputs and Outputs • User Input (GUI Variables) • Dataflow • Coding Standard • Standards • Advice • SCIRun/doc/Developer/Guide/coding_standard.html

  31. Module Structure • Support Files • .cc file • sub.mk • .xml file • .tcl file • sub.mk • .h file (optional)

  32. Ports and Datatypes • Ports • LockingHandles • Generation number • Memory Management • Sending Data • Cache Results • Datatypes • Fields, Matrix, SceneGraph • Detach (Dataflow) • Properties

  33. Component Wizard • Adding a Module

  34. Component Wizard

  35. Component Wizard • Edit a Port • Name • Namespace

  36. Component Wizard • Package • Category • Path

  37. Component Wizard • New Package? • New Category? • Reconfiguring.

  38. Component Wizard • After Compiling

  39. Component Wizard • Your Skeleton GUI

  40. GUI’s • TCL • itcl • blt • Use Simple GUI as a Pattern • GuiVars

  41. GUI’s • itcl_class SCIRun_Fields_SelectField { inherit Module constructor {config} { set name SelectField global $this-stampvalue global $this-runmode set_defaults } method set_defaults {} { set $this-stampvalue 100 set $this-runmode 0 # 0 nothing 1 accumulate 2 replace } method replace {} { set $this-runmode 2 $this-c needexecute } method accumulate {} { set $this-runmode 1 $this-c needexecute }

  42. GUI’s • method ui {} { set w .ui[modname] if {[winfo exists $w]} { raise $w return } toplevel $w frame $w.row1 frame $w.row3 frame $w.row4 pack $w.row1 $w.row3 $w.row4 -side top -e y -f both -padx 5 -pady 5 label $w.row1.value_label -text "Selection Value" entry $w.row1.value -textvariable $this-stampvalue pack $w.row1.value_label $w.row1.value -side left button $w.row3.execute -text "Replace" -command "$this replace" pack $w.row3.execute -side top -e n -f both button $w.row4.execute -text "Accumulate" -command "$this accumulate" pack $w.row4.execute -side top -e n -f both }

  43. GUI’s • GuiVars • Values to from C side • Initialize • C++ side constructor synchs with tcl name • tcl side sets the initial value • my_var.reset() • my_var.get() • tcl_command(...) • $this-c “needexecute”

  44. Algorithm Structure • Algorithm Base Class • Inherits from common base class • Defines the pure virtual interface needed by a module • Provides a static CompileInfo • Templated Algorithm • Implements the pure virtual interface in the base class • Potentially specialized for specific field type template<class Field> RenderField : public RenderFieldBase virtual void render(FieldBase&)=0;

  45. TypeDescription • TypeDescription object augments RTTI • Holds: • Strings that describe object’s exact type • Namespace string • Path to the .h file that declares the object • Has a recursive structure • Example: foo<bar, foobar<int> >;

  46. CompileInfo • Similar info as a TypeDescription • Algorithm is not instantiated, so cannot yet be queried • Start with a CompileInfo from Algorithm base class • Augmented with information from all pertinent TypeDescription objects for the specific types involved • Passed to DynamicLoader, which creates the proper type

  47. DynamicLoader • Returns Requested Algorithm • Writes C++ instantiation code • Compile shared library, using SCIRun makefiles • Load shared library (dlopen) • Return Instance of Algorithm (Cached for next use) • Synchronization code such that • Only 1 thread can compile at a time per algorithm • Multiple algorithms can compile and load at the same time

  48. Calling Module • void ShowField::execute(){// Get a Field from input field port. field = (FieldIPort *)get_iport("Field"); field->get(field_handle);// Get the input field's type info. const TypeDescription *td = field_handle->get_type_description();// Get the Algorithm. CompileInfo *ci = RenderFieldBase::get_compile_info(td); if (! DynamicLoader::scirun_loader().get(*ci, rend_algo)) { error("Could not compile algorithm for ShowField -"); • return; } RenderFieldBase *rf = dynamic_cast<RenderFieldBase*>(rend_algo);// Let the templated algorithm render this field. rf->render(field_handle, /* any other parameters from gui */);// Send results downstream...} No template instantiations for the exact algorithm type

  49. Example • //! ConvertTetBase supports the dynamically loadable algorithm concept.//! when dynamically loaded the user will dynamically cast to a //! ConvertTetBase from the DynamicAlgoBase they will have a pointer to.class ConvertTetBase : public DynamicAlgoBase{public: virtual FieldHandle convert_quadratic(FieldHandle in) = 0; virtual ~ConvertTetBase(); static const string& get_h_file_path(); static string dyn_file_name(const TypeDescription *td) {// add no extension. return template_class_name() + "." + td->get_filename() + "."; } static const string base_class_name() { static string name("ConvertTetBase"); return name; } static const string template_class_name() { static string name("ConvertTet"); return name; }//! support the dynamically compiled algorithm concept static CompileInfo *get_compile_info(const TypeDescription *td);};