I 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 at the right took about six minutes to generate (300 calls with 300 by 300 images).
The API for the call is pretty straightforward. There are two required positional parameters u and v which are m by n float arrays (they must be float arrays right now). There is one optional keyword TEXTURE
which can be set to a byte array the same size as u and v. It is useful to set TEXTURE
to the same array for frames of a movie; there will be a lot of jitter if you don’t.
Installation is slightly more complicated than for IDL code. Grab the zip file, unzip it, and place the contents in the IDL path and the IDL DLM path. Start IDL and type:
IDL> vis_build_flow
You should be ready to go as long as your !make_dll
system variable is set correctly (which is probably the case on normal Unix platforms, but only if you have installed the Developer Tools on Mac OS X or Visual Studio on Windows). I would be interested in people’s experiences trying to install this since I haven’t distributed a DLM on this site before.
I am going to package some visualization routines together with the vis
prefix, but I’m waiting until I have a critical mass of useful routines before distributing the whole thing.
UPDATE: by the way, if you use VIS_LIC
and can share your results, I would like to see any images made with it.
April 11th, 2008 at 5:37 am
Great work for using IDL with new visualization methods!
But I can’t download zip file (It’s may be a wrong link!)
April 11th, 2008 at 7:29 am
It’s fixed now. Thanks for letting me know!
June 20th, 2008 at 12:08 pm
[…] a random texture gives less pixellated looking result than using a purely random texture. I added a texture keyword a while ago so that a common texture could be used for several LIC images, but now I’ve discovered […]
November 12th, 2008 at 7:42 am
Great, thank you very much for making this code public. It took me a while to get it to run, as this is the first time I’m using a dlm in IDL and for some reason I thought the function is called vis_flow and not vis_lic. Anyways, now it’s working. :)
This is my first try: . It shows the rotation of particles inside a blob. I will continue to play around with the code.
December 7th, 2008 at 10:14 am
Hi, I used your mg_lic.pro and really liked the results. Was looking forward to using this DLM (had been using IDL 6.0 which was too old, have only just updated), but having never used a DLM before, I’m at a bit of a loss. I downloaded the files, ran IDL and typed “vis_build_flow”, which worked fine. But I don’t know where to go next. I had expected that vis_lic would be an function I could then use, but its not. Did I miss something? Thanks!
December 7th, 2008 at 10:30 am
You need to put the .so/.dll and .elm files in you DLM path. The easiest way to do this is modify The IDL_DLM_PATH environment variable to contain the directory that has those files.
December 7th, 2008 at 12:59 pm
Thanks for the super-quick reply. still having problems though… I’ve added my working directory (/home/aoife/) to my IDL_PATH and IDL_DLM_PATH, but I could be missing something very big/simple.
my IDL attempt went something like this.
IDL> print,expand_path(!PATH)
/home/aoife:/usr/local/itt/idl70/lib/hook (etc)
IDL> print,expand_path(!DLM_PATH)
/home/aoife:/usr/local/itt/idl70/bin/bin.linux.x86
IDL> vis_build_flow
% Compiled module: VIS_BUILD_FLOW.
% Compiled module: VIS_SRC_ROOT.
% Compiled module: FILEPATH.
% Compiled module: PATH_SEP.
% Compiled module: VIS_MAKE_DLL.
IDL> dlm_load,’vis_flow’
IDL> vis_lic
% Attempt to call undefined procedure/function: ‘VIS_LIC’.
% Execution halted at: $MAIN$
IDL>
December 7th, 2008 at 1:05 pm
No need to do the DLM_LOAD, it should get picked up automatically if it’s in the IDL_DLM_PATH.
But VIS_LIC is a function.
Try this:
scale = 4L
restore, filepath('globalwinds.dat', subdir=['examples','data'])
u = rebin(u, 128L * scale, 64L * scale)
v = rebin(v, 128L * scale, 64L * scale)
im = vis_lic(u, v)
window, xsize=128 * scale, ysize=64 * scale
tvscl, im
January 17th, 2009 at 9:08 am
Hi, I have tried vis_lic on IDL 7.0 64bit version. The vis_build_flow went fine but when I try to use the vis_lic as mentioned in the above post I get “SEGMENTATION FAULT”…
January 17th, 2009 at 1:08 pm
Hi, I have investigated a bit and I have found out that the problem is caused in the vis_flow.c by the following condition and the command when it is true (which it is):
if (kw.texture) {
tex_data = &kw.texture->value.arr->data;
When I replace the condition with the command in its else part everything is fine. Cheers, Michal.
January 17th, 2009 at 4:43 pm
Hi, if I use the TEXTURE keyword then everything works just fine without any changes. Cheers, Michal.
January 18th, 2009 at 3:07 am
Hi, I have made the following animation with the help of your vis_lic code. It shows the dependence of the observed direction of the polarization vector on inclination of the observer for a non-rotating black hole for scattered thermal emission. Cheers, Michal.
http://astro.cas.cz/dovciak/pub/functions/polarization/polar2_ab_200.gif
January 18th, 2009 at 11:15 am
This is awesome, Michal!
January 19th, 2009 at 11:41 am
Cool, that’s a great animation!
@Michal What platform were you having the problem with? 64-bit Linux or Windows?
January 19th, 2009 at 2:06 pm
64bit linux, CentOS-5.2. The problem is that when I did not use keyword TEXTURE the condition I mentioned was true, i.e. kw.texture was true (but at the same time it was not created?). Then IDL tried to read &kw.texture->value.arr->data which was not created and thus it crashed with Segmentation fault…?
January 20th, 2009 at 11:32 am
Hi, I have added the intensity of polarized light depicted in shades of red on top of the LIC depicted polarization angle (see my comment above). Cheers, Michal.
http://astro.cas.cz/dovciak/pub/functions/polarization/polar4_ab_200.gif
October 18th, 2010 at 8:47 am
Hi,
I am working in windows.
I put vis_flow.dlm in C:\RSI\IDL62\bin\bin.x86\’ but got the following error. Pl. let me know how to use this dlm in windows.
IDL> restore, filepath(‘globalwinds.dat’, subdir=[‘examples’,’data’])
IDL> v = rebin(v, 128L * scale, 64L * scale)
IDL> u = rebin(u, 128L * scale, 64L * scale)
IDL> im = vis_lic(u, v)
VIS_LIC: Error loading sharable executable.
Symbol: IDL_Load, File = C:\RSI\IDL62\bin\bin.x86\vis_flow.dll
The specified module could not be found.
Execution halted at: $MAIN$
October 18th, 2010 at 9:00 am
Did you use VIS_BUILD_FLOW?
October 18th, 2010 at 9:04 am
Yes, when I use it, I got following messages…
IDL> vis_build_flow
Compiled module: VIS_BUILD_FLOW.
Compiled module: VIS_SRC_ROOT.
‘cl’ is not recognized as an internal or external command,
operable program or batch file.
cl -D_DLL -DMSWIN -DWIN32 -D_MT /nologo /I”C:\RSI\IDL62\external\include” /c “C:\pron\vis_lic.c” /Fo”vis_lic_10388_BHARTI-SXM8.obj”
Could Not Find C:\Documents and Settings\bharti\.idl\rsi\compile_dir-118-idl_6_2-win32-x86-m32-f64\vis_lic_10388_BHARTI-SXM8.exp
Could Not Find C:\Documents and Settings\bharti\.idl\rsi\compile_dir-118-idl_6_2-win32-x86-m32-f64\vis_lic_10388_BHARTI-SXM8.lib
Could Not Find C:\Documents and Settings\bharti\.idl\rsi\compile_dir-118-idl_6_2-win32-x86-m32-f64\vis_lic_10388_BHARTI-SXM8.obj
October 18th, 2010 at 9:40 am
You have to install Visual Studio or the free command line compiler from Microsoft and make sure the tools are in the path.
October 19th, 2010 at 3:16 am
Hi,
I tried in linux and it is working fine. I used vis_lic.pro, it needs vis_pinknoise.pro
October 21st, 2010 at 3:04 am
Hi,
Kindly send me vis_pinknoise.pro
October 21st, 2010 at 10:53 am
Here’s vis_pinknoise.pro.
December 2nd, 2015 at 9:21 pm
[…] have tackled LIC and have code to produce images from vector fields in my […]