Find a contour on a 2D image without drawing it?

Is it possible to extract a contour's data from a 2D wave without actually printing the contour? I have a function where I want to ultimately find the intersection between 2 contours at the same z-value for two different 2D waves. So far, I have been able to get the procedure to work by inserting the code #include<Extract Contours As Waves> at the top of my procedure window and executing something along the lines of the following:

<br />
function PullContour(wav,level)<br />
     wave wav<br />
     variable level<br />
     display/N=Wave1;appendimage wav<br />
     AppendMatrixContour/W=Wave1 wav<br />
     ModifyContour/W=Wave1 $nameofwave(wav) manLevels={level,0,1}<br />
     DoUpdate<br />
     string str1 = nameofwave(wav)+"="+num2str(level)<br />
     WMDuplicateTraceWave("Wave1",str1)<br />
end<br />


It seems inefficient to ask Igor to create a new image and draw a contour plot when all I really want is the underlying data.

Thanks,
Chris Smallwood