I have been searching for a better visualization for vector fields for awhile. Line integral convolution (LIC) is one of several methods that seems promising.
The main references I used for my LIC implementation is the original paper “Imaging Vector Fields Using Line Integral Convolution” by Brian Cabral and Leith (Casey) Leedom and this C++ implementation by Bill Martin.
I used the globalwinds.dat
data set in the examples/data
directory of the IDL distribution for all the visualizations in this article. The standard visualization for a vector field is to display arrows on a grid of the data points. For example, iVector produces the following visualization.
I find this type of display difficult to gain much from for datasets larger than a few tens of elements on a side.
The code I have (slowly) produces the below greyscale image. Besides the slow performance, I’m pretty happy with the result. This is not the best visualization for all tasks, but it’s a pretty good general purpose display.
But this only indicates the direction of the vectors in the vector field (and leaves two possibilities at that), saying nothing of the magnitude of the vectors. The simplest way that I thought of adding magnitude was to use the HSV color system with hue equalling red, saturation equalling magnitude, and using the LIC output as the value. This produces:
Some other tries that I think are promising:
Not bad, but I’m going to sharpen up this code a bit before I release it. This is still a work in progress…
December 8th, 2007 at 11:10 pm
Looking for your code release!
December 8th, 2007 at 11:27 pm
OK. I want to speed this up because it is very slow, but I think a DLM is the only way to make this a reasonable speed. I’ll release the pure IDL version now then.
December 9th, 2007 at 12:01 am
[…] was hoping to speed up the code I mentioned last month implementing a line integral convolution (LIC) flow visualization, but I haven’t had time to […]
March 18th, 2008 at 1:00 am
Hi,
I download the mg_lic.pro source code file and run it in IDL,which causes my computer to crash down and I can’t see any result.
so I want to know, My computer is about 1GB’s memory,so maybe too small:)
or would you like to tell me how to run your program more efficient?
thanks a lot
March 18th, 2008 at 1:30 pm
It is very slow right now. I haven’t had the time to finish writing this as a DLM which I’m hoping will make this take a reasonable time. Follow the other post about LIC for updates on the code.
April 11th, 2008 at 12:18 am
[…] have finished the line-integral convolution (LIC) implementation as a DLM and cleaned it up a bit (see other articles for background). More work is needed, but it can give useful results now. The movie […]
October 7th, 2008 at 10:52 pm
If you’re still looking for a way to make the amplitude visible, you could try using 1/f noise instead of white noise (so the noise is somewhat clumpy) and making the length of the convolution proportional to the amplitude… you should get long streaky bits where the field is strong and clumpy bits where it’s weak.
October 30th, 2008 at 10:56 am
[…] the suggestion of Anne in the comments of a previous posting about line-integral convolution (LIC) algorithm for vector field […]
August 28th, 2009 at 12:19 pm
[…] section on various flow visualization techniques was very useful since I’ve been thinking about line-integral convolutions (LIC) lately. There were also discussions of choosing colors, […]
April 13th, 2011 at 8:18 am
[…] integral convolution (LIC) 1, 2, 3, 4, […]
April 13th, 2011 at 9:01 pm
Very nice! This kind of display just begs for a simple animation. Just a handful of frames should be enough to make it come alive.
April 14th, 2011 at 5:23 am
Yes, that is why I added a TEXTURE keyword so that the same random values for the texture can be used in each frame of an animation. I think it works pretty well.
April 16th, 2011 at 7:33 am
Here’s an example animation.
October 18th, 2012 at 11:25 pm
Hello Michael,
Looking at the results you have have shown. I would very much like to use this. However, I have not been able to get it to work – yet. ANy chance you can post a link to globalwinds.dat ? Seems like it isnt there in the example directory by default with IDL 6.2 .
I have also not had success when I simply comment out the “RESTORE” line from mg_lic.pro
Can you post an example when you pass u and V fields to mg_lic ?
Thanks in advance,
Vijay.
October 19th, 2012 at 8:50 am
Here is the data file.
Check out the code in
mg_lic.pro
–it is an example of using the MG_LIC routine.January 31st, 2013 at 6:12 pm
I can’t get the algorithm (mg_LIC) running on my computer.
It always shows this error message;
I’m using IDL 7.1. Is there something that need to be done, that has not yet being done?
Thanks
January 31st, 2013 at 8:15 pm
Are you in the same directory as
mg_lic.pro
or havemg_lic.pro
in your!path
?February 2nd, 2013 at 9:30 am
No. I’m not sure. I have checked the library I coudn’t find mg_lic.
Thanks
February 2nd, 2013 at 9:37 am
It could be that you have an old version of the library that uses
vis_lic.pro
. The new version is on Github.February 5th, 2013 at 8:49 am
Thanks. it finally worked
August 16th, 2013 at 2:02 pm
Hi Michael,
thanks for this code, it works beautifully. Just one question. What should I do to add colors, as in your last image above? Can you share the idl commands that I need to add?
Thanks in advance
August 16th, 2013 at 2:24 pm
Check out this example code. By the way, updates are at GitHub.