// ----------------------------------------------------------------------------- // Fractional Spline Wavelets Demo Macro // // This demo shows a Fractional Spline Wavelets transformation on the mandrill // image then it rescales the wavelt coefficients, it inverts the transformation. // In the second this macro makes a Hard Threshold of the coefficients ant inverts // the transformation. // // http://bigwww.epfl.ch/demo/fractsplines // // Daniel Sage // Biomecial Imaging Group (BIG) // Ecole Polytechnique Fˇdˇrale de Lausanne (EPFL), Lausanne, Switzerland // // 20 February 2007 // ----------------------------------------------------------------------------- run("Mandrill (70K)"); run("8-bit"); run("FSW Module", "op='baboon.jpg transform analysis' filter='orthonormal 3.14 0.0' scale='4 4' size='extend' "); run("FSW Module", "op='analysis process rescaled' processing='Rescale' scale='4 4'"); run("FSW Module", "op='analysis inverse perf_rec' filter='orthonormal 3.14 0.0' scale='4 4'"); run("FSW Module", "op='analysis process threshold' processing='hardthreshold 200' scale='4 4'"); run("FSW Module", "op='threshold inverse synthesis' filter='orthonormal 3.14 0.0' scale='4 4'"); // ----------------------------------------------------------------------------- // DESCRIPTION OF PARAMETERS // ----------------------------------------------------------------------------- // // The arguments of the "FSW Module" macro consist to one mandatory argument [op] // and three option arguments [filter, scale, processing, size]: // // ----------------------------------------------------------------------------- // 1. Type of operation on specified images // // Syntax: op='INPUT OPERATION OUTPUT' // INPUT: It is a string which given the name of the input image. // Default value: input. // OPERATION: It is a keyword to define the operation. // The authorized values are: // transform: to perform a wavelet transform (default value) // process: to apply a processing to the wavelet coefficients // inverse: to perform a inverse wavelet transform // OUTPUT: It is a string which the name of the output image. // Default value: output. // // ----------------------------------------------------------------------------- // 2. Customize of the wavelet // // Syntax: filter='KIND DEGREE SHIFT' // KIND: It is a string which given the kind of the spline wavalets. // The authorized values are: // orthonormal (default value) // b-spline // dual // DEGREE: It is a number which given the fractional degree of the spline. // The range of the values are [-0.49, 5.00]. // Default value: 3.0. // SHIFT: It is a number which given the shift of the spline. // The range of the values are [-0.50, 0.50]. // Default value: 0.0. // // This argument has an effect only for transform and inverse operations. // // ----------------------------------------------------------------------------- // 3. Number of scales // // Syntax: filter='SCALEX SCALEY SCALEZ' // SCALEX: It is an integer number which given the number of scale in the X direction. // The range of the values are [0, N] where N is the maximum number // of iterations corresponding to the size of the image. // Default value: 1. // SCALEY: It is an integer number which given the number of scale in the Y direction. // The range of the values are [0, N] where N is the maximum number // of iterations corresponding to the size of the image. // Default value: 1. // SCALEZ: It is an integer number which given the number of scale in the Z direction. // The range of the values are [0, N] where N is the maximum number // of iterations corresponding to the size of the image. // Default value: 0. // // ----------------------------------------------------------------------------- // 4. Type of processing // // Syntax: filter='PROCESS ARGUMENT' // PROCESS: It is a keyword to define the processing to apply to the vwavelet coefficients. // The authorized values are: // Bypass: no processing (default value) // HardThreshold: Hard threshold at ARGUMENT // SoftThreshold: Soft threshold at ARGUMENT // Enhancement: Multiply the coefficients by ARGUEMENT // Rescale: Make an automatic rescale for 0 to 255 in every // sub-bands to make a nice visualisation of the wavelet coefficients // ARGUMENT: It is an number which given the value of threshold for the // HardThreshold and the SoftThreshold or the factor for the Enhancement processing. // The range of the values has no limit. // Default value: 0.00. // // // This argument has an effect only for processing operation. // ----------------------------------------------------------------------------- // // 5. Type of resizing of the input image // // Syntax: size='RESIZE' // RESIZE: It is a keyword to define the processing to apply to the vwavelet coefficients. // The authorized values are: // Unchanged: no resizing, if the size of the image is not a power of 2, // the transform could be slow. (default value) // Crop: crop the image to the closest power of 2. // Extend: extend the image to the closest power of 2. // Default value: Bypass. // // This argument has an effect only for transform operation. //