ParaView VR Plugin state files

Addendum to http://www.paraview.org/Wiki/ParaView/Users_Guide/CAVE_Display

VRConnectionManager configuration deconstructed:

<VRConnectionManager>
 <VRPNConnection name="device_name" address="device_name@server_address">
 <Button id="button_id" name="button_name"/>
 <Button id="button_id" name="button_name"/>
 <Tracker id="0" name="tracker_pv_name"/>
 </VRPNConnection>
 </VRConnectionManager>

device_name: look in vrpn.cfg in the device server machine. The syntax for a particular device is usually

Vrpn_Class  device_name config_param1 config_param2

server_address : name of your machine on the LAN or your machine’s IP address.

button_name and tracker_pv_name:  the name of your device VRPN Connection instance in ParaView. This will be used later in VRInteractorStyles

VRInteractorStyles configuration deconstructed ( brackets [] denote optional):

<VRInteractorStyles> 
 <Style class="interactor_style_class" [origin="CutFunction.Origin"] [normal="CutFunction.Normal"] [set_property="RenderView1.property"]>
 <Button name="device_name.button_name"/>
 <Tracker name="device_name.tracker_pv_name"/>
 </Style> 
 </VRInteractorStyles>

<Style> element attributes :

set_property="RenderView1.property"

This means that the interactor style controls RenderView1’s property. Comprehensive list of proxies and properties

The two following attributes will only work if you also have a Slice filter in your state file. Otherwise* the application crashes.

origin="CutFunction.Origin"

Interactor style controls the slice filter’s origin position.

normal="CutFunction.Normal"

Interactor style controls the slice filter’s orientation.

*(as of 07/05/2012)

Posted in Uncategorized | Tagged , | Leave a comment

Mailing list to Forum

Last week I went on an exercise to import the paraview-developers mailing list to nabble forum. It involved:

Quora gave me the idea on what to do: http://www.quora.com/Internet-Forums/How-do-I-migrate-archives-of-a-mailing-list-to-a-forum

Fun fact: the Perl scripts were written and the mailing list archives downloaded on the bus trip from Chapel Hill to Durham thanks to the free wifi on the Triangle Transit bus.

Here’s the result:http://the-unofficial-paraview-developers-forum.34153.n6.nabble.com/

Sadly, I discovered today that such a service already exists: http://markmail.org/search/?q=paraview

Posted in Uncategorized | Tagged , , , , | Leave a comment

Windows: Building Qt From Source – NMAKE : fatal error U1077: ‘cd’ : return code ‘0x2’

I build Qt from source many, many times and often encounter this intermittent error:

NMAKE : fatal error U1077: ‘cd’ : return code ‘0x2’

Building Qt with configure and nmake takes at least an hour, and I have wasted many hours of my life rebuilding Qt (one of the suggestions that often works to fix the U1077 error is “Rerun nmake!” – but it doesn’t work all the time).

I finally found a solution that works (this time anyway, I will update this post if it fails in the future) requires building Qt in Safe Mode, and  uses jom for multi-core Qt building (way faster compilation! for multi-core processors anyway)

Reproduced verbatim from: http://qt-project.org/forums/viewthread/5362/#33212

All credit goes to agent8261

I too had problems trying to install Qt 4.7.2 and integrating it with visual studio. When I tried to compile Qt using nmake I always got an error stating that some dll was in use. The actual dll changed every time. After about 2 days of searching and trying things, I fixed it, but I’m not at all sure what was wrong.
Hopefully this will help. Here are the exact steps I had to do in order to compile:
1: I uninstalled all the QT binaries.
2: I deleted the Qt folder.
3: I downloaded the Visual Studio Add-in [qt.nokia.com]
4: I installed the visual studio add-in
5: I downloaded the Qt source code [get.qt.nokia.com]
6: I created New folders c:\Qt\4.7.2-vc\ and extracted the source code to it.
7: I set the environment variables:
QTDIR = C:\Qt\4.7.2-vc\
QMAKESPEC = win32-msvc2010
8: I added to the Path variable:
cd C:\Qt\4.7.2-vc\bin
!!Check!!
 If you set it up like I did, then you should be able to do:
C:\Qt\4.7.2-vc\configure.exe -help
from the windows cmd prompt.
9: I downloaded the lasts version of “jom”: ftp://ftp.qt.nokia.com/jom/
10: I created the folder C:\Qt\4.7.2-vc\jom extracted the jom files to it
11: I restarted windows then opened the VISUAL STUDIO command prompt and ran
C:
 cd C:\Qt\4.7.2-vc
 configure -debug-and-release -opensource -platform win32-msvc2010
The configuration took awhile. After it was finished
12: I RESTARTED IN SAFE MODE!!!!
I don’t know why this step was important, but I had to do the actual compilation in safe mode.
13: Open the VISUAL STUDIO command prompt and run
C:
 cd C:\Qt\4.7.2-vc
 C:\Qt\4.7.2-vc\jom\jom.exe –j 8
8 is the number of CPU cores for my computer.
Building the file took a long time. By far the longest I have ever seen, but if finally finished.
Afterwards I had to open visual studio and configure the add-in. Below are the sites that helped me figure everything out.
http://www.holoborodko.com/pavel/2011/02/01/how-to-compile-qt-4-7-with-visual-studio-2010/
http://stackoverflow.com/questions/4379374/compiling-qt-visual-studio-2010
http://blog.paulnettleship.com/2010/11/11/troubleshooting-visual-studio-2010-and-qt-4-7-integration/
http://dcsoft.wordpress.com/
FYI: I’m on windows 7, using visual studio 2010 ultimate (version 10.0.30319.1), running on a Intel i7(q720). I compiled 4.72 LGPL version of the QT framework. I am using the Visual Studio Qt add-in 1.1.9-1.
Posted in Uncategorized | Tagged , | 1 Comment

Unofficial Quora Follow Button on wordpress.com

If you have tried to add the Quora Follow Button to your wordpress.com blog,

you will notice that wordpress.com does not allow javascript embedding.

I created this Quora follow button

before I found Quora’s official recommendation (i.e. use html javascript adder)

FWIW I hosted the Gimp xcf file on Github: https://github.com/alexisylchan/Media/blob/master/Gimp/Quora-Follow-Icon.xcf

See it in action.

For html embedding, I used:

<a href="http://goto_url" >
 <img src="img_source_url" />
</a>

Sorry, I don’t have Photoshop.

Posted in Uncategorized | Leave a comment

Finally converted my old Compaq Presario to Linux

I used Linux for development at Oracle, and in my undergrad OS course, but never really set up a Linux machine before.  I always only had 1 machine, and it’s really painful to install Linux without having a connection to the internet

I gave up on trying to get Ubuntu server to connect with the network. I think the problem could be that I do not have a router, and am connecting the desktop straight to the modem. I have not gotten networking to work on Ubuntu desktop either, but hopefully that will change soon.

Edit: “Hello world! Blogging from my Ubuntu desktop!” Turns out that the network connection just works upon reboot.  After spending ~3 hours trying to configure the Ubuntu server network connection yesterday, this is like magic.

Posted in Uncategorized | 2 Comments

Vortex Visualization project

Vortex Visualization project:

Full PDF: http://sciviscontest.visweek.org/2011/contributions/UNCVortexVis_yc_jl_2/UNCVortexVis_yc_jl_4.pdf 

Goal: Given three data sets of fluid flow in a centrifugal pump** that vary across time, visualize where the vortices develop, and why.

**The data is courtesy of the Institute of Applied Mechanics, Clausthal University, Germany (Dipl. Wirtsch.-Ing. Andreas Lucius).

Streamlines in original data:

Vortex extraction:

Our vortex extraction method is based on streamlines**.  We seeded the streamlines from the blades of the pump. Imagine if we paint the blades of the pump (shown below) with wet paint, and pump in clear liquid with a slightly lower density than the paint density (hand-waving here).  The resulting paint pattern caused by the movement of the blades is similar to the streamline patterns that we generate.

** Scientists have since informed us that this method is not Galilean invariant (streamlines change based on the space and time reference frames), and therefore not useful for visualizing turbulence.

We separated each individual streamline into multiple segments based on the direction of rotation (clockwise vs counter-clockwise).

For each segment, we find the geometric mean position of all the points in that segment. Each point in the segment also has its own unit direction vector (starting from the “seed” of the streamline and ending at the last point in the segment).  We define the unit normal of each point as the cross-vector of each neighboring unit direction vector. This gives us the geometric mean direction.

We projected each segment onto a 2-D plane defined by its normal.  This normal is defined by the geometric mean position and the geometric mean direction.

Then we calculate the winding angle of each segment, i.e. the sum of the angles between the edges in the segment:

Image and method courtesy of Sadarjoen et al

Now that we have the geometric mean position, direction, and winding angle of each segment, we group each segment into a “vortex” based on the : position, direction, winding angle, and bounding box of the segments.

We used these criteria because the data sets contain many vortices that may be really close to each other, but may have different winding angles (how tightly coiled a vortex is) or different rotation direction. Some vortices may have the same center but vary a lot in size.

Here are some of the images captured during our exploration:

Second image color-coded by Winding Angle. The Winding Angle does a better job of separating vortices within a local region than the x-y-z size of the segments.



Second image color-coded by Winding Angle. The Winding Angle still does a better job of separating vortices  but the large vortex is really complicated. Vortex Center aggregation fails for the large vortex.
(structurally, it seems like 2 vortices sharing a same center with different extents).



The Red Vortex Center in the Right image has high Winding Angle. See next section.

Vortex with high Winding Angle but almost invisible because it is too small



Top:  Vortex Core shown    Bottom: The tiny red dot is actually a tightly wound streamline.

Vortex-tracking

To match vortices from one time step to the next time step, we used the same criteria as the vortex extraction method above (position, direction, winding angle, size).

In both cases, there exists more sophisticated methods for predicting the evolution of vortices and classifying the different features. See the references in our submission.

Posted in Uncategorized | Leave a comment

Collaborative Scientific Visualization project

MS project

(Code Diffs)

Goal: To enable two scientists discover new insights about their data by providing natural user interaction.

Description:
To help scientists perceive the shapes and features of the data, I use 3D stereo rendering , similar* to what you see in 3D televisions.

Unlike the stereo rendering in 3D televisions, I also provide head-tracking. To understand why this is important, hold up a pencil in front of your eyes, and move your head from side to side. Notice that what you see changes as you move your head. The Virtual Reality community has measured how head motion and stereo affect shape perception and most studies determined that the head motion is more important than stereo in perceiving shapes.

I also think that it would be useful for scientists to be able to pick up the data sets and move them around, rotate them, and maybe even move different data sets in relation to each other. This is why I provide the scientists with styluses for picking and rotating the data sets.

*conceptually similar, though technically different

Technical solutions:

The scientific visualization application for this project was forked off Kitware’s Paraview code on Feb 28,2011 . The branch did not include the multi-client functionality that the ParaView code currently support.

To work around this issue, I use simple socket/client C code to send visualization parameters back and forth between two ParaView client-servers.

This is ideally what we want the scientists to see:

And this is what happens behind the scenes during independent sessions (sometimes scientists like working on their own before sharing their work):

And this is what happens behind the scenes during collaborative sessions:

Thanks to VRPN, data from the hardware devices in this system can be read via the VRPN client-server libraries. I just had to write some C++ code to convert the measurements into VTK readings. Thanks to Cory Quammen and David Borland for providing me with the starter code. The latest ParaView code from Kitware handles this via the VRPN Plugin.

 

Posted in Uncategorized | Tagged | Leave a comment

Smart Pointers

When I first started my ParaView project, I ignored vtkSmartPointer because using vtkSmartPointer made it very difficult for me to debug and understand the large number of classes in VTK and ParaView.

As I started my quest to be a better developer, and improving my understanding of C++ , i discovered the RAII idiom and smart pointers. Apparently if you use a smart pointer to a resource instead of a regular pointer, the compiler counts the number of references to the resource and deletes the allocated memory when the resource is no longer referenced.

Posted in Uncategorized | Tagged | 2 Comments

Cygwin: Getting ‘A’ and ‘B’ when pressing Up and Down keys in vi

Problem: up and down keys produce ‘A’ and ‘B’ in vi instead of up and down.

Solution: export TERM=cygwinc

Source: http://cygwin.com/ml/cygwin/2003-02/msg01629.html

Posted in Uncategorized | Tagged | Leave a comment

How I created a second fork of a Github repo

Tried following the steps mentioned in http://alt.adrianshort.co.uk/blog/2011/11/08/create-multiple-forks-of-a-github-repo/ but it didn’t work for me for some reason. Documenting this for personal purposes.

Was working on a new machine, so had to:

Set up Git

git config –global user.name “Username”
git config –global user.email “youremail@yourdomain”
git config –global credential.helper cache
git remote add origin https://github.com/Username/YourRepo.git

Generate SSH Keys 

cd ~/.ssh
ssh-keygen -t rsa -C “youremail@yourdomain”

Clone the original Github Repo  on local machine, rename the origin branch as stated here
git clone https://github.com/SourceUserName/SourceRepo.git
cd SourceRepo/
git remote rename origin upstream

Created a new empty repo on the Github account

Push code from local machine to Github

The following didn’t work for me – git requested username/password. I gave it the correct values but it threw an authentication error –> git push -u origin master

So:

git push git@github.com:Username/YourRepo.git master –force

Edit: The only downsides to this are:

1. the second fork is not identified as a fork of the original repository, and
2. you cannot name the second repository with the same name on Github. This could be  a problem if your CMAKE compile files rely on a specific repository name.

 

Posted in Uncategorized | Tagged | Leave a comment