Adding User Tools to the Wavelet Toolkit

You can extend the capabilities of the IDL Wavelet Toolkit by adding your own user-defined tool functions. These wavelet functions should follow the same calling mechanism as the built-in tool functions such as WV_TOOL_DENOISE. In addition, your tool function should begin with the prefix 'wv_tool_'.

  1. Let's say you want to add a wavelet tool called "Edge Detect" that uses the wavelet transform to detect edges in images. To do this, first create a tool function that accepts a data array and possibly other variable parameters:
  2. FUNCTION wv_tool_edgedetect, $ 
       Array ; 1D vector or 2D array 
       [,X]  ; X coordinates of array 
       [,Y]  ; Y coordinates of array 
       [, GROUP_LEADER=group_leader] 
       [, TITLE=title] [, UNITS=units] 
       [, XTITLE=xtitle] [, XUNITS=xunits] 
       [, YTITLE=ytitle] [, YUNITS=yunits] 
       [, XOFFSET=xoffset] [, YOFFSET=yoffset] 
    ; start the edge detection applet... 
        ... 
    ; return the Widget ID for the applet 
       RETURN, wID 
    END 
    
  3. Save this function in a file wv_tool_edgedetect.pro that is accessible from your current IDL path.
  4. Now start the Wavelet Toolkit with your new wavelet function:
  5. WV_APPLET, TOOLS=['Edge Detect'] 
    

Your new tool should appear in the Tools Menu. The actual function name is constructed by removing all white space from the name and attaching a prefix of WV_TOOL_.

Note
At a minimum, your tool function must accept a data Array. All other parameters (such as X and Y) and keywords (GROUP_LEADER, TITLE, etc.) are optional. The IDL Wavelet Toolkit will pass in only those parameters and keywords that are usable by your tool function.