Questions about Line Integral Convolution tutorial
![](https://secure.gravatar.com/avatar/669ede13db3bee0428a06b47b90ac190.jpg?s=120&d=mm&r=g)
Hello, I found the Line Integral Convolution (LIC) example very timely for a project I'm working on. http://www.scipy.org/Cookbook/LineIntegralConvolution Once Cython & Pyrex were installed, the demo ran out of the box. Excellent. However, now I'm trying to apply this to a different dataset and the C component is crashing with index errors. I suspect these are being caused by the fact that my dataset is not a square array. An examination in the .pyx file has a couple of locations where the array indices appear to be transposed between x,y vs i,j. I'm not sure if this is a bug or not. The high symmetry of the demo vector field would probably not reveal this if it were a bug. So my questions for the author of the code or the list are: 1) Is there a paper or other reference for the algorithm implemented here? My searches have revealed several types of LIC implementations. It would be nice if this were in code comments or at least on the tutorial page. 2) Is the algorithm, the demo code, or LIC in general, restricted to square arrays? 3) Is there a pure-python or numpy-only (no Cython or Pyrex requirement) implementation? Thanks, Tom -- Dr. William T."Tom" Bridgman Scientific Visualization Studio Global Science & Technology, Inc. NASA/Goddard Space Flight Center Email: William.T.Bridgman@nasa.gov Code 610.3 Phone: 301-286-1346 Greenbelt, MD 20771 FAX: 301-286-1634 http://svs.gsfc.nasa.gov/
![](https://secure.gravatar.com/avatar/67eadceb08f909ead3915fc9d9145a7d.jpg?s=120&d=mm&r=g)
Hi William, I am not the author, but I may be able to answer some of your questions. On Mon, Nov 24, 2008 at 11:46 AM, Bridgman, William T. < William.T.Bridgman@nasa.gov> wrote:
Hello,
I found the Line Integral Convolution (LIC) example very timely for a project I'm working on.
http://www.scipy.org/Cookbook/LineIntegralConvolution
Once Cython & Pyrex were installed, the demo ran out of the box. Excellent.
However, now I'm trying to apply this to a different dataset and the C component is crashing with index errors. I suspect these are being caused by the fact that my dataset is not a square array.
An examination in the .pyx file has a couple of locations where the array indices appear to be transposed between x,y vs i,j. I'm not sure if this is a bug or not. The high symmetry of the demo vector field would probably not reveal this if it were a bug.
So my questions for the author of the code or the list are:
1) Is there a paper or other reference for the algorithm implemented here? My searches have revealed several types of LIC implementations. It would be nice if this were in code comments or at least on the tutorial page.
I am not sure which paper Anne has used, but I have found Cabral, Brian and Laeith Leedom. Imaging vector fields using line integral convolution. SIGGRAPH '93: Proceedings of the 20th annual conference on Computer graphics and interactive techniques, pages 263-270, 1993. a very useful reference.
2) Is the algorithm, the demo code, or LIC in general, restricted to square arrays?
Not that I know of. I have used it on rectangular arrays and it's working, although you may need to transpose the texture array to get it to work.
3) Is there a pure-python or numpy-only (no Cython or Pyrex requirement) implementation?
Not that I know of. However, with Anne's consent, I have created a scikit named vectorplot using the code she posted in the cookbook. This can be installed with a simple python setup.py install It's still not pure python, but you won't need Cython to compile the extension. I've added docstrings, a bit of documentation and utiliy functions to generate kernels that I use to "animate" vector fields. You can check out the code with subversion at http://svn.scipy.org/svn/scikits/trunk/vectorplot, but bear in mind that the user interface might change. HTH, David
Thanks, Tom -- Dr. William T."Tom" Bridgman Scientific Visualization Studio Global Science & Technology, Inc. NASA/Goddard Space Flight Center Email: William.T.Bridgman@nasa.gov Code 610.3 Phone: 301-286-1346 Greenbelt, MD 20771 FAX: 301-286-1634 http://svs.gsfc.nasa.gov/
_______________________________________________ SciPy-user mailing list SciPy-user@scipy.org http://projects.scipy.org/mailman/listinfo/scipy-user
participants (2)
-
Bridgman, William T.
-
David Huard