Using waves as flags in user functions

Hi everyone,

As the topic says, I'd like to ask how to refer to waves as flags in a custom user function. Although it probably doesn't matter, in my case I'd like to use it for the ImageInterpolate command using the Voronoi method.

In this command, one can specify the parameters over which to interpolate with the /S={x0,dx,xn,y0,dy,yn} flag. Because I want to include the Imageinterpolate in a self-written function quite a few times (about 20 times for each data set), and I will require different parameters for different datasets, it would be pain for my go into the procedure file and change all the parameter manually every time.

So, what I want to do was as follows: I want to create wave (called 'int_par') with 6 points which contain the parameters I want to use for that experiment (either manually or in the procedure, haven't decided that yet). Then, when I come to the interpolation command, I want to use the 'int_par' wave as input for my /S-flag (so, essentially /S=intpar). However, I can't get the syntax right to do that in my function.

I hope this is easily fixed? Many thanks in advance!
Soepvork wrote:
So, what I want to do was as follows: I want to create wave (called 'int_par') with 6 points which contain the parameters I want to use for that experiment (either manually or in the procedure, haven't decided that yet). Then, when I come to the interpolation command, I want to use the 'int_par' wave as input for my /S-flag (so, essentially /S=intpar). However, I can't get the syntax right to do that in my function.


You have to pass the wave elements to the flag one by one:
function VoronoiInterp(int_par,srcWave)
    wave int_par, srcWave
    imageInterpolate/s={int_par[0],int_par[1],int_par[2],int_par[3],int_par[4],int_par[5]} Voronoi srcWave
end


A