> I am interested in any information on the speed improvement that can
> be expected in translating parts of an IDL procedure to C. I plan on
> using "call_external" to invoke the functions within my C module.
> I am also interested in suggestions about when it is most beneficial
> to use C instead of IDL.
If the operation you need can be performed using IDL's built-in
functions and/or array operations, you're better off sticking
with that. IDL functions are optimized very well.
If, in your code, you find yourself having to perform iterative
operations explicitly, then you are better off using C or Fortran,
as performance will improve DRAMATICALLY. Even though IDL code is
"compiled", the pseudo-code that is generated is interpreted,
so iterative operations take a big cut in performance.
Some of the examples of cases where we use CALL_EXTERNAL are:
1. Needed a "personalized" type of trilinear interpolation that
didn't use background (0) pixels in the interpolation (to
avoid aliasing an image with sharp edges).
2. A three-dimensional neighbor-averaging filter applied to a
3. Needed a "personalized" run-length-encoding algorithm.
Hope this is useful.
Brain Image Analysis Lab, UCSD